"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["22893"],{89148:function(e,t,s){s.a(e,async function(e,i){try{s.r(t),s.d(t,{HuiHumidifierModesCardFeatureEditor:function(){return _}});var o=s(20054),a=(s(18111),s(61701),s(62953),s(40445)),n=s(96196),l=s(77845),d=s(22786),c=s(1087),r=s(52763),u=e([r]);r=(u.then?(await u)():u)[0];const h=["customize_modes"];let m,v=e=>e;class _ extends n.WF{setConfig(e){this._config=e}render(){var e,t;if(!this.hass||!this._config)return n.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,i=Object.assign(Object.assign({style:"dropdown"},this._config),{},{customize_modes:void 0!==this._config.modes}),o=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,s,i.customize_modes);return(0,n.qy)(m||(m=v` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,i,o,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){var t,s;const i=e.detail.value,{customize_modes:a}=i,n=(0,o.A)(i,h),l=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;a&&!n.modes&&(n.modes=(null==l?void 0:l.attributes.available_modes)||[]),!a&&n.modes&&delete n.modes,(0,c.r)(this,"config-changed",{config:n})}constructor(...e){super(...e),this._schema=(0,d.A)((e,t,s,i)=>{var o;return[{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:(null==s||null===(o=s.attributes.available_modes)||void 0===o?void 0:o.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,a.Cg)([(0,l.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,l.MZ)({attribute:!1})],_.prototype,"context",void 0),(0,a.Cg)([(0,l.wk)()],_.prototype,"_config",void 0),_=(0,a.Cg)([(0,l.EM)("hui-humidifier-modes-card-feature-editor")],_),i()}catch(h){i(h)}})}}]);
//# sourceMappingURL=22893.0507cebb3699b3c6.js.map