export const __rspack_esm_id="33862";export const __rspack_esm_ids=["33862"];export const __webpack_modules__={7205(e,t,s){s.r(t),s.d(t,{HuiClimatePresetModesCardFeatureEditor:()=>d});s(18111),s(61701);var o=s(62826),i=s(96196),a=s(44457),r=s(22786),c=s(1087);s(52763);class d extends i.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return i.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.preset_modes},s=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,e,t.customize_modes);return i.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,o=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0;t&&!s.preset_modes&&(s.preset_modes=o?.attributes.preset_modes||[]),!t&&s.preset_modes&&delete s.preset_modes,(0,c.r)(this,"config-changed",{config:s})}constructor(...e){super(...e),this._schema=(0,r.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:"preset_modes",selector:{select:{reorder:!0,multiple:!0,options:s?.attributes.preset_modes?.map(e=>({value:e,label:t(s,"preset_mode",e)}))||[]}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"preset_modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.climate-preset-modes.${e.name}`);default:return""}}}}(0,o.Cg)([(0,a.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],d.prototype,"context",void 0),(0,o.Cg)([(0,a.wk)()],d.prototype,"_config",void 0),d=(0,o.Cg)([(0,a.EM)("hui-climate-preset-modes-card-feature-editor")],d)}};
//# sourceMappingURL=33862.260bbe53fdd31152.js.map