UNPKG

iobroker.lovelace

Version:

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

5 lines 83.4 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["91749"],{92636:function(e,t,i){i.d(t,{z:()=>a});i(19083),i(61006);const a=e=>(t,i)=>e.includes(t,i)},50875:function(e,t,i){i.d(t,{Eu:()=>s,hZ:()=>r,o9:()=>c});var a=i(27486),n=i(11259);const o=["#4269d0","#f4bd4a","#ff725c","#6cc5b0","#a463f2","#ff8ab7","#9c6b4e","#97bbf5","#01ab63","#9498a0","#094bad","#c99000","#d84f3e","#49a28f","#048732","#d96895","#8043ce","#7599d1","#7a4c31","#74787f","#6989f4","#ffd444","#ff957c","#8fe9d3","#62cc71","#ffadda","#c884ff","#badeff","#bf8b6d","#b6bac2","#927acc","#97ee3f","#bf3947","#9f5b00","#f48758","#8caed6","#f2b94f","#eff26e","#e43872","#d9b100","#9d7a00","#698cff","#d9d9d9","#00d27e","#d06800","#009f82","#c49200","#cbe8ff","#fecddf","#c27eb6","#8cd2ce","#c4b8d9","#f883b0","#a49100","#f48800","#27d0df","#a04a9b"];function s(e){return o[e%o.length]}function r(e,t){const i=t.getPropertyValue(`--graph-color-${e+1}`)||s(e);return(0,n.Rq)(i)}const c=(0,a.Z)((e=>o.map(((t,i)=>r(i,e)))),((e,t)=>e[0].getPropertyValue("--graph-color-1")===t[0].getPropertyValue("--graph-color-1")))},19631:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{Bt:()=>l,T8:()=>d});i(19083);var n=i(16485),o=i(88977),s=i(20382),r=e([n]);n=(r.then?(await r)():r)[0];const c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],l=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:c.includes(e.first_weekday)?c.indexOf(e.first_weekday):1,d=e=>{const t=l(e);return c[t]};a()}catch(c){a(c)}}))},94947:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{G:()=>l});var n=i(16485),o=i(27486),s=i(27046),r=e([n,s]);[n,s]=r.then?(await r)():r;const c=(0,o.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),l=(e,t,i,a=!0)=>{const n=(0,s.W)(e,i,t);return a?c(t).format(n.value,n.unit):Intl.NumberFormat(t.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};a()}catch(c){a(c)}}))},11104:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{f:()=>u});var n,o,s,r=i(16485),c=i(20382),l=e([r]);r=(l.then?(await l)():l)[0];const d=null===(n=Intl.DateTimeFormat)||void 0===n||null===(o=(s=n.call(Intl)).resolvedOptions)||void 0===o?void 0:o.call(s).timeZone,h=null!=d?d:"UTC",u=(e,t)=>e===c.c_.local&&d?h:t;a()}catch(d){a(d)}}))},86431:function(e,t,i){i.d(t,{jL:()=>n,wZ:()=>o});i(71695),i(81804),i(47021);var a=i(47194);const n=e=>{var t;return null===(t=e.name_by_user||e.name)||void 0===t?void 0:t.trim()},o=(e,t,i)=>n(e)||i&&s(t,i)||t.localize("ui.panel.config.devices.unnamed_device",{type:t.localize(`ui.panel.config.devices.type.${e.entry_type||"device"}`)}),s=(e,t)=>{for(const i of t||[]){const t="string"==typeof i?i:i.entity_id,n=e.states[t];if(n)return(0,a.C)(n)}}},59847:function(e,t,i){i.d(t,{N:()=>n});var a=i(73850);const n=e=>(0,a.M)(e.entity_id)},75278:function(e,t,i){i.d(t,{e:()=>a});const a=(e,t)=>n(e.attributes,t),n=(e,t)=>!!(e.supported_features&t)},50602:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{SL:()=>c,l4:()=>u,sJ:()=>l,uf:()=>h});var n=i(16485),o=(i(19083),i(19423),i(11740),i(61006),i(20382)),s=i(34618),r=e([n]);n=(r.then?(await r)():r)[0];const c=e=>l(e.attributes),l=(e,t)=>!!e.unit_of_measurement||!!e.state_class||(t||[]).includes(e.device_class||""),d=e=>{switch(e.number_format){case o.y4.comma_decimal:return["en-US","en"];case o.y4.decimal_comma:return["de","es","it"];case o.y4.space_comma:return["fr","sv","cs"];case o.y4.system:return;default:return e.language}},h=(e,t,i)=>{const a=t?d(t):void 0;return Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)===o.y4.none||Number.isNaN(Number(e))?Number.isNaN(Number(e))||""===e||(null==t?void 0:t.number_format)!==o.y4.none?"string"==typeof e?e:`${(0,s.N)(e,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`:new Intl.NumberFormat("en-US",f(e,Object.assign(Object.assign({},i),{},{useGrouping:!1}))).format(Number(e)):new Intl.NumberFormat(a,f(e,i)).format(Number(e))},u=(e,t)=>{var i;const a=null==t?void 0:t.display_precision;return null!=a?{maximumFractionDigits:a,minimumFractionDigits:a}:Number.isInteger(Number(null==e||null===(i=e.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(null==e?void 0:e.state))?{maximumFractionDigits:0}:void 0},f=(e,t)=>{const i=Object.assign({maximumFractionDigits:2},t);if("string"!=typeof e)return i;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;i.minimumFractionDigits=t,i.maximumFractionDigits=t}return i};a()}catch(c){a(c)}}))},34618:function(e,t,i){i.d(t,{N:()=>a});const a=(e,t=2)=>Math.round(e*10**t)/10**t},85746:function(e,t,i){i.d(t,{V:()=>n});var a=i(87733);const n=(e,t)=>(e=>{switch(e){case"de":case"lb":return!0;default:return!1}})(t)?(0,a.f)(e):e.toLocaleLowerCase(t)},47558:function(e,t,i){i.d(t,{v:()=>a});i(71695),i(92745),i(47021);const a=(e,t)=>{const i={};for(const a of e){const e=t(a);e in i?i[e].push(a):i[e]=[a]}return i}},27046:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{W:()=>f});i(19423);var n=i(13809),o=i(29558),s=i(94763),r=i(19631),c=e([r]);r=(c.then?(await c)():c)[0];const d=1e3,h=60,u=60*h;function f(e,t=Date.now(),i,a={}){const c=Object.assign(Object.assign({},p),a||{}),l=(+e-+t)/d;if(Math.abs(l)<c.second)return{value:Math.round(l),unit:"second"};const f=l/h;if(Math.abs(f)<c.minute)return{value:Math.round(f),unit:"minute"};const v=l/u;if(Math.abs(v)<c.hour)return{value:Math.round(v),unit:"hour"};const m=new Date(e),g=new Date(t);m.setHours(0,0,0,0),g.setHours(0,0,0,0);const b=(0,n.j)(m,g);if(0===b)return{value:Math.round(v),unit:"hour"};if(Math.abs(b)<c.day)return{value:b,unit:"day"};const y=(0,r.Bt)(i),k=(0,o.z)(m,{weekStartsOn:y}),_=(0,o.z)(g,{weekStartsOn:y}),w=(0,s.p)(k,_);if(0===w)return{value:b,unit:"day"};if(Math.abs(w)<c.week)return{value:w,unit:"week"};const x=m.getFullYear()-g.getFullYear(),$=12*x+m.getMonth()-g.getMonth();return 0===$?{value:w,unit:"week"}:Math.abs($)<c.month||0===x?{value:$,unit:"month"}:{value:Math.round(x),unit:"year"}}const p={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(l){a(l)}}))},99426:function(e,t,i){i.r(t);var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778),s=i(35359),r=i(36522);i(23334),i(37583);let c,l,d,h,u=e=>e;const f={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,o.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(c||(c=u` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,s.$)({[this.alertType]:!0}),this.title?"":"no-title",f[this.alertType],(0,s.$)({content:!0,narrow:this.narrow}),this.title?(0,n.dy)(l||(l=u`<div class="title">${0}</div>`),this.title):n.Ld,this.dismissable?(0,n.dy)(d||(d=u`<ha-icon-button @click="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"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"):n.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,r.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(h||(h=u`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),n.oi)},34273:function(e,t,i){var a=i(61701),n=i(72621),o=(i(71695),i(9359),i(31526),i(47021),i(22997),i(57243)),s=i(50778),r=i(5111),c=i(76525);let l,d,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:c.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)(l||(l=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"===r.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)(d||(d=h`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),o.oi)},20130:function(e,t,i){var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(39785)),s=i(52876),r=i(50778),c=i(57243),l=i(5111);let d,h,u,f=e=>e;(0,a.Z)([(0,r.Mo)("ha-fab")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,c.iv)(d||(d=f`:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`)),"rtl"===l.E.document.dir?(0,c.iv)(h||(h=f`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,c.iv)(u||(u=f``))]}}]}}),o._)},20165:function(e,t,i){i.d(t,{m:()=>l});var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778);i(65981),i(37583);let s,r,c=e=>e;const l=e=>{switch(e.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"};(0,a.Z)([(0,o.Mo)("ha-floor-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"floor",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){if(this.floor.icon)return(0,n.dy)(s||(s=c`<ha-icon .icon="${0}"></ha-icon>`),this.floor.icon);const e=l(this.floor);return(0,n.dy)(r||(r=c`<ha-svg-icon .path="${0}"></ha-svg-icon>`),e)}}]}}),n.oi)},13928:function(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>r});var a=i(61701),n=(i(71695),i(47021),i(50778)),o=i(5111),s=i(37583);let r=(0,a.Z)([(0,n.Mo)("ha-icon-next")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"path",value(){return"rtl"===o.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}]}}),s.HaSvgIcon)},65981:function(e,t,i){i.r(t),i.d(t,{HaIcon:()=>C});var a=i(61701),n=i(72621),o=(i(19083),i(71695),i(40251),i(61006),i(47021),i(57243)),s=i(50778),r=i(36522),c=i(22381),l=i(80654),d=(i(92745),i(9359),i(31526),i(27608)),h=i(27486),u=i(37394);const f=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}'),p=(0,h.Z)((async()=>{const e=(0,d.MT)("hass-icon-db","mdi-icon-store");{const t=await(0,d.U2)("_version",e);t?t!==f.version&&(await(0,d.ZH)(e),(0,d.t8)("_version",f.version,e)):(0,d.t8)("_version",f.version,e)}return e})),v=["mdi","hass","hassio","hademo"];let m=[];i(37583);let g,b,y,k=e=>e;const _={},w={},x=(0,c.D)((()=>(async e=>{const t=Object.keys(e),i=await Promise.all(Object.values(e));(await p())("readwrite",(a=>{i.forEach(((i,n)=>{Object.entries(i).forEach((([e,t])=>{a.put(t,e)})),delete e[t[n]]}))}))})(w)),2e3),$={};let C=(0,a.Z)([(0,s.Mo)("ha-icon")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_legacy",value(){return!1}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(a,"willUpdate",this,3)([e]),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?(0,o.dy)(g||(g=k` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.dy)(b||(b=k`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let n,o=a;if(!t||!o)return;if(!v.includes(t)){const i=l.g[t];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in _){const e=_[o];let i;e.newName?(i=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):i=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(i),(0,r.B)(this,"write_log",{level:"warning",message:i})}if(o in $)return void(this._path=$[o]);if("home-assistant"===o){const t=(await i.e("48348").then(i.bind(i,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void($[o]=t)}try{n=await(e=>new Promise(((t,i)=>{if(m.push([e,t,i]),m.length>1)return;const a=p();(0,u.n)(1e3,(async()=>{(await a)("readonly",(e=>{for(const[t,i,a]of m)(0,d.RV)(e.get(t)).then((e=>i(e))).catch((e=>a(e)));m=[]}))})()).catch((e=>{for(const[,,t]of m)t(e);m=[]}))})))(o)}catch(h){n=void 0}if(n)return this.icon===e&&(this._path=n),void($[o]=n);const s=(e=>{let t;for(const i of f.parts){if(void 0!==i.start&&e<i.start)break;t=i}return t.file})(o);if(s in w)return void this._setPath(w[s],o,e);const c=fetch(`/static/mdi/${s}.json`).then((e=>e.json()));w[s]=c,this._setPath(c,o,e),x()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const i=await e;this.icon===t&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,i){const a=await e;this.icon===i&&(this._path=a[t]),$[t]=a[t]}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(y||(y=k`:host{fill:currentcolor}`))}}]}}),o.oi)},7285:function(e,t,i){i.d(t,{M:()=>f});var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(65703)),s=i(46289),r=i(57243),c=i(50778);let l,d,h,u=e=>e,f=(0,a.Z)([(0,c.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,r.iv)(l||(l=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,r.iv)(d||(d=u`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,r.iv)(h||(h=u``))]}}]}}),o.K)},95975:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(74760)),s=i(57243),r=i(50778),c=i(94947),l=i(87733),d=e([c]);c=(d.then?(await d)():d)[0];(0,a.Z)([(0,r.Mo)("ha-relative-time")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"datetime",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"capitalize",value(){return!1}},{kind:"field",key:"_interval",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearInterval()}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.datetime&&this._startInterval()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this._updateRelative()}},{kind:"method",key:"update",value:function(e){(0,n.Z)(i,"update",this,3)([e]),this._updateRelative()}},{kind:"method",key:"_clearInterval",value:function(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}},{kind:"method",key:"_startInterval",value:function(){this._clearInterval(),this._interval=window.setInterval((()=>this._updateRelative()),6e4)}},{kind:"method",key:"_updateRelative",value:function(){if(this.datetime){const e="string"==typeof this.datetime?(0,o.D)(this.datetime):this.datetime,t=(0,c.G)(e,this.hass.locale);this.innerHTML=this.capitalize?(0,l.f)(t):t}else this.innerHTML=this.hass.localize("ui.components.relative_time.never")}}]}}),s.fl);t()}catch(h){t(h)}}))},17170:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>f});var n=i(61701),o=i(72621),s=(i(71695),i(47021),i(97677)),r=i(43580),c=i(57243),l=i(50778),d=e([s]);s=(d.then?(await d)():d)[0];let h,u=e=>e,f=(0,n.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[r.Z,(0,c.iv)(h||(h=u`:host{--indicator-color:var(
          --ha-spinner-indicator-color,
          var(--primary-color)
        );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),s.Z);a()}catch(h){a(h)}}))},56032:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(47021),i(80519)),o=i(1261),s=i(57243),r=i(50778),c=i(85605),l=e([n]);n=(l.then?(await l)():l)[0];let d,h=e=>e;(0,c.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,c.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,a.Z)([(0,r.Mo)("ha-tooltip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[o.Z,(0,s.iv)(d||(d=h`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`))]}}]}}),n.Z);t()}catch(d){t(d)}}))},43546:function(e,t,i){i.d(t,{Cp:()=>s,TZ:()=>r,W2:()=>o,YY:()=>l,iI:()=>n,j2:()=>c,oT:()=>a});i(19083),i(9359),i(70104),i(77439),i(19423),i(40251),i(97499),i(61006);const a=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}})),n=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),o=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),s=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),r=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),c=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),l=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},80654:function(e,t,i){i.d(t,{g:()=>s});const a=window;"customIconsets"in a||(a.customIconsets={});const n=a.customIconsets,o=window;"customIcons"in o||(o.customIcons={});const s=new Proxy(o.customIcons,{get:(e,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:n[t]?{getIcon:n[t]}:void 0}})},36595:function(e,t,i){i.d(t,{N5:()=>s,fu:()=>o,jg:()=>n,z3:()=>a});i(71695),i(92745),i(19423),i(47021),i(1416),i(43839);const a=(e,t)=>e.callWS(Object.assign({type:"config/floor_registry/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"config/floor_registry/update",floor_id:t},i)),o=(e,t)=>e.callWS({type:"config/floor_registry/delete",floor_id:t}),s=e=>{const t={};for(const i of e)i.floor_id&&(i.floor_id in t||(t[i.floor_id]=[]),t[i.floor_id].push(i));return t}},25433:function(e,t,i){i.d(t,{MY:()=>g,Yc:()=>f,hb:()=>v,jV:()=>l,o1:()=>p,ri:()=>m,sS:()=>h});i(71695),i(40251),i(19134),i(11740),i(97003),i(88044),i(47021);var a=i(73358),n=i(73850),o=i(59847),s=i(85746),r=i(96194);const c="ui.components.logbook.messages",l=["counter","proximity","sensor","zone"],d={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},h=async(e,t,i)=>u(e,t,void 0,void 0,i),u=(e,t,i,a,n,o)=>{if((a||o)&&(!a||0===a.length)&&(!o||0===o.length))return Promise.resolve([]);const s={type:"logbook/get_events",start_time:t};return i&&(s.end_time=i),null!=a&&a.length&&(s.entity_ids=a),null!=o&&o.length&&(s.device_ids=o),n&&(s.context_id=n),e.callWS(s)},f=(e,t,i,a,n,o)=>{if((n||o)&&(!n||0===n.length)&&(!o||0===o.length))return Promise.reject("No entities or devices");const s={type:"logbook/event_stream",start_time:i,end_time:a};return null!=n&&n.length&&(s.entity_ids=n),null!=o&&o.length&&(s.device_ids=o),e.connection.subscribeMessage((e=>t(e)),s)},p=(e,t)=>({entity_id:e.entity_id,state:t,attributes:{device_class:null==e?void 0:e.attributes.device_class,source_type:null==e?void 0:e.attributes.source_type,has_date:null==e?void 0:e.attributes.has_date,has_time:null==e?void 0:e.attributes.has_time,entity_picture_local:a.iY.has((0,n.M)(e.entity_id))||null==e?void 0:e.attributes.entity_picture_local,entity_picture:a.iY.has((0,n.M)(e.entity_id))||null==e?void 0:e.attributes.entity_picture}}),v=(e,t)=>{for(const i of Object.keys(d)){const a=d[i];if(t.startsWith(a))return t.replace(a,`${e(`ui.components.logbook.${i}`)}`)}return t},m=(e,t,i,n,o)=>{switch(o){case"device_tracker":case"person":return"not_home"===i?t(`${c}.was_away`):"home"===i?t(`${c}.was_at_home`):t(`${c}.was_at_state`,{state:i});case"sun":return t("above_horizon"===i?`${c}.rose`:`${c}.set`);case"binary_sensor":{const o=i===a.uo,r=i===a.lC,l=n.attributes.device_class;if(l&&(o||r))return t(`${c}.${o?"detected_device_classes":"cleared_device_classes"}.${l}`,{device_class:(0,s.V)(t(`component.binary_sensor.entity_component.${l}.name`)||l,e.language)})||t(`${c}.${o?"detected_device_class":"cleared_device_class"}`,{device_class:(0,s.V)(t(`component.binary_sensor.entity_component.${l}.name`)||l,e.language)});break}case"cover":switch(i){case"open":return t(`${c}.was_opened`);case"opening":return t(`${c}.is_opening`);case"closing":return t(`${c}.is_closing`);case"closed":return t(`${c}.was_closed`)}break;case"event":return t(`${c}.detected_event_no_type`);case"lock":switch(i){case"unlocked":return t(`${c}.was_unlocked`);case"locking":return t(`${c}.is_locking`);case"unlocking":return t(`${c}.is_unlocking`);case"opening":return t(`${c}.is_opening`);case"open":return t(`${c}.is_opened`);case"locked":return t(`${c}.was_locked`);case"jammed":return t(`${c}.is_jammed`)}}return i===a.uo?t(`${c}.turned_on`):i===a.lC?t(`${c}.turned_off`):i===r.lz?t(`${c}.became_unknown`):i===r.nZ?t(`${c}.became_unavailable`):e.localize(`${c}.changed_to_state`,{state:n?e.formatEntityState(n,i):i})},g=e=>"sensor"!==(0,o.N)(e)||void 0===e.attributes.unit_of_measurement&&void 0===e.attributes.state_class},2357:function(e,t,i){i.d(t,{K:()=>n,c:()=>a});i(71695),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const a=new Set(["automation","script","scene","group"]),n=(e,t,i)=>e.callWS({type:"search/related",item_type:t,item_id:i})},69919:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{EX:()=>f,Fj:()=>w,M$:()=>x,SO:()=>p,Sk:()=>m,TN:()=>C,UJ:()=>g,Ym:()=>$,hF:()=>v});i(19083),i(61893),i(9359),i(56475),i(70104),i(40251);var n=i(73358),o=i(73850),s=i(59847),r=i(75278),c=i(50602),l=i(1416),d=i(76131),h=i(72473),u=e([c]);c=(u.then?(await u)():u)[0];let f=function(e){return e[e.INSTALL=1]="INSTALL",e[e.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",e[e.PROGRESS=4]="PROGRESS",e[e.BACKUP=8]="BACKUP",e[e.RELEASE_NOTES=16]="RELEASE_NOTES",e}({});const p=e=>(0,r.e)(e,f.PROGRESS)&&null!==e.attributes.update_percentage,v=(e,t=!1)=>(e.state===n.uo||t&&Boolean(e.attributes.skipped_version))&&(0,r.e)(e,f.INSTALL),m=e=>!!e.attributes.in_progress,g=(e,t)=>e.callWS({type:"update/release_notes",entity_id:t}),b="ioBroker Core",y="ioBroker Supervisor",k="ioBroker Operating System",_=(e,t)=>Object.values(e).filter((e=>"update"===(0,s.N)(e))).sort(((e,i)=>e.attributes.title===b?-3:i.attributes.title===b?3:e.attributes.title===k?-2:i.attributes.title===k?2:e.attributes.title===y?-1:i.attributes.title===y?1:(0,l.fe)(e.attributes.title||e.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",t))),w=(e,t=!1)=>_(e).filter((e=>v(e,t))),x=async(e,t)=>{const i=_(t.states,t.locale.language).map((e=>e.entity_id));if(!i.length)return void(0,d.showAlertDialog)(e,{title:t.localize("ui.panel.config.updates.no_update_entities.title"),text:t.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,h.C)(e,{message:t.localize("ui.panel.config.updates.checking_updates")});let a=0;const n=await t.connection.subscribeEvents((i=>{"update"===(0,o.M)(i.data.entity_id)&&(a++,(0,h.C)(e,{message:t.localize("ui.panel.config.updates.updates_refreshed",{count:a})}))}),"state_changed");await t.callService("homeassistant","update_entity",{entity_id:i}),await new Promise((e=>{setTimeout(e,15e3)})),n(),0===a&&(0,h.C)(e,{message:t.localize("ui.panel.config.updates.no_new_updates")})},$=(e,t)=>{const i=e.state,a=e.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:t.formatEntityState(e)}if("on"===i&&m(e)){return(0,r.e)(e,f.PROGRESS)&&null!==a.update_percentage?t.localize("ui.card.update.installing_with_progress",{progress:(0,c.uf)(a.update_percentage,t.locale,{maximumFractionDigits:a.display_precision,minimumFractionDigits:a.display_precision})}):t.localize("ui.card.update.installing")}return t.formatEntityState(e)},C=(e,t)=>{var i;if("hassio"!==(null===(i=t[e.entity_id])||void 0===i?void 0:i.domain))return"generic";const a=e.attributes.title||"";return a===b?"home_assistant":[b,y,k].includes(a)?"generic":"addon"};a()}catch(f){a(f)}}))},4242:function(e,t,i){i.d(t,{CE:()=>n,FH:()=>d,Nq:()=>r,Pb:()=>a,fm:()=>l,h8:()=>c,r4:()=>s,uh:()=>o});i(92745),i(9359),i(70104),i(19423),i(40251),i(81804);const a="system-admin",n="system-users",o=async e=>e.callWS({type:"config/auth/list"}),s=async(e,t,i,a)=>e.callWS({type:"config/auth/create",name:t,group_ids:i,local_only:a}),r=async(e,t,i)=>e.callWS(Object.assign(Object.assign({},i),{},{type:"config/auth/update",user_id:t})),c=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),l=e=>e?e.trim().split(" ").slice(0,3).map((e=>e.substring(0,1))).join(""):"?",d=(e,t,i)=>{const a=[],n=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&a.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",n("is_owner")]),i&&t.system_generated&&a.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",n("is_system")]),t.local_only&&a.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",n("is_local")]),t.is_active||a.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",n("is_not_active")]),a}},12939:function(e,t,i){i.d(t,{A:()=>n});var a=i(36522);const n=(e,t)=>(0,a.B)(e,"hass-more-info",t)},34515:function(e,t,i){i.r(t);var a=i(61701),n=(i(71695),i(47021),i(31622),i(57243)),o=i(50778);i(54202),i(43344),i(99426);let s,r,c,l,d,h=e=>e;(0,a.Z)([(0,o.Mo)("hass-error-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"toolbar",value(){return!0}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"error",value:void 0},{kind:"method",key:"render",value:function(){var e,t;return(0,n.dy)(s||(s=h` ${0} <div class="content"> <ha-alert alert-type="error">${0}</ha-alert> <slot> <mwc-button @click="${0}"> ${0} </mwc-button> </slot> </div> `),this.toolbar?(0,n.dy)(r||(r=h`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,n.dy)(c||(c=h` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,n.dy)(l||(l=h` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)):"",this.error,this._handleBack,null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,n.iv)(d||(d=h`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev{pointer-events:auto}.content{color:var(--primary-text-color);height:calc(100% - var(--header-height));display:flex;padding:16px;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}a{color:var(--primary-color)}ha-alert{margin-bottom:16px}`))]}}]}}),n.oi)},87979:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778),s=i(31146),r=(i(54202),i(43344),i(28008));let c,l,d,h,u,f=e=>e;(0,a.Z)([(0,o.Mo)("hass-subpage")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"main-page"})],key:"mainPage",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"backCallback",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"supervisor",value(){return!1}},{kind:"field",decorators:[(0,s.i)(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(c||(c=f` <div class="toolbar"> ${0} <div class="main-title"><slot name="header">${0}</slot></div> <slot name="toolbar-icon"></slot> </div> <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),this.mainPage||null!==(e=history.state)&&void 0!==e&&e.root?(0,n.dy)(l||(l=f` <ha-menu-button .hassio="${0}" .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.supervisor,this.hass,this.narrow):this.backPath?(0,n.dy)(d||(d=f` <a href="${0}"> <ha-icon-button-arrow-prev .hass="${0}"></ha-icon-button-arrow-prev> </a> `),this.backPath,this.hass):(0,n.dy)(h||(h=f` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,this._saveScrollPos)}},{kind:"method",decorators:[(0,o.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.$c,(0,n.iv)(u||(u=f`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin:var(--margin-title);line-height:20px;min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:1px}.content{position:relative;width:100%;height:calc(100% - 1px - var(--header-height));overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}#fab{position:absolute;right:calc(16px + env(safe-area-inset-right));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}:host([narrow]) #fab.tabs{bottom:calc(84px + env(safe-area-inset-bottom))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}`))]}}]}}),n.oi)},46670:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(19083),i(71695),i(92745),i(61893),i(9359),i(1331),i(31526),i(70104),i(40251),i(47021),i(60738)),s=(i(31622),i(2060),i(87319),i(57243)),r=i(50778),c=i(20552),l=i(27486),d=i(72344),h=i(86431),u=i(73850),f=i(47194),p=i(1416),v=i(47558),m=i(76320),g=(i(34273),i(54977),i(23334),i(13928),i(7285),i(56032)),b=i(82100),y=i(30635),k=i(71857),_=i(63318),w=i(2357),x=i(76131),$=i(12939),C=(i(34515),i(87979),i(28008)),L=i(16581),A=i(61107),M=e([g,L]);[g,L]=M.then?(await M)():M;let H,z,S,V,E,I,P,Z,B,O,T,N,j,F,D,R,W,U,G,Y,q,K,J,Q,X,ee,te,ie,ae,ne=e=>e;const oe="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",se="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",re="M18 15V18H15V20H18V23H20V20H23V18H20V15H18M13.3 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5V13.3C20.4 13.1 19.7 13 19 13C17.9 13 16.8 13.3 15.9 13.9L14.5 12L11 16.5L8.5 13.5L5 18H13.1C13 18.3 13 18.7 13 19C13 19.7 13.1 20.4 13.3 21Z",ce="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,r.Mo)("ha-config-area-page")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"areaId",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"showAdvanced",value(){return!1}},{kind:"field",decorators:[(0,r.SB)(),(0,o.F_)({context:y.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_related",value:void 0},{kind:"field",key:"_logbookTime",value(){return{recent:86400}}},{kind:"field",key:"_memberships",value(){return(0,l.Z)(((e,t,i)=>{const a=new Map;for(const s of t)s.area_id===e&&a.set(s.id,s);const n=[],o=[];for(const s of i)s.area_id?s.area_id===e&&n.push(s):s.device_id&&a.has(s.device_id)&&o.push(s);return{devices:Array.from(a.values()),entities:n,indirectEntities:o}}))}},{kind:"field",key:"_allDeviceIds",value(){return(0,l.Z)((e=>e.map((e=>e.id))))}},{kind:"field",key:"_allEntities",value(){return(0,l.Z)((e=>e.entities.map((e=>e.entity_id)).concat(e.indirectEntities.map((e=>e.entity_id)))))}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),(0,A.O)()}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),e.has("areaId")&&this._findRelated()}},{kind:"method",key:"render",value:function(){var e,t,i,a,n,o,r,c,l,f,p,m;if(!this.hass.areas||!this.hass.devices||!this.hass.entities)return s.Ld;const g=this.hass.areas[this.areaId];if(!g)return(0,s.dy)(H||(H=ne` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this.hass.localize("ui.panel.config.areas.area_not_found"));const b=this._memberships(this.areaId,Object.values(this.hass.devices),this._entityReg),{devices:y,entities:w}=b;y&&(y.forEach((e=>{e.name=(0,h.wZ)(e,this.hass)})),(0,k.Wg)(y,this.hass.locale.language)),w&&(w.forEach((e=>{e.name=(0,_.vA)(this.hass,e)})),(0,_._V)(w,this.hass.locale.language));const x=(0,v.v)(w,(e=>(0,u.M)(e.entity_id)));let $=[],C=[],L=[],A=[],M=[],ee=[];var te,ie,ae;(0,d.p)(this.hass,"automation")&&({groupedEntities:$,relatedEntities:A}=this._prepareEntities(x.automation,null===(te=this._related)||void 0===te?void 0:te.automation));(0,d.p)(this.hass,"scene")&&({groupedEntities:C,relatedEntities:M}=this._prepareEntities(x.scene,null===(ie=this._related)||void 0===ie?void 0:ie.scene));(0,d.p)(this.hass,"script")&&({groupedEntities:L,relatedEntities:ee}=this._prepareEntities(x.script,null===(ae=this._related)||void 0===ae?void 0:ae.script));return(0,s.dy)(z||(z=ne` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <ha-button-menu slot="toolbar-icon"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <mwc-list-item graphic="icon" .entry="${0}" @click="${0}"> ${0} <ha-svg-icon slot="graphic" .path="${0}"> </ha-svg-icon> </mwc-list-item> <mwc-list-item class="warning" graphic="icon" @click="${0}"> ${0} <ha-svg-icon class="warning" slot="graphic" .path="${0}"> </ha-svg-icon> </mwc-list-item> </ha-button-menu> <div class="container"> <div class="column"> ${0} <ha-card outlined .header="${0}">${0} </ha-card> <ha-card outlined .header="${0}"> ${0} </ha-card> </div> <div class="column"> ${0} ${0} ${0} </div> <div class="column"> ${0} </div> </div> </hass-subpage> `),this.hass,this.narrow,(0,s.dy)(S||(S=ne`${0}${0}`),g.icon?(0,s.dy)(V||(V=ne`<ha-icon .icon="${0}" style="margin-inline-end:8px"></ha-icon>`),g.icon):s.Ld,g.name),this.hass.localize("ui.common.menu"),se,g,this._showSettings,this.hass.localize("ui.panel.config.areas.edit_settings"),ce,this._deleteConfirm,this.hass.localize("ui.panel.config.areas.editor.delete"),oe,g.picture?(0,s.dy)(E||(E=ne`<div class="img-container"> <img alt="${0}" src="${0}"> <ha-icon-button .path="${0}" .entry="${0}" @click="${0}" .label="${0}" class="img-edit-btn"></ha-icon-button> </div>`),g.name,g.picture,ce,g,this._showSettings,this.hass.localize("ui.panel.config.areas.edit_settings")):(0,s.dy)(I||(I=ne`<mwc-button .entry="${0}" @click="${0}" .label="${0}"> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> </mwc-button>`),g,this._showSettings,this.hass.localize("ui.panel.config.areas.add_picture"),re),this.hass.localize("ui.panel.config.devices.caption"),y.length?(0,s.dy)(P||(P=ne`<mwc-list> ${0} </mwc-list>`),y.map((e=>(0,s.dy)(Z||(Z=ne` <a href="/config/devices/device/${0}"> <ha-list-item hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),e.id,e.name)))):(0,s.dy)(B||(B=ne` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.no_devices")),this.hass.localize("ui.panel.config.areas.editor.linked_entities_caption"),w.length?(0,s.dy)(O||(O=ne`<mwc-list> ${0}</mwc-list>`),w.map((e=>["scene","script","automation"].includes((0,u.M)(e.entity_id))?"":(0,s.dy)(T||(T=ne` <ha-list-item @click="${0}" .entity="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> `),this._openEntity,e,e.name)))):(0,s.dy)(N||(N=ne` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.areas.editor.no_linked_entities")),(0,d.p)(this.hass,"automation")?(0,s.dy)(j||(j=ne` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.automation.automations_heading"),null!==(e=$)&&void 0!==e&&e.length?(0,s.dy)(F||(F=ne`<h3> ${0}: </h3> <mwc-list> ${0}</mwc-list>`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),$.map((e=>this._renderAutomation(e.name,e.entity)))):"",null!==(t=A)&&void 0!==t&&t.length?(0,s.dy)(D||(D=ne`<h3> ${0}: </h3> <mwc-list> ${0}</mwc-list>`),this.hass.localize("ui.panel.config.areas.targeting_area"),A.map((e=>this._renderAutomation(e.name,e.entity)))):"",null!==(i=$)&&void 0!==i&&i.length||null!==(a=A)&&void 0!==a&&a.length?"":(0,s.dy)(R||(R=ne` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.automation.no_automations"))):"",(0,d.p)(this.hass,"scene")?(0,s.dy)(W||(W=ne` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.scene.scenes_heading"),null!==(n=C)&&void 0!==n&&n.length?(0,s.dy)(U||(U=ne`<h3> ${0}: </h3> <mwc-list> ${0}</mwc-list>`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),C.map((e=>this._renderScene(e.name,e.entity)))):"",null!==(o=M)&&void 0!==o&&o.length?(0,s.dy)(G||(G=ne`<h3> ${0}: </h3> <mwc-list> ${0}</mwc-list>`),this.hass.localize("ui.panel.config.areas.targeting_area"),M.map((e=>this._renderScene(e.name,e.entity)))):"",null!==(r=C)&&void 0!==r&&r.length||null!==(c=M)&&void 0!==c&&c.length?"":(0,s.dy)(Y||(Y=ne` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.scene.no_scenes"))):"",(0,d.p)(this.hass,"script")?(0,s.dy)(q||(q=ne` <ha-card outlined .header="${0}"> ${0} ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.script.scripts_heading"),null!==(l=L)&&void 0!==l&&l.length?(0,s.dy)(K||(K=ne`<h3> ${0}: </h3> ${0}`),this.hass.localize("ui.panel.config.areas.assigned_to_area"),L.map((e=>this._renderScript(e.name,e.entity)))):"",null!==(f=ee)&&void 0!==f&&f.length?(0,s.dy)(J||(J=ne`<h3> ${0}: </h3> ${0}`),this.hass.localize("ui.panel.config.areas.targeting_area"),ee.map((e=>this._renderScript(e.name,e.entity)))):"",null!==(p=L)&&void 0!==p&&p.length||null!==(m=ee)&&void 0!==m&&m.length?"":(0,s.dy)(Q||(Q=ne` <div class="no-entries"> ${0} </div> `),this.hass.localize("ui.panel.config.devices.script.no_scripts"))):"",(0,d.p)(this.hass,"logbook")?(0,s.dy)(X||(X=ne` <ha-card outlined .header="${0}"> <ha-logbook .hass="${0}" .time="${0}" .entityIds="${0}" .deviceIds="${0}" virtualize narrow no-icon></ha-logbook> </ha-card> `),this.hass.localize("panel.logbook"),this.hass,this._logbookTime,this._allEntities(b),this._allDeviceIds(b.devices)):"")}},{kind:"method",key:"_prepareEntities",value:function(e,t){const i=[],a=[];return null!=e&&e.length&&(e.forEach((e=>{const t=this.hass.states[e.entity_id];t&&i.push({name:(0,f.C)(t),entity:t})})),i.sort(((e,t)=>(0,p.fe)(e.name,t.name,this.hass.locale.language)))),null!=t&&t.length&&(t.forEach((e=>{const t=this.hass.states[e];t&&a.push({name:t?(0,f.C)(t):"",entity:t})})),a.sort(((e,t)=>(0,p.fe)(e.name,t.name,this.hass.locale.language)))),{groupedEntities:i,relatedEntities:a}}},{kind:"method",key:"_renderScene",value:function(e,t){return(0,s.dy)(ee||(ee=ne`<ha-tooltip .distance="${0}" .disabled="${0}" .content="${0}"> <a href="${0}"> <ha-list-item .disabled="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> </ha-tooltip>`),-4,!!t.attributes.id,this.hass.localize("ui.panel.config.devices.cant_edit"),(0,c.o)(t.attributes.id?`/config/scene/edit/${t.attributes.id}`:void 0),!t.attributes.id,e)}},{kind:"method",key:"_renderAutomation",value:function(e,t){return(0,s.dy)(te||(te=ne`<ha-tooltip .disabled="${0}" .distance="${0}" .content="${0}"> <a href="${0}"> <ha-list-item .disabled="${0}" hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> </ha-tooltip>`),!!t.attributes.id,-4,this.hass.localize("ui.panel.config.devices.cant_edit"),(0,c.o)(t.attributes.id?`/config/automation/edit/${encodeURIComponent(t.attributes.id)}`:void 0),!t.attributes.id,e)}},{kind:"method",key:"_renderScript",value:function(e,t){const i=this._entityReg.find((e=>e.entity_id===t.entity_id));let a=`/config/script/show/${t.entity_id}`;return i&&(a=`/config/script/edit/${i.unique_id}`),(0,s.dy)(ie||(ie=ne`<a href="${0}"> <ha-list-item hasMeta> <span>${0}</span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a>`),a,e)}},{kind:"method",key:"_findRelated",value:async function(){this._related=await(0,w.K)(this.hass,"area",this.areaId)}},{kind:"method",key:"_showSettings",value:function(e){const t=e.currentTarget.entry;this._openDialog(t)}},{kind:"method",key:"_openEntity",value:function(e){const t=e.currentTarget.entity;(0,$.A)(this,{entityId:t.entity_id})}},{kind:"method",key:"_openDialog",value:function(e){(0,A.E)(this,{entry:e,updateEntry:async t=>(0,b.IO)(this.hass,e.area_id,t)})}},{kind:"method",key:"_deleteConfirm",value:async function(){const e=this.hass.areas[this.areaId];(0,x.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.areas.delete.confirmation_title",{name:e.name}),text:this.hass.localize("ui.panel.config.areas.delete.confirmation_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:async()=>{await(0,b.qv)(this.hass,e.area_id),(0,m.T)((()=>history.back()))}})}},{kind:"get",static:!0,key:"styles",value:function(){return[C.Qx,(0,s.iv)(ae||(ae=ne`h3{margin:0;padding:0 16px;font-weight:500;color:var(--secondary-text-color)}img{border-radius:var(--ha-card-border-radius,12px);width:100%}.container{display:flex;flex-wrap:wrap;margin:auto;max-width:1000px;margin-top:32px;margin-bottom:32px}.column{padding:8px;box-sizing:border-box;width:33%;flex-grow:1}.fullwidth{padding:8px;width:100%}.column>:not(:first-child){margin-top:16px}:host([narrow]) .column{width:100%}:host([narrow]) .container{margin-top:0}a{text-decoration:none;color:var(--primary-text-color)}ha-card>a:first-child{display:block}ha-card>:first-child{margin-top:-16px}.img-container{position:relative}.img-edit-btn{position:absolute;top:4px;right:4px;inset-inline-end:4px;inset-inline-start:initial;display:none}.img-container:hover .img-edit-btn{display:block}.img-edit-btn::before{content:"";position:absolute;width:100%;height:100%;background-color:var(--card-background-color);opacity:.5;border-radius:50%}ha-logbook{height:400px}:host([narrow]) ha-logbook{height:235px;overflow:auto}.no-entries{text-align:center;padding:16px;color:var(--secondary-text-color)}mwc-button>ha-svg-icon{margin-inline-start:0;margin-inline-end:8px}`))]}}]}}),s.oi);t()}catch(H){t(H)}}))},33793:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(71695),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(47021),i(57243)),s=i(50778),r=i(69634),c=i(27486),l=i(89133),d=(i(20130),i(20165),i(23334),i(62801),i(37583),i(82100)),h=i(36595),u=i(76131),f=(i(97546),i(98241),i(82967)),p=i(61107),v=i(53955),m=e([l]);l=(m.then?(await m)():m)[0];let g,b,y,k,_,w,x,$=e=>e;const C="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",L="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",A="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",M="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",H="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",z="__unassigned__",S={sort:!1,delay:500,delayOnTouchOnly:!0};(0,a.Z)([(0,s.Mo)("ha-config-areas-dashboard")],(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:"is-wide",type:Boolean})],key:"isWide",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:"route",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_areas",value(){return[]}},{kind:"field",key:"_processAreas",value(){return(0,c.Z)(((e,t,i,a)=>{const n=e=>{let a=0,n=0,o=0;for(const i of Object.values(t))i.area_id===e.area_id&&("service"===i.entry_type?n++:a++);for(const t of Object.values(i))t.area_id===e.area_id&&o++;return Object.assign(Object.assign({},e),{},{devices:a,services:n,entities:o})},o=(0,h.N5)(e),s=e.filter((e=>!e.floor_id||!o[e.floor_id]));return{floors:Object.values(a).map((e=>Object.assign(Object.assign({},e),{},{areas:(o[e.floor_id]||[]).map(n)}))),unassignedAreas:s.map(n)}}))}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("hass")){const t=e.get("hass");this.hass.areas!==(null==t?void 0:t.areas)&&(this._areas=Object.values(this.hass.areas))}}},{kind:"method",key:"render",value:function(){const e=this.hass.areas&&this.hass.devices&&this.hass.entities&&this.hass.floors?this._processAreas(this._areas,this.hass.devices,this.hass.entities,this.hass.floors):void 0;return(0,o.dy)(g||(g=$` <hass-tabs-subpage .hass="${0}" .narrow="${0}" .isWide="${0}" back-path="/config" .tabs="${0}" .route="${0}"> <ha-icon-button slot="toolbar-icon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> <div class="container"> ${0} ${0} </div> <ha-fab slot="fab" class="floor" .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> <ha-fab slot="fab" .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage> `),this.hass,this.narrow,this.isWide,f.configSections.areas,this.route,this.hass.localize("ui.common.help"),A,this._showHelp,null==e?void 0:e.floors.map((e=>(0,o.dy)(b||(b=$`<div class="floor"> <div class="header"> <h2> <ha-floor-icon .floor="${0}"></ha-floor-icon> ${0} </h2> <ha-button-menu .floor="${0}" @action="${0}"> <ha-icon-button slot="trigger" .path="${0}"></ha-icon-button> <ha-list-item graphic="icon"><ha-svg-icon .path="${0}" slot="graphic"></ha-svg-icon>${0}</ha-list-item> <ha-list-item class="warning" graphic="icon"><ha-svg-icon class="warning" .path="${0}" slot="graphic"></ha-svg-icon>${0}</ha-list-item> </ha-button-menu> </div> <ha-sortable handle-selector="a" draggable-selector="a" @item-added="${0}" group="floor" .options="${0}" .floor="${0}"> <div class="areas"> ${0} </div> </ha-sortable> </div>`),e,e.name,e,this._handleFloorAction,L,M,this.hass.localize("ui.panel.config.areas.picker.floor.edit_floor"),C,this.hass.localize("ui.panel.config.areas.picker.floor.delete_floor"),this._areaAdded,S,e.floor_id,e.areas.map((e=>this._renderArea(e)))))),null!=e&&e.unassignedAreas.length?(0,o.dy)(y||(y=$`<div class="floor"> <div class="header"> <h2> ${0} </h2> </div> <ha-sortable handle-selector="a" draggable-selector="a" @item-added="${0}" group="floor" .options="${0}" .floor="${0}"> <div class="areas"> ${0} </div> </ha-sortable> </div>`),this.hass.localize("ui.panel.config.areas.picker.unassigned_areas"),this._areaAdded,S,z,null==e?void 0:e.unassignedAreas.map((e=>this._renderArea(e)))):o.Ld,this.hass.localize("ui.panel.config.areas.picker.create_floor"),this._createFloor,H,this.hass.localize("ui.panel.config.areas.picker.create_area"),this._createArea,H)}},{kind:"method",key:"_renderArea",value:function(e){return(0,o.dy)(k||(k=$`<a href="${0}" .sortableData="${0}"> <ha-card outlined> <div style="${0}" class="picture ${0}"> ${0} </div> <div class="card-header"> ${0} <ha-icon-button .area="${0}" .path="${0}" @click="${0}"></ha-icon-button> </div> <div class="card-content"> <div> ${0} </div> </div> </ha-card> </a>`),`/config/areas/area/${e.area_id}`,e,(0,r.V)({backgroundImage:e.picture?`url(${e.picture})`:void 0}),e.picture?"":"placeholder",!e.picture&&e.icon?(0,o.dy)(_||(_=$`<ha-icon .icon="${0}"></ha-icon>`),e.icon):"",e.name,e,M,this._openAreaDetails,(0,l.z)(this.hass.locale,[e.devices&&this.hass.localize("ui.panel.config.integrations.config_entry.devices",{count:e.devices}),e.services&&this.hass.localize("ui.panel.config.integrations.config_entry.services",{count:e.services}),e.entities&&this.hass.localize("ui.panel.config.integrations.config_entry.entities",{count:e.entities})].filter((e=>Boolean(e)))))}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),(0,p.O)()}},{kind:"method",key:"_openAreaDetails",value:function(e){e.preventDefault();const t=e.currentTarget.area;(0,p.E)(this,{entry:t,updateEntry:async e=>(0,d.IO)(this.hass,t.area_id,e)})}},{kind:"method",key:"_areaAdded",value:async function(e){e.stopPropagation();const{floor:t}=e.currentTarget,i=t===z?null:t,{data:a}=e.detail;this._areas=this._areas.map((e=>e.area_id===a.area_id?Object.assign(Object.assign({},e),{},{floor_id:i}):e)),await(0,d.IO)(this.hass,a.area_id,{floor_id:i})}},{kind:"method",key:"_handleFloorAction",value:function(e){const t=e.currentTarget.floor;switch(e.detail.index){case 0:this._editFloor(t);break;case 1:this._deleteFloor(t)}}},{kind:"method",key:"_createFloor",value:function(){this._openFloorDialog()}},{kind:"method",key:"_editFloor",value:function(e){this._openFloorDialog(e)}},{kind:"method",key:"_deleteFloor",value:async function(e){await(0,u.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.areas.picker.floor.confirm_delete"),text:this.hass.localize("ui.panel.config.areas.picker.floor.confirm_delete_text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})&&await(0,h.fu)(this.hass,e.floor_id)}},{kind:"method",key:"_createArea",value:function(){this._openAreaDialog()}},{kind:"method",key:"_showHelp",value:function(){(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.areas.caption"),text:(0,o.dy)(w||(w=$` ${0} <p> ${0} </p> <a href="/config/integrations/dashboard"> ${0} </a> `),this.hass.localize("ui.panel.config.areas.picker.introduction"),this.hass.localize("ui.panel.config.areas.picker.introduction2"),this.hass.localize("ui.panel.config.areas.picker.integrations_page"))})}},{kind:"method",key:"_openAreaDialog",value:function(e){(0,p.E)(this,{entry:e,createEntry:async e=>(0,d.Lo)(this.hass,e)})}},{kind:"method",key:"_openFloorDialog",value:function(e){(0,v.y)(this,{entry:e,createEntry:async(e,t)=>{const i=await(0,h.z3)(this.hass,e);t.forEach((e=>{(0,d.IO)(this.hass,e,{floor_id:i.floor_id})}))},updateEntry:async(t,i,a)=>{const n=await(0,h.jg)(this.hass,e.floor_id,t);i.forEach((e=>{(0,d.IO)(this.hass,e,{floor_id:n.floor_id})})),a.forEach((e=>{(0,d.IO)(this.hass,e,{floor_id:null})}))}})}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(x||(x=$`.container{padding:8px 16px 16px;margin:0 auto 64px auto}.header{display:flex;align-items:center;justify-content:space-between;color:var(--secondary-text-color);padding-inline-start:8px}.header h2{font-size:14px;font-weight:500;margin-top:28px}.header ha-icon{margin-inline-end:8px}.areas{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-gap:16px 16px;max-width:2000px;margin-bottom:16px}.areas>*{max-width:500px}ha-card{overflow:hidden}a{text-decoration:none}h1{padding-bottom:0}.picture{height:150px;width:100%;background-size:cover;background-position:center;position:relative}.placeholder{display:flex;align-items:center;justify-content:center;--mdc-icon-size:48px}.picture.placeholder::before{position:absolute;content:"";width:100%;height:100%;background-color:var(--sidebar-selected-icon-color);opacity:.12}.card-content{min-height:16px;color:var(--secondary-text-color)}.card-header{display:flex;justify-content:space-between;align-items:center;overflow-wrap:anywhere}.warning{color:var(--error-color)}`))}}]}}),o.oi);t()}catch(g){t(g)}}))},61186:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),o=(i(71695),i(47021),i(50778)),s=i(24312),r=i(46670),c=i(33793),l=e([r,c]);[r,c]=l.then?(await l)():l;(0,n.Z)([(0,o.Mo)("ha-config-areas")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"showAdvanced",value(){return!1}},{kind:"field",key:"routerOptions",value(){return{defaultPage:"dashboard",routes:{dashboard:{tag:"ha-config-areas-dashboard",cache:!0},area:{tag:"ha-config-area-page"}}}}},{kind:"method",key:"updatePageEl",value:function(e){e.hass=this.hass,"area"===this._currentPage&&(e.areaId=this.routeTail.path.substr(1)),e.narrow=this.narrow,e.isWide=this.isWide,e.showAdvanced=this.showAdvanced,e.route=this.routeTail}}]}}),s.n);a()}catch(d){a(d)}}))},61107:function(e,t,i){i.d(t,{E:()=>o,O:()=>n});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("97983"),i.e("24199"),i.e("78943"),i.e("42950"),i.e("65505"),i.e("58640"),i.e("42311"),i.e("17283"),i.e("18865"),i.e("27090"),i.e("44959"),i.e("3049"),i.e("72308"),i.e("84958"),i.e("38311"),i.e("17674")]).then(i.bind(i,2711)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:n,dialogParams:t})}},53955:function(e,t,i){i.d(t,{y:()=>o});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("91552"),i.e("97983"),i.e("24199"),i.e("78943"),i.e("42950"),i.e("65505"),i.e("58640"),i.e("42311"),i.e("40516"),i.e("27090"),i.e("72308"),i.e("37133")]).then(i.bind(i,43604)),o=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-floor-registry-detail",dialogImport:n,dialogParams:t})}},98241:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778),s=i(35359);let r,c,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-config-section")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"vertical",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"full-width"})],key:"fullWidth",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(r||(r=l` <div class="content ${0}"> <div class="header"><slot name="header"></slot></div> <div class="together layout ${0}"> <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `),(0,s.$)({narrow:!this.isWide,"full-width":this.fullWidth}),(0,s.$)({narrow:!this.isWide,vertical:this.vertical||!this.isWide,horizontal:!this.vertical&&this.isWide}))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(c||(c=l`:host{display:block}.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.layout{display:flex}.horizontal{flex-direction:row}.vertical{flex-direction:column}.flex-auto{flex:1 1 auto}.header{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);letter-spacing:var(--paper-font-headline_-_letter-spacing);line-height:var(--paper-font-headline_-_line-height);opacity:var(--dark-primary-opacity)}.together{margin-top:var(--config-section-content-together-margin-top,32px)}.intro{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height);width:100%;opacity:var(--dark-primary-opacity);font-size:14px;padding-bottom:20px}.horizontal .intro{max-width:400px;margin-right:40px;margin-inline-end:40px;margin-inline-start:initial}.panel{margin-top:-24px}.panel ::slotted(*){margin-top:24px;display:block}.narrow.content{max-width:640px}.narrow .together{margin-top:var(--config-section-narrow-content-together-margin-top,var(--config-section-content-together-margin-top,20px))}.narrow .intro{padding-bottom:20px;margin-right:0;margin-inline-end:0;margin-inline-start:initial;max-width:500px}.full-width{padding:0}.full-width .layout{flex-direction:column}`))}}]}}),n.oi)},16581:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),o=(i(52247),i(19083),i(71695),i(92745),i(61495),i(61893),i(9359),i(56475),i(31526),i(52924),i(40251),i(61006),i(47021),i(57243)),s=i(50778),r=i(72344),c=i(59847),l=i(93826),d=i(17170),h=i(25433),u=i(75244),f=i(4242),p=i(82480),v=e([d,p]);[d,p]=v.then?(await v)():v;let m,g,b,y,k,_=e=>e;const w=(e,t)=>new Date(e.getTime()-1e3*t).getTime()/1e3,x=(e,t)=>(void 0!==e||void 0!==t)&&(!e||!t||e.length!==t.length||e.some((e=>!t.includes(e)))||t.some((t=>!e.includes(t))));(0,a.Z)([(0,s.Mo)("ha-logbook")],(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:"time",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"entityIds",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"deviceIds",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"virtualize",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-icon"})],key:"noIcon",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-name"})],key:"noName",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"show-indicator"})],key:"showIndicator",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"relative-time"})],key:"relativeTime",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:"show-more-link",type:Boolean})],key:"showMoreLink",value(){return!0}},{kind:"field",decorators:[(0,s.SB)()],key:"_logbookEntries",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_traceContexts",value(){return{}}},{kind:"field",decorators:[(0,s.SB)()],key:"_userIdToName",value(){return{}}},{kind:"field",decorators:[(0,s.SB)()],key:"_error",value:void 0},{kind:"field",key:"_unsubLogbook",value:void 0},{kind:"field",key:"_liveUpdatesEnabled",value(){return!0}},{kind:"field",key:"_pendingStreamMessages",value(){return[]}},{kind:"field",key:"_throttleGetLogbookEntries",value(){return(0,l.P)((()=>this._getLogBookData()),1e3)}},{kind:"method",key:"render",value:function(){return(0,r.p)(this.hass,"logbook")?this._error?(0,o.dy)(m||(m=_`<div class="no-entries"> ${0} </div>`),`${this.hass.localize("ui.components.logbook.retrieval_error")}: ${this._error}`):void 0===this._logbookEntries?(0,o.dy)(g||(g=_` <div class="progress-wrapper"> <ha-spinner></ha-spinner> </div> `)):0===this._logbookEntries.length?(0,o.dy)(b||(b=_`<div class="no-entries"> ${0} </div>`),this.hass.localize("ui.components.logbook.entries_not_found")):(0,o.dy)(y||(y=_` <ha-logbook-renderer .hass="${0}" .narrow="${0}" .virtualize="${0}" .noIcon="${0}" .noName="${0}" .showIndicator="${0}" .relativeTime="${0}" .entries="${0}" .traceContexts="${0}" .userIdToName="${0}" @hass-logbook-live="${0}"></ha-logbook-renderer> `),this.hass,this.narrow,this.virtualize,this.noIcon,this.noName,this.showIndicator,this.relativeTime,this._logbookEntries,this._traceContexts,this._userIdToName,this._handleLogbookLive):o.Ld}},{kind:"method",key:"refresh",value:async function(e=!1){(e||!this._unsubLogbook&&void 0!==this._logbookEntries)&&(this._throttleGetLogbookEntries.cancel(),this._updateTraceContexts.cancel(),this._updateUsers.cancel(),this._unsubscribe(!0),this._liveUpdatesEnabled=!0,e?this._getLogBookData():this._throttleGetLogbookEntries())}},{kind:"method",key:"shouldUpdate",value:function(e){if(1!==e.size||!e.has("hass"))return!0;const t=e.get("hass");return!t||t.localize!==this.hass.localize}},{kind:"method",key:"willUpdate",value:function(e){let t=e.has("time");for(const i of["entityIds","deviceIds"]){if(!e.has(i))continue;const a=e.get(i),n=this[i];if(x(a,n)){t=!0;break}}t&&this.refresh(!0)}},{kind:"method",key:"_handleLogbookLive",value:function(e){e.detail.enable&&!this._liveUpdatesEnabled&&(this._pendingStreamMessages.forEach((e=>this._processStreamMessage(e))),this._pendingStreamMessages=[]),this._liveUpdatesEnabled=e.detail.enable}},{kind:"get",key:"_filterAlwaysEmptyResults",value:function(){const e=this.entityIds,t=this.deviceIds;return Boolean(e||t)&&(!e||0===e.length)&&(!t||0===t.length)}},{kind:"method",key:"_unsubscribe",value:function(e){this._unsubLogbook&&(this._unsubLogbook.then((e=>e())),this._unsubLogbook=void 0,this._logbookEntries=e?void 0:[],this._pendingStreamMessages=[])}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.hasUpdated&&this._subscribeLogbookPeriod(this._calculateLogbookPeriod())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._unsubscribe(!0)}},{kind:"method",key:"_calculateLogbookPeriod",value:function(){const e=new Date;if("range"in this.time)return{now:e,startTime:this.time.range[0],endTime:this.time.range[1],purgeBeforePythonTime:void 0};if("recent"in this.time){const t=w(e,this.time.recent);return{now:e,startTime:new Date(1e3*t),endTime:new Date(e.getTime()+31536e6),purgeBeforePythonTime:w(e,this.time.recent)}}throw new Error("Unexpected time specified")}},{kind:"method",key:"_subscribeLogbookPeriod",value:async function(e){if(!this._unsubLogbook)try{this._unsubLogbook=(0,h.Yc)(this.hass,(e=>{this._processOrQueueStreamMessage(e)}),e.startTime.toISOString(),e.endTime.toISOString(),this.entityIds,this.deviceIds),await this._unsubLogbook}catch(t){this._unsubLogbook=void 0,this._error=t}}},{kind:"method",key:"_getLogBookData",value:async function(){var e;if(this._error=void 0,this._filterAlwaysEmptyResults)return void this._unsubscribe(!1);const t=this._calculateLogbookPeriod();t.startTime>t.now?this._unsubscribe(!1):(this._updateUsers(),null!==(e=this.hass.user)&&void 0!==e&&e.is_admin&&this._updateTraceContexts(),this._subscribeLogbookPeriod(t))}},{kind:"field",key:"_nonExpiredRecords",value(){return e=>this._logbookEntries?e?this._logbookEntries.filter((t=>t.when>e)):this._logbookEntries:[]}},{kind:"field",key:"_processOrQueueStreamMessage",value(){return e=>{this._liveUpdatesEnabled?this._processStreamMessage(e):this._pendingStreamMessages.push(e)}}},{kind:"field",key:"_processStreamMessage",value(){return e=>{const t="recent"in this.time?w(new Date,this.time.recent):void 0,i=[...e.events].reverse();if(!this._logbookEntries||!this._logbookEntries.length)return void(this._logbookEntries=i);if(!i.length)return;const a=this._nonExpiredRecords(t);a.length?i[i.length-1].when>a[0].when?this._logbookEntries=i.concat(a):a[a.length-1].when>i[0].when?this._logbookEntries=a.concat(i):this._logbookEntries=a.concat(i).sort(((e,t)=>t.when-e.when)):this._logbookEntries=i}}},{kind:"field",key:"_updateTraceContexts",value(){return(0,l.P)((async()=>{this._traceContexts=await(0,u.U_)(this.hass)}),6e4)}},{kind:"field",key:"_updateUsers",value(){return(0,l.P)((async()=>{var e;const t={},i=(null===(e=this.hass.user)||void 0===e?void 0:e.is_admin)&&(0,f.uh)(this.hass);for(const a of Object.values(this.hass.states))a.attributes.user_id&&"person"===(0,c.N)(a)&&(t[a.attributes.user_id]=a.attributes.friendly_name);if(i){const e=await i;for(const i of e)i.id in t||(t[i.id]=i.name)}this._userIdToName=t}),6e4)}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,o.iv)(k||(k=_`:host{display:block}:host([virtualize]){height:100%}.no-entries{text-align:center;padding:16px;color:var(--secondary-text-color)}.progress-wrapper{display:flex;justify-content:center;height:100%;align-items:center}`))]}}]}}),o.oi);t()}catch(m){t(m)}}))},30511:function(e,t,i){i.r(t),i.d(t,{mdiHomeAssistant:()=>a});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},16485:function(e,t,i){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),r=i(49722),c=i(76632),l=i(7884),d=i(35185),h=i(65401),u=i(44180),f=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,r.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,f.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,c.shouldPolyfill)(e)&&t.push(Promise.all([i.e("2142"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,l.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,d.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,f.n)(e)))};await e(),t()}catch(p){t(p)}}),1)},31948:function(e,t,i){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)},47641:function(e,t,i){i.d(t,{o:()=>a});i(71695),i(40251),i(47021);const a=async()=>{await Promise.all([i.e("37066"),i.e("24606")]).then(i.bind(i,24700))}},88238:function(e,t,i){i.d(t,{RU:()=>n,X1:()=>a,u4:()=>o,zC:()=>s});i(88044);const a=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,n=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,o=e=>e.split("/")[4],s=e=>e.startsWith("https://brands.home-assistant.io/")}}]);
//# sourceMappingURL=91749.86068c5aa4b411cc.js.map