"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["45555"],{21630:function(t,e,o){o.r(e),o.d(e,{HuiSelectOptionsCardFeatureEditor:function(){return m}});var i,n=o(20054),s=o(72153),a=o(7739),c=o(44734),u=o(43080),r=o(69683),l=o(6454),h=(o(28706),o(62062),o(18111),o(61701),o(69085),o(26099),o(40445)),d=o(96196),p=o(77845),v=o(22786),f=o(1087),_=(o(52763),["customize_options"]),m=function(t){function e(){var t;(0,c.A)(this,e);for(var o=arguments.length,i=new Array(o),n=0;n<o;n++)i[n]=arguments[n];return(t=(0,r.A)(this,e,[].concat(i)))._schema=(0,v.A)(function(t,e,o){var i;return[{name:"customize_options",selector:{boolean:{}}}].concat((0,a.A)(o?[{name:"options",selector:{select:{multiple:!0,reorder:!0,options:(null==e||null===(i=e.attributes.options)||void 0===i?void 0:i.map(function(o){return{value:o,label:t(e,o)}}))||[]}}}]:[]))}),t._computeLabelCallback=function(e){switch(e.name){case"options":case"customize_options":return t.hass.localize("ui.panel.lovelace.editor.features.types.select-options.".concat(e.name));default:return""}},t}return(0,l.A)(e,t),(0,u.A)(e,[{key:"setConfig",value:function(t){this._config=t}},{key:"render",value:function(){var t,e;if(!this.hass||!this._config)return d.s6;var o=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(e=this.context)||void 0===e?void 0:e.entity_id]:void 0,n=Object.assign(Object.assign({},this._config),{},{customize_options:void 0!==this._config.options}),a=this._schema(this.hass.formatEntityState,o,n.customize_options);return(0,d.qy)(i||(i=(0,s.A)([' <ha-form .hass="','" .data="','" .schema="','" .computeLabel="','" @value-changed="','"></ha-form> '])),this.hass,n,a,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(t){var e,o,i=t.detail.value,s=i.customize_options,a=(0,n.A)(i,_),c=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(o=this.context)||void 0===o?void 0:o.entity_id]:void 0;s&&!a.options&&(a.options=(null==c?void 0:c.attributes.options)||[]),!s&&a.options&&delete a.options,(0,f.r)(this,"config-changed",{config:a})}}])}(d.WF);(0,h.Cg)([(0,p.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,h.Cg)([(0,p.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,h.Cg)([(0,p.wk)()],m.prototype,"_config",void 0),m=(0,h.Cg)([(0,p.EM)("hui-select-options-card-feature-editor")],m)}}]);
//# sourceMappingURL=45555.7bdcb46389b0f641.js.map