export const __rspack_esm_id="22893";export const __rspack_esm_ids=["22893"];export const __webpack_modules__={89148(e,t,s){s.a(e,async function(e,i){try{s.r(t),s.d(t,{HuiHumidifierModesCardFeatureEditor:()=>m});s(18111),s(61701);var o=s(62826),a=s(96196),d=s(97735),c=s(22786),r=s(1087),l=s(52763),n=e([l]);l=(n.then?(await n)():n)[0];class m extends a.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return a.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.modes},s=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,e,t.customize_modes);return a.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,i=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0;t&&!s.modes&&(s.modes=i?.attributes.available_modes||[]),!t&&s.modes&&delete s.modes,(0,r.r)(this,"config-changed",{config:s})}constructor(...e){super(...e),this._schema=(0,c.A)((e,t,s,i)=>[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.humidifier-modes.style_list.${t}`)}))}}},{name:"customize_modes",selector:{boolean:{}}},...i?[{name:"modes",selector:{select:{reorder:!0,multiple:!0,options:s?.attributes.available_modes?.map(e=>({value:e,label:t(s,"mode",e)}))||[]}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.humidifier-modes.${e.name}`);default:return""}}}}(0,o.Cg)([(0,d.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,d.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,o.Cg)([(0,d.wk)()],m.prototype,"_config",void 0),m=(0,o.Cg)([(0,d.EM)("hui-humidifier-modes-card-feature-editor")],m),i()}catch(e){i(e)}})}};
//# sourceMappingURL=22893.a7d8a25e554381ee.js.map