"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[92208],{57075:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);var n,r,s=i(97058),o=i(28430),u=i(57567),c=i(25979),h=i(12463),l=i(16472),f=(i(28706),i(15697)),d=i(57527),g=i(51209),_=i(90789),m=i(49588),y=i(148),p=(i(2441),i(55682)),v=(i(41247),i(30013)),C=i(24652),H=i(13263),b=i(35170),k=e([p,b]);[p,b]=k.then?(await k)():k;var A=["humidifier-modes","humidifier-toggle"],V=(0,m.kp)(v.H,(0,m.Ik)({entity:(0,m.lq)((0,m.Yj)()),name:(0,m.lq)(C.q),theme:(0,m.lq)((0,m.Yj)()),show_current_as_primary:(0,m.lq)((0,m.zM)()),features:(0,m.lq)((0,m.YO)((0,m.bz)()))})),M=[{name:"entity",required:!0,selector:{entity:{domain:"humidifier"}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{type:"grid",name:"",schema:[{name:"theme",selector:{theme:{}}}]},{name:"show_current_as_primary",selector:{boolean:{}}}],z=function(e){function t(){var e;(0,u.A)(this,t);for(var i=arguments.length,a=new Array(i),n=0;n<i;n++)a[n]=arguments[n];return(e=(0,l.A)(this,t,[].concat(a)))._featureContext=(0,_.A)(function(e){return{entity_id:e}}),e._computeLabelCallback=function(t){return"show_current_as_primary"===t.name?e.hass.localize("ui.panel.lovelace.editor.card.humidifier.show_current_as_primary"):e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name))},e}return(0,h.A)(t,e),(0,c.A)(t,[{key:"setConfig",value:function(e){(0,m.vA)(e,V),this._config=e}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return d.s6;var t=this._config.entity,i=this._featureContext(t);return(0,d.qy)(n||(n=(0,o.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=",'></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path=','></ha-svg-icon> <h3 slot="header"> ',' </h3> <div class="content"> <hui-card-features-editor .hass='," .context="," .featuresTypes="," .features="," @features-changed="," @edit-detail-element=","></hui-card-features-editor> </div> </ha-expansion-panel> "])),this.hass,this._config,M,this._computeLabelCallback,this._valueChanged,"M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z",this.hass.localize("ui.panel.lovelace.editor.card.generic.features"),this.hass,i,A,null!==(e=this._config.features)&&void 0!==e?e:[],this._featuresChanged,this._editDetailElement)}},{key:"_valueChanged",value:function(e){(0,y.r)(this,"config-changed",{config:e.detail.value})}},{key:"_featuresChanged",value:function(e){if(e.stopPropagation(),this._config&&this.hass){var t=e.detail.features,i=(0,s.A)((0,s.A)({},this._config),{},{features:t});0===t.length&&delete i.features,(0,y.r)(this,"config-changed",{config:i})}}},{key:"_editDetailElement",value:function(e){var t=this,i=e.detail.subElementConfig.index,a=this._config.features[i];(0,y.r)(this,"edit-sub-element",{config:a,saveConfig:function(e){return t._updateFeature(i,e)},context:{entity_id:this._config.entity},type:"feature"})}},{key:"_updateFeature",value:function(e,t){var i=this._config.features.concat();i[e]=t;var a=(0,s.A)((0,s.A)({},this._config),{},{features:i});(0,y.r)(this,"config-changed",{config:a})}}],[{key:"styles",get:function(){return[H.U,(0,d.AH)(r||(r=(0,o.A)(["ha-form{margin-bottom:24px;display:block}"])))]}}])}(d.WF);(0,f.Cg)([(0,g.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,f.Cg)([(0,g.wk)()],z.prototype,"_config",void 0),z=(0,f.Cg)([(0,g.EM)("hui-humidifier-card-editor")],z),i.d(t,{HuiHumidifierCardEditor:function(){return z}}),a()}catch(q){a(q)}})},30013:function(e,t,i){var a=i(49588),n=(0,a.Ik)({type:(0,a.Yj)(),view_layout:(0,a.bz)(),layout_options:(0,a.bz)(),grid_options:(0,a.bz)(),visibility:(0,a.bz)(),disabled:(0,a.lq)((0,a.zM)())});i.d(t,{H:function(){return n}})}}]);
//# sourceMappingURL=92208.2d02f4c5cf6810aa.js.map