"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9095"],{63211:function(t,e,a){a.d(e,{d:function(){return i}});const i=t=>t.stopPropagation()},21498:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaFormOptionalActions:function(){return v}});a(79827),a(35748),a(65315),a(837),a(37089),a(5934),a(18223),a(95013);var o=a(69868),s=a(84922),n=a(11991),c=a(65940),d=a(63211),l=a(17372),h=(a(77510),a(86160),a(60921),t([l]));l=(h.then?(await h)():h)[0];let r,p,u,m,_,y=t=>t;const f="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",b=[];class v extends s.WF{async focus(){var t;await this.updateComplete,null===(t=this.renderRoot.querySelector("ha-form"))||void 0===t||t.focus()}updated(t){if(super.updated(t),t.has("data")){var e;const t=null!==(e=this._displayActions)&&void 0!==e?e:b,a=this._hiddenActions(this.schema.schema,t);this._displayActions=[...t,...a.filter(t=>t in this.data)]}}render(){var t,e,a;const i=null!==(t=this._displayActions)&&void 0!==t?t:b,o=this._displaySchema(this.schema.schema,null!==(e=this._displayActions)&&void 0!==e?e:[]),n=this._hiddenActions(this.schema.schema,i),c=new Map(this.computeLabel?this.schema.schema.map(t=>[t.name,t]):[]);return(0,s.qy)(r||(r=y` ${0} ${0} `),o.length>0?(0,s.qy)(p||(p=y` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" .computeLabel="${0}" .computeHelper="${0}" .localizeValue="${0}"></ha-form> `),this.hass,this.data,o,this.disabled,this.computeLabel,this.computeHelper,this.localizeValue):s.s6,n.length>0?(0,s.qy)(u||(u=y` <ha-button-menu @action="${0}" fixed @closed="${0}"> <ha-button slot="trigger" appearance="filled" size="small"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> ${0} </ha-button-menu> `),this._handleAddAction,d.d,f,(null===(a=this.localize)||void 0===a?void 0:a.call(this,"ui.components.form-optional-actions.add"))||"Add interaction",n.map(t=>{const e=c.get(t);return(0,s.qy)(m||(m=y` <ha-list-item> ${0} </ha-list-item> `),this.computeLabel&&e?this.computeLabel(e):t)})):s.s6)}_handleAddAction(t){var e,a;const i=this._hiddenActions(this.schema.schema,null!==(e=this._displayActions)&&void 0!==e?e:b)[t.detail.index];this._displayActions=[...null!==(a=this._displayActions)&&void 0!==a?a:[],i]}constructor(...t){super(...t),this.disabled=!1,this._hiddenActions=(0,c.A)((t,e)=>t.map(t=>t.name).filter(t=>!e.includes(t))),this._displaySchema=(0,c.A)((t,e)=>t.filter(t=>e.includes(t.name)))}}v.styles=(0,s.AH)(_||(_=y`:host{display:flex!important;flex-direction:column;gap:24px}:host ha-form{display:block}`)),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"localize",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"data",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"schema",void 0),(0,o.__decorate)([(0,n.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"computeLabel",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"computeHelper",void 0),(0,o.__decorate)([(0,n.MZ)({attribute:!1})],v.prototype,"localizeValue",void 0),(0,o.__decorate)([(0,n.wk)()],v.prototype,"_displayActions",void 0),v=(0,o.__decorate)([(0,n.EM)("ha-form-optional_actions")],v),i()}catch(r){i(r)}})}}]);
//# sourceMappingURL=9095.0750e7dce89f597f.js.map