"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["98718"],{57237:function(t,e,o){o.d(e,{d:function(){return a}});const a=t=>t.stopPropagation()},70947:function(t,e,o){o(62953);var a=o(40445),i=o(90075),r=(o(43776),o(96196)),s=o(77845);o(67094);let n,c,h=t=>t;class l extends i.A{renderCheckboxIcon(){return(0,r.qy)(n||(n=h` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[i.A.styles,(0,r.AH)(c||(c=h`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"selected",void 0),l=(0,a.Cg)([(0,s.EM)("ha-dropdown-item")],l)},29823:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(62953);var a=o(40445),i=o(52254),r=o(96196),s=o(77845),n=t([i]);i=(n.then?(await n)():n)[0];let c,h=t=>t;class l extends i.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[i.A.styles,(0,r.AH)(c||(c=h`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,a.Cg)([(0,s.EM)("ha-dropdown")],l),e()}catch(c){e(c)}})},8456:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaFormOptionalActions:function(){return A}});o(74423),o(18111),o(22489),o(61701),o(45367),o(92731),o(3362),o(62953);var i=o(40445),r=o(96196),s=o(77845),n=o(22786),c=o(57237),h=o(18350),l=o(29823),d=(o(70947),o(67094),o(52763)),p=t([h,l,d]);[h,l,d]=p.then?(await p)():p;let u,m,v,g,y,f=t=>t;const b="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",w=[];class A extends r.WF{async focus(){var t;await this.updateComplete,null===(t=this.renderRoot.querySelector("ha-form"))||void 0===t||t.focus()}reportValidity(){const t=this.renderRoot.querySelector("ha-form");return!t||t.reportValidity()}updated(t){if(super.updated(t),t.has("data")){var e;const t=null!==(e=this._displayActions)&&void 0!==e?e:w,o=this._hiddenActions(this.schema.schema,t);this._displayActions=[...t,...o.filter(t=>t in this.data)]}}render(){var t,e,o;const a=null!==(t=this._displayActions)&&void 0!==t?t:w,i=this._displaySchema(this.schema.schema,null!==(e=this._displayActions)&&void 0!==e?e:[]),s=this._hiddenActions(this.schema.schema,a),n=new Map(this.computeLabel?this.schema.schema.map(t=>[t.name,t]):[]);return(0,r.qy)(u||(u=f` ${0} ${0} `),i.length>0?(0,r.qy)(m||(m=f` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .disabled="${0}" .computeLabel="${0}" .computeHelper="${0}" .localizeValue="${0}"></ha-form> `),this.hass,this.data,i,this.disabled,this.computeLabel,this.computeHelper,this.localizeValue):r.s6,s.length>0?(0,r.qy)(v||(v=f` <ha-dropdown @wa-select="${0}" @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-dropdown> `),this._handleAddAction,c.d,b,(null===(o=this.localize)||void 0===o?void 0:o.call(this,"ui.components.form-optional-actions.add"))||"Add interaction",s.map(t=>{const e=n.get(t);return(0,r.qy)(g||(g=f` <ha-dropdown-item .value="${0}"> ${0} </ha-dropdown-item> `),t,this.computeLabel&&e?this.computeLabel(e):t)})):r.s6)}_handleAddAction(t){var e;const o=t.detail.item.value;this._displayActions=[...null!==(e=this._displayActions)&&void 0!==e?e:[],o]}constructor(...t){super(...t),this.disabled=!1,this._hiddenActions=(0,n.A)((t,e)=>t.map(t=>t.name).filter(t=>!e.includes(t))),this._displaySchema=(0,n.A)((t,e)=>t.filter(t=>e.includes(t.name)))}}A.styles=(0,r.AH)(y||(y=f`:host{display:flex!important;flex-direction:column;gap:var(--ha-space-6)}:host ha-form{display:block}ha-dropdown{display:inline-block}`)),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"localize",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"data",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"schema",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],A.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"computeLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"computeHelper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"localizeValue",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_displayActions",void 0),A=(0,i.Cg)([(0,s.EM)("ha-form-optional_actions")],A),a()}catch(u){a(u)}})},69235:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await o.e("71055").then(o.bind(o,52370))).default),e()}catch(a){e(a)}},1)},35370:function(t,e,o){var a=o(26198);t.exports=function(t,e,o){for(var i=0,r=arguments.length>2?o:a(e),s=new t(r);r>i;)s[i]=e[i++];return s}}}]);
//# sourceMappingURL=98718.4a2a5a2d1d1c0d76.js.map