UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 53 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["45881"],{95262:function(e,t,i){"use strict";function a(e){return null==e||Array.isArray(e)?e:[e]}i.d(t,{r:()=>a})},19631:function(e,t,i){"use strict";i.a(e,(async function(e,a){try{i.d(t,{Bt:()=>r,T8:()=>c});i(19083);var n=i(16485),o=i(88977),s=i(20382),d=e([n]);n=(d.then?(await d)():d)[0];const l=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r=e=>e.first_weekday===s.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,o.L)(e.language)%7:l.includes(e.first_weekday)?l.indexOf(e.first_weekday):1,c=e=>{const t=r(e);return l[t]};a()}catch(l){a(l)}}))},93826:function(e,t,i){"use strict";i.d(t,{P:()=>a});i(71695),i(47021);const a=(e,t,i=!0,a=!0)=>{let n,o=0;const s=(...s)=>{const d=()=>{o=!1===i?0:Date.now(),n=void 0,e(...s)},l=Date.now();o||!1!==i||(o=l);const r=t-(l-o);r<=0||r>t?(n&&(clearTimeout(n),n=void 0),o=l,e(...s)):n||!1===a||(n=window.setTimeout(d,r))};return s.cancel=()=>{clearTimeout(n),n=void 0,o=0},s}},34273:function(e,t,i){"use strict";var a=i(61701),n=i(72621),o=(i(71695),i(9359),i(31526),i(47021),i(22997),i(57243)),s=i(50778),d=i(5111),l=i(76525);let r,c,h=e=>e;(0,a.Z)([(0,s.Mo)("ha-button-menu")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:l.gA,value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"corner",value(){return"BOTTOM_START"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"menu-corner"})],key:"menuCorner",value(){return"START"}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"x",value(){return null}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"y",value(){return null}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"multi",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"activatable",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"fixed",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value(){return!1}},{kind:"field",decorators:[(0,s.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"focus",value:function(){var e,t;null!==(e=this._menu)&&void 0!==e&&e.open?this._menu.focusItemAtIndex(0):null===(t=this._triggerButton)||void 0===t||t.focus()}},{kind:"method",key:"render",value:function(){return(0,o.dy)(r||(r=h` <div @click="${0}"> <slot name="trigger" @slotchange="${0}"></slot> </div> <mwc-menu .corner="${0}" .menuCorner="${0}" .fixed="${0}" .multi="${0}" .activatable="${0}" .y="${0}" .x="${0}"> <slot></slot> </mwc-menu> `),this._handleClick,this._setTriggerAria,this.corner,this.menuCorner,this.fixed,this.multi,this.activatable,this.y,this.x)}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),"rtl"===d.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(c||(c=h`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),o.oi)},23334:function(e,t,i){"use strict";i.r(t),i.d(t,{HaIconButton:()=>u});var a=i(61701),n=(i(71695),i(47021),i(74269),i(57243)),o=i(50778),s=i(20552);i(37583);let d,l,r,c,h=e=>e,u=(0,a.Z)([(0,o.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value(){return!1}},{kind:"field",decorators:[(0,o.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){var e;null===(e=this._button)||void 0===e||e.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value(){return{mode:"open",delegatesFocus:!0}}},{kind:"method",key:"render",value:function(){return(0,n.dy)(d||(d=h` <mwc-icon-button aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}"> ${0} </mwc-icon-button> `),(0,s.o)(this.label),(0,s.o)(this.hideTitle?void 0:this.label),(0,s.o)(this.ariaHasPopup),this.disabled,this.path?(0,n.dy)(l||(l=h`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.path):(0,n.dy)(r||(r=h`<slot></slot>`)))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(c||(c=h`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`))}}]}}),n.oi)},7285:function(e,t,i){"use strict";i.d(t,{M:()=>v});var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(65703)),s=i(46289),d=i(57243),l=i(50778);let r,c,h,u=e=>e,v=(0,a.Z)([(0,l.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,(0,d.iv)(r||(r=u`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,d.iv)(c||(c=u`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,d.iv)(h||(h=u``))]}}]}}),o.K)},43344:function(e,t,i){"use strict";var a=i(61701),n=i(72621),o=(i(52247),i(71695),i(47021),i(57243)),s=i(50778),d=i(36522),l=i(83716);i(23334);let r,c,h,u=e=>e;(0,a.Z)([(0,s.Mo)("ha-menu-button")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"hassio",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_hasNotifications",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_show",value(){return!1}},{kind:"field",key:"_alwaysVisible",value(){return!1}},{kind:"field",key:"_attachNotifOnConnect",value(){return!1}},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return o.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,o.dy)(r||(r=u` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",this._toggleMenu,e?(0,o.dy)(c||(c=u`<div class="dot"></div>`)):"")}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===(null==t?void 0:t.dockedSidebar),o=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,l.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,d.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(h||(h=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`))}}]}}),o.oi)},37583:function(e,t,i){"use strict";i.r(t),i.d(t,{HaSvgIcon:()=>h});var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778);let s,d,l,r,c=e=>e,h=(0,a.Z)([(0,o.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.YP)(s||(s=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,n.YP)(d||(d=c`<path class="primary-path" d="${0}"></path>`),this.path):n.Ld,this.secondaryPath?(0,n.YP)(l||(l=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):n.Ld)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`))}}]}}),n.oi)},48977:function(e,t,i){"use strict";function a(e){return"strategy"in e}i.d(t,{Oh:()=>o,Q2:()=>n,Tx:()=>a,vj:()=>s});const n=(e,t,i)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:i}),o=(e,t,i)=>e.callWS({type:"lovelace/config/save",url_path:t,config:i}),s=(e,t)=>e.callWS({type:"lovelace/config/delete",url_path:t})},83716:function(e,t,i){"use strict";i.d(t,{r:()=>a});i(71695),i(19423),i(47021);const a=(e,t)=>{const i=new n,a=e.subscribeMessage((e=>t(i.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{a.then((e=>null==e?void 0:e()))}};class n{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications=Object.assign(Object.assign({},this.notifications),e.notifications);return Object.values(this.notifications)}}},69040:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(22152),i(52247),i(71695),i(9359),i(31526),i(47021),i(57243)),s=i(50778),d=i(36522),l=(i(37583),i(94264)),r=i(27934),c=i(40249),h=e([r]);r=(h.then?(await h)():h)[0];(0,a.Z)([(0,s.Mo)("hui-badge")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"preview",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"_elementConfig",value:void 0},{kind:"method",key:"load",value:function(){if(!this.config)throw new Error("Cannot build badge without config");this._loadElement(this.config)}},{kind:"field",key:"_element",value:void 0},{kind:"field",key:"_listeners",value(){return[]}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearMediaQueries()}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._listenMediaQueries(),this._updateVisibility()}},{kind:"method",key:"_updateElement",value:function(e){this._element&&(this._element.setConfig(e),this._elementConfig=e,(0,d.B)(this,"badge-updated"))}},{kind:"method",key:"_loadElement",value:function(e){for(this._element=(0,r.JE)(e),this._elementConfig=e,this.hass&&(this._element.hass=this.hass),this._element.addEventListener("ll-upgrade",(e=>{e.stopPropagation(),this.hass&&(this._element.hass=this.hass),(0,d.B)(this,"badge-updated")}),{once:!0}),this._element.addEventListener("ll-rebuild",(t=>{t.stopPropagation(),this._loadElement(e),(0,d.B)(this,"badge-updated")}),{once:!0});this.lastChild;)this.removeChild(this.lastChild);this._updateVisibility()}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),this._element||this.load()}},{kind:"method",key:"update",value:function(e){if((0,n.Z)(i,"update",this,3)([e]),this._element){if(e.has("config")){const e=this._elementConfig;if(this.config!==e&&this.config){var t;(null===(t=this.config)||void 0===t?void 0:t.type)!==(null==e?void 0:e.type)?this._loadElement(this.config):this._updateElement(this.config)}}if(e.has("hass"))try{this.hass&&(this._element.hass=this.hass)}catch(a){this._loadElement((0,c.Fr)(a.message,null))}}(e.has("hass")||e.has("preview"))&&this._updateVisibility()}},{kind:"method",key:"_clearMediaQueries",value:function(){this._listeners.forEach((e=>e())),this._listeners=[]}},{kind:"method",key:"_listenMediaQueries",value:function(){var e;if(this._clearMediaQueries(),null===(e=this.config)||void 0===e||!e.visibility)return;const t=this.config.visibility,i=1===t.length&&"screen"===t[0].condition&&!!t[0].media_query;this._listeners=(0,l.av)(this.config.visibility,(e=>{this._updateVisibility(i&&e)}))}},{kind:"method",key:"_updateVisibility",value:function(e){var t;if(!this._element||!this.hass)return;if(this._element.hidden)return void this._setElementVisibility(!1);const i=e||this.preview||!(null!==(t=this.config)&&void 0!==t&&t.visibility)||(0,l.Ec)(this.config.visibility,this.hass);this._setElementVisibility(i)}},{kind:"method",key:"_setElementVisibility",value:function(e){this._element&&(this.hidden!==!e&&(this.style.setProperty("display",e?"":"none"),this.toggleAttribute("hidden",!e),(0,d.B)(this,"badge-visibility-changed",{value:e})),!e&&this._element.parentElement?this.removeChild(this._element):e&&!this._element.parentElement&&this.appendChild(this._element))}}]}}),o.fl);t()}catch(u){t(u)}}))},52293:function(e,t,i){"use strict";var a=i(61701),n=i(72621),o=(i(22152),i(71695),i(9359),i(68107),i(11740),i(46692),i(47021),i(57243)),s=i(50778),d=i(35359),l=i(91583),r=i(36522),c=(i(30043),i(62801),i(37583),i(60074),i(27353));let h,u,v,p,f,m,y=e=>e;const g={delay:100,delayOnTouchOnly:!0,direction:"horizontal",invertedSwapThreshold:.7};(0,a.Z)([(0,s.Mo)("hui-view-badges")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"badges",value(){return[]}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"viewIndex",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"show-add-label"})],key:"showAddLabel",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_dragging",value(){return!1}},{kind:"field",key:"_badgeConfigKeys",value(){return new WeakMap}},{kind:"method",key:"_checkAllHidden",value:function(){const e=!this.lovelace.editMode&&this.badges.every((e=>e.hidden));this.toggleAttribute("hidden",e)}},{kind:"field",key:"_badgeVisibilityChanged",value(){return()=>{this._checkAllHidden()}}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.addEventListener("badge-visibility-changed",this._badgeVisibilityChanged)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.removeEventListener("badge-visibility-changed",this._badgeVisibilityChanged)}},{kind:"method",key:"willUpdate",value:function(e){(e.has("badges")||e.has("lovelace"))&&this._checkAllHidden()}},{kind:"method",key:"_getBadgeKey",value:function(e){return this._badgeConfigKeys.has(e)||this._badgeConfigKeys.set(e,Math.random().toString()),this._badgeConfigKeys.get(e)}},{kind:"method",key:"_badgeMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,a=(0,c.BM)(this.lovelace.config,[this.viewIndex,t],[this.viewIndex,i]);this.lovelace.saveConfig(a)}},{kind:"method",key:"_badgeAdded",value:function(e){e.stopPropagation();const{index:t,data:i}=e.detail,a=i,n=[this.viewIndex,t],o=(0,c.BM)(this.lovelace.config,a,n);this.lovelace.saveConfig(o)}},{kind:"method",key:"_badgeRemoved",value:function(e){e.stopPropagation()}},{kind:"method",key:"_dragStart",value:function(){this._dragging=!0}},{kind:"method",key:"_dragEnd",value:function(){this._dragging=!1}},{kind:"method",key:"_addBadge",value:function(){(0,r.B)(this,"ll-create-badge")}},{kind:"method",key:"render",value:function(){if(!this.lovelace)return o.Ld;const e=this.lovelace.editMode,t=this.badges;return(0,o.dy)(h||(h=y` ${0} `),(null==t?void 0:t.length)>0||e?(0,o.dy)(u||(u=y` <ha-sortable .disabled="${0}" @item-moved="${0}" @item-added="${0}" @item-removed="${0}" @drag-start="${0}" @drag-end="${0}" group="badge" draggable-selector="[data-sortable]" .rollback="${0}" .options="${0}" invert-swap> <div class="badges ${0}"> ${0} ${0} </div> </ha-sortable> `),!e,this._badgeMoved,this._badgeAdded,this._badgeRemoved,this._dragStart,this._dragEnd,!1,g,(0,d.$)({"edit-mode":e}),(0,l.r)(t,(e=>this._getBadgeKey(e)),((t,i)=>{const a=[this.viewIndex,i];return(0,o.dy)(v||(v=y` ${0} `),e?(0,o.dy)(p||(p=y` <hui-badge-edit-mode data-sortable .hass="${0}" .lovelace="${0}" .path="${0}" .hiddenOverlay="${0}" .sortableData="${0}"> ${0} </hui-badge-edit-mode> `),this.hass,this.lovelace,a,this._dragging,a,t):t)})),e?(0,o.dy)(f||(f=y` <button class="add" @click="${0}" aria-label="${0}" .title="${0}"> <ha-ripple></ha-ripple> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </button> `),this._addBadge,this.hass.localize("ui.panel.lovelace.editor.section.add_badge"),this.hass.localize("ui.panel.lovelace.editor.section.add_badge"),"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",this.showAddLabel?this.hass.localize("ui.panel.lovelace.editor.section.add_badge"):o.Ld):o.Ld):o.Ld)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(m||(m=y`:host([hidden]){display:none!important}.badges{display:flex;align-items:flex-start;flex-wrap:var(--badges-wrap,wrap);justify-content:var(--badges-aligmnent,center);gap:8px;margin:0}hui-badge-edit-mode{display:block;position:relative;min-width:36px;min-height:36px}.add{position:relative;display:flex;flex-direction:row;align-items:center;outline:0;gap:8px;height:36px;padding:6px 20px 6px 20px;box-sizing:border-box;width:auto;border-radius:18px;background-color:transparent;border-width:2px;border-style:dashed;border-color:var(--primary-color);--mdc-icon-size:18px;cursor:pointer;font-size:14px;color:var(--primary-text-color);--ha-ripple-color:var(--primary-color);--ha-ripple-hover-opacity:0.04;--ha-ripple-pressed-opacity:0.12}.add:focus{border-style:solid}`))}}]}}),o.oi)},60074:function(e,t,i){"use strict";var a=i(61701),n=i(72621),o=(i(19083),i(71695),i(61006),i(47021),i(12582)),s=i(57243),d=i(50778),l=i(35359),r=i(68958),c=i(36522),h=(i(34273),i(23334),i(7285),i(37583),i(6671)),u=i(28008),v=i(71152),p=i(2593);let f,m,y=e=>e;const g="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";(0,a.Z)([(0,d.Mo)("hui-badge-edit-mode")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"path",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"hidden-overlay",type:Boolean})],key:"hiddenOverlay",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_menuOpened",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_hover",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_focused",value(){return!1}},{kind:"field",decorators:[(0,r.t)({key:"dashboardBadgeClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"get",key:"_badges",value:function(){const e=(0,p.Kx)(this.path);return(0,p.Cs)("badges",this.lovelace.config,e)}},{kind:"field",key:"_touchStarted",value(){return!1}},{kind:"method",key:"firstUpdated",value:function(){this.addEventListener("focus",(()=>{this._focused=!0})),this.addEventListener("blur",(()=>{this._focused=!1})),this.addEventListener("touchstart",(()=>{this._touchStarted=!0})),this.addEventListener("touchend",(()=>{setTimeout((()=>{this._touchStarted=!1}),10)})),this.addEventListener("mouseenter",(()=>{this._touchStarted||(this._hover=!0)})),this.addEventListener("mouseout",(()=>{this._hover=!1})),this.addEventListener("click",(()=>{this._hover=!0,document.addEventListener("click",this._documentClicked)}))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),document.removeEventListener("click",this._documentClicked)}},{kind:"field",key:"_documentClicked",value(){return e=>{this._hover=e.composedPath().includes(this),document.removeEventListener("click",this._documentClicked)}}},{kind:"method",key:"render",value:function(){const e=(this._hover||this._menuOpened||this._focused)&&!this.hiddenOverlay;return(0,s.dy)(f||(f=y` <div class="badge-wrapper" inert><slot></slot></div> <div class="badge-overlay ${0}"> <div class="edit" @click="${0}" @keydown="${0}" tabindex="0"> <div class="edit-overlay"></div> <ha-svg-icon class="edit" .path="${0}"> </ha-svg-icon> </div> <ha-button-menu class="more" corner="BOTTOM_END" menu-corner="END" .path="${0}" @action="${0}" @opened="${0}" @closed="${0}"> <ha-icon-button slot="trigger" .path="${0}"> </ha-icon-button> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} </ha-list-item> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} </ha-list-item> <li divider role="separator"></li> <ha-list-item graphic="icon" class="warning"> ${0} <ha-svg-icon class="warning" slot="graphic" .path="${0}"></ha-svg-icon> </ha-list-item> </ha-button-menu> </div> `),(0,l.$)({visible:e}),this._handleOverlayClick,this._handleOverlayClick,g,[this.path],this._handleAction,this._handleOpened,this._handleClosed,"M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",g,this.hass.localize("ui.panel.lovelace.editor.edit_card.edit"),"M16,8H14V11H11V13H14V16H16V13H19V11H16M2,12C2,9.21 3.64,6.8 6,5.68V3.5C2.5,4.76 0,8.09 0,12C0,15.91 2.5,19.24 6,20.5V18.32C3.64,17.2 2,14.79 2,12M15,3C10.04,3 6,7.04 6,12C6,16.96 10.04,21 15,21C19.96,21 24,16.96 24,12C24,7.04 19.96,3 15,3M15,19C11.14,19 8,15.86 8,12C8,8.14 11.14,5 15,5C18.86,5 22,8.14 22,12C22,15.86 18.86,19 15,19Z",this.hass.localize("ui.panel.lovelace.editor.edit_card.duplicate"),"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",this.hass.localize("ui.panel.lovelace.editor.edit_card.copy"),"M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",this.hass.localize("ui.panel.lovelace.editor.edit_card.cut"),this.hass.localize("ui.panel.lovelace.editor.edit_card.delete"),"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z")}},{kind:"method",key:"_handleOpened",value:function(){this._menuOpened=!0}},{kind:"method",key:"_handleClosed",value:function(){this._menuOpened=!1}},{kind:"method",key:"_handleOverlayClick",value:function(e){e.defaultPrevented||"keydown"===e.type&&"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),this._editBadge())}},{kind:"method",key:"_handleAction",value:function(e){switch(e.detail.index){case 0:this._editBadge();break;case 1:this._duplicateBadge();break;case 2:this._copyBadge();break;case 3:this._cutBadge();break;case 4:this._deleteBadge()}}},{kind:"method",key:"_cutBadge",value:function(){this._copyBadge(),(0,c.B)(this,"ll-delete-badge",{path:this.path,silent:!0})}},{kind:"method",key:"_copyBadge",value:function(){const{cardIndex:e}=(0,p.lJ)(this.path),t=this._badges[e];this._clipboard=(0,o.Z)(t)}},{kind:"method",key:"_duplicateBadge",value:function(){const{cardIndex:e}=(0,p.lJ)(this.path),t=(0,p.Kx)(this.path),i=(0,h.d)(this._badges[e]);(0,v.e)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:t,badgeConfig:i})}},{kind:"method",key:"_editBadge",value:function(){(0,c.B)(this,"ll-edit-badge",{path:this.path})}},{kind:"method",key:"_deleteBadge",value:function(){(0,c.B)(this,"ll-delete-badge",{path:this.path,silent:!1})}},{kind:"get",static:!0,key:"styles",value:function(){return[u.Qx,(0,s.iv)(m||(m=y`.badge-overlay{position:absolute;opacity:0;pointer-events:none;inset:0;display:flex;align-items:center;justify-content:center;transition:opacity 180ms ease-in-out}.badge-overlay.visible{opacity:1;pointer-events:auto}.badge-wrapper{position:relative;height:100%;z-index:0}.edit{outline:0!important;cursor:pointer;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:var(--ha-card-border-radius,12px);z-index:0}.edit-overlay{position:absolute;inset:0;opacity:.8;background-color:var(--primary-background-color);border-radius:var(--ha-card-border-radius,12px);z-index:0}.edit ha-svg-icon{display:flex;position:relative;color:var(--primary-text-color);border-radius:50%;padding:4px;background:var(--secondary-background-color);--mdc-icon-size:16px}.more{position:absolute;right:-8px;top:-8px;inset-inline-end:-10px;inset-inline-start:initial}.more ha-icon-button{cursor:pointer;border-radius:50%;background:var(--secondary-background-color);--mdc-icon-button-size:24px;--mdc-icon-size:16px}`))]}}]}}),s.oi)},3701:function(e,t,i){"use strict";i.a(e,(async function(e,a){try{i.d(t,{o:()=>r});i(71695),i(40251),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);var n=i(97728),o=i(40249),s=e([n]);n=(s.then?(await s)():s)[0];const d=new Set(["masonry"]),l={panel:()=>i.e("91773").then(i.bind(i,27447)),sidebar:()=>i.e("24065").then(i.bind(i,64331)),sections:()=>i.e("41640").then(i.bind(i,47905))},r=e=>(0,o.Tw)("view",e,d,l);a()}catch(d){a(d)}}))},66684:function(e,t,i){"use strict";i.d(t,{z:()=>o});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("46379"),i.e("97983"),i.e("15722"),i.e("82600"),i.e("80764"),i.e("58529"),i.e("52876"),i.e("10216")]).then(i.bind(i,78254)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-create-badge",dialogImport:n,dialogParams:t})}},71152:function(e,t,i){"use strict";i.d(t,{e:()=>o});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("97983"),i.e("15722"),i.e("67991")]).then(i.bind(i,71586)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-edit-badge",dialogImport:n,dialogParams:t})}},31366:function(e,t,i){"use strict";i.d(t,{V:()=>n});i(40251);var a=i(27353);async function n(e,t,i){try{const{path:n,silent:o}=i,s=t.config,d=(0,a.vs)(s,n);if(await t.saveConfig(d),o)return;const l=async()=>{t.saveConfig(s)};t.showToast({message:e.localize("ui.common.successfully_deleted"),duration:8e3,action:{action:l,text:e.localize("ui.common.undo")}})}catch(n){console.error(n),t.showToast({message:e.localize("ui.common.deleting_failed")})}}},29362:function(e,t,i){"use strict";i.d(t,{j9:()=>l});var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778);i(33101),i(37583);let s,d=e=>e;const l=e=>({type:"error",error:e});(0,a.Z)([(0,o.Mo)("hui-error-section")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"isStrategy",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"method",key:"render",value:function(){return this._config?(0,n.dy)(s||(s=d` <h1>Error</h1> <p>${0}</p> `),this._config.error):n.Ld}}]}}),n.oi)},82747:function(e,t,i){"use strict";i.d(t,{Jh:()=>n,e4:()=>a,rQ:()=>o,zh:()=>s});const a="masonry",n="panel",o="sidebar",s="sections"},18461:function(e,t,i){"use strict";i.d(t,{W:()=>n});var a=i(82747);const n=e=>null!=e&&e.type?e.type:null!=e&&e.panel?a.Jh:null!=e&&e.sections?a.zh:null!=e&&e.cards?a.e4:a.zh},97728:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(71695),i(92745),i(52805),i(9359),i(31526),i(48136),i(40251),i(47021),i(57243)),s=i(50778),d=i(36522),l=i(76320),r=i(78555),c=(i(37583),i(52293),i(81833)),h=e([r]);r=(h.then?(await h)():h)[0];let u,v,p,f=e=>e;const m="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",y=(e,t)=>{let i=0;for(let a=0;a<e.length;a++){if(e[a]<5){i=a;break}e[a]<e[i]&&(i=a)}return e[i]+=t,i};let g=(0,a.Z)(null,(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"isStrategy",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"cards",value(){return[]}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"badges",value(){return[]}},{kind:"field",decorators:[(0,s.SB)()],key:"_columns",value:void 0},{kind:"field",key:"_createColumnsIteration",value(){return 0}},{kind:"field",key:"_mqls",value:void 0},{kind:"field",key:"_mqlListenerRef",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(a,"connectedCallback",this,3)([]),this._initMqls()}},{kind:"method",key:"disconnectedCallback",value:function(){var e;(0,n.Z)(a,"disconnectedCallback",this,3)([]),null===(e=this._mqls)||void 0===e||e.forEach((e=>{e.removeListener(this._mqlListenerRef)})),this._mqlListenerRef=void 0,this._mqls=void 0}},{kind:"method",key:"setConfig",value:function(e){}},{kind:"method",key:"render",value:function(){var e,t;return(0,o.dy)(u||(u=f` <hui-view-badges .hass="${0}" .badges="${0}" .lovelace="${0}" .viewIndex="${0}" show-add-label></hui-view-badges> <div id="columns" class="${0}"></div> ${0} `),this.hass,this.badges,this.lovelace,this.index,null!==(e=this.lovelace)&&void 0!==e&&e.editMode?"edit-mode":"",null!==(t=this.lovelace)&&void 0!==t&&t.editMode?(0,o.dy)(v||(v=f` <ha-fab .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> `),this.hass.localize("ui.panel.lovelace.editor.edit_card.add"),this._addCard,m):"")}},{kind:"method",key:"_initMqls",value:function(){this._mqls=[300,600,900,1200].map((e=>{const t=window.matchMedia(`(min-width: ${e}px)`);return this._mqlListenerRef||(this._mqlListenerRef=this._updateColumns.bind(this)),t.addListener(this._mqlListenerRef),t}))}},{kind:"get",key:"mqls",value:function(){return this._mqls||this._initMqls(),this._mqls}},{kind:"method",key:"willUpdate",value:function(e){var t;if((0,n.Z)(a,"willUpdate",this,3)([e]),null!==(t=this.lovelace)&&void 0!==t&&t.editMode&&Promise.all([i.e("41103"),i.e("39341")]).then(i.bind(i,14370)),e.has("hass")){const t=e.get("hass");if(this.hass.dockedSidebar!==(null==t?void 0:t.dockedSidebar))return void this._updateColumns()}if(e.has("narrow"))return void this._updateColumns();const o=e.get("lovelace");(e.has("cards")||e.has("lovelace")&&o&&(o.config!==this.lovelace.config||o.editMode!==this.lovelace.editMode))&&this._createColumns()}},{kind:"method",key:"_addCard",value:function(){(0,d.B)(this,"ll-create-card")}},{kind:"method",key:"_createRootElement",value:function(e){const t=this.shadowRoot.getElementById("columns");for(;t.lastChild;)t.removeChild(t.lastChild);e.forEach((e=>t.appendChild(e)))}},{kind:"method",key:"_createColumns",value:async function(){if(!this._columns)return;this._createColumnsIteration++;const e=this._createColumnsIteration,t=[],i=[];for(let o=0;o<Math.min(this._columns,this.cards.length);o++){const e=document.createElement("div");e.classList.add("column"),t.push(0),i.push(e)}let a,n;this.hasUpdated?this._createRootElement(i):this.updateComplete.then((()=>{this._createRootElement(i)}));for(const[o,s]of this.cards.entries()){let d;void 0===a&&(a=(0,l.y)().then((()=>{a=void 0,n=void 0}))),void 0===n?n=new Date:(new Date).getTime()-n.getTime()>16&&(d=a);const r=(0,c.N)(s),[h]=await Promise.all([r,d]);if(e!==this._createColumnsIteration)return;this._addCardToColumn(i[y(t,h)],o,this.lovelace.editMode)}i.forEach((e=>{e.lastChild||e.parentElement.removeChild(e)}))}},{kind:"method",key:"_addCardToColumn",value:function(e,t,i){const a=this.cards[t];if(!i||this.isStrategy)a.preview=!1,e.appendChild(a);else{const i=document.createElement("hui-card-options");i.hass=this.hass,i.lovelace=this.lovelace,i.path=[this.index,t],a.preview=!0,i.appendChild(a),e.appendChild(i)}}},{kind:"method",key:"_updateColumns",value:function(){const e=this.mqls.reduce(((e,t)=>e+Number(t.matches)),0),t=Math.max(1,e-Number(!this.narrow&&"docked"===this.hass.dockedSidebar));t!==this._columns&&(this._columns=t,this._createColumns())}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(p||(p=f`:host{display:block;padding-top:4px}hui-view-badges{display:block;margin:4px 8px 4px 8px;font-size:85%}#columns{display:flex;flex-direction:row;justify-content:center;margin-left:4px;margin-right:4px}#columns.edit-mode{margin-bottom:72px}.column{flex:1 0 0;max-width:500px;min-width:0}.column:has(> *){flex-grow:1}.column:not(:has(> :not([hidden]))){flex-grow:0}.column>:not([hidden]){display:block;margin:var(--masonry-view-card-margin,4px 4px 8px)}ha-fab{position:fixed;right:calc(16px + env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;z-index:1}@media (max-width:500px){.column>*{margin-left:0;margin-right:0}}@media (max-width:599px){.column{max-width:600px}}`))}}]}}),o.oi);customElements.define("hui-masonry-view",g),t()}catch(u){t(u)}}))},33679:function(e,t,i){"use strict";var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(57243)),s=i(50778),d=i(82393),l=i(62201);let r,c,h=e=>e;(0,a.Z)([(0,s.Mo)("hui-view-container")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"background",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"theme",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"themeBackground",value:void 0},{kind:"field",key:"_unsubMediaQuery",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._setUpMediaQuery(),this._applyTheme()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearmediaQuery()}},{kind:"method",key:"_clearmediaQuery",value:function(){this._unsubMediaQuery&&(this._unsubMediaQuery(),this._unsubMediaQuery=void 0)}},{kind:"method",key:"_setUpMediaQuery",value:function(){this._unsubMediaQuery=(0,l.K)("(prefers-color-scheme: dark)",this._applyTheme.bind(this))}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("hass")&&this.hass){const t=e.get("hass");if(!t||this.hass.themes!==t.themes||this.hass.selectedTheme!==t.selectedTheme)return void this._applyTheme()}e.has("theme")&&this._applyTheme()}},{kind:"method",key:"render",value:function(){return(0,o.dy)(r||(r=h`<slot></slot>`))}},{kind:"method",key:"_applyTheme",value:function(){var e;this.hass&&(0,d.R)(this,null===(e=this.hass)||void 0===e?void 0:e.themes,this.theme)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(c||(c=h`:host{display:relative}`))}}]}}),o.oi)},3166:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(71695),i(9359),i(31526),i(70104),i(19423),i(40251),i(47021),i(12582)),s=i(57243),d=i(50778),l=i(68958),r=i(78555),c=(i(37583),i(6671)),h=i(10571),u=i(69040),v=i(11734),p=i(3701),f=i(66684),m=i(71152),y=i(41391),g=i(77711),k=i(27353),b=i(31366),_=i(5522),w=i(2593),x=i(29362),C=i(80373),E=i(28421),M=i(18461),$=e([r,u,v,C,p]);[r,u,v,C,p]=$.then?(await $)():$;(0,a.Z)([(0,d.Mo)("hui-view")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_cards",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_badges",value(){return[]}},{kind:"field",decorators:[(0,d.SB)()],key:"_sections",value(){return[]}},{kind:"field",key:"_layoutElementType",value:void 0},{kind:"field",key:"_layoutElement",value:void 0},{kind:"field",decorators:[(0,l.t)({key:"dashboardCardClipboard",state:!1,subscribe:!1,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"method",key:"_createCardElement",value:function(e){const t=document.createElement("hui-card");return t.hass=this.hass,t.preview=this.lovelace.editMode,t.config=e,t.addEventListener("card-updated",(e=>{e.stopPropagation(),this._cards=[...this._cards]})),t.load(),t}},{kind:"method",key:"createBadgeElement",value:function(e){const t=document.createElement("hui-badge");return t.hass=this.hass,t.preview=this.lovelace.editMode,t.config=e,t.addEventListener("badge-updated",(e=>{e.stopPropagation(),this._badges=[...this._badges]})),t.load(),t}},{kind:"method",key:"createSectionElement",value:function(e){const t=document.createElement("hui-section");return t.hass=this.hass,t.lovelace=this.lovelace,t.config=e,t.viewIndex=this.index,t.preview=this.lovelace.editMode,t.addEventListener("ll-rebuild",(i=>{this.lovelace.editMode||(i.stopPropagation(),this._rebuildSection(t,e))}),{once:!0}),t}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]);const t=e.get("lovelace");(e.has("index")||e.has("lovelace")&&(!t||this.lovelace.config.views[this.index]!==t.config.views[this.index]))&&this._initializeConfig()}},{kind:"method",key:"update",value:function(e){(0,n.Z)(i,"update",this,3)([e]),this._layoutElement&&(e.has("hass")&&(this._badges.forEach((e=>{e.hass=this.hass})),this._cards.forEach((e=>{e.hass=this.hass})),this._sections.forEach((e=>{try{e.hass=this.hass}catch(t){this._rebuildSection(e,(0,x.j9)(t.message))}})),this._layoutElement.hass=this.hass),e.has("narrow")&&(this._layoutElement.narrow=this.narrow),e.has("lovelace")&&(this._layoutElement.lovelace=this.lovelace,this._sections.forEach((e=>{try{e.hass=this.hass,e.lovelace=this.lovelace,e.preview=this.lovelace.editMode}catch(t){this._rebuildSection(e,(0,x.j9)(t.message))}})),this._cards.forEach((e=>{e.preview=this.lovelace.editMode})),this._badges.forEach((e=>{e.preview=this.lovelace.editMode}))),e.has("_cards")&&(this._layoutElement.cards=this._cards),e.has("_badges")&&(this._layoutElement.badges=this._badges))}},{kind:"method",key:"_initializeConfig",value:async function(){let e=this.lovelace.config.views[this.index],t=!1;(0,h.s)(e)&&(t=!0,e=await(0,E.ar)(e,this.hass)),e=Object.assign(Object.assign({},e),{},{type:(0,M.W)(e)});let i=!1;if(this._layoutElement&&this._layoutElementType===e.type||(i=!0,this._createLayoutElement(e)),this._createBadges(e),this._createCards(e),this._createSections(e),this._layoutElement.isStrategy=t,this._layoutElement.hass=this.hass,this._layoutElement.narrow=this.narrow,this._layoutElement.lovelace=this.lovelace,this._layoutElement.index=this.index,this._layoutElement.cards=this._cards,this._layoutElement.badges=this._badges,this._layoutElement.sections=this._sections,i){for(;this.lastChild;)this.removeChild(this.lastChild);this.appendChild(this._layoutElement)}}},{kind:"method",key:"_createLayoutElement",value:function(e){this._layoutElement=(0,p.o)(e),this._layoutElementType=e.type,this._layoutElement.addEventListener("ll-create-card",(e=>{var t;(0,y.F)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index],suggestedCards:null===(t=e.detail)||void 0===t?void 0:t.suggested})})),this._layoutElement.addEventListener("ll-edit-card",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];(0,g.x)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async e=>{const i=(0,k.LG)(this.lovelace.config,[this.index,t],e);await this.lovelace.saveConfig(i)},cardConfig:a})})),this._layoutElement.addEventListener("ll-delete-card",(e=>{this.lovelace&&(0,_.O)(this.hass,this.lovelace,e.detail)})),this._layoutElement.addEventListener("ll-create-badge",(async()=>{(0,f.z)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index]})})),this._layoutElement.addEventListener("ll-edit-badge",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path);(0,m.e)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index],badgeIndex:t})})),this._layoutElement.addEventListener("ll-delete-badge",(async e=>{this.lovelace&&(0,b.V)(this.hass,this.lovelace,e.detail)})),this._layoutElement.addEventListener("ll-duplicate-card",(e=>{const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];(0,g.x)(this,{lovelaceConfig:this.lovelace.config,saveCardConfig:async e=>{const t=(0,k.Z0)(this.lovelace.config,[this.index],e);await this.lovelace.saveConfig(t)},cardConfig:a,isNew:!0})})),this._layoutElement.addEventListener("ll-copy-card",(e=>{if(!this.lovelace)return;const{cardIndex:t}=(0,w.lJ)(e.detail.path),i=this.lovelace.config.views[this.index];if((0,h.s)(i))return;const a=i.cards[t];this._clipboard=(0,o.Z)(a)}))}},{kind:"method",key:"_createBadges",value:function(e){e&&e.badges&&Array.isArray(e.badges)?this._badges=e.badges.map((e=>{const t=(0,c.d)(e);return this.createBadgeElement(t)})):this._badges=[]}},{kind:"method",key:"_createCards",value:function(e){e&&e.cards&&Array.isArray(e.cards)?this._cards=e.cards.map((e=>this._createCardElement(e))):this._cards=[]}},{kind:"method",key:"_createSections",value:function(e){e&&e.sections&&Array.isArray(e.sections)?this._sections=e.sections.map(((e,t)=>{const i=this.createSectionElement(e);return i.index=t,i})):this._sections=[]}},{kind:"method",key:"_rebuildSection",value:function(e,t){const i=this.createSectionElement(t);i.index=e.index,e.parentElement&&e.parentElement.replaceChild(i,e),this._sections=this._sections.map((t=>t===e?i:t))}}]}}),s.fl);t()}catch(B){t(B)}}))},22152:function(){Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(e,t){return void 0!==t&&(t=!!t),this.hasAttribute(e)?!!t||(this.removeAttribute(e),!1):!1!==t&&(this.setAttribute(e,""),!0)})},16485:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{i(71695),i(92745),i(40251),i(47021);var a=i(61449),n=i(40574),o=i(30532),s=i(41674),d=i(49722),l=i(76632),r=i(7884),c=i(35185),h=i(65401),u=i(44180),v=i(49447);const e=async()=>{const e=(0,u.sS)(),t=[];(0,o.shouldPolyfill)()&&await Promise.all([i.e("80210"),i.e("74055")]).then(i.bind(i,98133)),(0,d.shouldPolyfill)()&&await Promise.all([i.e("2142"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,v.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,s.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,r.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("57377")]).then(i.bind(i,39030)).then((()=>i.e("61236").then(i.t.bind(i,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,v.n)(e)))};await e(),t()}catch(p){t(p)}}),1)},31948:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{i(71695),i(40251),i(47021);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await i.e("73378").then(i.bind(i,88198))).default),t()}catch(a){t(a)}}),1)},28008:function(e,t,i){"use strict";i.d(t,{$c:()=>v,Qx:()=>h,k1:()=>c,yu:()=>u});var a=i(57243);let n,o,s,d,l,r=e=>e;const c=(0,a.iv)(n||(n=r`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),h=(0,a.iv)(o||(o=r`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_fon