export const __rspack_esm_id="40852";export const __rspack_esm_ids=["40852"];export const __webpack_modules__={99743(e,t,s){s.r(t),s.d(t,{HuiClimateFanModesCardFeatureEditor:()=>d});s(18111),s(61701);var a=s(62826),o=s(96196),i=s(44457),n=s(22786),c=s(1087);s(52763);class d extends o.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return o.s6;const e=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0,t={style:"dropdown",...this._config,customize_modes:void 0!==this._config.fan_modes},s=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,e,t.customize_modes);return o.qy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${s}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){const{customize_modes:t,...s}=e.detail.value,a=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0;t&&!s.fan_modes&&(s.fan_modes=a?.attributes.fan_modes||[]),!t&&s.fan_modes&&delete s.fan_modes,(0,c.r)(this,"config-changed",{config:s})}constructor(...e){super(...e),this._schema=(0,n.A)((e,t,s,a)=>[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.climate-fan-modes.style_list.${t}`)}))}}},{name:"customize_modes",selector:{boolean:{}}},...a?[{name:"fan_modes",selector:{select:{multiple:!0,reorder:!0,options:s?.attributes.fan_modes?.map(e=>({value:e,label:t(s,"fan_mode",e)}))||[]}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"fan_modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.climate-fan-modes.${e.name}`);default:return""}}}}(0,a.Cg)([(0,i.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,i.MZ)({attribute:!1})],d.prototype,"context",void 0),(0,a.Cg)([(0,i.wk)()],d.prototype,"_config",void 0),d=(0,a.Cg)([(0,i.EM)("hui-climate-fan-modes-card-feature-editor")],d)}};
//# sourceMappingURL=40852.32327a2ea35cb4f9.js.map