iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
38 lines • 160 kB
JavaScript
export const __rspack_esm_id=61864;export const __rspack_esm_ids=[61864];export const __webpack_modules__={68348(e,t,i){i.d(t,{u:()=>s});i(18111),i(13579);const s=e=>{if(e.some(e=>"tagName"in e&&("HA-MENU"===e.tagName||"HA-CODE-EDITOR"===e.tagName)))return!1;const t=e[0];if("TEXTAREA"===t.tagName||"HA-SELECT"===t.parentElement?.tagName||"HA-DROPDOWN"===t.parentElement?.tagName)return!1;if("INPUT"!==t.tagName)return!0;switch(t.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},57237(e,t,i){i.d(t,{d:()=>s});const s=e=>e.stopPropagation()},51758(e,t,i){i.d(t,{Z:()=>s});const s=e=>{const t=window.location.pathname;return e?t+"?"+e:t}},19459(e,t,i){i.d(t,{b:()=>s});i(45367),i(92731),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const s=(e,t,i)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let a,o;if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(a=o;0!==a--;)if(!s(e[a],t[a],i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!s(a[1],t.get(a[0]),i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(o=e.length,o!==t.length)return!1;for(a=o;0!==a--;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const r=Object.keys(e);if(o=r.length,o!==Object.keys(t).length)return!1;for(a=o;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,r[a]))return!1;for(a=o;0!==a--;){const o=r[a];if(!s(e[o],t[o],i))return!1}if(i?.compareSymbols){const a=Object.getOwnPropertySymbols(e),o=Object.getOwnPropertySymbols(t);if(a.length!==o.length)return!1;for(const o of a){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!s(e[o],t[o],i))return!1}}return!0}return e!=e&&t!=t}},60353(e,t,i){i.d(t,{u:()=>s});class s{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=e.velocitySwipeThreshold??.5,this._movementTimeThreshold=e.movementTimeThreshold??100}}},64481(e,t,i){i.d(t,{D:()=>a,J:()=>r});i(64979);let s=!1;try{s="true"===window.localStorage.getItem("disableViewTransition")}catch{}const a=e=>{s=e},o=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},r=e=>{if(!document.startViewTransition||s)return e(!1),Promise.resolve();let t=!1;try{const i=document.startViewTransition(()=>{t=!0,e(!0)});return i.ready.catch(o),i.finished.catch(o)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),t?Promise.reject(i):(e(!1),Promise.resolve())}}},5745(e,t,i){var s=i(62826),a=i(99731),o=i(22441);class r extends a.Y{}r=(0,s.Cg)([(0,o.EM)("ha-chip-set")],r)},32023(e,t,i){var s=i(62826),a=i(42034),o=i(20832),r=i(63374),n=i(75640),l=i(91735),h=i(43826),c=i(5124),d=i(22441);class p extends o.${renderLeadingIcon(){return this.noLeadingIcon?c.qy``:super.renderLeadingIcon()}constructor(...e){super(...e),this.noLeadingIcon=!1}}p.styles=[l.R,a.R,h.R,n.R,r.R,c.AH`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-filter-chip-container-shape:var(--ha-border-radius-md);--md-filter-chip-outline-color:var(--outline-color);--md-filter-chip-selected-container-color:rgba(
var(--rgb-primary-text-color),
0.15
);--_label-text-font:var(--ha-font-family-body)}`],(0,s.Cg)([(0,d.MZ)({type:Boolean,reflect:!0,attribute:"no-leading-icon"})],p.prototype,"noLeadingIcon",void 0),p=(0,s.Cg)([(0,d.EM)("ha-filter-chip")],p)},99611(e,t,i){i.a(e,async function(e,t){try{i(18111),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var s=i(62826),a=i(1126),o=i(35211),r=i(5124),n=i(22441),l=i(1087),h=i(60353),c=i(22792),d=i(59992),p=i(14503),u=i(22348),g=e([a]);a=(g.then?(await g)():g)[0];const m=300,_=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),v=new Set(["volume-slider-container","forecast"]);class f extends((0,d.V)(r.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return r.qy` <wa-drawer id="drawer" placement="bottom" .open="${this._drawerOpen}" .lightDismiss="${!this.preventScrimClose}" .ariaLabelledby="${this.ariaLabelledBy}" .ariaDescribedby="${this.ariaDescribedBy}" @keydown="${this._handleKeyDown}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-hide="${this._handleHide}" @wa-after-hide="${this._handleAfterHide}" @click="${this._handleCloseAction}" without-header @touchstart="${this._handleTouchStart}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer"></slot> </wa-drawer> `}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${m}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},m)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,p.dp,r.AH`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${m}ms;--hide-duration:${m}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new h.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{const e=this._autofocusElement;this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):e?.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const e of t){if(e===this._drawer)break;if(e instanceof HTMLElement&&(e.scrollTop>0||_.has(e.localName)||Array.from(e.classList).some(e=>v.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,i=this._gestureRecognizer.move(t);i<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const t=this._drawer.shadowRoot?.querySelector('[part="body"]'),i=t?.offsetHeight||0;i>0&&e.delta<0&&Math.abs(e.delta)>.5*i?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,s.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],f.prototype,"ariaLabelledBy",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],f.prototype,"ariaDescribedBy",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"open",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],f.prototype,"flexContent",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],f.prototype,"preventScrimClose",void 0),(0,s.Cg)([(0,n.wk)()],f.prototype,"_drawerOpen",void 0),(0,s.Cg)([(0,n.wk)()],f.prototype,"_sliderInteractionActive",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,n.P)("#drawer")],f.prototype,"_drawer",void 0),(0,s.Cg)([(0,n.P)("#body")],f.prototype,"_bodyElement",void 0),(0,s.Cg)([(0,n.P)("[autofocus]")],f.prototype,"_autofocusElement",void 0),f=(0,s.Cg)([(0,n.EM)("ha-bottom-sheet")],f),t()}catch(e){t(e)}})},89865(e,t,i){i.a(e,async function(e,t){try{i(18111),i(61701);var s=i(62826),a=(i(22395),i(5124)),o=i(22441),r=i(1087),n=i(18350),l=(i(67094),e([n]));n=(l.then?(await l)():l)[0];class h extends a.WF{render(){return a.qy` <wa-button-group childSelector="ha-button"> ${this.buttons.map(e=>a.qy`<ha-button iconTag="ha-svg-icon" class="icon" .variant="${this.active===e.value&&this.activeVariant?this.activeVariant:this.variant}" .size="${this.size}" .value="${e.value}" @click="${this._handleClick}" .title="${e.label}" .appearance="${this.active===e.value?"accent":"filled"}"> ${e.iconPath?a.qy`<ha-svg-icon aria-label="${e.label}" .path="${e.iconPath}"></ha-svg-icon>`:e.label} </ha-button>`)} </wa-button-group> `}_handleClick(e){this.active=e.currentTarget.value,(0,r.r)(this,"value-changed",{value:this.active})}constructor(...e){super(...e),this.size="medium",this.nowrap=!1,this.fullWidth=!1,this.variant="brand"}}h.styles=a.AH`:host{--mdc-icon-size:var(--button-toggle-icon-size, 20px)}:host([no-wrap]) wa-button-group::part(base){flex-wrap:nowrap}wa-button-group{padding:var(--ha-button-toggle-group-padding)}:host([full-width]) wa-button-group,:host([full-width]) wa-button-group::part(base){width:100%}:host([full-width]) ha-button{flex:1}`,(0,s.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"buttons",void 0),(0,s.Cg)([(0,o.MZ)()],h.prototype,"active",void 0),(0,s.Cg)([(0,o.MZ)({reflect:!0})],h.prototype,"size",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"no-wrap"})],h.prototype,"nowrap",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"full-width"})],h.prototype,"fullWidth",void 0),(0,s.Cg)([(0,o.MZ)()],h.prototype,"variant",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"active-variant"})],h.prototype,"activeVariant",void 0),h=(0,s.Cg)([(0,o.EM)("ha-button-toggle-group")],h),t()}catch(e){t(e)}})},75064(e,t,i){var s=i(62826),a=i(5124),o=i(22441),r=i(2846);class n extends r.G{constructor(...e){super(...e),this.borderTop=!1}}n.styles=[...r.J,a.AH`:host{--md-list-item-one-line-container-height:48px;--md-list-item-two-line-container-height:64px}:host([border-top]) md-item{border-top:1px solid var(--divider-color)}[slot=start]{--state-icon-color:var(--secondary-text-color)}[slot=overline]{line-height:1.15rem;font-size:calc(var(--mdc-typography-subtitle1-font-size, 1rem) * .75);font-weight:var(--mdc-typography-subtitle1-font-weight,400);font-family:var(
--mdc-typography-subtitle1-font-family,
var(--mdc-typography-font-family)
);color:var(--mdc-select-label-ink-color,rgba(0,0,0,.6))}[slot=headline]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-m);white-space:nowrap}[slot=supporting-text]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-s);white-space:nowrap}::slotted(img),::slotted(state-badge){width:32px;height:32px}::slotted(.code){font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-xs)}::slotted(.domain){font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);align-self:flex-end;max-width:30%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`],(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"border-top"})],n.prototype,"borderTop",void 0),n=(0,s.Cg)([(0,o.EM)("ha-combo-box-item")],n)},76623(e,t,i){i.a(e,async function(e,s){try{i.d(t,{D:()=>d});var a=i(62826),o=i(5124),r=i(22441),n=i(91450),l=i(71727),h=i(85694),c=(i(47680),i(67094),e([h]));h=(c.then?(await c)():c)[0];const d={device:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",and:"M4.4,16.5C4.4,15.6 4.7,14.7 5.2,13.9C5.7,13.1 6.7,12.2 8.2,11.2C7.3,10.1 6.8,9.3 6.5,8.7C6.1,8 6,7.4 6,6.7C6,5.2 6.4,4.1 7.3,3.2C8.2,2.3 9.4,2 10.9,2C12.2,2 13.3,2.4 14.2,3.2C15.1,4 15.5,5 15.5,6.1C15.5,6.9 15.3,7.6 14.9,8.3C14.5,9 13.8,9.7 12.8,10.4L11.4,11.5L15.7,16.7C16.3,15.5 16.6,14.3 16.6,12.8H18.8C18.8,15.1 18.3,17 17.2,18.5L20,21.8H17L15.7,20.3C15,20.9 14.3,21.3 13.4,21.6C12.5,21.9 11.6,22.1 10.7,22.1C8.8,22.1 7.3,21.6 6.1,20.6C5,19.5 4.4,18.2 4.4,16.5M10.7,20C12,20 13.2,19.5 14.3,18.5L9.6,12.8L9.2,13.1C7.7,14.2 7,15.3 7,16.5C7,17.6 7.3,18.4 8,19C8.7,19.6 9.5,20 10.7,20M8.5,6.7C8.5,7.6 9,8.6 10.1,9.9L11.7,8.8C12.3,8.4 12.7,8 12.9,7.6C13.1,7.2 13.2,6.7 13.2,6.2C13.2,5.6 13,5.1 12.5,4.7C12.1,4.3 11.5,4.1 10.8,4.1C10.1,4.1 9.5,4.3 9.1,4.8C8.7,5.3 8.5,5.9 8.5,6.7Z",or:"M2,4C5,10 5,14 2,20H8C13,20 19,16 22,12C19,8 13,4 8,4H2M5,6H8C11.5,6 16.3,9 19.3,12C16.3,15 11.5,18 8,18H5C6.4,13.9 6.4,10.1 5,6Z",not:"M14.08,4.61L15.92,5.4L14.8,8H19V10H13.95L12.23,14H19V16H11.38L9.92,19.4L8.08,18.61L9.2,16H5V14H10.06L11.77,10H5V8H12.63L14.08,4.61Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",numeric_state:"M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",sun:"M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",template:"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",time:"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",trigger:"M10 7V9H9V15H10V17H6V15H7V9H6V7H10M16 7C17.11 7 18 7.9 18 9V15C18 16.11 17.11 17 16 17H12V7M16 9H14V15H16V9Z",zone:"M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z"};class p extends o.WF{render(){if(this.icon)return o.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.condition)return o.s6;if(!this.hass)return this._renderFallback();const e=(0,h.r)(this.hass.connection,this.hass.config,this.condition).then(e=>e?o.qy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback());return o.qy`${(0,n.T)(e)}`}_renderFallback(){const e=(0,l.m)(this.condition);return o.qy` <ha-svg-icon .path="${d[this.condition]||h.l[e]}"></ha-svg-icon> `}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"condition",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"icon",void 0),p=(0,a.Cg)([(0,r.EM)("ha-condition-icon")],p),s()}catch(e){s(e)}})},76538(e,t,i){var s=i(62826),a=i(5124),o=i(22441);class r extends a.WF{render(){const e=a.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=a.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return a.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?a.qy`${t}${e}`:a.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[a.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,s.Cg)([(0,o.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,s.Cg)([(0,o.EM)("ha-dialog-header")],r)},72554(e,t,i){i.a(e,async function(e,t){try{var s=i(62826),a=i(93900),o=i(35211),r=i(5124),n=i(22441),l=i(63672),h=i(1087),c=i(64481),d=i(22792),p=i(59992),u=i(14503),g=i(22348),m=(i(76538),i(26300)),_=e([a,m]);[a,m]=_.then?(await _)():_;const v="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class f extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${v}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,c.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,r.AH`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,h.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,h.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,h.r)(this,"closed"))}}}(0,s.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],f.prototype,"ariaLabelledBy",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],f.prototype,"ariaDescribedBy",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],f.prototype,"open",void 0),(0,s.Cg)([(0,n.MZ)({reflect:!0})],f.prototype,"type",void 0),(0,s.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],f.prototype,"width",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],f.prototype,"preventScrimClose",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"header-title"})],f.prototype,"headerTitle",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],f.prototype,"headerSubtitle",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],f.prototype,"headerSubtitlePosition",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],f.prototype,"flexContent",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],f.prototype,"withoutHeader",void 0),(0,s.Cg)([(0,n.wk)()],f.prototype,"_open",void 0),(0,s.Cg)([(0,n.P)(".body")],f.prototype,"bodyContainer",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],f.prototype,"_i18n",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:d.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,n.wk)()],f.prototype,"_bodyScrolled",void 0),(0,s.Cg)([(0,n.Ls)({passive:!0})],f.prototype,"_handleBodyScroll",null),f=(0,s.Cg)([(0,n.EM)("ha-dialog")],f),t()}catch(e){t(e)}})},59174(e,t,i){i.a(e,async function(e,t){try{var s=i(62826),a=i(35211),o=i(5124),r=i(22441),n=i(91450),l=i(22792),h=i(85694),c=i(44144),d=(i(47680),e([h]));h=(d.then?(await d)():d)[0];class p extends o.WF{render(){if(this.icon)return o.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.domain)return o.s6;if(!this._connection||!this._hassConfig)return this._renderFallback();const e=(0,h._4)(this._connection.connection,this._hassConfig.config,this.domain,this.deviceClass,this.state).then(e=>e?o.qy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback());return o.qy`${(0,n.T)(e)}`}_renderFallback(){if(this.domain&&this.domain in h.l)return o.qy` <ha-svg-icon .path="${h.l[this.domain]}"></ha-svg-icon> `;if(this.brandFallback){const e=(0,c.MR)({domain:this.domain,type:"icon",darkOptimized:this._hassUi?.themes.darkMode},this._hassConfig?.auth.data.hassUrl);return o.qy` <img alt="" src="${e}" crossorigin="anonymous" referrerpolicy="no-referrer"> `}return o.qy`<ha-svg-icon .path="${h.lW}"></ha-svg-icon>`}}p.styles=o.AH`img{width:var(--mdc-icon-size,24px)}`,(0,s.Cg)([(0,r.MZ)()],p.prototype,"domain",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"deviceClass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"state",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"icon",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"brand-fallback",type:Boolean})],p.prototype,"brandFallback",void 0),(0,s.Cg)([(0,r.wk)(),(0,a.Fg)({context:l.WF,subscribe:!0})],p.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,r.wk)(),(0,a.Fg)({context:l.Wq,subscribe:!0})],p.prototype,"_connection",void 0),(0,s.Cg)([(0,r.wk)(),(0,a.Fg)({context:l.EK,subscribe:!0})],p.prototype,"_hassUi",void 0),p=(0,s.Cg)([(0,r.EM)("ha-domain-icon")],p),t()}catch(e){t(e)}})},45100(e,t,i){i.a(e,async function(e,s){try{i.r(t),i.d(t,{HaIconButtonPrev:()=>p});var a=i(62826),o=i(5124),r=i(22441),n=i(63091),l=i(26300),h=e([l]);l=(h.then?(await h)():h)[0];const c="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";class p extends o.WF{render(){return o.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...e){super(...e),this.disabled=!1,this._icon="rtl"===n.G.document.dir?d:c}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"href",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"target",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"rel",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"download",void 0),(0,a.Cg)([(0,r.wk)()],p.prototype,"_icon",void 0),p=(0,a.Cg)([(0,r.EM)("ha-icon-button-prev")],p),s()}catch(e){s(e)}})},43661(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>n});var s=i(62826),a=i(22441),o=i(63091),r=i(67094);class n extends r.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===o.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,s.Cg)([(0,a.MZ)()],n.prototype,"path",void 0),n=(0,s.Cg)([(0,a.EM)("ha-icon-next")],n)},2846(e,t,i){i.d(t,{G:()=>h,J:()=>l});var s=i(62826),a=i(58168),o=i(82553),r=i(5124),n=i(22441);i(54276);const l=[o.R,r.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class h extends a.n{renderRipple(){return"text"===this.type?r.s6:r.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}h.styles=l,h=(0,s.Cg)([(0,n.EM)("ha-md-list-item")],h)},69464(e,t,i){var s=i(62826),a=i(5124),o=i(22441);class r extends a.WF{render(){return a.qy`<slot></slot>`}}r.styles=a.AH`:host{background-color:var(--ha-color-fill-neutral-quiet-resting);padding:var(--ha-space-2) var(--ha-space-3);font-weight:var(--ha-font-weight-bold);color:var(--secondary-text-color);min-height:var(--ha-space-6);display:flex;align-items:center;box-sizing:border-box}`,r=(0,s.Cg)([(0,o.EM)("ha-section-title")],r)},65329(e,t,i){i.a(e,async function(e,t){try{var s=i(62826),a=i(5124),o=i(22441),r=i(91450),n=i(71727),l=i(85694),h=(i(47680),i(67094),e([l]));l=(h.then?(await h)():h)[0];class c extends a.WF{render(){if(this.icon)return a.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.service)return a.s6;if(!this.hass)return this._renderFallback();const e=(0,l.f$)(this.hass.connection,this.hass.config,this.service).then(e=>e?a.qy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback());return a.qy`${(0,r.T)(e)}`}_renderFallback(){const e=(0,n.m)(this.service);return a.qy` <ha-svg-icon .path="${l.l[e]||l.Gn}"></ha-svg-icon> `}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)()],c.prototype,"service",void 0),(0,s.Cg)([(0,o.MZ)()],c.prototype,"icon",void 0),c=(0,s.Cg)([(0,o.EM)("ha-service-icon")],c),t()}catch(e){t(e)}})},14404(e,t,i){i.a(e,async function(e,s){try{i.d(t,{S:()=>x});var a=i(62826),o=i(5124),r=i(22441),n=i(91450),l=i(71727),h=i(85694),c=i(53580),d=(i(47680),i(67094),e([h]));h=(d.then?(await d)():d)[0];const p="M11,17A1,1 0 0,0 12,18A1,1 0 0,0 13,17A1,1 0 0,0 12,16A1,1 0 0,0 11,17M11,3V7H13V5.08C16.39,5.57 19,8.47 19,12A7,7 0 0,1 12,19A7,7 0 0,1 5,12C5,10.32 5.59,8.78 6.58,7.58L12,13L13.41,11.59L6.61,4.79V4.81C4.42,6.45 3,9.05 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M18,12A1,1 0 0,0 17,11A1,1 0 0,0 16,12A1,1 0 0,0 17,13A1,1 0 0,0 18,12M6,12A1,1 0 0,0 7,13A1,1 0 0,0 8,12A1,1 0 0,0 7,11A1,1 0 0,0 6,12Z",u="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",g="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",m="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",_="M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z",v="M13 11H11V5H13M13 15H11V13H13M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2Z",f="M8,7A2,2 0 0,1 10,9V14A2,2 0 0,1 8,16A2,2 0 0,1 6,14V9A2,2 0 0,1 8,7M14,14C14,16.97 11.84,19.44 9,19.92V22H7V19.92C4.16,19.44 2,16.97 2,14H4A4,4 0 0,0 8,18A4,4 0 0,0 12,14H14M21.41,9.41L17.17,13.66L18.18,10H14A2,2 0 0,1 12,8V4A2,2 0 0,1 14,2H20A2,2 0 0,1 22,4V8C22,8.55 21.78,9.05 21.41,9.41Z",y="M18,6H13A2,2 0 0,0 11,8V10.28C10.41,10.62 10,11.26 10,12A2,2 0 0,0 12,14C13.11,14 14,13.1 14,12C14,11.26 13.6,10.62 13,10.28V8H16V16H8V8H10V6H8L6,6V18H18M20,20H4V4H20M20,2H4A2,2 0 0,0 2,4V20A2,2 0 0,0 4,22H20C21.11,22 22,21.1 22,20V4C22,2.89 21.11,2 20,2Z",b="M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",w="M21,9L17,5V8H10V10H17V13M7,11L3,15L7,19V16H14V14H7V11Z",C="M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",$="M10.46,19C9,21.07 6.15,21.59 4.09,20.15C2.04,18.71 1.56,15.84 3,13.75C3.87,12.5 5.21,11.83 6.58,11.77L6.63,13.2C5.72,13.27 4.84,13.74 4.27,14.56C3.27,16 3.58,17.94 4.95,18.91C6.33,19.87 8.26,19.5 9.26,18.07C9.57,17.62 9.75,17.13 9.82,16.63V15.62L15.4,15.58L15.47,15.47C16,14.55 17.15,14.23 18.05,14.75C18.95,15.27 19.26,16.43 18.73,17.35C18.2,18.26 17.04,18.58 16.14,18.06C15.73,17.83 15.44,17.46 15.31,17.04L11.24,17.06C11.13,17.73 10.87,18.38 10.46,19M17.74,11.86C20.27,12.17 22.07,14.44 21.76,16.93C21.45,19.43 19.15,21.2 16.62,20.89C15.13,20.71 13.9,19.86 13.19,18.68L14.43,17.96C14.92,18.73 15.75,19.28 16.75,19.41C18.5,19.62 20.05,18.43 20.26,16.76C20.47,15.09 19.23,13.56 17.5,13.35C16.96,13.29 16.44,13.36 15.97,13.53L15.12,13.97L12.54,9.2H12.32C11.26,9.16 10.44,8.29 10.47,7.25C10.5,6.21 11.4,5.4 12.45,5.44C13.5,5.5 14.33,6.35 14.3,7.39C14.28,7.83 14.11,8.23 13.84,8.54L15.74,12.05C16.36,11.85 17.04,11.78 17.74,11.86M8.25,9.14C7.25,6.79 8.31,4.1 10.62,3.12C12.94,2.14 15.62,3.25 16.62,5.6C17.21,6.97 17.09,8.47 16.42,9.67L15.18,8.95C15.6,8.14 15.67,7.15 15.27,6.22C14.59,4.62 12.78,3.85 11.23,4.5C9.67,5.16 8.97,7 9.65,8.6C9.93,9.26 10.4,9.77 10.97,10.11L11.36,10.32L8.29,15.31C8.32,15.36 8.36,15.42 8.39,15.5C8.88,16.41 8.54,17.56 7.62,18.05C6.71,18.54 5.56,18.18 5.06,17.24C4.57,16.31 4.91,15.16 5.83,14.67C6.22,14.46 6.65,14.41 7.06,14.5L9.37,10.73C8.9,10.3 8.5,9.76 8.25,9.14Z",x={calendar:"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.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,3H18V1M17,12H12V17H17V12Z",device:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",event:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5M11,3A6,6 0 0,1 17,9C17,10.7 16.29,12.23 15.16,13.33L14.16,12.88C15.28,11.96 16,10.56 16,9A5,5 0 0,0 11,4A5,5 0 0,0 6,9C6,11.05 7.23,12.81 9,13.58V14.66C6.67,13.83 5,11.61 5,9A6,6 0 0,1 11,3Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",geo_location:"M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",homeassistant:c.mdiHomeAssistant,mqtt:w,numeric_state:b,sun:C,conversation:f,tag:y,template:g,time:u,time_pattern:p,webhook:$,persistent_notification:v,zone:_,list:m};class A extends o.WF{render(){if(this.icon)return o.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.trigger)return o.s6;if(!this.hass)return this._renderFallback();const e=(0,h.ab)(this.hass.connection,this.hass.config,this.trigger).then(e=>e?o.qy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback());return o.qy`${(0,n.T)(e)}`}_renderFallback(){const e=(0,l.m)(this.trigger);return o.qy` <ha-svg-icon .path="${x[this.trigger]||h.l[e]}"></ha-svg-icon> `}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)()],A.prototype,"trigger",void 0),(0,a.Cg)([(0,r.MZ)()],A.prototype,"icon",void 0),A=(0,a.Cg)([(0,r.EM)("ha-trigger-icon")],A),s()}catch(e){s(e)}})},36866(e,t,i){i.a(e,async function(e,t){try{var s=i(62826),a=i(5124),o=i(22441),r=i(91485),n=e([r]);r=(n.then?(await n)():n)[0];const l="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class h extends r.U{willUpdate(e){super.willUpdate(e),this.label||this.placeholder||this.hasUpdated&&!e.has("_i18n")||(this.placeholder=this.i18n?.localize?.("ui.common.search")||"Search")}renderStartDefault(){return a.qy`<ha-svg-icon slot="start" .path="${l}"></ha-svg-icon>`}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}h.styles=[...r.U.styles,a.AH`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`],h=(0,s.Cg)([(0,o.EM)("ha-input-search")],h),t()}catch(e){t(e)}})},91485(e,t,i){i.a(e,async function(e,s){try{i.d(t,{U:()=>w});var a=i(62826),o=(i(86137),i(30006)),r=i(92070),n=i(35211),l=i(5124),h=i(22441),c=i(6412),d=i(63672),p=i(57237),u=i(22792),g=i(26300),m=(i(67094),i(34127)),_=i(53305),v=e([o,g,m]);[o,g,m]=v.then?(await v)():v;const f="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",y="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",b="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,_.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(e){super.firstUpdated(e),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const e=!this.label&&this._hasSlotController.test("label"),t=!this.hint&&this._hasSlotController.test("hint"),i=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,c.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||i&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||t||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||e?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${f}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?b:y}"></ha-icon-button> </slot> <div slot="hint" class="${(0,c.H)({error:this.invalid||this._invalid})}" role="${(0,d.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(t?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...e){super(...e),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new r.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const e=this._input?.shadowRoot?.querySelector('[part~="start"]'),t=e?.offsetWidth??0;t>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${t}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[_.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,a.Cg)([(0,h.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,a.Cg)([(0,h.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,a.Cg)([(0,h.MZ)()],w.prototype,"pattern",void 0),(0,a.Cg)([(0,h.MZ)()],w.prototype,"min",void 0),(0,a.Cg)([(0,h.MZ)()],w.prototype,"max",void 0),(0,a.Cg)([(0,h.MZ)()],w.prototype,"step",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,a.Cg)([(0,h.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,a.Cg)([(0,h.P)("wa-input")],w.prototype,"_input",void 0),(0,a.Cg)([(0,h.wk)(),(0,n.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,a.Cg)([(0,h.EM)("ha-input")],w),s()}catch(e){s(e)}})},53305(e,t,i){i.d(t,{w:()=>l,N:()=>h});var s=i(62826),a=i(5124),o=i(22441),r=i(22786);i(74423);const n=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=e=>{class t extends e{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(e,t,i){this._formControl?.setSelectionRange(e,t,i)}setRangeText(e,t,i,s){this._formControl?.setRangeText(e,t,i,s)}checkValidity(){return!n||(this._formControl?.checkValidity()??!0)}reportValidity(){const e=this.checkValidity();return this._invalid=!e,e}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...e){super(...e),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,r.A)((e,t)=>{if(!t)return e;let i=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return i||(i="*"),i.startsWith('"')&&i.endsWith('"')&&(i=i.slice(1,-1)),i?`${e}${i}`:e})}}return t.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,s.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"hint",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"readonly",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"required",void 0),(0,s.Cg)([(0,o.MZ)({type:Number})],t.prototype,"minlength",void 0),(0,s.Cg)([(0,o.MZ)({type:Number})],t.prototype,"maxlength",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"autocapitalize",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"autocomplete",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"autofocus",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"spellcheck",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"inputmode",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"enterkeyhint",void 0),(0,s.Cg)([(0,o.MZ)()],t.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"validation-message"})],t.prototype,"validationMessage",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,attribute:"auto-validate"})],t.prototype,"autoValidate",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"invalid",void 0),(0,s.Cg)([(0,o.wk)()],t.prototype,"_invalid",void 0),t},h=a.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},30780(e,t,i){i.d(t,{EN:()=>l,I8:()=>d,L_:()=>c,MC:()=>h,O$:()=>a,bM:()=>n,ix:()=>o,rP:()=>r});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const s="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",a={condition:"M4 2A2 2 0 0 0 2 4V12H4V8H6V12H8V4A2 2 0 0 0 6 2H4M4 4H6V6H4M22 15.5V14A2 2 0 0 0 20 12H16V22H20A2 2 0 0 0 22 20V18.5A1.54 1.54 0 0 0 20.5 17A1.54 1.54 0 0 0 22 15.5M20 20H18V18H20V20M20 16H18V14H20M5.79 21.61L4.21 20.39L18.21 2.39L19.79 3.61Z",delay:"M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z",event:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5M11,3A6,6 0 0,1 17,9C17,10.7 16.29,12.23 15.16,13.33L14.16,12.88C15.28,11.96 16,10.56 16,9A5,5 0 0,0 11,4A5,5 0 0,0 6,9C6,11.05 7.23,12.81 9,13.58V14.66C6.67,13.83 5,11.61 5,9A6,6 0 0,1 11,3Z",play_media:"M8,5.14V19.14L19,12.14L8,5.14Z",service:"M12,5A2,2 0 0,1 14,7C14,7.24 13.96,7.47 13.88,7.69C17.95,8.5 21,11.91 21,16H3C3,11.91 6.05,8.5 10.12,7.69C10.04,7.47 10,7.24 10,7A2,2 0 0,1 12,5M22,19H2V17H22V19Z",wait_template:"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",wait_for_trigger:"M12,9A2,2 0 0,1 10,7C10,5.89 10.9,5 12,5C13.11,5 14,5.89 14,7A2,2 0 0,1 12,9M12,14A2,2 0 0,1 10,12C10,10.89 10.9,10 12,10C13.11,10 14,10.89 14,12A2,2 0 0,1 12,14M12,19A2,2 0 0,1 10,17C10,15.89 10.9,15 12,15C13.11,15 14,15.89 14,17A2,2 0 0,1 12,19M20,10H17V8.86C18.72,8.41 20,6.86 20,5H17V4A1,1 0 0,0 16,3H8A1,1 0 0,0 7,4V5H4C4,6.86 5.28,8.41 7,8.86V10H4C4,11.86 5.28,13.41 7,13.86V15H4C4,16.86 5.28,18.41 7,18.86V20A1,1 0 0,0 8,21H16A1,1 0 0,0 17,20V18.86C18.72,18.41 20,16.86 20,15H17V13.86C18.72,13.41 20,11.86 20,10Z",repeat:s,repeat_count:s,repeat_while:s,repeat_until:s,repeat_for_each:s,choose:"M11,5H8L12,1L16,5H13V9.43C12.25,9.89 11.58,10.46 11,11.12V5M22,11L18,7V10C14.39,9.85 11.31,12.57 11,16.17C9.44,16.72 8.62,18.44 9.17,20C9.72,21.56 11.44,22.38 13,21.83C14.56,21.27 15.38,19.56 14.83,18C14.53,17.14 13.85,16.47 13,16.17C13.47,12.17 17.47,11.97 17.95,11.97V14.97L22,11M10.63,11.59C9.3,10.57 7.67,10 6,10V7L2,11L6,15V12C7.34,12.03 8.63,12.5 9.64,13.4C9.89,12.76 10.22,12.15 10.63,11.59Z",if:"M14,4L16.29,6.29L13.41,9.17L14.83,10.59L17.71,7.71L20,10V4M10,4H4V10L6.29,7.71L11,12.41V20H13V11.59L7.71,6.29",device_id:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",stop:"M13 24C9.74 24 6.81 22 5.6 19L2.57 11.37C2.26 10.58 3 9.79 3.81 10.05L4.6 10.31C5.16 10.5 5.62 10.92 5.84 11.47L7.25 15H8V3.25C8 2.56 8.56 2 9.25 2S10.5 2.56 10.5 3.25V12H11.5V1.25C11.5 .56 12.06 0 12.75 0S14 .56 14 1.25V12H15V2.75C15 2.06 15.56 1.5 16.25 1.5C16.94 1.5 17.5 2.06 17.5 2.75V12H18.5V5.75C18.5 5.06 19.06 4.5 19.75 4.5S21 5.06 21 5.75V16C21 20.42 17.42 24 13 24Z",sequence:"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z",parallel:"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",variables:"M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20M16.6 8C18.1 9.3 19 11.1 19 13C19 14.9 18.1 16.7 16.6 18L15 17.4C16.3 16.4 17 14.7 17 13S16.3 9.6 15 8.6L16.6 8M7.4 8L9 8.6C7.7 9.6 7 11.3 7 13S7.7 16.4 9 17.4L7.4 18C5.9 16.7 5 14.9 5 13S5.9 9.3 7.4 8M12.1 12L13.5 10H15L12.8 13L14.1 16H12.8L12 14L10.6 16H9L11.3 12.9L10 10H11.3L12.1 12Z",set_conversation_response:"M12,8H4A2,2 0 0,0 2,10V14A2,2 0 0,0 4,16H5V20A1,1 0 0,0 6,21H8A1,1 0 0,0 9,20V16H12L17,20V4L12,8M21.5,12C21.5,13.71 20.54,15.26 19,16V8C20.53,8.75 21.5,10.3 21.5,12Z"},o=new Set(["variables"]),r=[{groups:{device_id:{},dynamicGroups:{}}},{titleKey:"ui.panel.config.automation.editor.actions.groups.helpers.label",groups:{helpers:{}}},{titleKey:"ui.panel.config.automation.editor.actions.groups.other.label",groups:{event:{},service:{},set_conversation_response:{},other:{}}}],n={condition:{},delay:{},wait_template:{},wait_for_trigger:{},repeat_count:{},repeat_while:{},repeat_until:{},repeat_for_each:{},choose:{},if:{},stop:{},sequence:{},parallel:{},variables:{}},l={repeat_count:{repeat:{count:2,sequence:[]}},repeat_while:{repeat:{while:[],sequence:[]}},repeat_until:{repeat:{until:[],sequence:[]}},repeat_for_each:{repeat:{for_each:{},sequence:[]}}},h=["ha-automation-action-choose","ha-automation-action-condition","ha-automation-action-if","ha-automation-action-parallel","ha-automation-action-repeat","ha-automation-action-sequence"],c=["choose","if","parallel","sequence","repeat_while","repeat_until"],d=["repeat_count","repeat_for_each","wait_for_trigger"]},2514(e,t,i){i.d(t,{L3:()=>l,uG:()=>c,QI:()=>u,bQ:()=>p,WT:()=>d,ft:()=>n,gs:()=>h});i(44114);var s=i(35518),a=i(9899);const o=e=>e.sendMessagePromise({type:"config/area_registry/list"}),r=(e,t)=>e.subscribeEvents((0,a.s)(()=>o(e).then(e=>t.setState(e,!0)),500,!0),"area_registry_updated"),n=(e,t)=>(0,s.N)("_areaRegistry",o,r,e,t),l=(e,t)=>e.callWS({type:"config/area_registry/create",...t}),h=(e,t,i)=>e.callWS({type:"config/area_registry/update",area_id:t,...i}),c=(e,t)=>e.callWS({type:"config/area_registry/delete",area_id:t}),d=(e,t)=>e.callWS({type:"config/area_registry/reorder",area_ids:t}),p=e=>{const t={};for(const i of e)i.area_id&&(i.area_id in t||(t[i.area_id]=[]),t[i.area_id].push(i));return t},u=e=>{const t={};for(const i of e)i.area_id&&(i.area_id in t||(t[i.area_id]=[]),t[i.area_id].push(i));return t}},53756(e,t,i){i.d(t,{t:()=>l,w:()=>h});i(74423),i(18111),i(22489),i(61701);var s=i(71727),a=i(74705),o=i(28978),r=i(15638),n=i(95350);const l=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],h=(e,t,i,l,h,c,d,p,u,g="")=>{let m,_=Object.keys(e.states);return d&&(_=_.filter(e=>d.includes(e))),p&&(_=_.filter(e=>!p.includes(e))),t&&(_=_.filter(e=>t.includes((0,s.m)(e)))),i&&(_=_.filter(e=>!i.includes((0,s.m)(e)))),m=_.map(t=>{const i=e.states[t],l=(0,o.u)(i),[h,c,d]=(0,a.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),p=(0,n.p$)(e.localize,(0,s.m)(t)),u=(0,r.qC)(e.language,e.translationMetadata.translations),m=h||c||t,_=[d,h?c:void 0].filter(Boolean).join(u?" ◂ ":" ▸ ");return{id:`${g}${t}`,primary:m,secondary:_,domain_name:p,sorting_label:[m,_].filter(Boolean).join("_"),search_labels:{entityName:h||null,deviceName:c||null,areaName:d||null,domainName:p||null,friendlyName:l||null,entityId:t},stateObj:i}}),h&&(m=m.filter(e=>e.id===u||e.stateObj?.attributes.device_class&&h.includes(e.stateObj.attributes.device_class))),c&&(m=m.filter(e=>e.id===u||e.stateObj?.attributes.unit_of_measurement&&c.includes(e.stateObj.attributes.unit_of_measurement))),l&&(m=m.filter(e=>e.id===u||e.stateObj&&l(e.stateObj))),m}},32250(e,t,i){i.d(t,{KD:()=>s,NL:()=>a,Rj:()=>r,_o:()=>n,ls:()=>o});i(44114);const s=(e,t)=>e.callWS({type:"config/floor_registry/create",...t}),a=(e,t,i)=>e.callWS({type:"config/floor_registry/update",floor_id:t,...i}),o=(e,t)=>e.callWS({type:"config/floor_registry/delete",floor_id:t}),r=(e,t)=>e.callWS({type:"config/floor_registry/reorder",floor_ids:t}),n=e=>{const t={};for(const i of e)i.floor_id&&(i.floor_id in t||(t[i.floor_id]=[]),t[i.floor_id].push(i));return t}},95311(e,t,i){i.d(t,{DF:()=>u,Lo:()=>y,MH:()=>h,MM:()=>g,Qz:()=>p,Ru:()=>_,UU:()=>v,_7:()=>d,bZ:()=>c,m0:()=>l,tD:()=>f,vX:()=>m,wY:()=>b});i(74423),i(44114),i(18111),i(22489),i(30531),i(7588),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var s=i(44537),a=i(69093),o=i(82286),r=i(24367),n=i(58594);const l=(e,t,i,s,a,o,r)=>{const n=[],l=[],h=[];return Object.values(i).forEach(i=>{i.labels.includes(t)&&p(e,a,s,i.area_id,o,r)&&h.push(i.area_id)}),Object.values(s).forEach(i=>{i.labels.includes(t)&&u(e.states,Object.values(a),i,o,r)&&l.push(i.id)}),Object.values(a).forEach(i=>{i.labels.includes(t)&&g(e.states[i.entity_id],o,r)&&n.push(i.entity_id)}),{areas:h,devices:l,entities:n}},h=(e,t,i,s,a)=>{const o=[];return Object.values(i).forEach(i=>{i.floor_id===t&&p(e,e.entities,e.devices,i.area_id,s,a)&&o.push(i.area_id)}),{areas:o}},c=(e,t,i,s,a,o)=>{const r=[],n=[];return Object.values(i).forEach(i=>{i.area_id===t&&u(e.states,Object.values(s),i,a,o)&&n.push(i.id)}),Object.values(s).forEach(i=>{i.area_id===t&&g(e.states[i.entity_id],a,o)&&r.push(i.entity_id)}),{devices:n,entities:r}},d=(e,t,i,s,a)=>{const o=[];return Object.values(i).forEach(i=>{i.device_id===t&&g(e.states[i.entity_id],s,a)&&o.push(i.entity_id)}),{entities:o}},p=(e,t,i,s,a,o)=>!!Object.values(i).some(i=>!(i.area_id!==s||!u(e.states,Object.values(t),i,a,o)))||Object.values(t).some(t=>!(t.area_id!==s||!g(e.states[t.entity_id],a,o))),u=(e,t,i,a,o)=>{const r=o?(0,n.fk)(o,t):void 0;if(a.target?.device&&!(0,s.e)(a.target.device).some(e=>m(e,i,r)))return!1;if(a.target?.entity){return t.filter(e=>e.device_id===i.id).some(t=>{const i=e[t.entity_id];return g(i,a,o)})}return!0},g=(e,t,i)=>!!e&&(!t.target?.entity||(0,s.e)(t.target.entity).some(t=>_(t,e,i))),m=(e,t,i)=>{const{manufacturer:s,model:a,model_id:o,integration:r}=e;return(!s||t.manufacturer===s)&&((!a||t.model===a)&&((!o||t.model_id===o)&&!(r&&i&&!i?.[t.id]?.has(r))))},_=(e,t,i)=>{const{domain:r,device_class:n,supported_features:l,unit_of_measurement:h,integration:c}=e;if(r){const e=(0,a.t)(t);if(Array.isArray(r)?!r.includes(e):e!==r)return!1}if(n){const e=t.attributes.device_class;if(e&&Array.isArray(n)?!n.includes(e):e!==n)return!1}if(l&&!(0,s.e)(l).some(e=>(0,o.$)(t,e)))return!1;if(h){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(h)?!h.includes(e):e!==h))return!1}return!c||i?.[t.entity_id]?.domain===c},v=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const{domain:t,integration:i,device_class:s,...a}=e.entity;return t||i||s?{entity:{...a,filter:{domain:t,integration:i,device_class:s}}}:{entity:a}},f=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const{integration:t,manufacturer:i,model:s,...a}=e.device;return t||i||s?{device:{...a,filter:{integration:t,manufacturer:i,model:s}}}:{device:a}},y=e=>{let t;if("target"in e)t=(0,s.e)(e.target?.entity);else if("entity"in e){if(e.entity?.include_entities)return;t=(0,s.e)(e.entity?.filter)}if(!t)return;const i=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,s.e)(e.domain).filter(e=>(0,r.z)(e)));return[...new Set(i)]},b=(e,t,i,a,o,r={target:{}})=>{if(!t)return[];const n=new Set((0,s.e)(t.entity_id)),p=new Set((0,s.e)(t.device_id)),u=new Set((0,s.e)(t.area_id)),g=new Set((0,s.e)(t.floor_id));return new Set((0,s.e)(t.label_id)).forEach(t=>{const s=l(e,t,o,a,i,r);s.devices.forEach(e=>p.add(e)),s.entities.forEach(e=>n.add(e)),s.areas.forEach(e=>u.add(e))}),g.forEach(t=>{h(e,t,o,r).areas.forEach(e=>u.add(e))}),u.forEach(t=>{const s=c(e,t,a,i,r);s.devices.forEach(e=>p.add(e)),s.entities.forEach(e=>n.add(e))}),p.forEach(t=>{d(e,t,i,r).entities.forEach(e=>n.add(e))}),Array.from(n)}},79172(e,t,i){i.d(t,{b:()=>a});var s=i(68348);const a=e=>class extends e{connectedCallback(){super.connectedCallback(),this.addKeyboardShortcuts()}disconnectedCallback(){this.removeKeyboardShortcuts(),super.disconnectedCallback()}addKeyboardShortcuts(){this._listenersAdded||(this._listenersAdded=!0,window.addEventListener("keydown",this._keydownEvent))}removeKeyboardShortcuts(){this._listenersAdded=!1,window.removeEventListener("keydown",this._keydownEvent)}supportedShortcuts(){return{}}supportedSingleKeyShortcuts(){return{}}constructor(...e){super(...e),this._keydownEvent=e=>{const t=this.supportedShortcuts(),i=e.shiftKey?e.key.toUpperCase():e.key;if((e.ctrlKey||e.metaKey)&&!e.altKey&&i in t){if(!(0,s.u)(e.composedPath()))return;if(window.getSelection()?.toString())return;return e.preventDefault(),void t[i]()}const a=this.supportedSingleKeyShortcuts();i in a&&(e.preventDefault(),a[i]())},this._listenersAdded=!1}}},59992(e,t,i){i.d(t,{V:()=>l});var s=i(62826),a=i(88696),o=i(5124),r=i(6412),n=i(22441);const l=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return o.qy` <div class="${(0,r.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,r.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],o.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:i=0,clientHeight:s=0,scrollTop:a=0}=e;this._contentScrollable=i-s>a+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new a.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,s.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,s.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t}},65467(e,t,i){i.a(e,async function(e,s){try{i.r(t);i(74423),i(44114),i(18111),i(22489),i(20116),i(7588),i(61701),i(18237),i(13579),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(46058),i(14603),i(47566),i(98721);var a=i(62826),o=(i(68825),i(35211)),r=i(5124),n=i(22441),l=i(6412),h=i(75751),c=i(22786),d=i(44537),p=i(1087),u=i(63091),g=i(65522),m=i(71727),_=i(74705),v=i(55931),f=i(20058),y=i(52220),b=i(51758),w=i(15638),C=i(9899),$=i(19459),x=i(74281),A=i(99611),L=i(18350),M=i(89865),H=(i(75064),i(76623)),V=i(72554),k=(i(76538),i(59174)),S=(i(18198),i(47680),i(26300)),T=i(45100),I=(i(43661),i(69464),i(65329)),E=i(34127),z=i(14404),q=i(36866),G=(i(1671),i(50723),i(30780)),D=i(2514),Z=i(88249),O=i(87225),j=i(77423),F=i(22792),B=i(58594),P=i(32250),N=i(85694),R=i(95350),W=i(93758),U=i(95311),K=i(88555),Q=i(3496),J=i(79172),Y=i(14503),X=i(36918),ee=i(41570),te=i(81619),ie=i(70897),se=i(2491),ae=i(25871),oe=i(82405),re=i(69070),ne=e([x,A,L,M,V,k,S,T,I,E,q,ie,se,ae,z,H,N,f]);[x,A,L,M,V,k,S,T,I,E,q,ie,se,ae,z,H,N,f]=ne.then?(await ne)():ne;const le="M6,2A4,4 0 0,1 10,6V8H14V6A4,4 0 0,1 18,2A4,4 0 0,1 22,6A4,4 0 0,1 18,10H16V14H18A4,4 0 0,1 22,18A4,4 0 0,1 18,22A4,4 0 0,1 14,18V16H10V18A4,4 0 0,1 6,22A4,4 0 0,1 2,18A4,4 0 0,1 6,14H8V10H6A4,4 0 0,1 2,6A4,4 0 0,1 6,2M16,18A2,2 0 0,0 18,20A2,2 0 0,0 20,18A2,2 0 0,0 18,16H16V18M14,10H10V14H14V10M6,16A2,2 0 0,0 4,18A2,2 0 0,0 6,20A2,2 0 0,0 8,18V16H6M8,6A2,2 0 0,0 6,4A2,2 0 0,0 4,6A2,2 0 0,0 6,8H8V6M18,8A2,2 0 0,0 20,6A2,2 0 0,0 18,4A2,2 0 0,0 16,6V8H18Z",he="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ce="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z",de="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",pe="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",ue={trigger:{collections:Q.NI,icons:z.S},condition:{collections:O.GS,icons:H.D},action:{collections:G.rP,icons:G.O$}},ge=new Set(["date","datetime","device_tracker","text","time","tts","update","weather","image_processing"]),me=new Set(["notify"]),_e=["dynamicGroups","helpers","other","customDynamicGroups"],ve=new Set([`${Z.VH}event`]);class fe extends((0,J.b)(r.WF)){willUpdate(e){e.has("hass")&&e.get("hass")?.states!==this.hass.states&&this._calculateUsedDomains(),e.has("_newTriggersAndConditions")&&this._subscribeDescriptions()}_subscribeDescriptions(){this._unsubscribe(),"trigger"===this._params?.type?(this._triggerDescriptions={},this._unsub=(0,Q.Wv)(this.hass,e=>{this._triggerDescriptions={...this._triggerDescriptions,...e}})):"condition"===this._params?.type&&(this._conditionDescriptions={},this._unsub=(0,O.bn)(this.hass,e=>{this._conditionDescriptions={...this._conditionDescriptions,...e}}))}showDialog(e){this._params=e,this._resetVariables();const t=(0,oe.II)(this.hass.states,this.hass.devices,this.hass.areas,e.type);if(this._openedFromQuery=!!t,t){const e=new URLSearchParams(u.G.location.search);e.delete(oe.Ku),e.delete(oe.jJ),e.delete(oe.yz),e.delete(oe.ve),u.G.history.replaceState(u.G.history.state,"",(0,b.Z)(e.toString()))}this.addKeyboardShortcuts(),this._loadConfigEntries(),this._unsubscribe(),this._fetchManifests(),this._calculateUsedDomains(),this._unsubscribeLabFeatures=(0,W.CO)(this.hass.connection,"automation","new_triggers_conditions",e=>{this._newTriggersAndConditions=e.enabled,this._tab=this._newTriggersAndConditions?"targets":"groups",t&&this._newTriggersAndConditions&&!this._selectedTarget&&(this._selectedTarget=t,this._getItemsByTarget())}),t||u.G.history.pushState({dialogData:{}},""),"action"===this._params?.type?(this.hass.loadBackendTranslation("services"),(0,N.Yd)(this.hass.connection,this.hass.config)):"trigger"===this._params?.type?(this.hass.loadBackendTranslation("triggers"),(0,N.Dl)(this.hass.connection,this.hass.config),this._subscribeDescriptions()):"condition"===this._params?.type&&(this.hass.loadBackendTranslation("conditions"),(0,N.mX)(this.hass.connection,this.hass.config),this._subscribeDescriptions()),window.addEventListener("resize",this._updateNarrow),this._updateNarrow(),this._bottomSheetMode=this._narrow,t&&this._newTriggersAndConditions&&!this._selectedTarget&&(this._selectedTarget=t,this._tab="targets",this._getItemsByTarget())}closeDialog(e){if(this._open&&e&&(this._selectedTarget||this._selectedGroup)){if(e.dialogData?.target)return this._selectedTarget=e.dialogData.target,this._getItemsByTarget(),this._tab="targets",!1;if(e.dialogData?.group)return this._selectedCollectionIndex=e.dialogData.collectionIndex,this._selectedGroup=e.dialogData.group,this._tab="groups",!1;if(this._narrow)return this._selectedTarget=void 0,this._selectedGroup=void 0,!1}return this._closing=!0,u.G.history.state?.dialogData?(this._open=!1,u.G.history.back(),!1):(this.removeKeyboardShortcuts(),this._unsubscribe(),this._params&&(0,p.r)(this,"dialog-closed",{dialog:this.localName}),this._params=void 0,this._resetVariables(),!0)}_resetVariables(){this._open=!0,this._closing=!1,this._selectedCollectionIndex=void 0,this._selectedGroup=void 0,this._selectedTarget=void 0,this._tab=this._newTriggersAndConditions?"targets":"groups",this._filter="",this._manifests=void 0,this._domains=void 0,this._bottomSheetMode=!1,this._narrow=!1,this._targetItems=void 0,this._loadItemsError=!1,this._openedFromQuery=!1}_calculateUsedDomains(){const e=new Set(Object.keys(this.hass.states).map(m.m));(0,$.b)(e,this._domains)||(this._domains=e)}get _systemDomains(){if(!this._manifests)return;const e="trigger"===this._params?.type?this._triggerDescriptions:this._conditionDescriptions;return this._calculateActiveSystemDomains(e,this._manifests,"trigger"===this._params?.type?Q.zz:O.ob)}async _loadConfigEntries(){const e=await(0,j.VN)(this.hass);this._configEntryLookup=Object.fromEntries(e.map(e=>[e.entry_id,e]))}async _fetchManifests(){const e={},t=await(0,R.fK)(this.hass);for(const i of t)e[i.domain]=i;this._manifests=e,this._selectedTarget&&this._targetItems&&this._getItemsByTarget()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._updateNarrow),this._unsubscribe()}supportedShortcuts(){return{v:()=>this._addClipboard()}}_unsubscribe(){this._unsub&&(this._unsub.then(e=>e()),this._unsub=void 0),this._unsubscribeLabFeatures&&(this._unsubscribeLabFeatures.then(e=>e()),this._unsubscribeLabFeatures=void 0)}_getEmptyNote(e){if("trigger"===e||"condition"===e)return this.hass.localize(`ui.panel.config.automation.editor.${e}s.no_items_for_target_note`,{labs_link:r.qy`<a href="/config/labs" @click="${this._close}">${this.hass.localize("ui.panel.config.labs.caption")}</a>`})}render(){return this._params?this._bottomSheetMode?r.qy` <ha-bottom-sheet .open="${this._open}" @closed="${this._handleClosed}" flexcontent> ${this._renderContent()} </ha-bottom-sheet> `:r.qy` <ha-dialog width="large" .open="${this._open}" @closed="${this._handleClosed}" flexcontent> ${this._renderContent()} </ha-dialog> `:r.s6}_renderContent(){const e=this._params.type,t=[{label:this.hass.localize("ui.panel.config.automation.editor.tabs.type"),value:"groups"}];this._newTriggersAndConditions&&t.unshift({label:this.hass.localize("ui.panel.config.automation.editor.tabs.target"),value:"targets"}),"trigger"!==this._params?.type&&t.push({label:this.hass.localize("ui.panel.config.automation.editor.blocks"),value:"blocks"});const i=this._filter||"blocks"===this._tab||"targets"===this._tab||this._narrow&&this._selectedGroup,s=i?[]:this._getCollections(e,ue[e].collections,this._domains,this.hass.localize,this.hass.services,this._triggerDescriptions,this._conditionDescriptions,this._manifests);return r.qy` <div slot="header"> ${this._renderHeader()} ${this._narrow&&(this._selectedGroup||this._selectedTarget)?r.s6:r.qy` <ha-input-search appearance="outlined" ?autofocus="${!this._narrow}" .value="${this._filter}" @input="${this._handleFilterInput}"></ha-input-search> `} ${this._filter||!(t.length>1)||this._narrow&&(this._selectedGroup||this._selectedTarget)?r.s6:r.qy`<ha-button-toggle-group variant="neutral" active-variant="brand" .buttons="${t}" .active="${this._tab}" size="small" full-width @value-changed="${this._switchTab}"></ha-button-toggle-group>`} </div> <div class="${(0,l.H)({content:!0,column:this._filter||this._narrow&&this._selectedTarget&&Object.values(this._selectedTarget)[0]&&!this._getAddFromTargetHidden(this._narrow,this._selectedTarget)})}"> ${this._filter?r.qy`<ha-automation-add-search .hass="${this.hass}" .filter="${this._filter}" .configEntryLookup="${this._configEntryLookup}" .manifests="${this._manifests}" .narrow="${this._narrow}" .addElementType="${this._params.type}" .items="${this._items(e,this.hass.localize,this.hass.services,this._manifests)}" .convertToItem="${this._convertToItem}" .newTriggersAndConditions="${this._newTriggersAndConditions}" @search-element-picked="${this._searchItemSelected}"> </ha-automation-add-search>`:"targets"===this._tab?r.qy`<ha-automation-add-from-target .hass="${this.hass}" .value="${this._selectedTarget}" @value-changed="${this._handleTargetSelected}" .narrow="${this._narrow}" class="${(0,l.H)({"ha-scrollbar":!0,hidden:!!this._getAddFromTargetHidden(this._narrow,this._selectedTarget)})}" .manifests="${this._manifests}"></ha-automation-add-from-target>`:r.qy` <ha-list-base class="${(0,l.H)({groups:!0,hidden:i,"ha-scrollbar":!0})}"> ${this._params.clipboardItem?r.qy`<ha-list-item-button class="paste" @click="${this._paste}"> <div slot="headline" class="label"> ${this.hass.localize(`ui.panel.config.automation.editor.${e}s.paste`)} </div> <div slot="supporting-text"> ${this.hass.localize(`ui.panel.config.automation.editor.${e}s.type.${this._params.clipboardItem}.label`)} </div> ${this._narrow?r.s6:r.qy`<span slot="end" class="shortcut"> <span>${ee.c?r.qy`<ha-svg-icon slot="start" .path="${le}"></ha-svg-icon>`:this.hass.localize("ui.panel.config.automation.editor.ctrl")}</span> <span>+</span> <span>V</span> </span>`} <ha-svg-icon slot="start" .path="${ce}"></ha-svg-icon><ha-svg-icon class="plus" slot="end" .path="${pe}"></ha-svg-icon> </ha-list-item-button> <wa-divider></wa-divider>`:r.s6} ${s.map(e=>r.qy` ${e.titleKey&&e.groups.length?r.qy`<ha-section-title> ${this.hass.localize(e.titleKey)} </ha-section-title>`:r.s6} ${(0,h.u)(e.groups,e=>e.key,t=>r.qy` <ha-list-item-button .value="${t.key}" .index="${e.collectionIndex}" @click="${this._groupSelected}" class="${t.key===this._selectedGroup?"selected":""}"> <div slot="headline">${t.name}</div> ${t.icon?r.qy`<span slot="start">${t.icon}</span>`:t.iconPath?r.qy`<ha-svg-icon slot="start" .path="${t.iconPath}"></ha-svg-icon>`:r.s6} ${this._narrow?r.qy`<ha-icon-next slot="end"></ha-icon-next>`:r.s6} </ha-list-item-button> `)} `)} </ha-list-base> `} ${this._filter?r.s6:r.qy` <ha-automation-add-items .hass="${this.hass}" .items="${this._getItems()}" .scrollable="${!this._narrow}" .error="${"targets"===this._tab&&this._loadItemsError?this.hass.localize("ui.panel.config.automation.editor.load_target_items_failed"):void 0}" .selectLabel="${this.hass.localize("ui.panel.config.automation.editor."+("groups"===this._tab?`${e}s.select`:"select_target"))}" .emptyLabel="${this.hass.localize(`ui.panel.config.automation.editor.${e}s.no_items_for_target`)}" .emptyNote="${this._getEmptyNote(e)}" .tooltipDescription="${"targets"===this._tab}" .target="${"targets"===this._tab&&this._selectedTarget&&[...this._extractTypeAndIdFromTarget(this._selectedTarget),this._getSelectedTargetLabel(this._selectedTarget)]||void 0}" .getLabel="${this._getLabel}" .configEntryLookup="${this._configEntryLookup}" class="${!this._narrow||this._selectedGroup||this._selectedTarget&&(!this._selectedTarget||Object.values(this._selectedTarget)[0])||"blocks"===this._tab?"":"hidden"}" @value-changed="${this._selected}"> </ha-automation-add-items> `} </div> `}_renderHeader(){const e=this._getDocumentationUrl(this._params.type);return r.qy` <ha-dialog-header subtitle-position="above"> <span slot="title">${this._getDialogTitle()}</span> ${this._renderDialogSubtitle()} ${this._narrow&&(this._selectedGroup||this._selectedTarget)?r.s6:r.qy` <ha-icon-button .path="${de}" .label="${this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.learn_more`)}" slot="actionItems" href="${e}" target="_blank" rel="noreferrer"></ha-icon-button> `} ${this._narrow&&(this._selectedGroup||this._selectedTarget)&&!this._openedFromQuery?r.qy`<ha-icon-button-prev slot="navigationIcon" @click="${this._back}"></ha-icon-button-prev>`:r.qy`<ha-icon-button .path="${he}" @click="${this._close}" slot="navigationIcon"></ha-icon-button>`} </ha-dialog-header> `}_renderDialogSubtitle(){if(!this._narrow)return r.s6;if(this._selectedGroup)return r.qy`<span slot="subtitle">${this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.add`)}</span>`;if(this._selectedTarget){let e;const[t,i]=this._extractTypeAndIdFromTarget(this._selectedTarget);if(i){if("area"===t){const t=this.hass.areas[i]?.floor_id;e=t?(0,v.X)(this.hass.floors[t])||t:this.hass.localize("ui.panel.config.automation.editor.other_areas")}else if("device"===t){const t=this.hass.devices[i]?.area_id;if(t)e=(0,g.A)(this.hass.areas[t])||t;else{const t=this.hass.devices[i];e=this.hass.localize("ui.panel.config.automation.editor."+("service"===t?.entry_type?"services":"unassigned_devices"))}}else if("entity"===t&&this.hass.states[i]){const t=this.hass.entities[i];if(!t||t.device_id||t.area_id){const t=this.hass.states[i],[s,a,o]=(0,_.Cf)(t,[{type:"entity"},{type:"device"},{type:"area"}],this.hass.entities,this.hass.devices,this.hass.areas,this.hass.floors);e=[o,s?a:void 0].filter(Boolean).join((0,w.qC)(this.hass.language,this.hass.translationMetadata.translations)?" ◂ ":" ▸ ")}else{const t=i.split(".",2)[0];e=(0,R.p$)(this.hass.localize,t,this._manifests?.[t])}}if(e)return r.qy`<span slot="subtitle">${e}</span>`}}return r.s6}_domainMatchesGroupType(e,t,i,s){const a=(s.includes("dynamic")&&(!t||t.is_built_in)||s.includes("customDynamic")&&!(t?.is_built_in??1))&&(me.has(e)||"entity"===t?.integration_type&&!ge.has(e)&&(i||(this._systemDomains?.active.has(e)??!1))||"system"===t?.integration_type&&(this._systemDomains?.active.has(e)??!1)),o=s.includes("helper")&&"helper"===t?.integration_type,r=s.includes("other")&&!me.has(e)&&(ge.has(e)||!["helper","entity","system"].includes(t?.integration_type||""));return a||o||r}_getDomainType(e){return me.has(e)||"entity"===this._manifests?.[e]?.integration_type&&!ge.has(e)&&(this._domains?.has(e)||this._systemDomains?.active.has(e))?"dynamicGroups":"helper"===this._manifests?.[e]?.integration_type?"helpers":"system"===this._manifests?.[e]?.integration_type&&this._systemDomains?.active.has(e)?"dynamicGroups":"other"}_sortDomainsByCollection(e,t){const i=[];return ue[e].collections.forEach(e=>{i.push(...Object.keys(e.groups))}),t.sort((e,t)=>{const s=e[0],a=t[0];if(i.includes(s)&&i.includes(a))return i.indexOf(s)-i.indexOf(a);let o=s,r=a;return i.includes(s)||(o=this._getDomainType(s)),i.includes(a)||(r=this._getDomainType(a)),o===r?(0,y.xL)(e[1].title,t[1].title,this.hass.locale.language):i.indexOf(o)-i.indexOf(r)}).map(e=>e[1])}_getDomainGroupedListItems(e,t,i,s){const a={},o=this._selectedTarget?.entity_id,r=o&&"system"!==this._manifests?.[(0,m.m)(o)]?.integration_type?(0,m.m)(o):void 0;return t.forEach(t=>{const o=i(t),n="system"===this._manifests?.[o]?.integration_type&&r?r:o;a[n]||(a[n]={title:(0,R.p$)(e,n,this._manifests?.[n]),items:[]}),a[n].items.push(s(e,o,t)),a[n].items.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}),this._sortDomainsByCollection(this._params.type,Object.entries(a))}_getTriggerListItems(e,t){return t.map(t=>{const i=(0,Q.zz)(t);return this._getTriggerListItem(e,i,t)}).sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}_getTriggerListItem(e,t,i){const s=(0,Q.hN)(i);return{icon:r.qy` <ha-trigger-icon .hass="${this.hass}" .trigger="${i}"></ha-trigger-icon> `,key:`${Z.VH}${i}`,name:e(`component.${t}.triggers.${s}.name`)||i,description:e(`component.${t}.triggers.${s}.description`)||i}}_getConditionListItem(e,t,i){const s=(0,O.YQ)(i);return{icon:r.qy` <ha-condition-icon .hass="${this.hass}" .condition="${i}"></ha-condition-icon> `,key:`${Z.VH}${i}`,name:e(`component.${t}.conditions.${s}.name`)||i,description:e(`component.${t}.conditions.${s}.description`)||i}}_getDomainGroupedActionListItems(e,t){const i={};return t.forEach(t=>{const[s,a]=t.split(".",2);i[s]||(i[s]={title:(0,R.p$)(e,s,this._manifests?.[s]),items:[]}),i[s].items.push({icon:r.qy` <ha-service-icon .hass="${this.hass}" .service="${`${s}.${a}`}"></ha-service-icon> `,key:`${Z.VH}${s}.${a}`,name:`${s?"":`${(0,R.p$)(e,s)}: `}${this.hass.localize(`component.${s}.services.${a}.name`)||this.hass.services[s][a]?.name||a}`,description:this.hass.localize(`component.${s}.services.${a}.description`)||this.hass.services[s][a]?.description||""}),i[s].items.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}),this._sortDomainsByCollection(this._params.type,Object.entries(i))}_back(){u.G.history.back()}_groupSelected(e){const t=e.currentTarget;if(this._selectedGroup===t.value)return this._selectedGroup=void 0,void(this._selectedCollectionIndex=void 0);this._selectedGroup=t.value,this._selectedCollectionIndex=e.currentTarget.index,u.G.history.pushState({dialogData:{group:this._selectedGroup,collectionIndex:this._selectedCollectionIndex}},""),requestAnimationFrame(()=>{this._itemsListElement?.scrollTo(0,0)})}_paste(){this._params.add(oe.uV),this.closeDialog()}_selected(e){let t;"targets"===this._tab&&this._selectedTarget&&Object.values(this._selectedTarget)[0]&&(t=this._selectedTarget),this._params.add(e.detail.value,t),this.closeDialog()}_getDefaultStateItems(e){const t=[this._convertToItem("state",{},e,this.hass.localize)],i=this._selectedTarget?.entity_id;if(i){const s=["counter","input_number","number","sensor"],a=(0,m.m)(i),o=this.hass.states[i];(s.includes(a)||o&&(0,f.x)(o))&&t.push(this._convertToItem("numeric_state",{},e,this.hass.localize))}return t}async _getItemsByTarget(){if(this._selectedTarget)try{if("trigger"===this._params.type){const e=await(0,K.oV)(this.hass.callWS,this._selectedTarget),t=this._getDomainGroupedListItems(this.hass.localize,e,Q.zz,(e,t,i)=>this._getTriggerListItem(e,t,i));return this._selectedTarget.entity_id&&t.push({title:this.hass.localize("ui.panel.config.automation.editor.triggers.groups.entity.label"),items:this._getDefaultStateItems("trigger")}),void(this._targetItems=t)}if("condition"===this._params.type){const e=await(0,K.vN)(this.hass.callWS,this._selectedTarget),t=this._getDomainGroupedListItems(this.hass.localize,e,O.ob,(e,t,i)=>this._getConditionListItem(e,t,i));return this._selectedTarget.entity_id&&t.push({title:this.hass.localize("ui.panel.config.automation.editor.conditions.groups.entity.label"),items:this._getDefaultStateItems("condition")}),void(this._targetItems=t)}if("action"===this._params.type){const e=(await(0,K.j_)(this.hass.callWS,this._selectedTarget)).filter(e=>!e.startsWith("homeassistant."));this._targetItems=this._getDomainGroupedActionListItems(this.hass.localize,e)}}catch(e){this._loadItemsError=!0,console.error(`Error fetching ${this._params.type}s for target`,e)}}_switchTab(e){this._tab=e.detail.value}_searchItemSelected(e){const t=e.detail;if(t.type&&!["floor","area"].includes(t.type))return this._params.add(t.id),void this.closeDialog();const i=(0,K.OJ)(t);this._filter="",this._selectedTarget={[`${i}_id`]:t.id.split(K.G_,2)[1]},this._tab="targets"}_handleClosed(){this._closing||this.closeDialog()}_getDialogTitle(){if(this._narrow&&this._selectedGroup)return(0,Z.Q)(this._selectedGroup)?(0,R.p$)(this.hass.localize,(0,Z.Dt)(this._selectedGroup),this._manifests?.[(0,Z.Dt)(this._selectedGroup)]):this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.groups.${this._selectedGroup}.label`)||this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.type.${this._selectedGroup}.label`);if(this._narrow&&this._selectedTarget){const e=this._getSelectedTargetLabel(this._selectedTarget);if(e)return e}return this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.add`)}static get styles(){return[Y.dp,r.AH`ha-bottom-sheet{--ha-bottom-sheet-height:90vh;--ha-bottom-sheet-height:calc(100dvh - var(--ha-space-12));--ha-bottom-sheet-max-height:var(--ha-bottom-sheet-height);--ha-bottom-sheet-max-width:888px;--ha-bottom-sheet-padding:0;--ha-bottom-sheet-surface-background:var(--card-background-color)}ha-dialog{--dialog-content-padding:0;--ha-dialog-min-height:min(
920px,
calc(
100vh - max(
var(--safe-area-inset-bottom),
var(--ha-space-4)
) - max(var(--safe-area-inset-top), var(--ha-space-4))
)
);--ha-dialog-min-height:min(
920px,
calc(
100dvh - max(
var(--safe-area-inset-bottom),
var(--ha-space-4)
) - max(var(--safe-area-inset-top), var(--ha-space-4))
)
);--ha-dialog-max-height:var(--ha-dialog-min-height)}ha-dialog ha-icon-button[slot=actionItems]{color:var(--secondary-text-color)}ha-input-search{display:block;--ha-input-padding-bottom:0;margin:0 var(--ha-space-4)}ha-button-toggle-group{--ha-button-toggle-group-padding:var(--ha-space-3) var(--ha-space-4) 0}.content{flex:1;min-height:0;height:100%;display:flex}.content.column{flex-direction:column;gap:var(--ha-space-3)}ha-list-item-button{--ha-row-item-padding-block:var(--ha-space-1);--ha-row-item-padding-inline:var(--ha-space-3);--ha-row-item-min-height:40px}ha-list-item-button::part(end),ha-list-item-button::part(start){color:var(--ha-color-on-neutral-quiet)}.groups,ha-automation-add-from-target{border-radius:var(--ha-border-radius-xl);border:1px solid var(--ha-color-border-neutral-quiet);margin:var(--ha-space-3)}.groups,ha-automation-add-from-target{overflow:auto;flex:4;margin-inline-end:0}ha-automation-add-from-target.hidden{display:none}.groups{--md-list-item-leading-space:var(--ha-space-3);--md-list-item-trailing-space:var(--md-list-item-leading-space);--md-list-item-bottom-space:var(--ha-space-1);--md-list-item-top-space:var(--md-list-item-bottom-space);--md-list-item-supporting-text-font:var(--ha-font-family-body);--md-list-item-one-line-container-height:var(--ha-space-10)}ha-bottom-sheet .groups,ha-bottom-sheet ha-automation-add-from-target{margin:var(--ha-space-3)}.groups .selected{background-color:var(--ha-color-fill-primary-normal-active);--md-list-item-label-text-color:var(--ha-color-on-primary-normal);--icon-primary-color:var(--ha-color-on-primary-normal)}.groups .selected ha-svg-icon{color:var(--ha-color-on-primary-normal)}ha-section-title{top:0;position:sticky;z-index:1}ha-automation-add-items{flex:6}.content.column ha-automation-add-from-target,.content.column ha-automation-add-items{flex:none}.content.column ha-automation-add-items{min-height:160px}.content.column ha-automation-add-from-target{overflow:clip}ha-dialog ha-automation-add-items{margin-top:var(--ha-space-3)}ha-bottom-sheet .groups{padding-bottom:max(var(--safe-area-inset-bottom),var(--ha-space-4))}.groups.hidden,ha-automation-add-items.hidden{display:none}.groups{padding-bottom:max(var(--safe-area-inset-bottom),var(--ha-space-3))}ha-icon-next{width:var(--ha-space-6)}wa-divider{--spacing:0}ha-svg-icon.plus{color:var(--primary-color)}.shortcut{--mdc-icon-size:var(--ha-space-3);display:inline-flex;flex-direction:row;align-items:center;gap:2px;margin-right:var(--ha-space-4)}.shortcut span{font-size:var(--ha-font-size-s);font-family:var(--ha-font-family-code);color:var(--ha-color-text-secondary)}.section-title-wrapper{height:0;position:relative}.section-title-wrapper ha-section-title{position:absolute;top:0;width:calc(100% - var(--ha-space-4));z-index:1}ha-automation-add-search{flex:1}`]}constructor(...e){super(...e),this._open=!0,this._tab="targets",this._filter="",this._bottomSheetMode=!1,this._narrow=!1,this._triggerDescriptions={},this._loadItemsError=!1,this._newTriggersAndConditions=!1,this._openedFromQuery=!1,this._conditionDescriptions={},this._configEntryLookup={},this._closing=!1,this._updateNarrow=()=>{this._narrow=window.matchMedia("(max-width: 870px)").matches||window.matchMedia("(max-height: 500px)").matches},this._calculateActiveSystemDomains=(0,c.A)((e,t,i)=>{const s=new Set,a={},o={};for(const[s,r]of Object.entries(e)){const e=i(s),n=t[e]?.integration_type;if("system"!==n&&"entity"!==n)continue;if("entity"===n&&Object.keys(this.hass.states).some(t=>(0,m.m)(t)===e))continue;a[e]||(a[e]=[],o[e]=new Set);const l=(0,d.e)(r.target?.entity);if(l)for(const t of l){const i=(0,d.e)(t);a[e].push(...i);for(const t of i)for(const i of(0,d.e)(t.domain)??[])o[e].add(i)}}for(const e of Object.values(this.hass.states))for(const[t,i]of Object.entries(a))s.has(t)||i.some(t=>(0,U.Ru)(t,e))&&s.add(t);const r=new Map;for(const[e,t]of Object.entries(o))for(const i of t)r.has(i)||r.set(i,new Set),r.get(i).add(e);return{active:s,byEntityDomain:r}}),this._getItems=()=>this._filter||"blocks"!==this._tab?!this._filter&&"groups"===this._tab&&this._selectedGroup?[{title:this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.name`),items:this._getGroupItems(this._params.type,this._selectedGroup,this._selectedCollectionIndex??0,this._domains,this.hass.localize,this.hass.services,this._manifests,this._systemDomains?.byEntityDomain)}]:!this._filter&&"targets"===this._tab&&this._selectedTarget&&this._targetItems?this._targetItems:void 0:[{title:this.hass.localize("ui.panel.config.automation.editor.blocks"),items:this._getBlockItems(this._params.type,this.hass.localize)}],this._getGroups=(e,t,i)=>{if(t&&void 0!==i){const s=ue[e].collections[i]?.groups[t]??ue[e].collections.find(e=>t in e.groups)?.groups[t];return s?.members||{[t]:s||{}}}return ue[e].collections.reduce((e,t)=>({...e,...t.groups}),{})},this._items=(0,c.A)((e,t,i,s)=>{const a=this._getGroups(e),o=i=>Object.entries(i).map(([i,s])=>s.members?o(s.members):this._convertToItem(i,s,e,t)),r=o(a).flat();return"trigger"===e?r.push(...this._triggers(t,this._triggerDescriptions,void 0)):"condition"===e?r.push(...this._conditions(t,this._conditionDescriptions,s,void 0)):"action"===e&&r.push(...this._services(t,i,s)),r.filter(({name:e})=>e)}),this._getCollections=(0,c.A)((e,t,i,s,a,o,r,n)=>{const l=[];let h=-1,c=-1;if(t.forEach((t,d)=>{let p=Object.entries(t.groups);const u=[],g=[];t.groups.dynamicGroups&&g.push("dynamic"),t.groups.helpers&&g.push("helper"),t.groups.other&&g.push("other"),t.groups.customDynamicGroups&&g.push("customDynamic"),"trigger"===e&&Object.keys(t.groups).some(e=>_e.includes(e))?(u.push(...this._triggerGroups(s,o,n,i,g)),p=p.filter(([e])=>!_e.includes(e))):"condition"===e&&Object.keys(t.groups).some(e=>_e.includes(e))?(u.push(...this._conditionGroups(s,r,n,i,g)),p=p.filter(([e])=>!_e.includes(e))):"action"===e&&Object.keys(t.groups).some(e=>_e.includes(e))&&(u.push(...this._serviceGroups(s,a,n,i,t.groups.dynamicGroups?void 0:t.groups.helpers?"helper":"other")),p=p.filter(([e])=>!_e.includes(e))),u.push(...p.map(([t,i])=>this._convertToItem(t,i,e,s))),u.length&&(t.generic&&(h=d),t.groups.dynamicGroups&&(c=d),l.push({collectionIndex:d,titleKey:t.titleKey,generic:t.generic,groups:u.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}))}),-1!==h&&-1!==c){const e=l[c].groups.filter(e=>ve.has(e.key))||[];l[c].groups=l[c].groups.filter(e=>!ve.has(e.key))||[],l[h].groups=[...l[h].groups||[],...e].sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}return l}),this._getBlockItems=(0,c.A)((e,t)=>{const i="action"===e?G.bM:O.oW;return Object.entries(i).map(([i,s])=>this._convertToItem(i,s,e,t)).sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}),this._getGroupItems=(0,c.A)((e,t,i,s,a,o,r,n)=>{if("trigger"===e&&(0,Z.Q)(t))return this._triggers(a,this._triggerDescriptions,n,t);if("condition"===e&&(0,Z.Q)(t))return this._conditions(a,this._conditionDescriptions,r,n,t);if("action"===e&&(0,Z.Q)(t))return this._services(a,o,r,t);const l=this._getGroups(e,t,i),h=Object.entries(l).map(([t,i])=>this._convertToItem(t,i,e,a));return"action"===e&&(this._selectedGroup?"helpers"===this._selectedGroup?h.unshift(...this._serviceGroups(a,o,r,s,"helper")):"other"===this._selectedGroup&&h.unshift(...this._serviceGroups(a,o,r,s,"other")):h.unshift(...this._serviceGroups(a,o,r,s,void 0))),h.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))}),this._serviceGroups=(e,t,i,s,a)=>{if(!t||!i)return[];const o=[];return Object.keys(t).forEach(t=>{const n=i[t],l=!s||s.has(t);(void 0===a&&(me.has(t)||"entity"===n?.integration_type&&l&&!ge.has(t))||"helper"===a&&"helper"===n?.integration_type||"other"===a&&!me.has(t)&&(ge.has(t)||!l&&"entity"===n?.integration_type||!["helper","entity"].includes(n?.integration_type||"")))&&o.push({icon:r.qy` <ha-domain-icon .domain="${t}" brand-fallback></ha-domain-icon> `,key:`${Z.VH}${t}`,name:(0,R.p$)(e,t,n),description:""})}),o.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))},this._triggerGroups=(e,t,i,s,a)=>{if(!t||!i)return[];const o=[],n=new Set;return Object.keys(t).forEach(t=>{const l=(0,Q.zz)(t);if(n.has(l))return;n.add(l);const h=i[l],c=!s||s.has(l);this._domainMatchesGroupType(l,h,c,a)&&o.push({icon:r.qy` <ha-domain-icon .domain="${l}" brand-fallback></ha-domain-icon> `,key:`${Z.VH}${l}`,name:(0,R.p$)(e,l,h),description:""})}),o.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))},this._triggers=(0,c.A)((e,t,i,s)=>{if(!t)return[];const a=s&&(0,Z.Q)(s)?(0,Z.Dt)(s):void 0,o=a?i?.get(a):void 0;return this._getTriggerListItems(e,Object.keys(t).filter(e=>{const t=(0,Q.zz)(e);return!s||s===`${Z.VH}${t}`||(o?.has(t)??!1)}))}),this._conditionGroups=(e,t,i,s,a)=>{if(!t||!i)return[];const o=[],n=new Set;return Object.keys(t).forEach(t=>{const l=(0,O.ob)(t);if(n.has(l))return;n.add(l);const h=i[l],c=!s||s.has(l);this._domainMatchesGroupType(l,h,c,a)&&o.push({icon:r.qy` <ha-domain-icon .domain="${l}" brand-fallback></ha-domain-icon> `,key:`${Z.VH}${l}`,name:(0,R.p$)(e,l,h),description:""})}),o.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))},this._conditions=(0,c.A)((e,t,i,s,a)=>{if(!t)return[];const o=[],r=a&&(0,Z.Q)(a)?(0,Z.Dt)(a):void 0,n=r?s?.get(r):void 0;for(const i of Object.keys(t)){const t=(0,O.ob)(i);a&&a!==`${Z.VH}${t}`&&!n?.has(t)||o.push(this._getConditionListItem(e,t,i))}return o}),this._services=(0,c.A)((e,t,i,s)=>{if(!t)return[];const a=[];let o;(0,Z.Q)(s)&&(o=(0,Z.Dt)(s));const n=s=>{const o=Object.keys(t[s]),n=i?.[s],l=!n||"entity"!==n.integration_type||!n.is_built_in;for(const i of o){const o=e(`component.${s}.services.${i}.name`,this.hass.services[s][i].description_placeholders)||t[s][i]?.name||i;a.push({icon:r.qy` <ha-service-icon .hass="${this.hass}" .service="${`${s}.${i}`}"></ha-service-icon> `,key:`${Z.VH}${s}.${i}`,name:l?`${(0,R.p$)(e,s)}: ${o}`:o,description:e(`component.${s}.services.${i}.description`,this.hass.services[s][i].description_placeholders)||t[s][i]?.description||""})}};return o?(n(o),a.sort((e,t)=>(0,y.xL)(e.name,t.name,this.hass.locale.language))):s&&!["helpers","other"].includes(s)?[]:(Object.keys(t).sort().forEach(e=>{const t=i?.[e];"helpers"===s&&"helper"!==t?.integration_type||"other"===s&&(ge.has(e)||["helper","entity"].includes(t?.integration_type||""))||n(e)}),a)}),this._getLabel=(0,c.A)(e=>this._labelRegistry?.find(({label_id:t})=>t===e)),this._getFloorAreaLookupMemoized=(0,c.A)(e=>(0,P._o)(Object.values(e))),this._getAreaDeviceLookupMemoized=(0,c.A)(e=>(0,D.QI)(Object.values(e))),this._getAreaEntityLookupMemoized=(0,c.A)(e=>(0,D.bQ)(Object.values(e))),this._getDeviceEntityLookupMemoized=(0,c.A)(e=>(0,B.I3)(Object.values(e))),this._extractTypeAndIdFromTarget=(0,c.A)(e=>{const[t,i]=Object.entries(e)[0];return[t.replace("_id",""),i]}),this._convertToItem=(e,t,i,s)=>({key:e,name:s(`ui.panel.config.automation.editor.${i}s.${t.members?"groups":"type"}.${e}.label`),description:s(`ui.panel.config.automation.editor.${i}s.${t.members?"groups":"type"}.${e}.description${t.members?"":".picker"}`),iconPath:t.icon||ue[i].icons[e]}),this._close=()=>{this._open=!1},this._getDocumentationUrl=(0,c.A)(e=>(0,X.o)(this.hass,"trigger"===e?"/docs/automation/trigger/":"condition"===e?"/docs/automation/condition/":"/docs/automation/action/")),this._handleTargetSelected=e=>{this._targetItems=void 0,this._loadItemsError=!1,this._selectedTarget=e.detail.value,u.G.history.pushState({dialogData:{target:this._selectedTarget}},""),requestAnimationFrame(()=>{this._narrow?this._contentElement?.scrollTo(0,0):this._itemsListElement?.scrollTo(0,0)}),this._getItemsByTarget()},this._handleFilterInput=e=>{this._debounceFilterChanged(e.target.value??"")},this._debounceFilterChanged=(0,C.s)(e=>{this._filter=e},200),this._addClipboard=()=>{this._params?.clipboardItem&&(this._params.add(oe.uV),(0,te.P)(this,{message:this.hass.localize("ui.panel.config.automation.editor.item_pasted",{item:this.hass.localize(`ui.panel.config.automation.editor.${this._params.type}s.type.${this._params.clipboardItem}.label`)}),dismissable:!0,...null!=this._params.clipboardPasteToastBottomOffset?{bottomOffset:this._params.clipboardPasteToastBottomOffset}:{}}),this.closeDialog())},this._getSelectedTargetLabel=(0,c.A)(e=>{const[t,i]=this._extractTypeAndIdFromTarget(e);if(void 0===i&&"floor"===t)return this.hass.localize("ui.panel.config.automation.editor.other_areas");if(void 0===i&&"area"===t)return this.hass.localize("ui.panel.config.automation.editor.unassigned_devices");if(void 0===i&&"service"===t)return this.hass.localize("ui.panel.config.automation.editor.services");if(void 0===i&&"device"===t)return this.hass.localize("ui.panel.config.automation.editor.unassigned_entities");if(void 0===i&&"helper"===t)return this.hass.localize("ui.panel.config.automation.editor.helpers");if(void 0===i&&(t.startsWith("entity_")||t.startsWith("helper_"))){const e=t.substring(7);return(0,R.p$)(this.hass.localize,e,this._manifests?.[e])}return i?(0,re.N)({entities:this.hass.entities,devices:this.hass.devices,areas:this.hass.areas,floors:this.hass.floors},this.hass.states,this.hass.localize,t,i,this._getLabel):void 0}),this._getAddFromTargetHidden=(0,c.A)((e,t)=>{if(e&&t){const[e,i]=this._extractTypeAndIdFromTarget(t);if(i&&("floor"===e&&!(this._getFloorAreaLookupMemoized(this.hass.areas)[i]?.length>0)||"area"===e&&!(this._getAreaDeviceLookupMemoized(this.hass.devices)[i]?.length>0)&&!(this._getAreaEntityLookupMemoized(this.hass.entities)[i]?.length>0)||"device"===e&&!(this._getDeviceEntityLookupMemoized(this.hass.entities)[i]?.length>0)||"entity"===e||"label"===e))return"hidden"}return""})}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],fe.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_open",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_params",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_selectedCollectionIndex",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_selectedGroup",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_selectedTarget",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_tab",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_filter",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_manifests",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_domains",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_bottomSheetMode",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_narrow",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_triggerDescriptions",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_targetItems",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_loadItemsError",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_newTriggersAndConditions",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_openedFromQuery",void 0),(0,a.Cg)([(0,n.wk)()],fe.prototype,"_conditionDescriptions",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:F.HD,subscribe:!0})],fe.prototype,"_labelRegistry",void 0),(0,a.Cg)([(0,n.P)("ha-automation-add-items")],fe.prototype,"_itemsListElement",void 0),(0,a.Cg)([(0,n.P)(".content")],fe.prototype,"_contentElement",void 0),fe=(0,a.Cg)([(0,n.EM)("add-automation-element-dialog")],fe),s()}catch(e){s(e)}})},70897(e,t,i){i.a(e,async function(e,t){try{i(44114),i(18111),i(22489),i(7588),i(61701);var s=i(62826),a=i(99222),o=i(73984),r=i(35211),n=i(5124),l=i(22441),h=i(63672),c=i(22786),d=i(1087),p=i(65522),u=i(37981),g=i(74705),m=i(52220),_=(i(18198),i(47680),i(43661),i(69464),i(93367)),v=(i(67094),i(1671),i(83892),i(50723),i(2514)),f=i(28223),y=i(77423),b=i(22792),w=i(58594),C=i(95350),$=i(5904),x=i(88555),A=i(44144),L=e([a,o,_]);[a,o,_]=L.then?(await L)():L;const M="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z";class H extends n.WF{willUpdate(e){super.willUpdate(e),this.hasUpdated||this._initialDataLoad(),(e.has("value")||e.has("narrow"))&&(this._fullHeight=!this.narrow||!this.value||!Object.values(this.value)[0],this.style.setProperty("--max-height",this._fullHeight?"none":"50%"))}updated(e){(e.has("value")||e.has("narrow")||void 0===this._showShowMoreButton)&&this._setShowTargetShowMoreButton()}async _initialDataLoad(){await this._loadConfigEntries(),this._getTreeData()}async _setShowTargetShowMoreButton(){await this.updateComplete,this._showShowMoreButton=this.narrow&&this.value&&!!Object.values(this.value)[0]&&this.scrollHeight>this.clientHeight}render(){return this.manifests&&this._configEntryLookup?n.qy` ${this.narrow&&this.value?this._renderNarrow(this._entries,this.value):n.qy` ${this._renderFloors(this.narrow,this._entries,this.value)} ${this._renderUnassigned(this.narrow,this._entries,this.value)} ${this._renderLabels(this.narrow,this.value)} `} ${this.narrow&&this._showShowMoreButton&&!this._fullHeight?n.qy` <div class="targets-show-more"> <ha-button appearance="filled" @click="${this._expandHeight}"> ${this._i18n.localize("ui.panel.config.automation.editor.show_more")} </ha-button> </div> `:n.s6} `:n.s6}_renderAreas(e){const t=Object.keys(e).filter(e=>{const[,t]=e.split(x.G_,2);return this._registries.areas[t]}).map(e=>{const[,t]=e.split(x.G_,2),i=this._registries.areas[t];return[e,(0,p.A)(i)||i.area_id,i.floor_id||void 0,i.icon]}).map(([e,t,i,s])=>{const{open:a,devices:o,entities:r}=this._entries[`floor${x.G_}${i||""}`].areas[e],l=Object.keys(o).length,h=l+r.length;return this._renderItem(t,e,!1,this._getSelectedTargetId(this.value)===e,!a&&!!h,a,this._renderAreaIcon(s),a?n.qy` ${l?this._renderDevices(o):n.s6} ${r.length?this._renderEntities(r):n.s6} `:void 0)});return this.narrow?n.qy`<ha-section-title>${this._i18n.localize("ui.components.target-picker.type.areas")}</ha-section-title> <ha-list-base>${t}</ha-list-base>`:t}_renderDevices(e){const t=Object.keys(e).filter(e=>this._registries.devices[e]).map(e=>{const t=this._registries.devices[e],i=t.primary_config_entry?this._configEntryLookup?.[t.primary_config_entry]:void 0,s=i?.domain;return[e,(0,u.xn)(t)||e,s]}).sort(([,e="zzz"],[,t="zzz"])=>(0,m.xL)(e,t,this.hass.locale.language)).map(([t,i,s])=>{const{open:a,entities:o}=e[t];return this._renderItem(i||t,`device${x.G_}${t}`,!1,this._getSelectedTargetId(this.value)===`device${x.G_}${t}`,!a&&!!o.length,a,s?this._renderDomainIcon(s):void 0,a?this._renderEntities(o):void 0)});return this.narrow?n.qy`<ha-section-title>${this._i18n.localize("ui.components.target-picker.type.devices")}</ha-section-title> <ha-list-base>${t}</ha-list-base>`:t}_renderDomains(e,t){const i=Object.keys(e).map(e=>{const i=e.substring(t.length,e.length-x.G_.length);return[e,(0,C.p$)(this._i18n.localize,i,this.manifests[i]),i]}).sort(([,e="zzz"],[,t="zzz"])=>(0,m.xL)(e,t,this.hass.locale.language)).map(([t,i,s])=>{const{open:a,entities:o}=e[t];return this._renderItem(i,t,!0,!1,!a&&!!o.length,a,this._renderDomainIcon(s),a?this._renderEntities(o):void 0)});return this.narrow?n.qy`<ha-section-title>${this._i18n.localize("ui.components.target-picker.type.devices")}</ha-section-title> <ha-list-base>${i}</ha-list-base>`:i}_renderEntities(e=[]){if(!e.length)return n.s6;const t=e.filter(e=>this.states[e]).map(e=>{const t=this.states[e],[i,s]=(0,g.Cf)(t,[{type:"entity"},{type:"device"},{type:"area"}],this._registries.entities,this._registries.devices,this._registries.areas,this._registries.floors);let a=i||s||e;return this._registries.entities[e]?.hidden&&(a+=` (${this._i18n.localize("ui.panel.config.automation.editor.entity_hidden")})`),[e,a,t]}).sort(([,e],[,t])=>(0,m.xL)(e,t,this.hass.locale.language)).map(([e,t,i])=>this._renderItem(t,`entity${x.G_}${e}`,!1,this._getSelectedTargetId(this.value)===`entity${x.G_}${e}`,!1,!1,this._renderEntityIcon(i)));return this.narrow?n.qy`<ha-section-title>${this._i18n.localize("ui.components.target-picker.type.entities")}</ha-section-title> <ha-list-base>${t}</ha-list-base>`:t}_renderItem(e,t,i=!1,s=!1,a=!1,o=!1,r,l){return this.narrow?n.qy`<ha-list-item-button .target="${t}" @click="${this._selectItem}"> ${r?.("start")} <div slot="headline">${e}</div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button>`:n.qy` <wa-tree-item .preventSelection="${i}" .target="${t}" .selected="${s}" .lazy="${a}" @wa-lazy-load="${this._expandItem}" @wa-collapse="${this._collapseItem}" .expanded="${o}" .title="${e}"> ${r?.()} ${e} ${l||n.s6} </wa-tree-item> `}_getTreeData(){this._floorAreas=(0,f.g3)(this.states,this._registries.floors,this._registries.areas,this._registries.devices,this._registries.entities,this._formatId,void 0,void 0,void 0,void 0,void 0,void 0,void 0);const e=this._floorAreas.filter(({id:e,areas:t})=>void 0!==e&&t.length);this._floorAreas.forEach(t=>{this._entries[t.id||`floor${x.G_}`]={open:1===e.length&&e[0].id===t.id,areas:{}},t.areas.forEach(e=>{this._entries[t.id||`floor${x.G_}`].areas[e.id]=this._loadArea(e)})}),this._loadUnassignedDevices(),this._loadUnassignedEntities(),this._entries={...this._entries},this.value&&this._valueChanged(this._getSelectedTargetId(this.value),!this.narrow)}_loadUnassignedDevices(){const e=Object.values(this._registries.devices).filter(e=>!e.area_id),t={},i={};e.forEach(({id:e,entry_type:s})=>{const a=this._registries.devices[e];if(!a||a.disabled_by)return;const o={open:!1,entities:this._getDeviceEntityLookupMemoized(this._registries.entities)[e]?.map(e=>e.entity_id)||[]};"service"!==s?t[e]=o:i[e]=o}),Object.keys(t).length&&(this._entries={...this._entries,[`area${x.G_}`]:{open:!1,devices:t}}),Object.keys(i).length&&(this._entries={...this._entries,[`service${x.G_}`]:{open:!1,devices:i}})}_loadUnassignedEntities(){Object.values(this._registries.entities).filter(e=>!e.area_id&&!e.device_id).forEach(({entity_id:e})=>{const t=e.split(".",2)[0],i=this.manifests?this.manifests[t]:void 0;if("helper"===i?.integration_type)return this._entries[`helper${x.G_}`]||(this._entries[`helper${x.G_}`]={open:!1,devices:{}}),this._entries[`helper${x.G_}`].devices[`helper_${t}${x.G_}`]||(this._entries[`helper${x.G_}`].devices[`helper_${t}${x.G_}`]={open:!1,entities:[]}),void this._entries[`helper${x.G_}`].devices[`helper_${t}${x.G_}`].entities.push(e);this._entries[`device${x.G_}`]||(this._entries[`device${x.G_}`]={open:!1,devices:{}}),this._entries[`device${x.G_}`].devices[`entity_${t}${x.G_}`]||(this._entries[`device${x.G_}`].devices[`entity_${t}${x.G_}`]={open:!1,entities:[]}),this._entries[`device${x.G_}`].devices[`entity_${t}${x.G_}`].entities.push(e)})}_loadArea(e){const[,t]=e.id.split(x.G_,2),i=this._getAreaDeviceLookupMemoized(this._registries.devices)[t]||[],s=this._getAreaEntityLookupMemoized(this._registries.entities)[t]||[],a={};i.forEach(({id:e})=>{const t=this._registries.devices[e];t&&!t.disabled_by&&(a[e]={open:!1,entities:this._getDeviceEntityLookupMemoized(this._registries.entities)[e]?.map(e=>e.entity_id)||[]})});const o=[];return s.forEach(e=>{e.device_id&&a[e.device_id]||o.push(e.entity_id)}),{open:!1,devices:a,entities:o}}_expandTreeToItem(e,t){if("floor"!==e&&"label"!==e){if("entity"===e){const e=this._registries.entities[t]?.device_id,i=e?this._registries.devices[e]:void 0,s=e&&i?.area_id||void 0;if(!s){let s,a;const o=this._registries.entities[t];if(!e&&o.area_id)s=`floor${x.G_}${this._registries.areas[o.area_id]?.floor_id||""}`,a=`area${x.G_}${o.area_id}`;else if(e)s=`${"service"===i.entry_type?"service":"area"}${x.G_}`,a=e;else{const e=t.split(".",1)[0],i="helper"===this.manifests[e]?.integration_type;s=i?`helper${x.G_}`:`device${x.G_}`,a=`${i?"helper_":"entity_"}${e}${x.G_}`}return void(this._entries={...this._entries,[s]:{...this._entries[s],open:!0,devices:{...this._entries[s].devices,[a]:{...this._entries[s].devices[a],open:!0}}}})}const a=`floor${x.G_}${this._registries.areas[s]?.floor_id||""}`,o=`area${x.G_}${s}`;return void(this._entries={...this._entries,[a]:{...this._entries[a],open:!0,areas:{...this._entries[a].areas,[o]:{...this._entries[a].areas[o],open:!0,devices:{...this._entries[a].areas[o].devices,[e]:{...this._entries[a].areas[o].devices[e],open:!0}}}}}})}if("device"===e){const e=this._registries.devices[t]?.area_id;if(!e){const e=`${"service"===this._registries.devices[t].entry_type?"service":"area"}${x.G_}`;return void(this._entries={...this._entries,[e]:{...this._entries[e],open:!0}})}const i=`floor${x.G_}${this._registries.areas[e]?.floor_id||""}`,s=`area${x.G_}${e}`;return void(this._entries={...this._entries,[i]:{...this._entries[i],open:!0,areas:{...this._entries[i].areas,[s]:{...this._entries[i].areas[s],open:!0}}}})}if("area"===e){const e=`floor${x.G_}${this._registries.areas[t]?.floor_id||""}`;this._entries={...this._entries,[e]:{...this._entries[e],open:!0}}}}}_handleSelectionChange(e){const t=e.detail.selection[0];t?.target&&this._valueChanged(t.target)}_selectItem(e){const t=e.currentTarget.target;t&&this._valueChanged(t)}async _valueChanged(e,t=!1){const[i,s]=e.split(x.G_,2);(0,d.r)(this,"value-changed",{value:{[`${i}_id`]:s||void 0}}),t&&s&&(this._expandTreeToItem(i,s),await this.updateComplete,"label"===i?this.shadowRoot.querySelector("ha-list-item-button.selected")?.scrollIntoView({block:"center"}):this.shadowRoot.querySelector("wa-tree-item[selected]")?.scrollIntoView({block:"center"}))}_toggleItem(e,t){const[i,s]=e.split(x.G_,2);if("floor"!==i){if("area"===i&&s){const i=`floor${x.G_}${this._registries.areas[s]?.floor_id||""}`;return void(this._entries={...this._entries,[i]:{...this._entries[i],areas:{...this._entries[i].areas,[e]:{...this._entries[i].areas[e],open:t}}}})}if("area"!==i)if("service"!==i){if("device"===i&&s){const e=this._registries.devices[s]?.area_id;if(e){const i=`area${x.G_}${this._registries.devices[s]?.area_id??""}`,a=`floor${x.G_}${e&&this._registries.areas[e]?.floor_id||""}`;return void(this._entries={...this._entries,[a]:{...this._entries[a],areas:{...this._entries[a].areas,[i]:{...this._entries[a].areas[i],devices:{...this._entries[a].areas[i].devices,[s]:{...this._entries[a].areas[i].devices[s],open:t}}}}}})}const i=`${"service"===this._registries.devices[s]?.entry_type?"service":"area"}${x.G_}`;return void(this._entries={...this._entries,[i]:{...this._entries[i],devices:{...this._entries[i].devices,[s]:{...this._entries[i].devices[s],open:t}}}})}"device"!==i?"helper"!==i?i.startsWith("entity_")?this._entries={...this._entries,[`device${x.G_}`]:{...this._entries[`device${x.G_}`],devices:{...this._entries[`device${x.G_}`].devices,[e]:{...this._entries[`device${x.G_}`].devices[e],open:t}}}}:i.startsWith("helper_")&&(this._entries={...this._entries,[`helper${x.G_}`]:{...this._entries[`helper${x.G_}`],devices:{...this._entries[`helper${x.G_}`].devices,[e]:{...this._entries[`helper${x.G_}`].devices[e],open:t}}}}):this._entries={...this._entries,[e]:{...this._entries[e],open:t}}:this._entries={...this._entries,[e]:{...this._entries[e],open:t}}}else this._entries={...this._entries,[e]:{...this._entries[e],open:t}};else this._entries={...this._entries,[e]:{...this._entries[e],open:t}}}else this._entries={...this._entries,[e]:{...this._entries[e],open:t}}}_expandItem(e){const t=e.target.target;this._toggleItem(t,!0)}_collapseItem(e){const t=e.target.target;this._toggleItem(t,!1)}async _loadConfigEntries(){const e=await(0,y.VN)(this.hass);this._configEntryLookup=Object.fromEntries(e.map(e=>[e.entry_id,e]))}_expandHeight(){this._fullHeight=!0,this.style.setProperty("--max-height","none")}constructor(...e){super(...e),this.narrow=!1,this._floorAreas=[],this._entries={},this._fullHeight=!1,this._configEntryLookup={},this._renderNarrow=(0,c.A)((e,t)=>{const[i,s]=Object.entries(t)[0],a=i.replace("_id","");if(!a||"label"===a)return n.s6;if("floor"===a)return this._renderAreas(e[`floor${x.G_}${s??""}`].areas);if("area"===a&&s){const t=e[`floor${x.G_}${this._registries.areas[s]?.floor_id||""}`],{devices:i,entities:a}=t.areas[`area${x.G_}${s}`],o=Object.keys(i).length;return n.qy` ${o?this._renderDevices(i):n.s6} ${a.length?this._renderEntities(a):n.s6} `}if(!s&&"area"===a||"service"===a){const t=e[`${a}${x.G_}`].devices;return this._renderDevices(t)}if(s&&"device"===a){const t=this._registries.devices[s]?.area_id;if(t){const i=this._registries.areas[t]?.floor_id||"",{entities:a}=e[`floor${x.G_}${i}`].areas[`area${x.G_}${t}`].devices[s];return a.length?this._renderEntities(a):n.s6}const i="service"===this._registries.devices[s].entry_type,{entities:a}=e[`${i?"service":"area"}${x.G_}`].devices[s];return a.length?this._renderEntities(a):n.s6}if("device"===a||"helper"===a){const{devices:t}=e[`${a}${x.G_}`];return this._renderDomains(t,"device"===a?"entity_":"helper_")}if(!s&&(a.startsWith("entity")||a.startsWith("helper"))){const{entities:t}=e[`${a.startsWith("entity")?"device":"helper"}${x.G_}`].devices[`${a}${x.G_}`];return this._renderEntities(t)}return n.s6}),this._renderFloors=(0,c.A)((e,t,i)=>{const s=!this._floorAreas.length||!this._floorAreas[0].id&&!this._floorAreas[0].areas.length,a=s?void 0:this._floorAreas.map((e,s)=>0!==s||e.id?this._renderItem(e.id?e.primary:this._i18n.localize("ui.panel.config.automation.editor.other_areas"),e.id||`floor${x.G_}`,!e.id,!!e.id&&this._getSelectedTargetId(i)===e.id,!t[e.id||`floor${x.G_}`].open&&!!Object.keys(t[e.id||`floor${x.G_}`].areas).length,t[e.id||`floor${x.G_}`].open,this._renderFloorIcon(e),t[e.id||`floor${x.G_}`].open?this._renderAreas(t[e.id||`floor${x.G_}`].areas):void 0):this._renderAreas(t[e.id||`floor${x.G_}`].areas));return n.qy`<ha-section-title>${this._i18n.localize("ui.panel.config.automation.editor.home")}</ha-section-title> ${s?n.qy`<ha-row-item> <div slot="headline"> ${this._i18n.localize("ui.components.area-picker.no_areas")} </div> </ha-row-item>`:n.qy`${e?n.qy`<ha-list-base>${a}</ha-list-base>`:n.qy`<wa-tree @wa-selection-change="${this._handleSelectionChange}">${a}</wa-tree>`}`}`}),this._renderLabels=(0,c.A)((e,t)=>{const i=this._getLabelsMemoized(this.states,this._registries.areas,this._registries.devices,this._registries.entities,this._labelRegistry,void 0,void 0,void 0,void 0,void 0,void 0,`label${x.G_}`);return i.length?n.qy`<ha-section-title>${this._i18n.localize("ui.components.label-picker.labels")}</ha-section-title> <ha-list-base> ${i.map(i=>n.qy`<ha-list-item-button .target="${i.id}" @click="${this._selectItem}" class="${this._getSelectedTargetId(t)===i.id?"selected":""}">${i.icon?n.qy`<ha-icon slot="start" .icon="${i.icon}"></ha-icon>`:i.icon_path?n.qy`<ha-svg-icon slot="start" .path="${i.icon_path}"></ha-svg-icon>`:n.s6} <div slot="headline">${i.primary}</div> ${e?n.qy`<ha-icon-next slot="end"></ha-icon-next> `:n.s6} </ha-list-item-button>`)} </ha-list-base>`:n.s6}),this._renderUnassigned=(0,c.A)((e,t,i)=>{const s=Object.keys(t[`area${x.G_}`]?.devices||{}).length,a=Object.keys(t[`service${x.G_}`]?.devices||{}).length,o=Object.keys(t[`device${x.G_}`]?.devices||{}).length,r=Object.keys(t[`helper${x.G_}`]?.devices||{}).length;if(!(s||a||o||r))return n.s6;const l=[];if(o){const e=t[`device${x.G_}`].open;l.push(this._renderItem(this._i18n.localize("ui.components.target-picker.type.entities"),`device${x.G_}`,!0,!1,!e,e,void 0,t[`device${x.G_}`].open?this._renderDomains(t[`device${x.G_}`].devices,"entity_"):void 0))}if(r){const e=t[`helper${x.G_}`].open;l.push(this._renderItem(this._i18n.localize("ui.panel.config.automation.editor.helpers"),`helper${x.G_}`,!0,!1,!e,e,void 0,t[`helper${x.G_}`].open?this._renderDomains(t[`helper${x.G_}`].devices,"helper_"):void 0))}if(s){const e=t[`area${x.G_}`].open;l.push(this._renderItem(this._i18n.localize("ui.components.target-picker.type.devices"),`area${x.G_}`,!0,!1,!e,e,void 0,t[`area${x.G_}`].open?this._renderDevices(t[`area${x.G_}`].devices):void 0))}if(a){const e=t[`service${x.G_}`].open;l.push(this._renderItem(this._i18n.localize("ui.panel.config.automation.editor.services"),`service${x.G_}`,!0,!1,!e,e,void 0,t[`service${x.G_}`].open?this._renderDevices(t[`service${x.G_}`].devices):void 0))}return n.qy`<ha-section-title>${this._i18n.localize("ui.panel.config.automation.editor.unassigned")}</ha-section-title>${e?n.qy`<ha-list-base>${l}</ha-list-base>`:n.qy`<wa-tree @wa-selection-change="${this._handleSelectionChange}"> ${l} </wa-tree>`} `}),this._renderFloorIcon=e=>t=>e.id&&e.floor?n.qy`<ha-floor-icon slot="${(0,h.J)(t)}" .floor="${e.floor}"></ha-floor-icon>`:n.qy`<ha-svg-icon slot="${(0,h.J)(t)}" .path="${M}"></ha-svg-icon>`,this._renderAreaIcon=e=>t=>e?n.qy`<ha-icon slot="${(0,h.J)(t)}" .icon="${e}"></ha-icon>`:n.qy`<ha-svg-icon slot="${(0,h.J)(t)}" .path="${M}"></ha-svg-icon>`,this._renderDomainIcon=e=>t=>n.qy` <img slot="${(0,h.J)(t)}" alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${(0,A.MR)({domain:e,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}"> `,this._renderEntityIcon=e=>t=>n.qy`<ha-state-icon slot="${(0,h.J)(t)}" .stateObj="${e}"></ha-state-icon>`,this._getAreaDeviceLookupMemoized=(0,c.A)(e=>(0,v.QI)(Object.values(e))),this._getAreaEntityLookupMemoized=(0,c.A)(e=>(0,v.bQ)(Object.values(e))),this._getDeviceEntityLookupMemoized=(0,c.A)(e=>(0,w.I3)(Object.values(e))),this._getSelectedTargetId=(0,c.A)(e=>e&&Object.keys(e).length?`${Object.keys(e)[0].replace("_id","")}${x.G_}${Object.values(e)[0]}`:void 0),this._getLabelsMemoized=(0,c.A)($.I),this._formatId=(0,c.A)(e=>[e.type,e.id].join(x.G_))}}H.styles=n.AH`:host{--wa-color-neutral-fill-quiet:var(--ha-color-fill-primary-normal-active);position:relative}ha-section-title{top:0;position:sticky;z-index:1}wa-tree-item::part(item){height:var(--ha-space-10);padding:var(--ha-space-1) var(--ha-space-3);cursor:pointer;border-inline-start:0}wa-tree-item::part(label){gap:var(--ha-space-3);font-family:var(--ha-font-family-heading);font-weight:var(--ha-font-weight-medium);overflow:hidden}ha-list-item-button::part(label){font-weight:var(--ha-font-weight-medium);font-family:var(--ha-font-family-heading)}.item-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}ha-floor-icon,ha-icon,ha-state-icon,ha-svg-icon{padding:var(--ha-space-1);color:var(--ha-color-on-neutral-quiet)}wa-tree-item::part(item):hover{background-color:var(--ha-color-fill-neutral-quiet-hover)}img{width:24px;height:24px;padding:var(--ha-space-1)}img.domain-icon{filter:grayscale(100%)}state-badge{width:24px;height:24px}wa-tree-item[selected]::part(item):hover{background-color:var(--ha-color-fill-primary-normal-hover)}wa-tree-item::part(base).tree-item-selected .item{background-color:#ff0}ha-list-base{--ha-row-item-padding-inline:var(--ha-space-3);--ha-row-item-padding-block:var(--ha-space-1);--ha-row-item-min-height:40px}ha-list-item-button::part(end){color:var(--ha-color-on-neutral-quiet)}ha-list-item-button.selected{background-color:var(--ha-color-fill-primary-normal-active);--md-list-item-label-text-color:var(--ha-color-on-primary-normal);--icon-primary-color:var(--ha-color-on-primary-normal)}ha-list-item-button.selected::part(headline){color:var(--ha-color-on-primary-normal)}ha-list-item-button.selected ha-icon,ha-list-item-button.selected ha-svg-icon,wa-tree-item[selected],wa-tree-item[selected]>ha-floor-icon,wa-tree-item[selected]>ha-icon,wa-tree-item[selected]>ha-state-icon,wa-tree-item[selected]>ha-svg-icon{color:var(--ha-color-on-primary-normal)}.targets-show-more{display:flex;justify-content:center;position:absolute;bottom:0;width:100%;padding-bottom:var(--ha-space-2);box-shadow:inset 0 -8px 12px 0 rgba(0,0,0,.06);z-index:2}@media all and (max-width:870px),all and (max-height:500px){:host{max-height:var(--max-height,50%);overflow:hidden}}`,(0,s.Cg)([(0,l.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,s.Cg)([(0,l.MZ)({attribute:!1})],H.prototype,"value",void 0),(0,s.Cg)([(0,l.MZ)({type:Boolean})],H.prototype,"narrow",void 0),(0,s.Cg)([(0,l.MZ)({attribute:!1})],H.prototype,"manifests",void 0),(0,s.Cg)([(0,l.wk)(),(0,r.Fg)({context:b.D5,subscribe:!0})],H.prototype,"_i18n",void 0),(0,s.Cg)([(0,r.Fg)({context:b.iN,subscribe:!0})],H.prototype,"states",void 0),(0,s.Cg)([(0,r.Fg)({context:b.Hd,subscribe:!0})],H.prototype,"_registries",void 0),(0,s.Cg)([(0,l.wk)(),(0,r.Fg)({context:b.HD,subscribe:!0})],H.prototype,"_labelRegistry",void 0),(0,s.Cg)([(0,l.wk)()],H.prototype,"_floorAreas",void 0),(0,s.Cg)([(0,l.wk)()],H.prototype,"_entries",void 0),(0,s.Cg)([(0,l.wk)()],H.prototype,"_showShowMoreButton",void 0),(0,s.Cg)([(0,l.wk)()],H.prototype,"_fullHeight",void 0),H=(0,s.Cg)([(0,l.EM)("ha-automation-add-from-target")],H),t()}catch(e){t(e)}})},2491(e,t,i){i.a(e,async function(e,t){try{var s=i(62826),a=i(5124),o=i(22441),r=i(6412),n=i(75751),l=i(22786),h=i(1087),c=i(57237),d=(i(67094),i(34127)),p=(i(1671),i(50723),i(14503)),u=i(14440),g=e([d,u]);[d,u]=g.then?(await g)():g;const m="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",_="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class v extends a.WF{render(){return a.qy`<div class="${(0,r.H)({items:!0,blank:this.error||!this.items||!this.items.length,error:this.error,scrolled:this._itemsScrolled,"ha-scrollbar":this.scrollable})}" @scroll="${this._onItemsScroll}"> ${this.items||this.error?this.error?a.qy`${this.error} <div>${this._renderTarget(this.target)}</div>`:this.items&&!this.items.length?a.qy`${this.emptyLabel} ${this.target?a.qy`<div>${this._renderTarget(this.target)}</div>`:a.s6} ${this.emptyNote?a.qy`<div class="empty-note">${this.emptyNote}</div>`:a.s6}`:(0,n.u)(this.items,(e,t)=>`item-group-${t}`,e=>this._renderItemList(e.title,e.items)):this.selectLabel} </div>`}_renderItemList(e,t){return t&&t.length?a.qy` <div class="items-title">${e}</div> <ha-list-base> ${(0,n.u)(t,e=>e.key,e=>a.qy` <ha-list-item-button .value="${e.key}" @click="${this._selected}"> <div slot="headline" class="${this.target?"item-headline":""}"> ${e.name}${this._renderTarget(this.target)} </div> ${!this.tooltipDescription&&e.description?a.qy`<div slot="supporting-text">${e.description}</div>`:a.s6} ${e.icon?a.qy`<span slot="start">${e.icon}</span>`:e.iconPath?a.qy`<ha-svg-icon slot="start" .path="${e.iconPath}"></ha-svg-icon>`:a.s6} ${this.tooltipDescription&&e.description?a.qy`<ha-svg-icon tabindex="0" id="${`description-tooltip-${e.key}`}" slot="end" .path="${m}" @click="${c.d}"></ha-svg-icon> <ha-tooltip slot="end" .for="${`description-tooltip-${e.key}`}" @wa-show="${c.d}" @wa-hide="${c.d}" @wa-after-hide="${c.d}" @wa-after-show="${c.d}">${e.description}</ha-tooltip> `:a.s6} <ha-svg-icon slot="end" class="plus" .path="${_}"></ha-svg-icon> </ha-list-item-button> `)} </ha-list-base> `:a.s6}_selected(e){const t=e.currentTarget;(0,h.r)(this,"value-changed",{value:t.value})}_onItemsScroll(e){const t=e.target.scrollTop??0;this._itemsScrolled=t>0}scrollTo(e,t){"number"==typeof e?this._itemsDiv?.scrollTo(e,t):this._itemsDiv?.scrollTo(e)}constructor(...e){super(...e),this.configEntryLookup={},this.tooltipDescription=!1,this.scrollable=!1,this._itemsScrolled=!1,this._renderTarget=(0,l.A)(e=>e?a.qy`<div class="selected-target"> ${(0,u.B)({entities:this.hass.entities,devices:this.hass.devices,areas:this.hass.areas,floors:this.hass.floors},this.hass.states,e[0],e[1],this.configEntryLookup,this.getLabel)} <div class="label">${e[2]}</div> </div>`:a.s6)}}v.styles=[p.dp,a.AH`:host{display:flex;flex-grow:1}:host([scrollable]) .items{overflow:auto}.items{display:flex;flex-direction:column;flex:1}.items.blank{border-radius:var(--ha-border-radius-xl);background-color:var(--ha-color-surface-default);align-items:center;color:var(--ha-color-text-secondary);padding:var(--ha-space-4);margin:0 var(--ha-space-4) max(var(--safe-area-inset-bottom),var(--ha-space-3));line-height:var(--ha-line-height-expanded);justify-content:center}.empty-note{color:var(--ha-color-text-secondary);margin-top:var(--ha-space-2);text-align:center}.empty-note a{color:currentColor;text-decoration:underline}.items.error{background-color:var(--ha-color-fill-danger-quiet-resting);color:var(--ha-color-on-danger-normal)}.items ha-list-base{--ha-row-item-padding-inline:var(--ha-space-3);--ha-row-item-padding-block:var(--ha-space-2);--ha-list-gap:var(--ha-space-3);gap:var(--ha-space-2);padding:0 var(--ha-space-4);padding-bottom:max(var(--safe-area-inset-bottom),var(--ha-space-3))}.items ha-list-base ha-list-item-button{border-radius:var(--ha-border-radius-lg);border:1px solid var(--ha-color-border-neutral-quiet);overflow:hidden}.items ha-list-base ha-list-item-button::part(end),.items ha-list-base ha-list-item-button::part(start){color:var(--ha-color-on-neutral-quiet)}.items ha-list-base ha-list-item-button::part(end){gap:var(--ha-space-3)}.items .item-headline{display:flex;align-items:center;gap:var(--ha-space-2);min-height:var(--ha-space-9);flex-wrap:wrap}.items-title{position:sticky;display:flex;align-items:center;font-weight:var(--ha-font-weight-medium);padding-top:var(--ha-space-2);padding-bottom:var(--ha-space-2);padding-inline-start:var(--ha-space-8);padding-inline-end:var(--ha-space-3);top:0;z-index:1;background-color:var(--card-background-color)}ha-bottom-sheet .items-title{padding-top:var(--ha-space-3)}.scrolled .items-title:first-of-type{box-shadow:var(--bar-box-shadow);border-bottom:1px solid var(--ha-color-border-neutral-quiet)}ha-svg-icon.plus{color:var(--primary-color)}.selected-target{display:inline-flex;gap:var(--ha-space-1);justify-content:center;align-items:center;border-radius:var(--ha-border-radius-md);background:var(--ha-color-fill-neutral-normal-resting);padding:0 var(--ha-space-2) 0 var(--ha-space-1);border:var(--ha-border-width-sm) solid var(--ha-color-border-neutral-quiet);color:var(--ha-color-on-neutral-normal);overflow:hidden}.selected-target .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.selected-target ha-domain-icon,.selected-target ha-icon,.selected-target ha-svg-icon{display:flex;padding:var(--ha-space-1) 0}.selected-target ha-floor-icon{display:flex;height:32px;width:32px;align-items:center}.selected-target ha-domain-icon{filter:grayscale(100%)}`],(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"items",void 0),(0,s.Cg)([(0,o.MZ)()],v.prototype,"error",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"select-label"})],v.prototype,"selectLabel",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"empty-label"})],v.prototype,"emptyLabel",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"emptyNote",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"target",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"getLabel",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"configEntryLookup",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,attribute:"tooltip-description"})],v.prototype,"tooltipDescription",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],v.prototype,"scrollable",void 0),(0,s.Cg)([(0,o.wk)()],v.prototype,"_itemsScrolled",void 0),(0,s.Cg)([(0,o.P)(".items")],v.prototype,"_itemsDiv",void 0),(0,s.Cg)([(0,o.Ls)({passive:!0})],v.prototype,"_onItemsScroll",null),v=(0,s.Cg)([(0,o.EM)("ha-automation-add-items")],v),t()}catch(e){t(e)}})},25871(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(61701);var s=i(62826),a=i(35211),o=(i(32308),i(78648)),r=i(5124),n=i(22441),l=i(89784),h=i(22786),c=i(91335),d=i(1087),p=i(15638),u=(i(5745),i(32023),i(74281)),g=i(89865),m=(i(75064),i(59174)),_=(i(18198),i(43661),i(69464),i(73150),i(30780)),v=i(28223),f=i(87225),y=i(22792),b=i(31422),w=i(53756),C=i(5904),$=i(88555),x=i(59653),A=i(85614),L=e([u,g,m]);[u,g,m]=L.then?(await L)():L;const M="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",H="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",V=["separator","entity","device","area","separator","label"],k=[{name:"primary",weight:10},{name:"secondary",weight:7}];class S extends r.WF{get _showEntityId(){return this.hass.userData?.showEntityIdPicker}willUpdate(e){if(this.hasUpdated||(0,A.i)(),!this.hasUpdated||e.has("filter")){if(this._removeKeyboardShortcuts)return void(this.filter||(this._removeKeyboardShortcuts(),this._removeKeyboardShortcuts=void 0));this._removeKeyboardShortcuts=(0,c.Tc)(window,{ArrowUp:this._selectPreviousSearchItem,ArrowDown:this._selectNextSearchItem,Home:this._selectFirstSearchItem,End:this._selectLastSearchItem,Enter:this._pickSelectedSearchItem})}}disconnectedCallback(){super.disconnectedCallback(),this._removeKeyboardShortcuts?.()}render(){const e=this._getFilteredItems(this.addElementType,this.hass.localize,this.filter,this.configEntryLookup,this.items,this.newTriggersAndConditions,this._selectedSearchSection);let t;return e.length||(t=this._selectedSearchSection?"item"===this._selectedSearchSection?`ui.panel.config.automation.editor.${this.addElementType}s.empty_search.item`:`ui.panel.config.automation.editor.empty_section_search.${this._selectedSearchSection}`:`ui.panel.config.automation.editor.${this.addElementType}s.empty_search.global`),r.qy` ${this._renderSections()} ${t?r.qy`<div class="empty-search"> ${this.hass.localize(t,{term:r.qy`<b>‘${this.filter}’</b>`})} </div>`:r.qy` <div class="search-results"> <div class="section-title-wrapper"> ${!this._selectedSearchSection&&this._searchSectionTitle?r.qy`<ha-section-title> ${this._searchSectionTitle} </ha-section-title>`:r.s6} </div> <lit-virtualizer .keyFunction="${this._keyFunction}" tabindex="0" scroller .items="${e}" .renderItem="${this._renderSearchResultRow}" style="min-height:36px" class="${this._searchListScrolled?"scrolled":""}" @scroll="${this._onScrollSearchList}" @focus="${this._focusSearchList}" @visibilityChanged="${this._visibilityChanged}"> </lit-virtualizer> </div> `} `}_renderSections(){if("trigger"===this.addElementType&&!this.newTriggersAndConditions)return r.s6;const e=["item"];return"trigger"!==this.addElementType&&e.push("block"),this.newTriggersAndConditions&&e.push(...V),r.qy` <ha-chip-set class="sections"> ${e.map(e=>"separator"===e?r.qy`<div class="separator"></div>`:r.qy`<ha-filter-chip @click="${this._toggleSection}" .section-id="${e}" .selected="${this._selectedSearchSection===e}" .label="${this._getSearchSectionLabel(e)}"> </ha-filter-chip>`)} </ha-chip-set> `}_onScrollSearchList(e){const t=e.target.scrollTop??0;this._searchListScrolled=t>0}_visibilityChanged(e){if(this._virtualizerElement){const t=this._virtualizerElement.items[e.first],i=this._virtualizerElement.items[e.first+1];if(void 0===t||void 0===i||"string"==typeof t||"string"==typeof i||0===e.first||0===e.first&&e.last===this._virtualizerElement.items.length-1)return void(this._searchSectionTitle=void 0);let s;s=t.type&&!["area","floor"].includes(t.type)?t.type:(0,$.OJ)(t),this._searchSectionTitle=this._getSearchSectionLabel(s)}}_filterGroup(e,t,i,s,a=!0){const o=this._fuseIndexes[e](t);return a?(0,x.x)(t,i,s,e=>e.id,o):(0,x.C)(t,i,s,o,{ignoreLocation:!0})}_toggleSection(e){e.stopPropagation(),this._searchSectionTitle=void 0;const t=e.target["section-id"];t&&(this._selectedSearchSection===t?this._selectedSearchSection=void 0:this._selectedSearchSection=t,this._virtualizerElement&&this._virtualizerElement.scrollToIndex(0))}_getSearchSectionLabel(e){return"block"===e?this.hass.localize("ui.panel.config.automation.editor.blocks"):"item"===e||["trigger","condition","action"].includes(e)?this.hass.localize(`ui.panel.config.automation.editor.${this.addElementType}s.name`):this.hass.localize("ui.components.target-picker.type."+("entity"===e?"entities":`${e}s`))}_resetSelectedSearchItem(){this._virtualizerElement?.querySelector(".selected")?.classList.remove("selected"),this._selectedSearchItemIndex=-1}_selectSearchItem(e){(0,d.r)(this,"search-element-picked",e)}constructor(...e){super(...e),this.configEntryLookup={},this.narrow=!1,this.newTriggersAndConditions=!1,this._searchListScrolled=!1,this._getDevicesMemoized=(0,h.A)(b.oG),this._getLabelsMemoized=(0,h.A)(C.I),this._getEntitiesMemoized=(0,h.A)(w.w),this._getAreasAndFloorsMemoized=(0,h.A)(v.bi),this._selectedSearchItemIndex=-1,this._renderSearchResultRow=(e,t)=>{if(!e)return r.s6;if("string"==typeof e)return r.qy`<ha-section-title>${e}</ha-section-title>`;const i=["trigger","condition","action","block"].includes(e.type)?"item":(0,$.OJ)(e);let s=!1,a=!1,o=!1;return"area"!==i&&"floor"!==i||(a=(0,p.qC)(this.hass.language,this.hass.translationMetadata.translations),s="area"===i&&!!e.area?.floor_id),"entity"===i&&(o=!!this._showEntityId),r.qy` <ha-combo-box-item id="${`search-list-item-${t}`}" tabindex="-1" .type="${"empty"===i?"text":"button"}" class="${"empty"===i?"empty":""}" style="${"area"===e.type&&s?"--md-list-item-leading-space: var(--ha-space-12);":""}" .value="${e}" @click="${this._selectSearchResult}"> ${"area"===e.type&&s?r.qy` <ha-tree-indicator style="${(0,l.W)({width:"var(--ha-space-12)",position:"absolute",top:"0",left:a?void 0:"var(--ha-space-1)",right:a?"var(--ha-space-1)":void 0,transform:a?"scaleX(-1)":""})}" .end="${e.last}" slot="start"></ha-tree-indicator> `:r.s6} ${e.renderedIcon?r.qy`<div slot="start"> ${e.renderedIcon} </div>`:e.icon?r.qy`<ha-icon slot="start" .icon="${e.icon}"></ha-icon>`:e.icon_path||"area"===i?r.qy`<ha-svg-icon slot="start" .path="${e.icon_path||H}"></ha-svg-icon>`:"entity"===i&&e.stateObj?r.qy` <state-badge slot="start" .stateObj="${e.stateObj}" .hass="${this.hass}"></state-badge> `:"device"===i&&e.domain?r.qy` <ha-domain-icon slot="start" .domain="${e.domain}" brand-fallback></ha-domain-icon> `:"floor"===i?r.qy`<ha-floor-icon slot="start" .floor="${e.floor}"></ha-floor-icon>`:r.s6} <span slot="headline">${e.primary}</span> ${e.secondary?r.qy`<span slot="supporting-text">${e.secondary}</span>`:r.s6} ${e.stateObj&&o?r.qy` <span slot="supporting-text" class="code"> ${e.stateObj?.entity_id} </span> `:r.s6} ${!e.domain_name||"entity"===i&&o?r.s6:r.qy` <div slot="trailing-supporting-text" class="domain"> ${e.domain_name} </div> `} ${"item"===i?r.qy`<ha-svg-icon class="plus" slot="end" .path="${M}"></ha-svg-icon>`:this.narrow?r.qy`<ha-icon-next slot="end"></ha-icon-next>`:r.s6} </ha-combo-box-item> `},this._keyFunction=e=>"string"==typeof e?e:e.id,this._createFuseIndex=(e,t)=>o.A.createIndex(t,e),this._fuseIndexes={area:(0,h.A)(e=>this._createFuseIndex(e,v.Z2)),entity:(0,h.A)(e=>this._createFuseIndex(e,w.t)),device:(0,h.A)(e=>this._createFuseIndex(e,b._o)),label:(0,h.A)(e=>this._createFuseIndex(e,C.u)),item:(0,h.A)(e=>this._createFuseIndex(e,k)),block:(0,h.A)(e=>this._createFuseIndex(e,k))},this._getFilteredItems=(0,h.A)((e,t,i,s,a,o,r)=>{const n=[];if(!r||"item"===r){let s=this._convertItemsToComboBoxItems(a,e);i&&(s=this._filterGroup("item",s,i,k)),!r&&s.length&&n.push(t(`ui.panel.config.automation.editor.${e}s.name`)),n.push(...s)}if("trigger"!==e&&(!r||"block"===r)){const s="action"===e?_.bM:"condition"===e?f.oW:{};let a=this._convertItemsToComboBoxItems(Object.keys(s).map(i=>this.convertToItem(i,{},e,t)),"block");i&&(a=this._filterGroup("block",a,i,k)),!r&&a.length&&n.push(t("ui.panel.config.automation.editor.blocks")),n.push(...a)}if(o){if(!r||"entity"===r){let e=this._getEntitiesMemoized(this.hass,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,`entity${$.G_}`);i&&(e=this._filterGroup("entity",e,i,w.t)),!r&&e.length&&n.push(t("ui.components.target-picker.type.entities")),n.push(...e)}if(!r||"device"===r){let e=this._getDevicesMemoized(this.hass,s,void 0,void 0,void 0,void 0,void 0,void 0,void 0,`device${$.G_}`);i&&(e=this._filterGroup("device",e,i,b._o)),!r&&e.length&&n.push(t("ui.components.target-picker.type.devices")),n.push(...e)}if(!r||"area"===r){let e=this._getAreasAndFloorsMemoized(this.hass.states,this.hass.floors,this.hass.areas,this.hass.devices,this.hass.entities,(0,h.A)(e=>[e.type,e.id].join($.G_)),void 0,void 0,void 0,void 0,void 0,void 0,void 0);i&&(e=this._filterGroup("area",e,i,v.Z2,!1)),!r&&e.length&&n.push(t("ui.components.target-picker.type.areas")),n.push(...e.map((t,i)=>{const s=e[i+1];return!s||"area"===t.type&&"floor"===s.type?{...t,last:!0}:t}))}if(!r||"label"===r){let e=this._getLabelsMemoized(this.hass.states,this.hass.areas,this.hass.devices,this.hass.entities,this._labelRegistry,void 0,void 0,void 0,void 0,void 0,void 0,`label${$.G_}`);i&&(e=this._filterGroup("label",e,i,C.u)),!r&&e.length&&n.push(t("ui.components.target-picker.type.labels")),n.push(...e)}}return n}),this._convertItemsToComboBoxItems=(e,t)=>e.map(({key:e,name:i,description:s,iconPath:a,icon:o})=>({id:e,primary:i,secondary:s,icon_path:a,renderedIcon:o,type:t,search_labels:{key:e,name:i,description:s}})),this._focusSearchList=()=>{-1===this._selectedSearchItemIndex&&this._selectNextSearchItem()},this._selectSearchResult=e=>{e.stopPropagation();const t=e.currentTarget.value;t&&this._selectSearchItem(t)},this._selectNextSearchItem=e=>{if(e?.stopPropagation(),e?.preventDefault(),!this._virtualizerElement)return;const t=this._virtualizerElement.items,i=t.length-1;if(-1===i)return void this._resetSelectedSearchItem();const s=i===this._selectedSearchItemIndex?this._selectedSearchItemIndex:this._selectedSearchItemIndex+1;if(t[s]){if("string"==typeof t[s]){if(s===i)return;this._selectedSearchItemIndex=s+1}else this._selectedSearchItemIndex=s;this._scrollToSelectedSearchItem()}},this._scrollToSelectedSearchItem=()=>{this._virtualizerElement?.querySelector(".selected")?.classList.remove("selected"),this._virtualizerElement?.scrollToIndex(this._selectedSearchItemIndex,"end"),requestAnimationFrame(()=>{this._virtualizerElement?.querySelector(`#search-list-item-${this._selectedSearchItemIndex}`)?.classList.add("selected")})},this._selectPreviousSearchItem=e=>{if(e.stopPropagation(),e.preventDefault(),this._virtualizerElement&&this._selectedSearchItemIndex>0){const e=this._selectedSearchItemIndex-1,t=this._virtualizerElement.items;if(!t[e])return;if("string"==typeof t[e]){if(0===e)return;this._selectedSearchItemIndex=e-1}else this._selectedSearchItemIndex=e;this._scrollToSelectedSearchItem()}},this._selectFirstSearchItem=e=>{if(e.stopPropagation(),!this._virtualizerElement||!this._virtualizerElement.items.length)return;"string"==typeof this._virtualizerElement.items[0]?this._selectedSearchItemIndex=1:this._selectedSearchItemIndex=0,this._scrollToSelectedSearchItem()},this._selectLastSearchItem=e=>{if(e.stopPropagation(),!this._virtualizerElement||!this._virtualizerElement.items.length)return;const t=this._virtualizerElement.items.length-1;"string"==typeof this._virtualizerElement.items[t]?this._selectedSearchItemIndex=t-1:this._selectedSearchItemIndex=t,this._scrollToSelectedSearchItem()},this._pickSelectedSearchItem=e=>{e.stopPropagation();const t=this._virtualizerElement?.items.filter(e=>"string"!=typeof e);if(t&&1===t.length){const e=t[0];return void this._selectSearchItem(e)}if(-1===this._selectedSearchItemIndex)return;e.preventDefault();const i=this._virtualizerElement?.items[this._selectedSearchItemIndex];i&&this._selectSearchItem(i)}}}S.styles=r.AH`:host{display:flex;flex-direction:column}.empty-search{display:flex;flex-direction:column;flex:1;padding:var(--ha-space-3);border-radius:var(--ha-border-radius-xl);background-color:var(--ha-color-surface-default);align-items:center;color:var(--ha-color-text-secondary);margin:var(--ha-space-3) var(--ha-space-4) max(var(--safe-area-inset-bottom),var(--ha-space-3));line-height:var(--ha-line-height-expanded);padding-top:var(--ha-space-6);justify-content:start}.sections{display:flex;flex-wrap:nowrap;gap:var(--ha-space-2);padding:var(--ha-space-3);margin-bottom:calc(var(--ha-space-3) * -1);overflow:auto;overflow-x:auto;overflow-y:hidden}.sections ha-filter-chip{flex-shrink:0;--md-filter-chip-selected-container-color:var(--ha-color-fill-primary-normal-hover);color:var(--primary-color)}.sections .separator{height:var(--ha-space-8);width:0;border:1px solid var(--ha-color-border-neutral-quiet)}.search-results{border-radius:var(--ha-border-radius-xl);border:1px solid var(--ha-color-border-neutral-quiet);margin:var(--ha-space-3);overflow:hidden;flex:1;display:flex;flex-direction:column}lit-virtualizer ha-section-title{width:100%}lit-virtualizer{flex:1}lit-virtualizer:focus-visible{outline:0}ha-combo-box-item{width:100%}ha-combo-box-item.selected{background-color:var(--ha-color-fill-neutral-quiet-hover)}@media (prefers-color-scheme:dark){ha-combo-box-item.selected{background-color:var(--ha-color-fill-neutral-normal-hover)}}ha-svg-icon.plus{color:var(--primary-color)}`,(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)()],S.prototype,"filter",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"configEntryLookup",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"manifests",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"items",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],S.prototype,"narrow",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"new-triggers-and-conditions"})],S.prototype,"newTriggersAndConditions",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"convertToItem",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"add-element-type"})],S.prototype,"addElementType",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_searchSectionTitle",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_selectedSearchSection",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_searchListScrolled",void 0),(0,s.Cg)([(0,n.wk)(),(0,a.Fg)({context:y.HD,subscribe:!0})],S.prototype,"_labelRegistry",void 0),(0,s.Cg)([(0,n.P)("lit-virtualizer")],S.prototype,"_virtualizerElement",void 0),(0,s.Cg)([(0,n.Ls)({passive:!0})],S.prototype,"_onScrollSearchList",null),(0,s.Cg)([(0,n.Ls)({passive:!0})],S.prototype,"_visibilityChanged",null),S=(0,s.Cg)([(0,n.EM)("ha-automation-add-search")],S),t()}catch(e){t(e)}})},14440(e,t,i){i.a(e,async function(e,s){try{i.d(t,{B:()=>c});var a=i(5124),o=i(59174),r=(i(18198),i(47680),i(93367)),n=(i(67094),e([o,r]));[o,r]=n.then?(await n)():n;const l="M17.63,5.84C17.27,5.33 16.67,5 16,5H5A2,2 0 0,0 3,7V17A2,2 0 0,0 5,19H16C16.67,19 17.27,18.66 17.63,18.15L22,12L17.63,5.84Z",h="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",c=(e,t,i,s,o,r,n)=>{if(!s)return a.s6;if("floor"===i&&e.floors[s])return a.qy`<ha-floor-icon .slot="${n}" .floor="${e.floors[s]}"></ha-floor-icon>`;if("area"===i){const t=e.areas[s];return t?.icon?a.qy`<ha-icon .slot="${n}" .icon="${t.icon}"></ha-icon>`:a.qy`<ha-svg-icon .slot="${n}" .path="${h}"></ha-svg-icon>`}if("device"===i&&e.devices[s]){const t=e.devices[s],i=t.primary_config_entry?o[t.primary_config_entry]:void 0,r=i?.domain;if(r)return a.qy`<ha-domain-icon .domain="${r}" brand-fallback .slot="${n}"></ha-domain-icon>`}if("entity"===i&&t[s])return a.qy`<ha-state-icon .stateObj="${t[s]}" .slot="${n}"></ha-state-icon>`;if("label"===i&&r){const e=r(s);return e?.icon?a.qy`<ha-icon .slot="${n}" .icon="${e.icon}"></ha-icon>`:a.qy`<ha-svg-icon .slot="${n}" .path="${l}"></ha-svg-icon>`}return a.s6};s()}catch(e){s(e)}})},69070(e,t,i){i.d(t,{N:()=>n});var s=i(65522),a=i(37981),o=i(74705),r=i(55931);const n=(e,t,i,n,l,h)=>{if("floor"===n)return e.floors[l]&&(0,r.X)(e.floors[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_floor");if("area"===n)return e.areas[l]&&(0,s.A)(e.areas[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_area");if("device"===n)return e.devices[l]&&(0,a.xn)(e.devices[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_device");if("entity"===n&&t[l]){const i=t[l],[s,a]=(0,o.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors);return s||a||l}if("entity"===n)return i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_entity");if("label"===n&&h){const e=h(l);return e?.name||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_label")}return l}},59653(e,t,i){i.d(t,{C:()=>r,x:()=>n});i(18111),i(22489),i(20116),i(7588),i(61701);var s=i(78648);const a={ignoreDiacritics:!0,isCaseSensitive:!1,threshold:.3,minMatchCharLength:2,ignoreLocation:!0};function o(e,t,i,o,r){return new s.A(e,{...a,minMatchCharLength:r??("string"==typeof t&&t.length<2?t.length:2),...o||{}},i).search(t)}function r(e,t,i,s,a={}){const r=t.toLowerCase().split(" ").filter(e=>e.trim());if(!r.length)return e;let n=2;r.forEach(e=>{e.length<n&&(n=e.length)});return o(e,{$and:r.map(e=>({$or:i.map(t=>({$path:"string"==typeof t?t:Array.isArray(t)?t.join("."):"string"==typeof t.name?t.name:t.name.join("."),$val:e}))}))},s,{...a,shouldSort:!1},n).map(e=>e.item)}function n(e,t,i,s,a,r={}){const n=t.toLowerCase().split(" ").filter(e=>e.trim());if(!n.length)return e;if(1===n.length)return o(e,n[0],a,r).map(e=>e.item);const l={};let h=0;if(n.forEach(t=>{if(!t.trim())return;const n=o(e,t,a,{...r,shouldSort:!1,includeScore:!0,includeMatches:!0});n.length&&(h++,n.forEach(e=>{const t=s(e.item);l[t]||(l[t]={item:e.item,hits:0,score:0}),l[t].hits+=1;const a=function(e,t){if(!e.matches||0===e.matches.length)return 1;let i=1;for(const s of e.matches){const e=t.find(e=>"string"==typeof e.name?e.name===s.key:e.name.join(".")===s.key);e&&e.weight&&e.weight>i&&(i=e.weight)}return i}(e,i),o=(e.score?1-e.score:0)*a;l[t].score+=o}))}),h!==n.length)return[];const c=Object.values(l).filter(({hits:e})=>e===n.length);return c.sort((e,t)=>t.score-e.score),c.map(({item:e})=>e)}},36918(e,t,i){i.d(t,{o:()=>s});const s=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},22348(e,t,i){i.d(t,{V:()=>a});var s=i(37177);const a=e=>!!e&&s.n},41570(e,t,i){i.d(t,{c:()=>s});const s=/Mac/i.test(navigator.userAgent)},37177(e,t,i){i.d(t,{n:()=>s});const s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};