"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[98971],{53622:function(e,t,a){a.a(e,async function(e,n){try{a.r(t);var o=a(25979),i=a(57567),s=a(12463),r=a(16472),c=(a(28706),a(15697)),d=a(51209),u=a(26792),l=e([u]);u=(l.then?(await l)():l)[0];var h={featureType:"climate-fan-modes",i18nFeatureId:"climate-fan-modes",modeField:"fan_modes",defaultStyle:"dropdown",getAvailableModesOrdered:function(e){var t;return null!==(t=null==e?void 0:e.attributes.fan_modes)&&void 0!==t?t:[]},getModeLabel:function(e,t,a){return t?e.formatEntityAttributeValue(t,"fan_mode",a):a}},m=function(e){function t(){var e;(0,i.A)(this,t);for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return(e=(0,r.A)(this,t,[].concat(n))).descriptor=h,e}return(0,s.A)(t,e),(0,o.A)(t)}(u.k);m=(0,c.Cg)([(0,d.EM)("hui-climate-fan-modes-card-feature-editor")],m),a.d(t,{HuiClimateFanModesCardFeatureEditor:function(){return m}}),n()}catch(f){n(f)}})},26792:function(e,t,a){a.a(e,async function(e,n){try{var o,i=a(86613),s=a(28430),r=a(97058),c=a(74512),d=a(57567),u=a(25979),l=a(12463),h=a(16472),m=a(43939),f=(a(28706),a(62062),a(18111),a(61701),a(26099),a(15697)),v=a(57527),p=a(51209),y=a(90789),_=a(148),g=a(55682),A=e([g]);g=(A.then?(await A)():A)[0];var b=["customize_modes"];function F(e){e.customize_modes;return(0,m.A)(e,b)}var C=function(e){function t(){var e;(0,d.A)(this,t);for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return(e=(0,h.A)(this,t,[].concat(n)))._schema=(0,y.A)(function(t,a,n){var o,i=e.descriptor,s=null!==(o=i.styleListI18nFeatureId)&&void 0!==o?o:i.i18nFeatureId;return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(function(e){return{value:e,label:t("ui.panel.lovelace.editor.features.types.".concat(s,".style_list.").concat(e))}})}}},{name:"customize_modes",selector:{boolean:{}}}].concat((0,c.A)(n?[{name:i.modeField,selector:{select:{reorder:!0,multiple:!0,options:i.getAvailableModesOrdered(a).map(function(t){return{value:t,label:i.getModeLabel(e.hass,a,t)}})}}}]:[]))}),e._computeLabelCallback=function(t){var a=e.descriptor.i18nFeatureId,n=e.descriptor.modeField;return"style"===t.name||"customize_modes"===t.name||t.name===n?e.hass.localize("ui.panel.lovelace.editor.features.types.".concat(a,".").concat(t.name)):""},e}return(0,l.A)(t,e),(0,u.A)(t,[{key:"setConfig",value:function(e){e.type===this.descriptor.featureType&&(this._config=e)}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return v.s6;var t=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,a=this.descriptor,n=a.modeField,i=a.defaultStyle,c=(0,r.A)((0,r.A)({style:i},this._config),{},{customize_modes:void 0!==this._config[n]}),d=this._schema(this.hass.localize,t,c.customize_modes);return(0,v.qy)(o||(o=(0,s.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,c,d,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,a=e.detail.value,n=a.customize_modes,o=F(a),s=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[this.context.entity_id]:void 0,c=this.descriptor,d=c.modeField,u=c.getAvailableModesOrdered,l=d;n&&!o[l]&&(o=(0,r.A)((0,r.A)({},o),{},(0,i.A)({},d,u(s)))),n||void 0===o[l]||delete o[l],(0,_.r)(this,"config-changed",{config:o})}}])}(v.WF);(0,f.Cg)([(0,p.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,f.Cg)([(0,p.MZ)({attribute:!1})],C.prototype,"context",void 0),(0,f.Cg)([(0,p.wk)()],C.prototype,"_config",void 0),a.d(t,{k:function(){return C}}),n()}catch(k){n(k)}})}}]);
//# sourceMappingURL=98971.a364be8c3bafd863.js.map