"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["48465"],{16072:function(e,t,s){s.a(e,async function(e,o){try{s.r(t),s.d(t,{HuiClimateHvacModesCardFeatureEditor:function(){return p}});var a=s(20054),i=(s(26910),s(18111),s(61701),s(62953),s(40445)),c=s(96196),n=s(77845),l=s(22786),d=s(1087),h=s(52763),r=s(38279),u=e([h]);h=(u.then?(await u)():u)[0];const m=["customize_modes"];let v,_=e=>e;class p extends c.WF{setConfig(e){this._config=e}render(){var e,t;if(!this.hass||!this._config)return c.s6;const s=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(t=this.context)||void 0===t?void 0:t.entity_id]:void 0,o=Object.assign(Object.assign({style:"icons"},this._config),{},{customize_modes:void 0!==this._config.hvac_modes}),a=this._schema(this.hass.localize,this.hass.formatEntityState,s,o.customize_modes);return(0,c.qy)(v||(v=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,o,a,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){var t,s;const o=e.detail.value,{customize_modes:i}=o,c=(0,a.A)(o,m),n=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(s=this.context)||void 0===s?void 0:s.entity_id]:void 0;if(i&&!c.hvac_modes){const e=((null==n?void 0:n.attributes.hvac_modes)||[]).concat().sort(r.VV);c.hvac_modes=e}!i&&c.hvac_modes&&delete c.hvac_modes,(0,d.r)(this,"config-changed",{config:c})}constructor(...e){super(...e),this._schema=(0,l.A)((e,t,s,o)=>[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.climate-preset-modes.style_list.${t}`)}))}}},{name:"customize_modes",selector:{boolean:{}}},...o?[{name:"hvac_modes",selector:{select:{reorder:!0,multiple:!0,options:((null==s?void 0:s.attributes.hvac_modes)||[]).concat().sort(r.VV).map(e=>({value:e,label:s?t(s,e):e}))}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"hvac_modes":case"style":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.climate-hvac-modes.${e.name}`);default:return""}}}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"context",void 0),(0,i.Cg)([(0,n.wk)()],p.prototype,"_config",void 0),p=(0,i.Cg)([(0,n.EM)("hui-climate-hvac-modes-card-feature-editor")],p),o()}catch(m){o(m)}})}}]);
//# sourceMappingURL=48465.d4bb6561fccce3c2.js.map