"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[63091],{67294:function(e,t,a){a.a(e,async function(e,n){try{a.r(t);var i,r,s=a(97058),o=a(28430),c=a(74512),h=a(57567),u=a(25979),l=a(12463),f=a(16472),d=(a(28706),a(15697)),m=a(57527),_=a(51209),g=a(90789),p=a(49588),v=a(148),y=a(45602),C=(a(2441),a(55682)),b=(a(41247),a(30013)),k=a(24652),H=a(13263),A=a(35170),V=e([C,A]);[C,A]=V.then?(await V)():V;var w={climate:["climate-hvac-modes","climate-preset-modes","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes"],water_heater:["water-heater-operation-modes"]},z=(0,p.kp)(b.H,(0,p.Ik)({entity:(0,p.lq)((0,p.Yj)()),name:(0,p.lq)(k.q),theme:(0,p.lq)((0,p.Yj)()),show_current_as_primary:(0,p.lq)((0,p.zM)()),features:(0,p.lq)((0,p.YO)((0,p.bz)()))})),M=function(e){function t(){var e;(0,h.A)(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(e=(0,f.A)(this,t,[].concat(n)))._featureContext=(0,g.A)(function(e){return{entity_id:e}}),e._schema=(0,g.A)(function(e){return[{name:"entity",selector:{entity:{domain:["climate","water_heater"]}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{type:"grid",name:"",schema:[{name:"theme",selector:{theme:{}}}]}].concat((0,c.A)("climate"===e?[{name:"show_current_as_primary",selector:{boolean:{}}}]:[]))}),e._computeLabelCallback=function(t){return"show_current_as_primary"===t.name?e.hass.localize("ui.panel.lovelace.editor.card.thermostat.show_current_as_primary"):e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name))},e}return(0,l.A)(t,e),(0,u.A)(t,[{key:"setConfig",value:function(e){(0,p.vA)(e,z),this._config=e}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return m.s6;var t=this._config.entity,a=(0,y.m)(t),n=this._featureContext(t);return(0,m.qy)(i||(i=(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,this._schema(a),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,n,w[a],null!==(e=this._config.features)&&void 0!==e?e:[],this._featuresChanged,this._editDetailElement)}},{key:"_valueChanged",value:function(e){(0,v.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,a=(0,s.A)((0,s.A)({},this._config),{},{features:t});0===t.length&&delete a.features,(0,v.r)(this,"config-changed",{config:a})}}},{key:"_editDetailElement",value:function(e){var t=this,a=e.detail.subElementConfig.index,n=this._config.features[a];(0,v.r)(this,"edit-sub-element",{config:n,saveConfig:function(e){return t._updateFeature(a,e)},context:{entity_id:this._config.entity},type:"feature"})}},{key:"_updateFeature",value:function(e,t){var a=this._config.features.concat();a[e]=t;var n=(0,s.A)((0,s.A)({},this._config),{},{features:a});(0,v.r)(this,"config-changed",{config:n})}}],[{key:"styles",get:function(){return[H.U,(0,m.AH)(r||(r=(0,o.A)(["ha-form{margin-bottom:24px;display:block}"])))]}}])}(m.WF);(0,d.Cg)([(0,_.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,d.Cg)([(0,_.wk)()],M.prototype,"_config",void 0),M=(0,d.Cg)([(0,_.EM)("hui-thermostat-card-editor")],M),a.d(t,{HuiThermostatCardEditor:function(){return M}}),n()}catch(x){n(x)}})},30013:function(e,t,a){var n=a(49588),i=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())});a.d(t,{H:function(){return i}})}}]);
//# sourceMappingURL=63091.270d4a9689469687.js.map