export const __rspack_esm_id="40731";export const __rspack_esm_ids=["40731"];export const __webpack_modules__={13654(e,t,a){a.a(e,async function(e,s){try{a.r(t),a.d(t,{HuiAlarmPanelCardEditor:()=>g});a(18111),a(22489),a(61701);var i=a(62826),l=a(96196),n=a(44457),o=a(22786),c=a(63533),r=a(1087),h=a(82286),d=(a(52763),a(9182)),_=a(84329),m=a(84698),u=a(44155),p=e([_]);_=(p.then?(await p)():p)[0];const y=(0,c.kp)(m.H,(0,c.Ik)({entity:(0,c.lq)((0,c.Yj)()),name:(0,c.lq)(u.q),states:(0,c.lq)((0,c.YO)()),theme:(0,c.lq)((0,c.Yj)())})),f=Object.keys(_.ALARM_MODE_STATE_MAP);class g extends l.WF{setConfig(e){(0,c.vA)(e,y),this._config=e}render(){if(!this.hass||!this._config)return l.s6;const e=this.hass.states[this._config.entity],t={states:(0,_.filterSupportedAlarmStates)(e,_.DEFAULT_STATES),...this._config};return l.qy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${this._schema(this.hass.localize,e,t.states)}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){const t=e.detail.value;if(t.states){const e=f.filter(e=>t.states.includes(e));t.states=e}if(t.states&&t.entity!==this._config?.entity){const e=this.hass?.states[t.entity];e&&(t.states=(0,_.filterSupportedAlarmStates)(e,t.states))}(0,r.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._schema=(0,o.A)((e,t,a)=>[{name:"entity",required:!0,selector:{entity:{domain:"alarm_control_panel"}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"theme",selector:{theme:{}}},{name:"states",selector:{select:{multiple:!0,mode:"list",options:f.map(s=>({value:s,label:e(`ui.card.alarm_control_panel.${s}`),disabled:!(a.includes(s)||t&&(0,h.$)(t,d.t[_.ALARM_MODE_STATE_MAP[s]].feature||0))}))}}}]),this._computeLabelCallback=e=>{switch(e.name){case"entity":return this.hass.localize("ui.panel.lovelace.editor.card.generic.entity");case"name":return this.hass.localize("ui.panel.lovelace.editor.card.generic.name");case"theme":return`${this.hass.localize("ui.panel.lovelace.editor.card.generic.theme")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;default:return this.hass.localize("ui.panel.lovelace.editor.card.alarm-panel.available_states")}}}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),g=(0,i.Cg)([(0,n.EM)("hui-alarm-panel-card-editor")],g),s()}catch(e){s(e)}})},84698(e,t,a){a.d(t,{H:()=>i});var s=a(63533);const i=(0,s.Ik)({type:(0,s.Yj)(),view_layout:(0,s.bz)(),layout_options:(0,s.bz)(),grid_options:(0,s.bz)(),visibility:(0,s.bz)(),disabled:(0,s.lq)((0,s.zM)())})}};
//# sourceMappingURL=40731.d98804e13601bc36.js.map