iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
22 lines • 51.2 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[23554],{60353:function(t,e,a){a.d(e,{u:function(){return i}});class i{start(t){const e=Date.now();this._startY=t,this._startTime=e,this._lastY=t,this._lastTime=e,this._delta=0}move(t){const e=Date.now();return this._delta=this._startY-t,this._lastY=t,this._lastTime=e,this._delta}end(){const t=this.getVelocity(),e=Math.abs(t)>this._velocityThreshold;return{velocity:t,delta:this._delta,isSwipe:e,isDownwardSwipe:t>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const t=this._lastTime-this._startTime;return t>0?(this._lastY-this._startY)/t:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(t={}){var e,a;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(e=t.velocitySwipeThreshold)&&void 0!==e?e:.5,this._movementTimeThreshold=null!==(a=t.movementTimeThreshold)&&void 0!==a?a:100}}},64481:function(t,e,a){a.d(e,{D:function(){return o},J:function(){return r}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=t=>{i=t},s=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},r=t=>{if(!document.startViewTransition||i)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(s),a.finished.catch(s)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},14693:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{r:function(){return $}});a(62953);var o=a(40445),s=a(35211),r=a(5124),n=a(67576),l=a(71769),d=a(22792),h=a(99611),c=(a(76538),a(26300)),p=a(72554),u=t([h,c,p]);[h,c,p]=u.then?(await u)():u;let v,m,g,b,f,_,y,w,x,C,S,I=t=>t;const k="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",A="(max-width: 870px), (max-height: 500px)";class $ extends r.WF{connectedCallback(){super.connectedCallback(),this._unsubMediaQuery=(0,l.m)(A,t=>{this._modeSet&&!this.allowModeChange||(this.mode=t?"bottom-sheet":"dialog",this._modeSet=!0)})}get _defaultAriaLabelledBy(){return this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)}_renderCloseButton(t){var e,a,i;return this.hideCloseButton?(0,r.qy)(v||(v=I`<span slot="${0}"></span>`),t):(0,r.qy)(m||(m=I` <slot name="headerNavigationIcon" slot="${0}"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> `),t,null!==(e=null===(a=this._i18n)||void 0===a||null===(i=a.localize)||void 0===i?void 0:i.call(a,"ui.common.close"))&&void 0!==e?e:"Close",k)}_renderHeaderContent(){return(0,r.qy)(g||(g=I` <ha-dialog-header .subtitlePosition="${0}"> ${0} ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> `),this.headerSubtitlePosition,this._renderCloseButton("navigationIcon"),void 0!==this.headerTitle?(0,r.qy)(b||(b=I`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,r.qy)(f||(f=I`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,r.qy)(_||(_=I`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,r.qy)(y||(y=I`<slot name="headerSubtitle" slot="subtitle"></slot>`)))}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unsubMediaQuery)||void 0===t||t.call(this),this._unsubMediaQuery=void 0,this._modeSet=!1}render(){return"bottom-sheet"===this.mode?(0,r.qy)(w||(w=I` <ha-bottom-sheet .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .flexContent="${0}" .open="${0}" .preventScrimClose="${0}"> ${0} <slot></slot> <slot name="footer" slot="footer"></slot> </ha-bottom-sheet> `),this._defaultAriaLabelledBy,this.ariaDescribedBy,this.flexContent,this.open,this.preventScrimClose,this.withoutHeader?r.s6:(0,r.qy)(x||(x=I` <slot name="header" slot="header">${0}</slot> `),this._renderHeaderContent())):(0,r.qy)(C||(C=I` <ha-dialog .open="${0}" .type="${0}" .width="${0}" .preventScrimClose="${0}" .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .headerTitle="${0}" .headerSubtitle="${0}" .headerSubtitlePosition="${0}" .flexContent="${0}" .withoutHeader="${0}"> ${0} <slot name="headerTitle" slot="headerTitle"></slot> <slot name="headerSubtitle" slot="headerSubtitle"></slot> <slot name="headerActionItems" slot="headerActionItems"></slot> <slot></slot> <slot name="footer" slot="footer"></slot> </ha-dialog> `),this.open,this.type,this.width,this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this.headerTitle,this.headerSubtitle,this.headerSubtitlePosition,this.flexContent,this.withoutHeader,this._renderCloseButton("headerNavigationIcon"))}static get styles(){return[(0,r.AH)(S||(S=I`ha-bottom-sheet{--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-surface-background:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--ha-bottom-sheet-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);--ha-bottom-sheet-content-padding:var(
--dialog-content-padding,
0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6)
)}`))]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.allowModeChange=!1,this.withoutHeader=!1,this.hideCloseButton=!1,this.flexContent=!1,this.mode="dialog",this._modeSet=!1}}(0,o.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],$.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],$.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",void 0),(0,o.Cg)([(0,n.MZ)({reflect:!0})],$.prototype,"type",void 0),(0,o.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],$.prototype,"width",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],$.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"header-title"})],$.prototype,"headerTitle",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],$.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],$.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-mode-change"})],$.prototype,"allowModeChange",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],$.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"hide-close-button"})],$.prototype,"hideCloseButton",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],$.prototype,"flexContent",void 0),(0,o.Cg)([(0,n.wk)()],$.prototype,"mode",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:d.D5,subscribe:!0})],$.prototype,"_i18n",void 0),$=(0,o.Cg)([(0,n.EM)("ha-adaptive-dialog")],$),i()}catch(v){i(v)}})},99611:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(13579),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(40445),o=a(1126),s=a(35211),r=a(5124),n=a(67576),l=a(1087),d=a(60353),h=a(22792),c=a(59992),p=a(14503),u=a(22348),v=t([o,c]);[o,c]=v.then?(await v)():v;let m,g,b=t=>t;const f=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"]),y=new Set(["volume-slider-container","forecast"]);class w extends((0,c.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(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,r.qy)(m||(m=b` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <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> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${f}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},f)}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,(0,r.AH)(g||(g=b`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}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}`),f,f)]}constructor(...t){super(...t),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.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(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.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}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const a of e){if(a===this._drawer)break;if(a instanceof HTMLElement&&(a.scrollTop>0||_.has(a.localName)||Array.from(a.classList).some(t=>y.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,a=this._gestureRecognizer.move(e);a<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const a=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),i=(null==a?void 0:a.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,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,s.Fg)({context:h.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],w.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],w.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],w),e()}catch(m){e(m)}})},76538:function(t,e,a){a(62953);var i=a(40445),o=a(5124),s=a(67576);let r,n,l,d,h,c,p=t=>t;class u extends o.WF{render(){const t=(0,o.qy)(r||(r=p`<div class="header-title"> <slot name="title"></slot> </div>`)),e=(0,o.qy)(n||(n=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(d||(d=p`${0}${0}`),e,t):(0,o.qy)(h||(h=p`${0}${0}`),t,e))}static get styles(){return[(0,o.AH)(c||(c=p`: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(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,s.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,i.Cg)([(0,s.EM)("ha-dialog-header")],u)},72554:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),s=a(35211),r=a(5124),n=a(67576),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),v=a(22348),m=(a(76538),a(26300)),g=t([o,m,p]);[o,m,p]=g.then?(await g)():g;let b,f,_,y,w,x,C,S=t=>t;const I="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 k extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){var t,e,a;return(0,r.qy)(b||(b=S` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?r.s6:(0,r.qy)(f||(f=S`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(t=null===(e=this._i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.close"))&&void 0!==t?t:"Close",I,void 0!==this.headerTitle?(0,r.qy)(_||(_=S`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,r.qy)(y||(y=S`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,r.qy)(w||(w=S`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,r.qy)(x||(x=S`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(t){this._open?(0,h.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){var e;const a=(null===(e=t.detail)||void 0===e?void 0:e.source)===t.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,r.AH)(C||(C=S`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(...t){super(...t),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 t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t,e;if(null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,v.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}null===(e=this.querySelector("[autofocus]"))||void 0===e||e.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],k.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],k.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],k.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],k.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],k.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],k.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],k.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],k.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],k.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],k.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],k.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],k.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,s.Fg)({context:c.D5,subscribe:!0})],k.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,s.Fg)({context:c.WF,subscribe:!0})],k.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],k.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],k.prototype,"_handleBodyScroll",null),k=(0,i.Cg)([(0,n.EM)("ha-dialog")],k),e()}catch(b){e(b)}})},28170:function(t,e,a){a.d(e,{o:function(){return d}});a(62953);var i=a(40445),o=a(5124),s=a(67576),r=a(1087),n=a(83892);let l;class d extends n.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,r.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,r.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}d.styles=[n.x.styles,(0,o.AH)(l||(l=(t=>t)`:host{--ha-list-item-focus-radius:var(--ha-border-radius-sm);--ha-list-item-focus-width:2px;--ha-list-item-focus-width-start:var(--ha-space-2);--ha-list-item-focus-offset:-2px;--ha-list-item-focus-background:var(--ha-color-fill-neutral-quiet-hover)}:host(:focus){outline:0}.base{border-radius:var(--ha-list-item-focus-radius);outline:var(--ha-list-item-focus-width) solid transparent;outline-offset:var(--ha-list-item-focus-offset);transition:outline-color var(--ha-animation-duration-fast) ease-out,background-color var(--ha-animation-duration-fast) ease-out}@keyframes ha-list-item-focus-in{from{outline-width:var(--ha-list-item-focus-width-start);outline-offset:calc(-1 * var(--ha-list-item-focus-width-start))}to{outline-width:var(--ha-list-item-focus-width);outline-offset:var(--ha-list-item-focus-offset)}}:host(:focus-visible) .base{outline-color:var(--ha-color-focus);background-color:var(--ha-list-item-focus-background);animation:ha-list-item-focus-in var(--ha-animation-duration-normal) ease-in}`))],(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],d.prototype,"interactive",void 0),d=(0,i.Cg)([(0,s.EM)("ha-list-item-base")],d)},1671:function(t,e,a){a(62953);var i=a(40445),o=a(5124),s=a(67576),r=a(63672),n=(a(54276),a(28170));let l,d,h,c,p=t=>t;class u extends n.o{activate(){var t;null===(t=this._item)||void 0===t||t.click()}_renderBase(t){return void 0!==this.href?(0,o.qy)(l||(l=p`<a part="base" class="base interactive" id="item" href="${0}" target="${0}" rel="${0}" download="${0}" tabindex="-1" aria-disabled="${0}"> ${0}${0} </a>`),(0,r.J)(this.disabled?void 0:this.href),(0,r.J)(this.target),(0,r.J)(this.rel),(0,r.J)(this.download),this.disabled?"true":"false",this._renderRipple(),t):(0,o.qy)(d||(d=p`<button part="base" class="base interactive" id="item" type="button" ?disabled="${0}" tabindex="-1"> ${0}${0} </button>`),this.disabled,this._renderRipple(),t)}_renderRipple(){return(0,o.qy)(h||(h=p`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled)}constructor(...t){super(...t),this.interactive=!0}}u.styles=[n.o.styles,(0,o.AH)(c||(c=p`:host{cursor:pointer;--ha-ripple-color:var(--primary-text-color)}:host([disabled]){cursor:default}.base.interactive{width:100%;border:none;background:0 0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;appearance:none;cursor:inherit}:host([disabled]) .base.interactive{color:var(--disabled-text-color)}`))],(0,i.Cg)([(0,s.MZ)({type:String})],u.prototype,"href",void 0),(0,i.Cg)([(0,s.MZ)({type:String})],u.prototype,"target",void 0),(0,i.Cg)([(0,s.MZ)({type:String})],u.prototype,"rel",void 0),(0,i.Cg)([(0,s.MZ)({type:String})],u.prototype,"download",void 0),(0,i.Cg)([(0,s.P)("#item")],u.prototype,"_item",void 0),u=(0,i.Cg)([(0,s.EM)("ha-list-item-button")],u)},83892:function(t,e,a){a.d(e,{x:function(){return m}});a(18111),a(13579),a(27495),a(42762),a(62953);var i=a(40445),o=a(92070),s=a(5124),r=a(67576);let n,l,d,h,c,p,u,v=t=>t;class m extends s.WF{_onSlotChange(t){return e=>{const a=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,s.qy)(n||(n=v`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,s.qy)(l||(l=v` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,s.qy)(d||(d=v`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const a=this._slotController.test("headline"),i=this._slotController.test("supporting-text"),o=a||void 0!==this.headline,r=i||void 0!==this.supportingText;return(0,s.qy)(h||(h=v` ${0} ${0} `),o?(0,s.qy)(c||(c=v`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:s.s6):s.s6,r?(0,s.qy)(p||(p=v`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:s.s6):s.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new o.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}m.styles=(0,s.AH)(u||(u=v`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,i.Cg)([(0,r.MZ)({type:String})],m.prototype,"headline",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"supporting-text"})],m.prototype,"supportingText",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),(0,i.Cg)([(0,r.wk)()],m.prototype,"_hasStart",void 0),(0,i.Cg)([(0,r.wk)()],m.prototype,"_hasEnd",void 0),m=(0,i.Cg)([(0,r.EM)("ha-row-item")],m)},50723:function(t,e,a){a.d(e,{N:function(){return u}});a(74423),a(26910),a(18111),a(22489),a(7588),a(62953);var i=a(40445),o=a(5124),s=a(67576),r=a(91335);a(44114),a(94490);const n=t=>{const e=[];let a=t;for(;a;){e.push(a);const t=a.parentNode;if(t instanceof ShadowRoot)a=t.host;else if(t)a=t;else{const t=a.getRootNode();a=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const a=n(t),i=n(e);let o=0;for(;o<a.length&&o<i.length&&a[o]===i[o];)o++;return 0===o?0:o===a.length?-1:o===i.length?1:a[o].compareDocumentPosition(i[o])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var d=a(1087);let h,c,p=t=>t;class u extends o.WF{connectedCallback(){super.connectedCallback(),this.hasAttribute("ha-list")||this.setAttribute("ha-list",""),!this.hasAttribute("role")&&this.hostRole&&this.setAttribute("role",this.hostRole),this._unbindKeys=(0,r.Tc)(this,{ArrowDown:this._onForward,ArrowUp:this._onBack,Home:this._onHome,End:this._onEnd,Enter:this._onActivate,Space:this._onActivate}),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("ha-list-item-register",this._onItemRegister),this.addEventListener("ha-list-item-unregister",this._onItemUnregister)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unbindKeys)||void 0===t||t.call(this),this._unbindKeys=void 0,this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("ha-list-item-register",this._onItemRegister),this.removeEventListener("ha-list-item-unregister",this._onItemUnregister)}focus(t){this.items.length?this.focusItemAtIndex(this._activeItemIndex>=0?this._activeItemIndex:0):super.focus(t)}focusItemAtIndex(t){t<0||this.setActiveItemIndex(t,!0)}getActiveItemIndex(){return this._activeItemIndex}setActiveItemIndex(t,e=!1){this._hasFocusableItem?(this._activeItemIndex=Math.max(0,Math.min(this.items.length-1,t)),this._isFocusable(this._activeItemIndex)||(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(e)):this._activeItemIndex=-1}updateListItems(){this._recomputeFocusableIndexes(),(this._activeItemIndex>=this.items.length||!this._hasFocusableItem||this._activeItemIndex<0)&&(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(!1)}_recomputeFocusableIndexes(){let t=-1,e=-1;for(let a=0;a<this.items.length;a++)this._isFocusable(a)&&(-1===t&&(t=a),e=a);this._firstFocusableIndex=t,this._lastFocusableIndex=e,this._hasFocusableItem=-1!==t}render(){return(0,o.qy)(h||(h=p`<div part="base" class="base"> <slot></slot> </div>`))}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){var e;(this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0)&&(null===(e=this.items[this._activeItemIndex])||void 0===e||e.focus())}_moveFocus(t,e){!this._hasFocusableItem||e<0||e===this._activeItemIndex||(t.preventDefault(),this._activeItemIndex=e,this._applyActive(!0))}_stepIndex(t,e){const a=this.items.length;if(!a||!this._hasFocusableItem)return t;let i=t;for(let o=0;o<a;o++){if(i+=e,i<0||i>=a){if(!this.wrapFocus)return t;i=(i+a)%a}if(this._isFocusable(i))return i}return t}constructor(...t){super(...t),this.wrapFocus=!1,this.ariaLabel=null,this.items=[],this.hostRole="list",this._activeItemIndex=-1,this._firstFocusableIndex=-1,this._lastFocusableIndex=-1,this._hasFocusableItem=!1,this._onItemRegister=t=>{t.stopPropagation();const e=t.detail.item;if(this.items.includes(e))return;const a=[...this.items,e];a.sort(l),this.items=a,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let a=0;a<this.items.length;a++)if(e.includes(this.items[a]))return void(a!==this._activeItemIndex&&(this._activeItemIndex=a,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,d.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}u.styles=(0,o.AH)(c||(c=p`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`)),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-focus"})],u.prototype,"wrapFocus",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"aria-label",reflect:!0})],u.prototype,"ariaLabel",void 0),u=(0,i.Cg)([(0,s.EM)("ha-list-base")],u)},28180:function(t,e,a){a(89463),a(18111),a(61701),a(62953);var i=a(40445),o=a(5124),s=a(67576),r=a(1087),n=(a(47680),a(67094),a(1671),a(50723),a(93421));let l,d,h,c,p,u,v,m,g=t=>t;class b extends o.WF{render(){return this.sections.length?(0,o.qy)(l||(l=g`${0}`),this.sections.map((t,e)=>this._renderSection(t,e))):o.s6}_renderSection(t,e){return t.actions.length||t.empty||t.emptyKey?(0,o.qy)(d||(d=g` <h3 class="section-header"> ${0} </h3> ${0} `),this._localizeValue(t.title,t.titleKey),t.actions.length?(0,o.qy)(h||(h=g`<ha-list-base> ${0} </ha-list-base>`),t.actions.map((t,a)=>this._renderActionItem(t,e,a))):(0,o.qy)(c||(c=g`<h4 class="empty"> ${0} </h4>`),this._localizeValue(t.empty,t.emptyKey))):o.s6}_renderActionItem(t,e,a){return(0,o.qy)(p||(p=g` <ha-list-item-button .disabled="${0}" data-section-index="${0}" data-action-index="${0}" .headline="${0}" .supportingText="${0}" @click="${0}"> ${0} <ha-svg-icon class="plus" slot="end" .path="${0}"></ha-svg-icon> </ha-list-item-button> `),!1===t.enabled,e,a,this._localizeValue(t.name,t.nameKey),this._localizeValue(t.description,t.descriptionKey),this._actionSelected,t.icon?(0,o.qy)(u||(u=g`<ha-icon class="start-icon" slot="start" .icon="${0}"></ha-icon>`),t.icon):t.iconPath?(0,o.qy)(v||(v=g`<ha-svg-icon class="start-icon" slot="start" .path="${0}"></ha-svg-icon>`),t.iconPath):o.s6,"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z")}_localizeValue(t,e){return t||(e?this._localize(e):void 0)}_actionSelected(t){var e;const a=null===(e=this.sections[Number(t.currentTarget.dataset.sectionIndex)])||void 0===e?void 0:e.actions[Number(t.currentTarget.dataset.actionIndex)];a&&!1!==a.enabled&&(0,r.r)(this,"add-to-list-action-selected",{action:a})}constructor(...t){super(...t),this.sections=[]}}b.styles=(0,o.AH)(m||(m=g`:host{display:block}.section-header{padding:var(--ha-space-2) var(--ha-space-6) var(--ha-space-1);margin:0;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-medium);color:var(--secondary-text-color)}.empty{padding:var(--ha-space-2) var(--ha-space-6) var(--ha-space-1);margin:0;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);color:var(--secondary-text-color)}ha-list-item-button{--ha-row-item-padding-inline:var(--ha-space-5)}ha-icon,ha-svg-icon{display:flex;align-items:center}.start-icon{color:var(--ha-color-text-secondary)}.plus{color:var(--primary-color)}ha-list-item-button[disabled] .plus,ha-list-item-button[disabled] .start-icon{color:var(--disabled-text-color)}`)),(0,i.Cg)([(0,s.wk)(),(0,n.IW)()],b.prototype,"_localize",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"sections",void 0),b=(0,i.Cg)([(0,s.EM)("ha-add-to-action-list")],b)},59992:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{V:function(){return v}});a(62953);var o=a(40445),s=a(88696),r=a(5124),n=a(6412),l=a(67576),d=t([s]);s=(d.then?(await d)():d)[0];let h,c,p=t=>t;const u=t=>void 0===t?[]:Array.isArray(t)?t:[t],v=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,r.qy)(h||(h=p` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...u(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,r.AH)(c||(c=p`.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 t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=t;this._contentScrollable=a-i>o+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const a=t.currentTarget;this._contentScrolled=(null!==(e=a.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new s.P(this,{target:null,callback:t=>{var e;const a=null===(e=t[0])||void 0===e?void 0:e.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrollable",void 0),e};i()}catch(h){i(h)}})},80825:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(44114),a(62953);var o=a(40445),s=a(5124),r=a(35211),n=a(67576),l=a(65522),d=a(1087),h=a(14693),c=a(22792),p=a(34884),u=(a(28180),a(41250)),v=a(14503),m=t([h]);h=(m.then?(await m)():m)[0];let g,b,f,_=t=>t;const y="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",w="M12,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,2M10,16.5L16,12L10,7.5V16.5Z",x="M14 10H3V12H14V10M14 6H3V8H14V6M3 16H10V14H3V16M21.5 11.5L23 13L16 20L11.5 15.5L13 14L16 17L21.5 11.5Z",C="M17.5 15.5C17.5 16.61 16.61 17.5 15.5 17.5S13.5 16.61 13.5 15.5 14.4 13.5 15.5 13.5 17.5 14.4 17.5 15.5M8.5 13.5C7.4 13.5 6.5 14.4 6.5 15.5S7.4 17.5 8.5 17.5 10.5 16.61 10.5 15.5 9.61 13.5 8.5 13.5M23 15V18C23 18.55 22.55 19 22 19H21V20C21 21.11 20.11 22 19 22H5C3.9 22 3 21.11 3 20V19H2C1.45 19 1 18.55 1 18V15C1 14.45 1.45 14 2 14H3C3 10.13 6.13 7 10 7H11V5.73C10.4 5.39 10 4.74 10 4C10 2.9 10.9 2 12 2S14 2.9 14 4C14 4.74 13.6 5.39 13 5.73V7H14C17.87 7 21 10.13 21 14H22C22.55 14 23 14.45 23 15M21 16H19V14C19 11.24 16.76 9 14 9H10C7.24 9 5 11.24 5 14V16H3V17H5V20H19V17H21V16Z",S="M15,20A1,1 0 0,0 16,19V4H8A1,1 0 0,0 7,5V16H5V5A3,3 0 0,1 8,2H19A3,3 0 0,1 22,5V6H20V5A1,1 0 0,0 19,4A1,1 0 0,0 18,5V9L18,19A3,3 0 0,1 15,22H5A3,3 0 0,1 2,19V18H13A2,2 0 0,0 15,20M9,6H14V8H9V6M9,10H14V12H9V10M9,14H14V16H9V14Z";class I extends s.WF{showDialog(t){this._params=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,(0,d.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params?(0,s.qy)(g||(g=_` <ha-adaptive-dialog .open="${0}" header-title="${0}" @closed="${0}"> ${0} </ha-adaptive-dialog> `),this._open,this._i18n.localize("ui.dialogs.more_info_control.add_to.title",{target:(0,l.A)(this._areas[this._params.areaId])||this._params.areaId}),this._dialogClosed,this._renderOptions()):s.s6}_renderOptions(){if(!this._params)return s.s6;const t=[{title:this._i18n.localize("ui.panel.config.devices.automation.automations_heading"),actions:[{type:"automation",key:"automation_trigger",iconPath:C,name:this._i18n.localize("ui.dialogs.more_info_control.add_to.action_options.automation_trigger")},{type:"automation",key:"automation_condition",iconPath:x,name:this._i18n.localize("ui.dialogs.more_info_control.add_to.action_options.automation_condition")},{type:"automation",key:"automation_action",iconPath:w,name:this._i18n.localize("ui.dialogs.more_info_control.add_to.action_options.automation_action")}]},{title:this._i18n.localize("ui.panel.config.devices.script.scripts_heading"),actions:[{type:"automation",key:"script_action",iconPath:S,name:this._i18n.localize("ui.dialogs.more_info_control.add_to.action_options.script_action")}]}];return this._params.canCreateScene&&this._params.entityIds.length&&t.push({title:this._i18n.localize("ui.panel.config.devices.scene.scenes_heading"),actions:[{type:"scene",iconPath:y,name:this._i18n.localize("ui.dialogs.more_info_control.add_to.action_options.scene")}]}),(0,s.qy)(b||(b=_` <ha-add-to-action-list .sections="${0}" @add-to-list-action-selected="${0}"></ha-add-to-action-list> `),t,this._handleActionSelected)}_handleActionSelected(t){if(!this._params)return;const{action:e}=t.detail;"scene"!==e.type?(this.closeDialog(),(0,u.B8)(e.key,{area_id:this._params.areaId})):this._handleCreateScene()}_handleCreateScene(){this._params&&(this.closeDialog(),(0,p.Tx)({entities:(0,u.S6)(this._params.entityIds)},this._params.areaId))}static get styles(){return[v.RF,v.nA,(0,s.AH)(f||(f=_`ha-adaptive-dialog{--dialog-content-padding:0}`))]}constructor(...t){super(...t),this._open=!1}}(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],I.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.wn,subscribe:!0})],I.prototype,"_areas",void 0),(0,o.Cg)([(0,n.wk)()],I.prototype,"_params",void 0),(0,o.Cg)([(0,n.wk)()],I.prototype,"_open",void 0),I=(0,o.Cg)([(0,n.EM)("dialog-area-add-to")],I),i()}catch(g){i(g)}})},22348:function(t,e,a){a.d(e,{V:function(){return o}});var i=a(37177);const o=t=>!!t&&i.n},37177:function(t,e,a){a.d(e,{n:function(){return i}});a(27495);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);