Closed SirDester closed 2 years ago
history documentation history source (message by IssueLinks)
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (history
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
@bramkragten Thanks for moving the issue to the right place, sorry I opened it wrongly :)
I'm seeing the same behavior as SirDister. Began after updating to HA 2022.2.3. Chrome shows the following error;
9f5922e0.js:1 Uncaught (in promise) RangeError: Invalid time value
at s (9f5922e0.js:1:1159)
at d (9f5922e0.js:1:4723)
at state-history-charts.ts:17:1
at state-history-charts.ts:17:1
at Array.forEach (<anonymous>)
at h (state-history-charts.ts:17:1)
at r.value (ha-panel-history.ts:115:1)
Also getting this behavior after updating to 2022.2.5 (Might have been happening prior to this, but I haven't noticed it until now)
Getting this error message on Firefox 97.0:
Uncaught (in promise) RangeError: date value is not finite in DateTimeFormat.format()
Same issue. (originally thought its https://github.com/home-assistant/frontend/issues/10515, might be related..)
This action had been disabled, that may caused this problem. Relevant json response:
[{
"entity_id": "button.shelly_ota_update",
"state": "unknown",
"attributes": {
"device_class": "update",
"friendly_name": "shelly OTA Update"
},
"last_changed": "2022-02-11T18:00:00+00:00",
"last_updated": "2022-02-11T18:00:00+00:00"
}, {
"state": "unavailable",
"last_changed": "2022-02-11T18:02:51.489805+00:00"
}, {
"state": "unknown",
"last_changed": "2022-02-11T18:02:51.867532+00:00"
}, {
"entity_id": "button.shelly_ota_update",
"state": "",
"attributes": {},
"last_changed": "2022-02-11T18:03:02.567939+00:00",
"last_updated": "2022-02-11T18:03:02.567939+00:00"
}],
I think the state=""
is the problem here.
same stacktrace, here is what at d (9f5922e0.js:1:4723)
is actually:
https://github.com/home-assistant/frontend/blob/dev/src/common/entity/compute_state_display.ts#L126
the issue is that it checks for unknowns and unavialables at https://github.com/home-assistant/frontend/blob/dev/src/common/entity/compute_state_display.ts#L19, but does not checks for empty value. (haven't done a root analysis about why/how can it be empty, maybe in a followup?)
anyways, i made a PR, that may fix it :)
hotfix:
DELETE FROM "states" where state is null
it will remove all records from db without state. may delete more stuff thats needed, but at least you won't need to loose all your history.
@lintaba , followed the provided instruction. History loads okay now. Doesn't seem like many records were lost. The crucial ones were retained!
@lintaba, Thanks for the hotfix and the PR, alas I already cleaned my history at the beginning (but as I told I don't use home assistant from so much time, my history was not so valuable...) so I can't directly check but analysis is good.
@lintaba
My futile attempt to fix the poblem was to use MariaDB and phpMyAdmin on an separate Server for DB administration.
Now I uses your hotfix "[DELETE] FROM states WHERE state is null". It has cleaned 347 records - but i see no effect: History still does not load.
Is there any ohter idea? Do I have to delete local files?
Regards, Eckart
@Eckart0 can you confirm that you have the same stacktrace as we had? You can also turn on "debugger on exception" with chrome. For us it was the 2nd entry in stacktrace that caused the issue.
If my solution was not working for you, maybe you have a different issue than we had.
Hello lintaba, The chrome console with history window shows:
9f5922e0.js:1 Uncaught (in promise) RangeError: Invalid time value
at s (9f5922e0.js:1:1159)
at d (9f5922e0.js:1:4723)
at state-history-charts.ts:17:1
at state-history-charts.ts:17:1
at Array.forEach (<anonymous>)
at h (state-history-charts.ts:17:1)
at r.value (3c471dc4.js:54:1228)
s @ 9f5922e0.js:1
d @ 9f5922e0.js:1
(anonym) @ state-history-charts.ts:17
(anonym) @ state-history-charts.ts:17
h @ state-history-charts.ts:17
value @ 3c471dc4.js:54
await in value (async)
value @ 3c471dc4.js:54
_$AE @ styles.ts:368
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368
await in _$EC (async)
requestUpdate @ styles.ts:368
o @ styles.ts:368
b @ styles.ts:368
w @ styles.ts:368
r @ 3c471dc4.js:1
value @ hass-loading-screen.ts:11
value @ hass-loading-screen.ts:11
_currentLoadProm.l.then._currentLoadProm @ hass-loading-screen.ts:11
Promise.then (async)
value @ hass-loading-screen.ts:11
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368
await in _$EC (async)
requestUpdate @ styles.ts:368
set @ styles.ts:368
k @ styles.ts:368
_$AI @ styles.ts:368
m @ styles.ts:368
T @ styles.ts:368
_$AI @ styles.ts:368
S @ styles.ts:368
update @ styles.ts:368
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368
await in _$EC (async)
requestUpdate @ styles.ts:368
set @ styles.ts:368
k @ styles.ts:368
_$AI @ styles.ts:368
m @ styles.ts:368
T @ styles.ts:368
_$AI @ styles.ts:368
S @ styles.ts:368
update @ styles.ts:368
performUpdate @ styles.ts:368
scheduleUpdate @ styles.ts:368
_$EC @ styles.ts:368
await in _$EC (async)
requestUpdate @ styles.ts:368
set @ styles.ts:368
t @ home-assistant.ts:32
(anonym) @ home-assistant.ts:32
i @ typography.js:181
s @ typography.js:181
(anonym) @ home-assistant.ts:32
The logbook does not work either and shows the same error: "Invalid time value" Do you need more or other information? I could delete all my history data, if that could fix the probleme. They are not very important. Is that a quick solution?
Greetings, Eckart
Von: lintaba @.> Gesendet: Donnerstag, 17. Februar 2022 15:20 An: home-assistant/frontend @.> Cc: Eckart0 @.>; Mention @.> Betreff: Re: [home-assistant/frontend] History page loading forever (Issue #11605)
@Eckart0 https://github.com/Eckart0 can you confirm that you have the same stacktrace as we had? You can also turn on "debugger on exception" with chrome. For us it was the 2nd entry in stacktrace that caused the issue.
If my solution was not working for you, maybe you have a different issue than we had.
— Reply to this email directly, view it on GitHub https://github.com/home-assistant/frontend/issues/11605#issuecomment-1042998883 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHCXC4K2NDW2M6XC5U2CYU3U3T7YJANCNFSM5N2HZVUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHCXC4LA5CNENWIUE2DTF4TU3T7YJA5CNFSM5N2HZVUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHYVOMYY.gif Message ID: @. @.> >
Ok, here ist the result of chrome debugger on event:
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[45715,95457,81855,87224],{12198:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{D_:()=>o,p6:()=>a,mn:()=>c,NC:()=>u,Nh:()=>f,yQ:()=>m});var i=r(14516),n=r(54121);n.Xp&&await n.Xp;const o=(e,t)=>s(t).format(e),s=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"}))),a=(e,t)=>l(t).format(e),l=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"}))),c=((0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric"}))),(e,t)=>d(t).format(e)),d=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short"}))),u=(e,t)=>h(t).format(e),h=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric"}))),f=(e,t)=>p(t).format(e),p=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long"}))),m=(e,t)=>y(t).format(e),y=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric"})));e()}),1)},44583:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{o0:()=>s,E8:()=>l});var i=r(14516),n=r(65810),o=r(54121);o.Xp&&await o.Xp;const s=(e,t)=>a(t).format(e),a=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.y)(e)}))),l=(e,t)=>c(t).format(e),c=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,n.y)(e)})));(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:(0,n.y)(e)})));e()}),1)},49684:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{mr:()=>s,Vu:()=>l,xO:()=>d});var i=r(14516),n=r(65810),o=r(54121);o.Xp&&await o.Xp;const s=(e,t)=>a(t).format(e),a=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:(0,n.y)(e)}))),l=(e,t)=>c(t).format(e),c=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,n.y)(e)}))),d=(e,t)=>u(t).format(e),u=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{weekday:"long",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.y)(e)})));e()}),1)},25516:(e,t,r)=>{r.d(t,{i:()=>i});const i=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){this[`__${String(t.key)}`]=e},get(){return this[`__${String(t.key)}`]},enumerable:!0,configurable:!0},finisher(r){const i=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){if(i.call(this),this[t.key]){const r=this.renderRoot.querySelector(e);if(!r)return;r.scrollTop=this[t.key]}}}})},70518:(e,t,r)=>{r.d(t,{X:()=>i});const i=(e,t,r)=>(void 0!==r&&(r=!!r),e.hasAttribute(t)?!!r||(e.removeAttribute(t),!1):!1!==r&&(e.setAttribute(t,""),!0))},58831:(e,t,r)=>{r.d(t,{M:()=>i});const i=e=>e.substr(0,e.indexOf("."))},29171:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{D:()=>d});var i=r(56007),n=r(12198),o=r(44583),s=r(49684),a=r(18457),l=r(22311),c=e([o,s,n]);[o,s,n]=c.then?await c:c;const d=(e,t,r,c)=>{const d=void 0!==c?c:t.state;if(d===i.lz||d===i.nZ)return e(`state.default.${d}`);if((0,a.SL)(t)){if("monetary"===t.attributes.device_class)try{return(0,a.uf)(d,r,{style:"currency",currency:t.attributes.unit_of_measurement})}catch(e){}return`${(0,a.uf)(d,r)}${t.attributes.unit_of_measurement?" "+t.attributes.unit_of_measurement:""}`}const u=(0,l.N)(t);if("input_datetime"===u){if(void 0===c){let e;return t.attributes.has_date&&t.attributes.has_time?(e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),(0,o.o0)(e,r)):t.attributes.has_date?(e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),(0,n.p6)(e,r)):t.attributes.has_time?(e=new Date,e.setHours(t.attributes.hour,t.attributes.minute),(0,s.mr)(e,r)):t.state}try{const e=c.split(" ");if(2===e.length)return(0,o.o0)(new Date(e.join("T")),r);if(1===e.length){if(c.includes("-"))return(0,n.p6)(new Date(`${c}T00:00`),r);if(c.includes(":")){const e=new Date;return(0,s.mr)(new Date(`${e.toISOString().split("T")[0]}T${c}`),r)}}return c}catch(e){return c}}return"humidifier"===u&&"on"===d&&t.attributes.humidity?`${t.attributes.humidity} %`:"counter"===u||"number"===u||"input_number"===u?(0,a.uf)(d,r):"button"===u||"input_button"===u||"scene"===u||"sensor"===u&&"timestamp"===t.attributes.device_class?(0,o.o0)(new Date(d),r):t.attributes.device_class&&e(`component.${u}.state.${t.attributes.device_class}.${d}`)||e(`component.${u}.state._.${d}`)||d}}))},83849:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(98651),n=r(47181),o=r(72055);const s=(e,t)=>{const r=(null==t?void 0:t.replace)||!1;var a;i.U?i.U.then((()=>s(e,t))):(r?o.E.history.replaceState(null!==(a=o.E.history.state)&&void 0!==a&&a.root?{root:!0}:null,"",e):o.E.history.pushState(null,"",e),(0,n.B)(o.E,"location-changed",{replace:r}))}},18457:(e,t,r)=>{r.d(t,{SL:()=>o,Hd:()=>s,uf:()=>a});var i=r(66477),n=r(27593);const o=e=>!!e.attributes.unit_of_measurement||!!e.attributes.state_class,s=e=>{switch(e.number_format){case i.y4.comma_decimal:return["en-US","en"];case i.y4.decimal_comma:return["de","es","it"];case i.y4.space_comma:return["fr","sv","cs"];case i.y4.system:return;default:return e.language}},a=(e,t,r)=>{const o=t?s(t):void 0;if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)!==i.y4.none&&!Number.isNaN(Number(e))&&Intl)try{return new Intl.NumberFormat(o,l(e,r)).format(Number(e))}catch(t){return console.error(t),new Intl.NumberFormat(void 0,l(e,r)).format(Number(e))}return"string"==typeof e?e:`${(0,n.N)(e,null==r?void 0:r.maximumFractionDigits).toString()}${"currency"===(null==r?void 0:r.style)?` ${r.currency}`:""}`},l=(e,t)=>{const r={maximumFractionDigits:2,...t};if("string"!=typeof e)return r;if(!t||!t.minimumFractionDigits&&!t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;r.minimumFractionDigits=t,r.maximumFractionDigits=t}return r}},43793:(e,t,r)=>{r.d(t,{x:()=>i});const i=(e,t)=>e.substring(0,t.length)===t},36639:(e,t,r)=>{r.d(t,{v:()=>i});const i=(e,t)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!i(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!i(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const o=Object.keys(e);if(n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(!i(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}},8330:(e,t,r)=>{r.d(t,{P:()=>i});const i=(e,t,r=!0,i=!0)=>{let n,o=0;return(...s)=>{const a=()=>{o=!1===r?0:Date.now(),n=void 0,e(...s)},l=Date.now();o||!1!==r||(o=l);const c=t-(l-o);c<=0||c>t?(n&&(clearTimeout(n),n=void 0),o=l,e(...s)):n||!1===i||(n=window.setTimeout(a,c))}}},31206:(e,t,r)=>{r.r(t),r.d(t,{HaCircularProgress:()=>y});var i=r(54930),n=r(37500),o=r(72367);function s(){s=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!c(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=h(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function a(e){var t,r=h(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function l(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function c(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function p(e,t,r){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},p(e,t,r||e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}let y=function(e,t,r,i){var n=s();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var u=t((function(e){n.initializeInstanceElements(e,h.elements)}),r),h=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(d(o.descriptor)||d(n.descriptor)){if(c(o)||c(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(c(o)){if(c(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}l(o,n)}else t.push(o)}return t}(u.d.map(a)),e);return n.initializeClassElements(u.F,h.elements),n.runClassFinishers(u.F,h.finishers)}([(0,o.Mo)("ha-circular-progress")],(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"active",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"alt",value:()=>"Loading"},{kind:"field",decorators:[(0,o.Cb)()],key:"size",value:()=>"medium"},{kind:"set",key:"density",value:function(e){}},{kind:"get",key:"density",value:function(){switch(this.size){case"tiny":return-8;case"small":return-5;default:return 0;case"large":return 5}}},{kind:"set",key:"indeterminate",value:function(e){}},{kind:"get",key:"indeterminate",value:function(){return this.active}},{kind:"get",static:!0,key:"styles",value:function(){return[p(m(r),"styles",this),n.iv`
:host {
overflow: hidden;
}
`]}}]}}),i.D)},22814:(e,t,r)=>{r.d(t,{uw:()=>i,iI:()=>n,W2:()=>o,TZ:()=>s});const i=`${location.protocol}//${location.host}`,n=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),o=async(e,t,r,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:r,password:i}),s=async(e,t,r)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:r})},99990:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{W:()=>s});var i=r(58763),n=e([i]);i=(n.then?await n:n)[0];const o={};const s=(e,t,r,n,s)=>{const c=r.cacheKey,u=new Date,h=new Date(u);h.setHours(h.getHours()-r.hoursToShow);let f=h,p=!1,m=o[c+`_${r.hoursToShow}`];if(m&&f>=m.startTime&&f<=m.endTime&&m.language===s){if(f=m.endTime,p=!0,u<=m.endTime)return m.prom}else m=o[c]=function(e,t,r){return{prom:Promise.resolve({line:[],timeline:[]}),language:e,startTime:t,endTime:r,data:{line:[],timeline:[]}}}(s,h,u);const y=m.prom;return m.prom=(async()=>{let r;try{r=(await Promise.all([y,(0,i.vq)(e,t,f,u,p)]))[1]}catch(e){throw delete o[c],e}const s=(0,i.Nu)(e,r,n);return p?(a(s.line,m.data.line),l(s.timeline,m.data.timeline),d(h,m.data)):m.data=s,m.data})(),m.startTime=h,m.endTime=u,m.prom},a=(e,t)=>{e.forEach((e=>{const r=e.unit,i=t.find((e=>e.unit===r));i?e.data.forEach((e=>{const t=i.data.find((t=>e.entity_id===t.entity_id));t?t.states=t.states.concat(e.states):i.data.push(e)})):t.push(e)}))},l=(e,t)=>{e.forEach((e=>{const r=t.find((t=>t.entity_id===e.entity_id));r?r.data=r.data.concat(e.data):t.push(e)}))},c=(e,t)=>{if(0===t.length)return t;const r=t.findIndex((t=>new Date(t.last_changed)>e));if(0===r)return t;const i=-1===r?t.length-1:r-1;return t[i].last_changed=e,t.slice(i)},d=(e,t)=>{t.line.forEach((t=>{t.data.forEach((t=>{t.states=c(e,t.states)}))})),t.timeline.forEach((t=>{t.data=c(e,t.data)}))}}))},55422:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{jV:()=>c,sS:()=>u,rM:()=>h,tf:()=>y});var i=r(49706),n=r(58831),o=r(29171),s=r(56007),a=e([o]);o=(a.then?await a:a)[0];const l="ui.components.logbook.messages",c=["proximity","sensor"],d={},u=async(e,t,r)=>{const i=await e.loadBackendTranslation("device_class");return f(e,i,await m(e,t,void 0,void 0,void 0,r))},h=async(e,t,r,i,n)=>{const o=await e.loadBackendTranslation("device_class");return f(e,o,await p(e,t,r,i,n))},f=(e,t,r)=>{for(const i of r){const r=e.states[i.entity_id];i.state&&r&&(i.message=v(e,t,i.state,r,(0,n.M)(i.entity_id)))}return r},p=async(e,t,r,i,n)=>{const o="*";i||(i=o);const s=`${t}${r}`;if(d[s]||(d[s]={}),i in d[s])return d[s][i];if(i!==o&&d[s]["*"]){return(await d[s]["*"]).filter((e=>e.entity_id===i))}return d[s][i]=m(e,t,r,i!==o?i:void 0,n).then((e=>e.reverse())),d[s][i]},m=async(e,t,r,i,n,o)=>{const s=new URLSearchParams;return r&&s.append("end_time",r),i&&s.append("entity",i),n&&s.append("entity_matches_only",""),o&&s.append("context_id",o),e.callApi("GET",`logbook/${t}?${s.toString()}`)},y=(e,t)=>{d[`${e}${t}`]={}},v=(e,t,r,n,a)=>{switch(a){case"device_tracker":case"person":return"not_home"===r?t(`${l}.was_away`):"home"===r?t(`${l}.was_at_home`):t(`${l}.was_at_state`,"state",r);case"sun":return t("above_horizon"===r?`${l}.rose`:`${l}.set`);case"binary_sensor":{const e=r===i.uo,o=r===i.lC,s=n.attributes.device_class;switch(s){case"battery":if(e)return t(`${l}.was_low`);if(o)return t(`${l}.was_normal`);break;case"connectivity":if(e)return t(`${l}.was_connected`);if(o)return t(`${l}.was_disconnected`);break;case"door":case"garage_door":case"opening":case"window":if(e)return t(`${l}.was_opened`);if(o)return t(`${l}.was_closed`);break;case"lock":if(e)return t(`${l}.was_unlocked`);if(o)return t(`${l}.was_locked`);break;case"plug":if(e)return t(`${l}.was_plugged_in`);if(o)return t(`${l}.was_unplugged`);break;case"presence":if(e)return t(`${l}.was_at_home`);if(o)return t(`${l}.was_away`);break;case"safety":if(e)return t(`${l}.was_unsafe`);if(o)return t(`${l}.was_safe`);break;case"cold":case"gas":case"heat":case"moisture":case"motion":case"occupancy":case"power":case"problem":case"smoke":case"sound":case"vibration":if(e)return t(`${l}.detected_device_class`,{device_class:t(`component.binary_sensor.device_class.${s}`)});if(o)return t(`${l}.cleared_device_class`,{device_class:t(`component.binary_sensor.device_class.${s}`)});break;case"tamper":if(e)return t(`${l}.detected_tampering`);if(o)return t(`${l}.cleared_tampering`)}break}case"cover":switch(r){case"open":return t(`${l}.was_opened`);case"opening":return t(`${l}.is_opening`);case"closing":return t(`${l}.is_closing`);case"closed":return t(`${l}.was_closed`)}break;case"lock":if("unlocked"===r)return t(`${l}.was_unlocked`);if("locked"===r)return t(`${l}.was_locked`)}return r===i.uo?t(`${l}.turned_on`):r===i.lC?t(`${l}.turned_off`):s.V_.includes(r)?t(`${l}.became_unavailable`):e.localize(`${l}.changed_to_state`,"state",n?(0,o.D)(t,n,e.locale,r):r)}}))},9893:(e,t,r)=>{r.d(t,{Qo:()=>i,kb:()=>o,cs:()=>s});const i="custom:",n=window;"customCards"in n||(n.customCards=[]);const o=n.customCards,s=e=>o.find((t=>t.type===e))},97389:(e,t,r)=>{if(r.d(t,{mA:()=>n,lj:()=>o,U_:()=>s,nV:()=>a,Zm:()=>l}),32143==r.j)var i=r(43793);const n=(e,t,r,i)=>e.callWS({type:"trace/get",domain:t,item_id:r,run_id:i}),o=(e,t,r)=>e.callWS({type:"trace/list",domain:t,item_id:r}),s=(e,t,r)=>e.callWS({type:"trace/contexts",domain:t,item_id:r}),a=(e,t)=>{const r=t.split("/").reverse();let i=e;for(;r.length;){const e=r.pop(),t=Number(e);if(isNaN(t))i=i[e];else if(Array.isArray(i))i=i[t];else if(0!==t)throw new Error("If config is not an array, can only return index 0")}return i},l=e=>"trigger"===e||(0,i.x)(e,"trigger/")},65253:(e,t,r)=>{r.d(t,{Pb:()=>i,CE:()=>n,uh:()=>o,r4:()=>s,Nq:()=>a,h8:()=>l,fm:()=>c,FH:()=>p});const i="system-admin",n="system-users",o=async e=>e.callWS({type:"config/auth/list"}),s=async(e,t,r,i)=>e.callWS({type:"config/auth/create",name:t,group_ids:r,local_only:i}),a=async(e,t,r)=>e.callWS({...r,type:"config/auth/update",user_id:t}),l=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),c=e=>e?e.trim().split(" ").slice(0,3).map((e=>e.substring(0,1))).join(""):"?",d=32143==r.j?"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":null,u=32143==r.j?"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":null,h=32143==r.j?"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":null,f=32143==r.j?"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":null,p=(e,t,r)=>{const i=[],n=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&i.push([d,n("is_owner")]),r&&t.system_generated&&i.push([u,n("is_system")]),t.local_only&&i.push([h,n("is_local")]),t.is_active||i.push([f,n("is_not_active")]),i}},60034:(e,t,r)=>{r.a(e,(async e=>{var t=r(37500),i=r(72367),n=r(31811),o=e([n]);function s(){s=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!c(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=h(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function a(e){var t,r=h(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function l(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function c(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}n=(o.then?await o:o)[0];!function(e,t,r,i){var n=s();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var u=t((function(e){n.initializeInstanceElements(e,h.elements)}),r),h=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(d(o.descriptor)||d(n.descriptor)){if(c(o)||c(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(c(o)){if(c(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}l(o,n)}else t.push(o)}return t}(u.d.map(a)),e);n.initializeClassElements(u.F,h.elements),n.runClassFinishers(u.F,h.finishers)}([(0,i.Mo)("more-info-default")],(function(e,r){return{F:class extends r{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"stateObj",value:void 0},{kind:"method",key:"render",value:function(){return this.hass&&this.stateObj?t.dy`<ha-attributes
.hass=${this.hass}
.stateObj=${this.stateObj}
></ha-attributes>`:t.dy``}}]}}),t.oi)}))},86201:(e,t,r)=>{r.a(e,(async e=>{r.r(t),r.d(t,{MoreInfoDialog:()=>j});r(53918),r(27303),r(22001);var i=r(37500),n=r(72367),o=r(40015),s=r(7323),a=r(49706),l=r(47181),c=r(58831),d=r(91741),u=r(83849),h=(r(34821),r(90806),r(10983),r(74186)),f=r(55422),p=r(94458),m=r(11654),y=r(11789),v=r(26765),g=r(74265),b=r(60034),w=r(4295),k=r(93797),_=r(10122),E=e([f,_,k,w,b,y]);function P(){P=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!x(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=T(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:S(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=S(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function C(e){var t,r=T(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function D(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function x(e){return e.decorators&&e.decorators.length}function $(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function S(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function T(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}[f,_,k,w,b,y]=E.then?await E:E;const z=["camera","configurator"],I=["scene","automation"],O=["script"];let j=function(e,t,r,i){var n=P();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if($(o.descriptor)||$(n.descriptor)){if(x(o)||x(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(x(o)){if(x(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}D(o,n)}else t.push(o)}return t}(s.d.map(C)),e);return n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-dialog")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"large",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_currTabIndex",value:()=>0},{kind:"method",key:"showDialog",value:function(e){this._entityId=e.entityId,this._entityId?this.large=!1:this.closeDialog()}},{kind:"method",key:"closeDialog",value:function(){this._entityId=void 0,this._currTabIndex=0,(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"shouldShowEditIcon",value:function(e,t){return!(!I.includes(e)||!t.attributes.id)||(!!O.includes(e)||"person"===e&&"false"!==t.attributes.editable)}},{kind:"method",key:"render",value:function(){if(!this._entityId)return i.dy``;const e=this._entityId,t=this.hass.states[e];if(!t)return i.dy``;const r=(0,c.M)(e),n=(0,d.C)(t);return i.dy`
<ha-dialog
open
@closed=${this.closeDialog}
.heading=${n}
hideActions
data-domain=${r}
>
<div slot="heading" class="heading">
<ha-header-bar>
<ha-icon-button
slot="navigationIcon"
dialogAction="cancel"
.label=${this.hass.localize("ui.dialogs.more_info_control.dismiss")}
.path=${"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"}
></ha-icon-button>
<div
slot="title"
class="main-title"
.title=${n}
@click=${this._enlarge}
>
${n}
</div>
${this.hass.user.is_admin?i.dy`
<ha-icon-button
slot="actionItems"
.label=${this.hass.localize("ui.dialogs.more_info_control.settings")}
.path=${"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"}
@click=${this._gotoSettings}
></ha-icon-button>
`:""}
${this.shouldShowEditIcon(r,t)?i.dy`
<ha-icon-button
slot="actionItems"
.label=${this.hass.localize("ui.dialogs.more_info_control.edit")}
.path=${"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"}
@click=${this._gotoEdit}
></ha-icon-button>
`:""}
</ha-header-bar>
${a.l.includes(r)&&(this._computeShowHistoryComponent(e)||this._computeShowLogBookComponent(e))?i.dy`
<mwc-tab-bar
.activeIndex=${this._currTabIndex}
@MDCTabBar:activated=${this._handleTabChanged}
>
<mwc-tab
.label=${this.hass.localize("ui.dialogs.more_info_control.details")}
></mwc-tab>
<mwc-tab
.label=${this.hass.localize("ui.dialogs.more_info_control.history")}
></mwc-tab>
</mwc-tab-bar>
`:""}
</div>
<div class="content">
${(0,o.F)(0===this._currTabIndex?i.dy`
${z.includes(r)?"":i.dy`
<state-card-content
in-dialog
.stateObj=${t}
.hass=${this.hass}
></state-card-content>
`}
${a.l.includes(r)||!this._computeShowHistoryComponent(e)?"":i.dy`<ha-more-info-history
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history>`}
${a.l.includes(r)||!this._computeShowLogBookComponent(e)?"":i.dy`<ha-more-info-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-logbook>`}
<more-info-content
.stateObj=${t}
.hass=${this.hass}
></more-info-content>
${t.attributes.restored?i.dy`
<p>
${this.hass.localize("ui.dialogs.more_info_control.restored.not_provided")}
</p>
<p>
${this.hass.localize("ui.dialogs.more_info_control.restored.remove_intro")}
</p>
<mwc-button
class="warning"
@click=${this._removeEntity}
>
${this.hass.localize("ui.dialogs.more_info_control.restored.remove_action")}
</mwc-button>
`:""}
`:i.dy`
<ha-more-info-history
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history>
<ha-more-info-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-logbook>
`)}
</div>
</ha-dialog>
`}},{kind:"method",key:"_enlarge",value:function(){this.large=!this.large}},{kind:"method",key:"_computeShowHistoryComponent",value:function(e){return(0,s.p)(this.hass,"history")&&!a.f0.includes((0,c.M)(e))}},{kind:"method",key:"_computeShowLogBookComponent",value:function(e){if(!(0,s.p)(this.hass,"logbook"))return!1;const t=this.hass.states[e];if(!t||t.attributes.unit_of_measurement)return!1;const r=(0,c.M)(e);return!f.jV.includes(r)&&!a.f0.includes(r)}},{kind:"method",key:"_removeEntity",value:function(){const e=this._entityId;(0,v.g7)(this,{title:this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_title"),text:this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_text"),confirmText:this.hass.localize("ui.common.remove"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{(0,h.z3)(this.hass,e)}})}},{kind:"method",key:"_gotoSettings",value:function(){(0,g.ku)(),(0,p.R)(this,{entity_id:this._entityId}),this.closeDialog()}},{kind:"method",key:"_gotoEdit",value:function(){const e=this.hass.states[this._entityId],t=(0,c.M)(this._entityId);let r=e.entity_id;(I.includes(t)||"person"===t)&&(r=e.attributes.id),(0,u.c)(`/config/${t}/edit/${r}`),this.closeDialog()}},{kind:"method",key:"_handleTabChanged",value:function(e){e.detail.index!==this._currTabIndex&&(this._currTabIndex=e.detail.index)}},{kind:"get",static:!0,key:"styles",value:function(){return[m.yu,i.iv`
ha-dialog {
--dialog-surface-position: static;
--dialog-content-position: static;
}
ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
flex-shrink: 0;
display: block;
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-header-bar {
--mdc-theme-primary: var(--app-header-background-color);
--mdc-theme-on-primary: var(--app-header-text-color, white);
border-bottom: none;
}
}
.heading {
border-bottom: 1px solid
var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
}
@media all and (min-width: 451px) and (min-height: 501px) {
ha-dialog {
--mdc-dialog-max-width: 90vw;
}
.content {
width: 352px;
}
ha-header-bar {
width: 400px;
}
.main-title {
overflow: hidden;
text-overflow: ellipsis;
cursor: default;
}
ha-dialog[data-domain="camera"] .content,
ha-dialog[data-domain="camera"] ha-header-bar {
width: auto;
}
:host([large]) .content {
width: calc(90vw - 48px);
}
:host([large]) ha-dialog[data-domain="camera"] .content,
:host([large]) ha-header-bar {
width: 90vw;
}
}
ha-dialog[data-domain="camera"] {
--dialog-content-padding: 0;
}
state-card-content,
ha-more-info-history,
ha-more-info-logbook:not(:last-child) {
display: block;
margin-bottom: 16px;
}
`]}}]}}),i.oi)}))},4295:(e,t,r)=>{r.a(e,(async e=>{var t=r(83008),i=r(37500),n=r(72367),o=r(7323),s=r(47181),a=r(8330),l=r(77243),c=r(99990),d=e([c,l]);function u(){u=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!p(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=v(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:y(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=y(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function h(e){var t,r=v(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function f(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function p(e){return e.decorators&&e.decorators.length}function m(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function y(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function v(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function b(e,t,r){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},b(e,t,r||e)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}[c,l]=d.then?await d:d;!function(e,t,r,i){var n=u();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(m(o.descriptor)||m(n.descriptor)){if(p(o)||p(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(p(o)){if(p(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}f(o,n)}else t.push(o)}return t}(s.d.map(h)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-history")],(function(e,r){class l extends r{constructor(...t){super(...t),e(this)}}return{F:l,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_stateHistory",value:void 0},{kind:"field",key:"_showMoreHref",value:()=>""},{kind:"field",key:"_throttleGetStateHistory",value(){return(0,a.P)((()=>{this._getStateHistory()}),1e4)}},{kind:"method",key:"render",value:function(){return this.entityId?i.dy`${(0,o.p)(this.hass,"history")?i.dy` <div class="header">
<div class="title">
${this.hass.localize("ui.dialogs.more_info_control.history")}
</div>
<a href=${this._showMoreHref} @click=${this._close}
>${this.hass.localize("ui.dialogs.more_info_control.show_more")}</a
>
</div>
<state-history-charts
up-to-now
.hass=${this.hass}
.historyData=${this._stateHistory}
.isLoadingData=${!this._stateHistory}
></state-history-charts>`:""}`:i.dy``}},{kind:"method",key:"updated",value:function(e){if(b(w(l.prototype),"updated",this).call(this,e),e.has("entityId")){if(this._stateHistory=void 0,!this.entityId)return;return this._showMoreHref=`/history?entity_id=${this.entityId}&start_date=${(0,t.Z)().toISOString()}`,void this._throttleGetStateHistory()}if(!this.entityId||!e.has("hass"))return;const r=e.get("hass");r&&this.hass.states[this.entityId]!==(null==r?void 0:r.states[this.entityId])&&setTimeout(this._throttleGetStateHistory,1e3)}},{kind:"method",key:"_getStateHistory",value:async function(){(0,o.p)(this.hass,"history")&&(this._stateHistory=await(0,c.W)(this.hass,this.entityId,{cacheKey:`more_info.${this.entityId}`,hoursToShow:24},this.hass.localize,this.hass.language))}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,s.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[i.iv`
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.header > a,
a:visited {
color: var(--primary-color);
}
.title {
font-family: var(--paper-font-title_-_font-family);
-webkit-font-smoothing: var(
--paper-font-title_-_-webkit-font-smoothing
);
font-size: var(--paper-font-subhead_-_font-size);
font-weight: var(--paper-font-title_-_font-weight);
letter-spacing: var(--paper-font-title_-_letter-spacing);
line-height: var(--paper-font-title_-_line-height);
}
`]}}]}}),i.oi)}))},93797:(e,t,r)=>{r.a(e,(async e=>{var t=r(83008),i=r(37500),n=r(72367),o=r(7323),s=r(47181),a=r(22311),l=r(8330),c=(r(31206),r(55422)),d=r(97389),u=r(65253),h=r(97740),f=r(11654),p=e([c,h]);function m(){m=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!g(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=k(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:w(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=w(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function y(e){var t,r=k(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function v(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function g(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function w(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function k(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function E(e,t,r){return E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},E(e,t,r||e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}[c,h]=p.then?await p:p;!function(e,t,r,i){var n=m();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(b(o.descriptor)||b(n.descriptor)){if(g(o)||g(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(g(o)){if(g(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}v(o,n)}else t.push(o)}return t}(s.d.map(y)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-logbook")],(function(e,r){class h extends r{constructor(...t){super(...t),e(this)}}return{F:h,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_logbookEntries",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_traceContexts",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_userIdToName",value:()=>({})},{kind:"field",key:"_lastLogbookDate",value:void 0},{kind:"field",key:"_fetchUserPromise",value:void 0},{kind:"field",key:"_error",value:void 0},{kind:"field",key:"_showMoreHref",value:()=>""},{kind:"field",key:"_throttleGetLogbookEntries",value(){return(0,l.P)((()=>{this._getLogBookData()}),1e4)}},{kind:"method",key:"render",value:function(){if(!this.entityId)return i.dy``;return this.hass.states[this.entityId]?i.dy`
${(0,o.p)(this.hass,"logbook")?this._error?i.dy`<div class="no-entries">
${`${this.hass.localize("ui.components.logbook.retrieval_error")}: ${this._error}`}
</div>`:this._logbookEntries?this._logbookEntries.length?i.dy`
<div class="header">
<div class="title">
${this.hass.localize("ui.dialogs.more_info_control.logbook")}
</div>
<a href=${this._showMoreHref} @click=${this._close}
>${this.hass.localize("ui.dialogs.more_info_control.show_more")}</a
>
</div>
<ha-logbook
narrow
no-icon
no-name
relative-time
.hass=${this.hass}
.entries=${this._logbookEntries}
.traceContexts=${this._traceContexts}
.userIdToName=${this._userIdToName}
></ha-logbook>
`:i.dy`<div class="no-entries">
${this.hass.localize("ui.components.logbook.entries_not_found")}
</div>`:i.dy`
<ha-circular-progress
active
alt=${this.hass.localize("ui.common.loading")}
></ha-circular-progress>
`:""}
`:i.dy``}},{kind:"method",key:"firstUpdated",value:function(){this._fetchUserPromise=this._fetchUserNames()}},{kind:"method",key:"updated",value:function(e){if(E(P(h.prototype),"updated",this).call(this,e),e.has("entityId")){if(this._lastLogbookDate=void 0,this._logbookEntries=void 0,!this.entityId)return;return this._showMoreHref=`/logbook?entity_id=${this.entityId}&start_date=${(0,t.Z)().toISOString()}`,void this._throttleGetLogbookEntries()}if(!this.entityId||!e.has("hass"))return;const r=e.get("hass");r&&this.hass.states[this.entityId]!==(null==r?void 0:r.states[this.entityId])&&setTimeout(this._throttleGetLogbookEntries,1e3)}},{kind:"method",key:"_getLogBookData",value:async function(){if(!(0,o.p)(this.hass,"logbook"))return;const e=this._lastLogbookDate||new Date((new Date).getTime()-864e5),t=new Date;let r,i;try{var n;[r,i]=await Promise.all([(0,c.rM)(this.hass,e.toISOString(),t.toISOString(),this.entityId,!0),null!==(n=this.hass.user)&&void 0!==n&&n.is_admin?(0,d.U_)(this.hass):{},this._fetchUserPromise])}catch(e){this._error=e.message}this._logbookEntries=this._logbookEntries?[...r,...this._logbookEntries]:r,this._lastLogbookDate=t,this._traceContexts=i}},{kind:"method",key:"_fetchUserNames",value:async function(){var e;const t={},r=(null===(e=this.hass.user)||void 0===e?void 0:e.is_admin)&&(0,u.uh)(this.hass);if(Object.values(this.hass.states).forEach((e=>{e.attributes.user_id&&"person"===(0,a.N)(e)&&(this._userIdToName[e.attributes.user_id]=e.attributes.friendly_name)})),r){const e=await r;for(const r of e)r.id in t||(t[r.id]=r.name)}this._userIdToName=t}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,s.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,i.iv`
.no-entries {
text-align: center;
padding: 16px;
color: var(--secondary-text-color);
}
ha-logbook {
--logbook-max-height: 250px;
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-logbook {
--logbook-max-height: unset;
}
}
ha-circular-progress {
display: flex;
justify-content: center;
}
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.header > a,
a:visited {
color: var(--primary-color);
}
.title {
font-family: var(--paper-font-title_-_font-family);
-webkit-font-smoothing: var(
--paper-font-title_-_-webkit-font-smoothing
);
font-size: var(--paper-font-subhead_-_font-size);
font-weight: var(--paper-font-title_-_font-weight);
letter-spacing: var(--paper-font-title_-_letter-spacing);
line-height: var(--paper-font-title_-_line-height);
}
`]}}]}}),i.oi)}))},10122:(e,t,r)=>{r.a(e,(async e=>{var t=r(37500),i=r(72367),n=r(80910),o=r(49686),s=r(82791),a=e([o]);function l(){l=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!u(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=p(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:f(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=f(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function c(e){var t,r=p(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function d(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function u(e){return e.decorators&&e.decorators.length}function h(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function f(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function y(e,t,r){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},y(e,t,r||e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}o=(a.then?await a:a)[0];let g=function(e,t,r,i){var n=l();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(h(o.descriptor)||h(n.descriptor)){if(u(o)||u(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(u(o)){if(u(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}d(o,n)}else t.push(o)}return t}(s.d.map(c)),e);return n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}(null,(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",key:"_detachedChild",value:void 0},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"update",value:function(e){y(v(r.prototype),"update",this).call(this,e);const t=this.stateObj,i=this.hass;if(!t||!i)return void(this.lastChild&&(this._detachedChild=this.lastChild,this.removeChild(this.lastChild)));let a;if(this._detachedChild&&(this.appendChild(this._detachedChild),this._detachedChild=void 0),t.attributes&&"custom_ui_more_info"in t.attributes)a=t.attributes.custom_ui_more_info;else{const e=(0,s.S)(t);(0,o.importMoreInfoControl)(e),a="hidden"===e?void 0:`more-info-${e}`}a&&(0,n.Z)(this,a.toUpperCase(),{hass:i,stateObj:t})}}]}}),t.fl);customElements.define("more-info-content",g)}))},82791:(e,t,r)=>{r.d(t,{S:()=>s,n3:()=>a,ST:()=>l});var i=r(49706),n=r(22311);const o={alarm_control_panel:()=>r.e(81838).then(r.bind(r,81838)),automation:()=>r.e(35513).then(r.bind(r,35513)),camera:()=>Promise.all([r.e(54040),r.e(14920)]).then(r.bind(r,14920)),climate:()=>Promise.all([r.e(75009),r.e(42955),r.e(5632),r.e(9823)]).then(r.bind(r,9823)),configurator:()=>Promise.all([r.e(4940),r.e(42949)]).then(r.bind(r,94433)),counter:()=>r.e(6850).then(r.bind(r,6850)),cover:()=>Promise.all([r.e(31811),r.e(97148)]).then(r.bind(r,97148)),fan:()=>Promise.all([r.e(75009),r.e(42955),r.e(6038),r.e(31811),r.e(69626)]).then(r.bind(r,69626)),group:()=>Promise.all([r.e(75009),r.e(42955),r.e(46002),r.e(18449),r.e(11789),r.e(39902)]).then(r.bind(r,39902)),humidifier:()=>Promise.all([r.e(75009),r.e(42955),r.e(79277),r.e(35317)]).then(r.bind(r,35317)),input_datetime:()=>Promise.all([r.e(75009),r.e(42955),r.e(88985),r.e(36215),r.e(51522),r.e(56127)]).then(r.bind(r,56127)),light:()=>Promise.all([r.e(75009),r.e(42955),r.e(92887),r.e(31811),r.e(29598)]).then(r.bind(r,29598)),lock:()=>Promise.all([r.e(31811),r.e(85083)]).then(r.bind(r,85083)),media_player:()=>Promise.all([r.e(75009),r.e(42955),r.e(22946),r.e(46684)]).then(r.bind(r,46684)),person:()=>Promise.all([r.e(31811),r.e(23956),r.e(95993)]).then(r.bind(r,95993)),remote:()=>Promise.all([r.e(75009),r.e(42955),r.e(5713),r.e(31811),r.e(6514)]).then(r.bind(r,6514)),script:()=>r.e(71593).then(r.bind(r,71593)),sun:()=>r.e(66369).then(r.bind(r,66369)),timer:()=>Promise.all([r.e(31811),r.e(69491)]).then(r.bind(r,69491)),vacuum:()=>Promise.all([r.e(75009),r.e(42955),r.e(11139),r.e(31811),r.e(17184)]).then(r.bind(r,17184)),water_heater:()=>Promise.all([r.e(75009),r.e(42955),r.e(52994)]).then(r.bind(r,52994)),weather:()=>r.e(8914).then(r.bind(r,8914))},s=e=>{const t=(0,n.N)(e);return a(t)},a=e=>i.l.includes(e)?e:i.tm.includes(e)?"hidden":"default",l=e=>{e in o&&o[e]()}},94458:(e,t,r)=>{r.d(t,{T:()=>n,R:()=>s});var i=r(47181);const n=()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(29907),r.e(68200),r.e(88985),r.e(30879),r.e(28055),r.e(46976),r.e(22001),r.e(82376),r.e(28007),r.e(16023),r.e(68101),r.e(640),r.e(1929),r.e(49499)]).then(r.bind(r,49499)),o=()=>document.querySelector("home-assistant").shadowRoot.querySelector("dialog-entity-editor"),s=(e,t)=>((0,i.B)(e,"show-dialog",{dialogTag:"dialog-entity-editor",dialogImport:n,dialogParams:t}),o)},97740:(e,t,r)=>{r.a(e,(async e=>{var t=r(196),i=r(37500),n=r(72367),o=r(228),s=r(49706),a=r(12198),l=r(49684),c=r(25516),d=r(47181),u=r(58831),h=r(16023),f=r(87744),p=(r(3143),r(31206),r(42952)),m=r(11654),y=e([l,a,p]);function v(){v=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!w(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=E(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:_(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=_(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function g(e){var t,r=E(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function b(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function w(e){return e.decorators&&e.decorators.length}function k(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function _(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function E(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}[l,a,p]=y.then?await y:y;!function(e,t,r,i){var n=v();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(k(o.descriptor)||k(n.descriptor)){if(w(o)||w(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(w(o)){if(w(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}b(o,n)}else t.push(o)}return t}(s.d.map(g)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-logbook")],(function(e,r){return{F:class extends r{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"userIdToName",value:()=>({})},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"traceContexts",value:()=>({})},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"entries",value:()=>[]},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"narrow"})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"rtl",type:Boolean})],key:"_rtl",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"virtualize",reflect:!0})],key:"virtualize",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-icon"})],key:"noIcon",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-name"})],key:"noName",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"relative-time"})],key:"relativeTime",value:()=>!1},{kind:"field",decorators:[(0,c.i)(".container")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"shouldUpdate",value:function(e){const t=e.get("hass"),r=void 0===t||t.locale!==this.hass.locale;return e.has("entries")||e.has("traceContexts")||r}},{kind:"method",key:"updated",value:function(e){const t=e.get("hass");void 0!==t&&t.language===this.hass.language||(this._rtl=(0,f.HE)(this.hass))}},{kind:"method",key:"render",value:function(){var e;return null!==(e=this.entries)&&void 0!==e&&e.length?i.dy`
<div
class="container ha-scrollbar ${(0,o.$)({narrow:this.narrow,rtl:this._rtl,"no-name":this.noName,"no-icon":this.noIcon})}"
@scroll=${this._saveScrollPos}
>
${this.virtualize?(0,t.AR)({items:this.entries,layout:t.bW,renderItem:(e,t)=>this._renderLogbookItem(e,t)}):this.entries.map(((e,t)=>this._renderLogbookItem(e,t)))}
</div>
`:i.dy`
<div class="container no-entries" .dir=${(0,f.$3)(this._rtl)}>
${this.hass.localize("ui.components.logbook.entries_not_found")}
</div>
`}},{kind:"method",key:"_renderLogbookItem",value:function(e,t){if(void 0===t)return i.dy``;const r=this.entries[t-1],n=e.entity_id?this.hass.states[e.entity_id]:void 0,c=e.context_user_id&&this.userIdToName[e.context_user_id],d=e.entity_id?(0,u.M)(e.entity_id):e.domain;return i.dy`
<div class="entry-container">
${0===t||null!=e&&e.when&&null!=r&&r.when&&new Date(e.when).toDateString()!==new Date(r.when).toDateString()?i.dy`
<h4 class="date">
${(0,a.p6)(new Date(e.when),this.hass.locale)}
</h4>
`:i.dy``}
<div class="entry ${(0,o.$)({"no-entity":!e.entity_id})}">
<div class="icon-message">
${this.noIcon?"":i.dy`
<state-badge
.hass=${this.hass}
.overrideIcon=${e.icon||(e.domain&&!n?(0,h.K)(e.domain):void 0)}
.overrideImage=${s.iY.has(d)?"":(null==n?void 0:n.attributes.entity_picture_local)||(null==n?void 0:n.attributes.entity_picture)}
.stateObj=${n}
.stateColor=${!1}
></state-badge>
`}
<div class="message-relative_time">
<div class="message">
${this.noName?"":i.dy`<a
href="#"
@click=${this._entityClicked}
.entityId=${e.entity_id}
><span class="name">${e.name}</span></a
>`}
${e.message}
${c?` ${this.hass.localize("ui.components.logbook.by")} ${c}`:e.context_event_type?"call_service"===e.context_event_type?` ${this.hass.localize("ui.components.logbook.by_service")}\n ${e.context_domain}.${e.context_service}`:e.context_entity_id===e.entity_id?` ${this.hass.localize("ui.components.logbook.by")}\n ${e.context_name?e.context_name:e.context_event_type}`:i.dy` ${this.hass.localize("ui.components.logbook.by")}
<a
href="#"
@click=${this._entityClicked}
.entityId=${e.context_entity_id}
class="name"
>${e.context_entity_id_name}</a
>`:""}
</div>
<div class="secondary">
<span
>${(0,l.Vu)(new Date(e.when),this.hass.locale)}</span
>
-
<ha-relative-time
.hass=${this.hass}
.datetime=${e.when}
capitalize
></ha-relative-time>
${"automation"===e.domain&&e.context_id in this.traceContexts?i.dy`
-
<a
href=${`/config/automation/trace/${this.traceContexts[e.context_id].item_id}?run_id=${this.traceContexts[e.context_id].run_id}`}
@click=${this._close}
>${this.hass.localize("ui.components.logbook.show_trace")}</a
>
`:""}
</div>
</div>
</div>
</div>
</div>
`}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_entityClicked",value:function(e){const t=e.currentTarget.entityId;t&&(e.preventDefault(),e.stopPropagation(),(0,d.B)(this,"hass-more-info",{entityId:t}))}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,d.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[m.Qx,m.$c,i.iv`
:host([virtualize]) {
display: block;
height: 100%;
}
.rtl {
direction: ltr;
}
.entry-container {
width: 100%;
}
.entry {
display: flex;
width: 100%;
line-height: 2em;
padding: 8px 16px;
box-sizing: border-box;
border-top: 1px solid var(--divider-color);
}
.entry.no-entity,
.no-name .entry {
cursor: default;
}
.entry:hover {
background-color: rgba(var(--rgb-primary-text-color), 0.04);
}
.narrow:not(.no-icon) .time {
margin-left: 32px;
}
.message-relative_time {
display: flex;
flex-direction: column;
}
.secondary {
font-size: 12px;
line-height: 1.7;
}
.secondary a {
color: var(--secondary-text-color);
}
.date {
margin: 8px 0;
padding: 0 16px;
}
.narrow .date {
padding: 0 8px;
}
.rtl .date {
direction: rtl;
}
.icon-message {
display: flex;
align-items: center;
}
.no-entries {
text-align: center;
color: var(--secondary-text-color);
}
state-badge {
margin-right: 16px;
flex-shrink: 0;
color: var(--state-icon-color);
}
.message {
color: var(--primary-text-color);
}
.no-name .message:first-letter {
text-transform: capitalize;
}
a {
color: var(--primary-color);
}
.container {
max-height: var(--logbook-max-height);
}
:host([virtualize]) .container {
height: 100%;
}
.narrow .entry {
line-height: 1.5;
padding: 8px;
}
.narrow .icon-message state-badge {
margin-left: 0;
}
`]}}]}}),i.oi)}))},73953:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{J:()=>l});var i=r(71948),n=r(7778),o=e([i]);i=(o.then?await o:o)[0];const s=new Set(["error","state-label"]),a={"entity-filter":()=>r.e(68045).then(r.bind(r,68045))},l=e=>(0,n.Tw)("badge",e,s,a,void 0,"state-label")}))},51153:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{l$:()=>y,Z6:()=>v,Do:()=>g});var i=r(10175),n=(r(80251),r(89894)),o=r(14888),s=r(69377),a=r(95035),l=r(6169),c=r(41043),d=r(57464),u=(r(24617),r(82778)),h=r(7778),f=e([u,d,c,l,a,s,o,n,i]);[u,d,c,l,a,s,o,n,i]=f.then?await f:f;const p=new Set(["entity","entities","button","entity-button","glance","grid","light","sensor","thermostat","weather-forecast"]),m={"alarm-panel":()=>r.e(77639).then(r.bind(r,77639)),area:()=>Promise.all([r.e(319),r.e(97282),r.e(65131)]).then(r.bind(r,95795)),calendar:()=>Promise.resolve().then(r.bind(r,80251)),conditional:()=>r.e(68857).then(r.bind(r,68857)),"empty-state":()=>r.e(67284).then(r.bind(r,67284)),"energy-carbon-consumed-gauge":()=>Promise.all([r.e(91573),r.e(55424),r.e(31523),r.e(43283),r.e(19490)]).then(r.bind(r,19490)),"energy-date-selection":()=>Promise.all([r.e(71250),r.e(55424),r.e(82649),r.e(10346)]).then(r.bind(r,10346)),"energy-devices-graph":()=>Promise.all([r.e(5287),r.e(55424),r.e(62336),r.e(77251)]).then(r.bind(r,47420)),"energy-distribution":()=>Promise.all([r.e(55424),r.e(32191)]).then(r.bind(r,9928)),"energy-gas-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(41305)]).then(r.bind(r,41305)),"energy-grid-neutrality-gauge":()=>Promise.all([r.e(31752),r.e(55424),r.e(31523),r.e(32176)]).then(r.bind(r,32176)),"energy-solar-consumed-gauge":()=>Promise.all([r.e(86087),r.e(55424),r.e(31523),r.e(43283),r.e(85930)]).then(r.bind(r,85930)),"energy-solar-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(70310)]).then(r.bind(r,70310)),"energy-sources-table":()=>Promise.all([r.e(57646),r.e(55424),r.e(62336),r.e(17595),r.e(16938)]).then(r.bind(r,16938)),"energy-usage-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(9897)]).then(r.bind(r,9897)),"entity-filter":()=>r.e(33688).then(r.bind(r,33688)),error:()=>Promise.all([r.e(77426),r.e(55796)]).then(r.bind(r,55796)),gauge:()=>Promise.all([r.e(31523),r.e(43283)]).then(r.bind(r,43283)),"history-graph":()=>Promise.all([r.e(62336),r.e(25825),r.e(38026)]).then(r.bind(r,38026)),"horizontal-stack":()=>r.e(89173).then(r.bind(r,89173)),humidifier:()=>r.e(68558).then(r.bind(r,68558)),iframe:()=>r.e(95018).then(r.bind(r,95018)),logbook:()=>Promise.all([r.e(196),r.e(81855),r.e(90851)]).then(r.bind(r,8436)),map:()=>Promise.all([r.e(23956),r.e(60076)]).then(r.bind(r,60076)),markdown:()=>Promise.all([r.e(4940),r.e(26607)]).then(r.bind(r,51282)),"media-control":()=>Promise.all([r.e(28611),r.e(11866)]).then(r.bind(r,11866)),"picture-elements":()=>Promise.all([r.e(54909),r.e(319),r.e(97282),r.e(99810),r.e(44121)]).then(r.bind(r,83358)),"picture-entity":()=>Promise.all([r.e(319),r.e(97282),r.e(25917)]).then(r.bind(r,41500)),"picture-glance":()=>Promise.all([r.e(319),r.e(97282),r.e(7015)]).then(r.bind(r,66621)),picture:()=>r.e(45338).then(r.bind(r,45338)),"plant-status":()=>r.e(48723).then(r.bind(r,48723)),"safe-mode":()=>r.e(24503).then(r.bind(r,24503)),"shopping-list":()=>Promise.all([r.e(54040),r.e(43376)]).then(r.bind(r,43376)),starting:()=>r.e(47873).then(r.bind(r,47873)),"statistics-graph":()=>Promise.all([r.e(62336),r.e(17595),r.e(95396)]).then(r.bind(r,95396)),"vertical-stack":()=>r.e(26136).then(r.bind(r,26136))},y=e=>(0,h.Xm)("card",e,p,m,void 0,void 0),v=e=>(0,h.Tw)("card",e,p,m,void 0,void 0),g=e=>(0,h.ED)(e,"card",p,m)}))},7778:(e,t,r)=>{r.d(t,{N2:()=>o,Tw:()=>c,Xm:()=>d,ED:()=>u});var i=r(47181),n=r(9893);const o=(e,t)=>({type:"error",error:e,origConfig:t}),s=(e,t)=>{const r=document.createElement(e);return r.setConfig(t),r},a=(e,t)=>(e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.all([r.e(77426),r.e(55796)]).then(r.bind(r,55796)),customElements.whenDefined("hui-error-card").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(o(e,t)),l=e=>e.startsWith(n.Qo)?e.substr(n.Qo.length):void 0,c=(e,t,r,i,n,o)=>{try{return d(e,t,r,i,n,o)}catch(r){return console.error(e,t.type,r),a(r.message,t)}},d=(e,t,r,n,o,c)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||c||o&&"entity"in t))throw new Error("No card type configured");const d=t.type?l(t.type):void 0;if(d)return((e,t)=>{if(customElements.get(e))return s(e,t);const r=a(`Custom element doesn't exist: ${e}.`,t);if(!e.includes("-"))return r;r.style.display="None";const n=window.setTimeout((()=>{r.style.display=""}),2e3);return customElements.whenDefined(e).then((()=>{clearTimeout(n),(0,i.B)(r,"ll-rebuild")})),r})(d,t);let u;if(o&&!t.type&&t.entity){u=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else u=t.type||c;if(void 0===u)throw new Error("No type specified");const h=`hui-${u}-${e}`;if(n&&u in n)return n[u](),((e,t)=>{if(customElements.get(e))return s(e,t);const r=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(r),r.setConfig(t)}catch(e){(0,i.B)(r,"ll-rebuild")}})),r})(h,t);if(r&&r.has(u))return s(h,t);throw new Error(`Unknown type encountered: ${u}`)},u=async(e,t,r,i)=>{const n=l(e);if(n){const e=customElements.get(n);if(e)return e;if(!n.includes("-"))throw new Error(`Custom element not found: ${n}`);return new Promise(((e,t)=>{setTimeout((()=>t(new Error(`Custom element not found: ${n}`))),2e3),customElements.whenDefined(n).then((()=>e(customElements.get(n))))}))}const o=`hui-${e}-${t}`,s=customElements.get(o);if(r&&r.has(e))return s;if(i&&e in i)return s||i[e]().then((()=>customElements.get(o)));throw new Error(`Unknown type: ${e}`)}},89026:(e,t,r)=>{r.d(t,{t:()=>o,Q:()=>s});var i=r(7778);const n={picture:()=>r.e(69130).then(r.bind(r,69130)),buttons:()=>Promise.all([r.e(42109),r.e(32587)]).then(r.bind(r,32587)),graph:()=>r.e(28922).then(r.bind(r,28922))},o=e=>(0,i.Tw)("header-footer",e,void 0,n,void 0,void 0),s=e=>(0,i.ED)(e,"header-footer",void 0,n)},83320:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{w:()=>c});var i=r(7355),n=(r(26602),r(93479),r(51432),r(73089)),o=(r(8864),r(17875)),s=r(7778),a=e([o,n,i]);[o,n,i]=a.then?await a:a;const l=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),c=e=>(0,s.Tw)("element",e,l)}))},37482:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{m:()=>m,T:()=>y});var i=r(12141),n=r(31479),o=r(23266),s=r(65716),a=r(97600),l=r(83896),c=r(45340),d=(r(56427),r(23658),r(7778)),u=e([c,l,a,s,o,n,i]);[c,l,a,s,o,n,i]=u.then?await u:u;const h=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","text-entity","toggle-entity","button","call-service"]),f={"button-entity":()=>r.e(85611).then(r.bind(r,85611)),"climate-entity":()=>r.e(35642).then(r.bind(r,35642)),"cover-entity":()=>r.e(16755).then(r.bind(r,16755)),"group-entity":()=>r.e(81534).then(r.bind(r,81534)),"input-button-entity":()=>r.e(83968).then(r.bind(r,83968)),"humidifier-entity":()=>r.e(41102).then(r.bind(r,41102)),"input-datetime-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(88985),r.e(36215),r.e(51522),r.e(68559)]).then(r.bind(r,22350)),"input-number-entity":()=>r.e(12335).then(r.bind(r,12335)),"input-select-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(32950)]).then(r.bind(r,25675)),"input-text-entity":()=>r.e(73943).then(r.bind(r,73943)),"lock-entity":()=>r.e(61596).then(r.bind(r,61596)),"number-entity":()=>r.e(66778).then(r.bind(r,66778)),"select-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(96596)]).then(r.bind(r,35994)),"timer-entity":()=>r.e(31203).then(r.bind(r,31203)),conditional:()=>r.e(97749).then(r.bind(r,97749)),"weather-entity":()=>r.e(71850).then(r.bind(r,71850)),divider:()=>r.e(41930).then(r.bind(r,41930)),section:()=>r.e(94832).then(r.bind(r,94832)),weblink:()=>r.e(44689).then(r.bind(r,44689)),cast:()=>r.e(25840).then(r.bind(r,25840)),buttons:()=>Promise.all([r.e(42109),r.e(82137)]).then(r.bind(r,82137)),attribute:()=>Promise.resolve().then(r.bind(r,45340)),text:()=>r.e(63459).then(r.bind(r,63459))},p={_domain_not_found:"text",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime",weather:"weather"},m=e=>(0,d.Tw)("row",e,h,f,p,void 0),y=e=>(0,d.ED)(e,"row",h,f)}))},49686:(e,t,r)=>{r.a(e,(async e=>{r.r(t),r.d(t,{importMoreInfoControl:()=>i.ST,createBadgeElement:()=>n.J,createCardElement:()=>o.Z6,createHeaderFooterElement:()=>s.t,createHuiElement:()=>a.w,createRowElement:()=>l.m});var i=r(82791),n=r(73953),o=r(51153),s=r(89026),a=r(83320),l=r(37482),c=e([l,a,o,n]);[l,a,o,n]=c.then?await c:c}))}}]);
//# sourceMappingURL=9f5922e0.js.map
Does that make things clearer?
Again to the background of the error:
Now my question: My data in the database is not that important. Can it help if I create the database completely new?
Greetings, Eckart
You may have a different kind of invalid date. Deleting the db will resolve the issue, but you'll loose your history. There is an ongoing patch (see relevant pr's) that will resolve the issue sooner or later.
If you have the time (and since you are messing around with hass, probably have :D ), you can figure out exactly what date is bad. (For me it was empty date, but you can have a non-empty invalid value too.)
Hi, it is definitely not a bug in the database, but one in the UI.
I have backed up and removed the entire old database, created a new one and restarted HA cold. HA creates a new empty DB with all the fields, but the history error remains. However, the logbook can at least be accessed again.
The messages I read from the Chrome debugger are "Uncaught RangeError: Value need to be finite number for Intl.RelativeTimeFormat.prototype.format()" and "ha-panel-history.ts:115 Uncaught (in promise) RangeError: Invalid time value".
Is there anything else I can do to fix this or assist you guys? Or do I have to wait for an update?
Greetings, Eckart
Uncaught RangeError: Value need to be finite number for Intl.RelativeTimeFormat.prototype.format()
at RelativeTimeFormat.format (<anonymous>)
at a (frontend_latest/729f9b9d.js:1:351)
at n.value (frontend_latest/729f9b9d.js:98:10429)
at n.value (frontend_latest/729f9b9d.js:98:10083)
at n.value (frontend_latest/729f9b9d.js:98:9091)
at N.M (frontend_latest/app.19214a15.js:1248:19034)
at N.S (frontend_latest/app.19214a15.js:1248:19100)
at N.T (frontend_latest/app.19214a15.js:1248:19474)
at N._$AI (frontend_latest/app.19214a15.js:1248:18929)
at S (frontend_latest/app.19214a15.js:1248:15135)
barbara.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
eckart.png:1 Failed to load resource: the server responded with a status of 404 (Not Found)
9f5922e0.js:1 Uncaught (in promise) RangeError: Invalid time value
at s (frontend_latest/9f5922e0.js:1:1159)
at d (frontend_latest/9f5922e0.js:1:4723)
at frontend_latest/60601f58.js:56:1571
at frontend_latest/60601f58.js:56:1684
at Array.forEach (<anonymous>)
at h (frontend_latest/60601f58.js:56:989)
at r.value (frontend_latest/3c471dc4.js:54:1228)
Entwicklertools konnten Quellzuordnung nicht laden: Inhalt für chrome-extension://mmhlniccooihdimnnjhamobppdhaolme/lib/tp/browser-polyfill.min.js.map: HTTP-Fehler: Statuscode 404, net::ERR_UNKNOWN_URL_SCHEME konnte nicht geladen werden
ha-panel-history.ts:115 Uncaught (in promise) RangeError: Invalid time value
at s (9f5922e0.js:1:1159)
at d (9f5922e0.js:1:4723)
at state-history-charts.ts:17:1
at state-history-charts.ts:17:1
at Array.forEach (<anonymous>)
at h (state-history-charts.ts:17:1)
at r.value (ha-panel-history.ts:115:1)
Source code:
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[45715,95457,81855,87224],{12198:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{D_:()=>o,p6:()=>a,mn:()=>c,NC:()=>u,Nh:()=>f,yQ:()=>m});var i=r(14516),n=r(54121);n.Xp&&await n.Xp;const o=(e,t)=>s(t).format(e),s=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"}))),a=(e,t)=>l(t).format(e),l=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"}))),c=((0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric"}))),(e,t)=>d(t).format(e)),d=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short"}))),u=(e,t)=>h(t).format(e),h=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric"}))),f=(e,t)=>p(t).format(e),p=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long"}))),m=(e,t)=>y(t).format(e),y=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric"})));e()}),1)},44583:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{o0:()=>s,E8:()=>l});var i=r(14516),n=r(65810),o=r(54121);o.Xp&&await o.Xp;const s=(e,t)=>a(t).format(e),a=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.y)(e)}))),l=(e,t)=>c(t).format(e),c=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,n.y)(e)})));(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:(0,n.y)(e)})));e()}),1)},49684:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{mr:()=>s,Vu:()=>l,xO:()=>d});var i=r(14516),n=r(65810),o=r(54121);o.Xp&&await o.Xp;const s=(e,t)=>a(t).format(e),a=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:(0,n.y)(e)}))),l=(e,t)=>c(t).format(e),c=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,n.y)(e)}))),d=(e,t)=>u(t).format(e),u=(0,i.Z)((e=>new Intl.DateTimeFormat("en"!==e.language||(0,n.y)(e)?e.language:"en-u-hc-h23",{weekday:"long",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.y)(e)})));e()}),1)},25516:(e,t,r)=>{r.d(t,{i:()=>i});const i=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){this[`__${String(t.key)}`]=e},get(){return this[`__${String(t.key)}`]},enumerable:!0,configurable:!0},finisher(r){const i=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){if(i.call(this),this[t.key]){const r=this.renderRoot.querySelector(e);if(!r)return;r.scrollTop=this[t.key]}}}})},70518:(e,t,r)=>{r.d(t,{X:()=>i});const i=(e,t,r)=>(void 0!==r&&(r=!!r),e.hasAttribute(t)?!!r||(e.removeAttribute(t),!1):!1!==r&&(e.setAttribute(t,""),!0))},58831:(e,t,r)=>{r.d(t,{M:()=>i});const i=e=>e.substr(0,e.indexOf("."))},29171:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{D:()=>d});var i=r(56007),n=r(12198),o=r(44583),s=r(49684),a=r(18457),l=r(22311),c=e([o,s,n]);[o,s,n]=c.then?await c:c;const d=(e,t,r,c)=>{const d=void 0!==c?c:t.state;if(d===i.lz||d===i.nZ)return e(`state.default.${d}`);if((0,a.SL)(t)){if("monetary"===t.attributes.device_class)try{return(0,a.uf)(d,r,{style:"currency",currency:t.attributes.unit_of_measurement})}catch(e){}return`${(0,a.uf)(d,r)}${t.attributes.unit_of_measurement?" "+t.attributes.unit_of_measurement:""}`}const u=(0,l.N)(t);if("input_datetime"===u){if(void 0===c){let e;return t.attributes.has_date&&t.attributes.has_time?(e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),(0,o.o0)(e,r)):t.attributes.has_date?(e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),(0,n.p6)(e,r)):t.attributes.has_time?(e=new Date,e.setHours(t.attributes.hour,t.attributes.minute),(0,s.mr)(e,r)):t.state}try{const e=c.split(" ");if(2===e.length)return(0,o.o0)(new Date(e.join("T")),r);if(1===e.length){if(c.includes("-"))return(0,n.p6)(new Date(`${c}T00:00`),r);if(c.includes(":")){const e=new Date;return(0,s.mr)(new Date(`${e.toISOString().split("T")[0]}T${c}`),r)}}return c}catch(e){return c}}return"humidifier"===u&&"on"===d&&t.attributes.humidity?`${t.attributes.humidity} %`:"counter"===u||"number"===u||"input_number"===u?(0,a.uf)(d,r):"button"===u||"input_button"===u||"scene"===u||"sensor"===u&&"timestamp"===t.attributes.device_class?(0,o.o0)(new Date(d),r):t.attributes.device_class&&e(`component.${u}.state.${t.attributes.device_class}.${d}`)||e(`component.${u}.state._.${d}`)||d}}))},83849:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(98651),n=r(47181),o=r(72055);const s=(e,t)=>{const r=(null==t?void 0:t.replace)||!1;var a;i.U?i.U.then((()=>s(e,t))):(r?o.E.history.replaceState(null!==(a=o.E.history.state)&&void 0!==a&&a.root?{root:!0}:null,"",e):o.E.history.pushState(null,"",e),(0,n.B)(o.E,"location-changed",{replace:r}))}},18457:(e,t,r)=>{r.d(t,{SL:()=>o,Hd:()=>s,uf:()=>a});var i=r(66477),n=r(27593);const o=e=>!!e.attributes.unit_of_measurement||!!e.attributes.state_class,s=e=>{switch(e.number_format){case i.y4.comma_decimal:return["en-US","en"];case i.y4.decimal_comma:return["de","es","it"];case i.y4.space_comma:return["fr","sv","cs"];case i.y4.system:return;default:return e.language}},a=(e,t,r)=>{const o=t?s(t):void 0;if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)!==i.y4.none&&!Number.isNaN(Number(e))&&Intl)try{return new Intl.NumberFormat(o,l(e,r)).format(Number(e))}catch(t){return console.error(t),new Intl.NumberFormat(void 0,l(e,r)).format(Number(e))}return"string"==typeof e?e:`${(0,n.N)(e,null==r?void 0:r.maximumFractionDigits).toString()}${"currency"===(null==r?void 0:r.style)?` ${r.currency}`:""}`},l=(e,t)=>{const r={maximumFractionDigits:2,...t};if("string"!=typeof e)return r;if(!t||!t.minimumFractionDigits&&!t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;r.minimumFractionDigits=t,r.maximumFractionDigits=t}return r}},43793:(e,t,r)=>{r.d(t,{x:()=>i});const i=(e,t)=>e.substring(0,t.length)===t},36639:(e,t,r)=>{r.d(t,{v:()=>i});const i=(e,t)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!i(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!i(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const o=Object.keys(e);if(n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(!i(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}},8330:(e,t,r)=>{r.d(t,{P:()=>i});const i=(e,t,r=!0,i=!0)=>{let n,o=0;return(...s)=>{const a=()=>{o=!1===r?0:Date.now(),n=void 0,e(...s)},l=Date.now();o||!1!==r||(o=l);const c=t-(l-o);c<=0||c>t?(n&&(clearTimeout(n),n=void 0),o=l,e(...s)):n||!1===i||(n=window.setTimeout(a,c))}}},31206:(e,t,r)=>{r.r(t),r.d(t,{HaCircularProgress:()=>y});var i=r(54930),n=r(37500),o=r(72367);function s(){s=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!c(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=h(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function a(e){var t,r=h(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function l(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function c(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function p(e,t,r){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},p(e,t,r||e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}let y=function(e,t,r,i){var n=s();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var u=t((function(e){n.initializeInstanceElements(e,h.elements)}),r),h=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(d(o.descriptor)||d(n.descriptor)){if(c(o)||c(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(c(o)){if(c(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}l(o,n)}else t.push(o)}return t}(u.d.map(a)),e);return n.initializeClassElements(u.F,h.elements),n.runClassFinishers(u.F,h.finishers)}([(0,o.Mo)("ha-circular-progress")],(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"active",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"alt",value:()=>"Loading"},{kind:"field",decorators:[(0,o.Cb)()],key:"size",value:()=>"medium"},{kind:"set",key:"density",value:function(e){}},{kind:"get",key:"density",value:function(){switch(this.size){case"tiny":return-8;case"small":return-5;default:return 0;case"large":return 5}}},{kind:"set",key:"indeterminate",value:function(e){}},{kind:"get",key:"indeterminate",value:function(){return this.active}},{kind:"get",static:!0,key:"styles",value:function(){return[p(m(r),"styles",this),n.iv`
:host {
overflow: hidden;
}
`]}}]}}),i.D)},22814:(e,t,r)=>{r.d(t,{uw:()=>i,iI:()=>n,W2:()=>o,TZ:()=>s});const i=`${location.protocol}//${location.host}`,n=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),o=async(e,t,r,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:r,password:i}),s=async(e,t,r)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:r})},99990:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{W:()=>s});var i=r(58763),n=e([i]);i=(n.then?await n:n)[0];const o={};const s=(e,t,r,n,s)=>{const c=r.cacheKey,u=new Date,h=new Date(u);h.setHours(h.getHours()-r.hoursToShow);let f=h,p=!1,m=o[c+`_${r.hoursToShow}`];if(m&&f>=m.startTime&&f<=m.endTime&&m.language===s){if(f=m.endTime,p=!0,u<=m.endTime)return m.prom}else m=o[c]=function(e,t,r){return{prom:Promise.resolve({line:[],timeline:[]}),language:e,startTime:t,endTime:r,data:{line:[],timeline:[]}}}(s,h,u);const y=m.prom;return m.prom=(async()=>{let r;try{r=(await Promise.all([y,(0,i.vq)(e,t,f,u,p)]))[1]}catch(e){throw delete o[c],e}const s=(0,i.Nu)(e,r,n);return p?(a(s.line,m.data.line),l(s.timeline,m.data.timeline),d(h,m.data)):m.data=s,m.data})(),m.startTime=h,m.endTime=u,m.prom},a=(e,t)=>{e.forEach((e=>{const r=e.unit,i=t.find((e=>e.unit===r));i?e.data.forEach((e=>{const t=i.data.find((t=>e.entity_id===t.entity_id));t?t.states=t.states.concat(e.states):i.data.push(e)})):t.push(e)}))},l=(e,t)=>{e.forEach((e=>{const r=t.find((t=>t.entity_id===e.entity_id));r?r.data=r.data.concat(e.data):t.push(e)}))},c=(e,t)=>{if(0===t.length)return t;const r=t.findIndex((t=>new Date(t.last_changed)>e));if(0===r)return t;const i=-1===r?t.length-1:r-1;return t[i].last_changed=e,t.slice(i)},d=(e,t)=>{t.line.forEach((t=>{t.data.forEach((t=>{t.states=c(e,t.states)}))})),t.timeline.forEach((t=>{t.data=c(e,t.data)}))}}))},55422:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{jV:()=>c,sS:()=>u,rM:()=>h,tf:()=>y});var i=r(49706),n=r(58831),o=r(29171),s=r(56007),a=e([o]);o=(a.then?await a:a)[0];const l="ui.components.logbook.messages",c=["proximity","sensor"],d={},u=async(e,t,r)=>{const i=await e.loadBackendTranslation("device_class");return f(e,i,await m(e,t,void 0,void 0,void 0,r))},h=async(e,t,r,i,n)=>{const o=await e.loadBackendTranslation("device_class");return f(e,o,await p(e,t,r,i,n))},f=(e,t,r)=>{for(const i of r){const r=e.states[i.entity_id];i.state&&r&&(i.message=v(e,t,i.state,r,(0,n.M)(i.entity_id)))}return r},p=async(e,t,r,i,n)=>{const o="*";i||(i=o);const s=`${t}${r}`;if(d[s]||(d[s]={}),i in d[s])return d[s][i];if(i!==o&&d[s]["*"]){return(await d[s]["*"]).filter((e=>e.entity_id===i))}return d[s][i]=m(e,t,r,i!==o?i:void 0,n).then((e=>e.reverse())),d[s][i]},m=async(e,t,r,i,n,o)=>{const s=new URLSearchParams;return r&&s.append("end_time",r),i&&s.append("entity",i),n&&s.append("entity_matches_only",""),o&&s.append("context_id",o),e.callApi("GET",`logbook/${t}?${s.toString()}`)},y=(e,t)=>{d[`${e}${t}`]={}},v=(e,t,r,n,a)=>{switch(a){case"device_tracker":case"person":return"not_home"===r?t(`${l}.was_away`):"home"===r?t(`${l}.was_at_home`):t(`${l}.was_at_state`,"state",r);case"sun":return t("above_horizon"===r?`${l}.rose`:`${l}.set`);case"binary_sensor":{const e=r===i.uo,o=r===i.lC,s=n.attributes.device_class;switch(s){case"battery":if(e)return t(`${l}.was_low`);if(o)return t(`${l}.was_normal`);break;case"connectivity":if(e)return t(`${l}.was_connected`);if(o)return t(`${l}.was_disconnected`);break;case"door":case"garage_door":case"opening":case"window":if(e)return t(`${l}.was_opened`);if(o)return t(`${l}.was_closed`);break;case"lock":if(e)return t(`${l}.was_unlocked`);if(o)return t(`${l}.was_locked`);break;case"plug":if(e)return t(`${l}.was_plugged_in`);if(o)return t(`${l}.was_unplugged`);break;case"presence":if(e)return t(`${l}.was_at_home`);if(o)return t(`${l}.was_away`);break;case"safety":if(e)return t(`${l}.was_unsafe`);if(o)return t(`${l}.was_safe`);break;case"cold":case"gas":case"heat":case"moisture":case"motion":case"occupancy":case"power":case"problem":case"smoke":case"sound":case"vibration":if(e)return t(`${l}.detected_device_class`,{device_class:t(`component.binary_sensor.device_class.${s}`)});if(o)return t(`${l}.cleared_device_class`,{device_class:t(`component.binary_sensor.device_class.${s}`)});break;case"tamper":if(e)return t(`${l}.detected_tampering`);if(o)return t(`${l}.cleared_tampering`)}break}case"cover":switch(r){case"open":return t(`${l}.was_opened`);case"opening":return t(`${l}.is_opening`);case"closing":return t(`${l}.is_closing`);case"closed":return t(`${l}.was_closed`)}break;case"lock":if("unlocked"===r)return t(`${l}.was_unlocked`);if("locked"===r)return t(`${l}.was_locked`)}return r===i.uo?t(`${l}.turned_on`):r===i.lC?t(`${l}.turned_off`):s.V_.includes(r)?t(`${l}.became_unavailable`):e.localize(`${l}.changed_to_state`,"state",n?(0,o.D)(t,n,e.locale,r):r)}}))},9893:(e,t,r)=>{r.d(t,{Qo:()=>i,kb:()=>o,cs:()=>s});const i="custom:",n=window;"customCards"in n||(n.customCards=[]);const o=n.customCards,s=e=>o.find((t=>t.type===e))},97389:(e,t,r)=>{if(r.d(t,{mA:()=>n,lj:()=>o,U_:()=>s,nV:()=>a,Zm:()=>l}),32143==r.j)var i=r(43793);const n=(e,t,r,i)=>e.callWS({type:"trace/get",domain:t,item_id:r,run_id:i}),o=(e,t,r)=>e.callWS({type:"trace/list",domain:t,item_id:r}),s=(e,t,r)=>e.callWS({type:"trace/contexts",domain:t,item_id:r}),a=(e,t)=>{const r=t.split("/").reverse();let i=e;for(;r.length;){const e=r.pop(),t=Number(e);if(isNaN(t))i=i[e];else if(Array.isArray(i))i=i[t];else if(0!==t)throw new Error("If config is not an array, can only return index 0")}return i},l=e=>"trigger"===e||(0,i.x)(e,"trigger/")},65253:(e,t,r)=>{r.d(t,{Pb:()=>i,CE:()=>n,uh:()=>o,r4:()=>s,Nq:()=>a,h8:()=>l,fm:()=>c,FH:()=>p});const i="system-admin",n="system-users",o=async e=>e.callWS({type:"config/auth/list"}),s=async(e,t,r,i)=>e.callWS({type:"config/auth/create",name:t,group_ids:r,local_only:i}),a=async(e,t,r)=>e.callWS({...r,type:"config/auth/update",user_id:t}),l=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),c=e=>e?e.trim().split(" ").slice(0,3).map((e=>e.substring(0,1))).join(""):"?",d=32143==r.j?"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":null,u=32143==r.j?"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":null,h=32143==r.j?"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":null,f=32143==r.j?"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":null,p=(e,t,r)=>{const i=[],n=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&i.push([d,n("is_owner")]),r&&t.system_generated&&i.push([u,n("is_system")]),t.local_only&&i.push([h,n("is_local")]),t.is_active||i.push([f,n("is_not_active")]),i}},60034:(e,t,r)=>{r.a(e,(async e=>{var t=r(37500),i=r(72367),n=r(31811),o=e([n]);function s(){s=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!c(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=h(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function a(e){var t,r=h(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function l(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function c(e){return e.decorators&&e.decorators.length}function d(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}n=(o.then?await o:o)[0];!function(e,t,r,i){var n=s();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var u=t((function(e){n.initializeInstanceElements(e,h.elements)}),r),h=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(d(o.descriptor)||d(n.descriptor)){if(c(o)||c(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(c(o)){if(c(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}l(o,n)}else t.push(o)}return t}(u.d.map(a)),e);n.initializeClassElements(u.F,h.elements),n.runClassFinishers(u.F,h.finishers)}([(0,i.Mo)("more-info-default")],(function(e,r){return{F:class extends r{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)()],key:"stateObj",value:void 0},{kind:"method",key:"render",value:function(){return this.hass&&this.stateObj?t.dy`<ha-attributes
.hass=${this.hass}
.stateObj=${this.stateObj}
></ha-attributes>`:t.dy``}}]}}),t.oi)}))},86201:(e,t,r)=>{r.a(e,(async e=>{r.r(t),r.d(t,{MoreInfoDialog:()=>j});r(53918),r(27303),r(22001);var i=r(37500),n=r(72367),o=r(40015),s=r(7323),a=r(49706),l=r(47181),c=r(58831),d=r(91741),u=r(83849),h=(r(34821),r(90806),r(10983),r(74186)),f=r(55422),p=r(94458),m=r(11654),y=r(11789),v=r(26765),g=r(74265),b=r(60034),w=r(4295),k=r(93797),_=r(10122),E=e([f,_,k,w,b,y]);function P(){P=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!x(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=T(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:S(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=S(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function C(e){var t,r=T(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function D(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function x(e){return e.decorators&&e.decorators.length}function $(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function S(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function T(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}[f,_,k,w,b,y]=E.then?await E:E;const z=["camera","configurator"],I=["scene","automation"],O=["script"];let j=function(e,t,r,i){var n=P();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if($(o.descriptor)||$(n.descriptor)){if(x(o)||x(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(x(o)){if(x(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}D(o,n)}else t.push(o)}return t}(s.d.map(C)),e);return n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-dialog")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"large",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_currTabIndex",value:()=>0},{kind:"method",key:"showDialog",value:function(e){this._entityId=e.entityId,this._entityId?this.large=!1:this.closeDialog()}},{kind:"method",key:"closeDialog",value:function(){this._entityId=void 0,this._currTabIndex=0,(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"shouldShowEditIcon",value:function(e,t){return!(!I.includes(e)||!t.attributes.id)||(!!O.includes(e)||"person"===e&&"false"!==t.attributes.editable)}},{kind:"method",key:"render",value:function(){if(!this._entityId)return i.dy``;const e=this._entityId,t=this.hass.states[e];if(!t)return i.dy``;const r=(0,c.M)(e),n=(0,d.C)(t);return i.dy`
<ha-dialog
open
@closed=${this.closeDialog}
.heading=${n}
hideActions
data-domain=${r}
>
<div slot="heading" class="heading">
<ha-header-bar>
<ha-icon-button
slot="navigationIcon"
dialogAction="cancel"
.label=${this.hass.localize("ui.dialogs.more_info_control.dismiss")}
.path=${"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"}
></ha-icon-button>
<div
slot="title"
class="main-title"
.title=${n}
@click=${this._enlarge}
>
${n}
</div>
${this.hass.user.is_admin?i.dy`
<ha-icon-button
slot="actionItems"
.label=${this.hass.localize("ui.dialogs.more_info_control.settings")}
.path=${"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"}
@click=${this._gotoSettings}
></ha-icon-button>
`:""}
${this.shouldShowEditIcon(r,t)?i.dy`
<ha-icon-button
slot="actionItems"
.label=${this.hass.localize("ui.dialogs.more_info_control.edit")}
.path=${"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"}
@click=${this._gotoEdit}
></ha-icon-button>
`:""}
</ha-header-bar>
${a.l.includes(r)&&(this._computeShowHistoryComponent(e)||this._computeShowLogBookComponent(e))?i.dy`
<mwc-tab-bar
.activeIndex=${this._currTabIndex}
@MDCTabBar:activated=${this._handleTabChanged}
>
<mwc-tab
.label=${this.hass.localize("ui.dialogs.more_info_control.details")}
></mwc-tab>
<mwc-tab
.label=${this.hass.localize("ui.dialogs.more_info_control.history")}
></mwc-tab>
</mwc-tab-bar>
`:""}
</div>
<div class="content">
${(0,o.F)(0===this._currTabIndex?i.dy`
${z.includes(r)?"":i.dy`
<state-card-content
in-dialog
.stateObj=${t}
.hass=${this.hass}
></state-card-content>
`}
${a.l.includes(r)||!this._computeShowHistoryComponent(e)?"":i.dy`<ha-more-info-history
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history>`}
${a.l.includes(r)||!this._computeShowLogBookComponent(e)?"":i.dy`<ha-more-info-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-logbook>`}
<more-info-content
.stateObj=${t}
.hass=${this.hass}
></more-info-content>
${t.attributes.restored?i.dy`
<p>
${this.hass.localize("ui.dialogs.more_info_control.restored.not_provided")}
</p>
<p>
${this.hass.localize("ui.dialogs.more_info_control.restored.remove_intro")}
</p>
<mwc-button
class="warning"
@click=${this._removeEntity}
>
${this.hass.localize("ui.dialogs.more_info_control.restored.remove_action")}
</mwc-button>
`:""}
`:i.dy`
<ha-more-info-history
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history>
<ha-more-info-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-logbook>
`)}
</div>
</ha-dialog>
`}},{kind:"method",key:"_enlarge",value:function(){this.large=!this.large}},{kind:"method",key:"_computeShowHistoryComponent",value:function(e){return(0,s.p)(this.hass,"history")&&!a.f0.includes((0,c.M)(e))}},{kind:"method",key:"_computeShowLogBookComponent",value:function(e){if(!(0,s.p)(this.hass,"logbook"))return!1;const t=this.hass.states[e];if(!t||t.attributes.unit_of_measurement)return!1;const r=(0,c.M)(e);return!f.jV.includes(r)&&!a.f0.includes(r)}},{kind:"method",key:"_removeEntity",value:function(){const e=this._entityId;(0,v.g7)(this,{title:this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_title"),text:this.hass.localize("ui.dialogs.more_info_control.restored.confirm_remove_text"),confirmText:this.hass.localize("ui.common.remove"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{(0,h.z3)(this.hass,e)}})}},{kind:"method",key:"_gotoSettings",value:function(){(0,g.ku)(),(0,p.R)(this,{entity_id:this._entityId}),this.closeDialog()}},{kind:"method",key:"_gotoEdit",value:function(){const e=this.hass.states[this._entityId],t=(0,c.M)(this._entityId);let r=e.entity_id;(I.includes(t)||"person"===t)&&(r=e.attributes.id),(0,u.c)(`/config/${t}/edit/${r}`),this.closeDialog()}},{kind:"method",key:"_handleTabChanged",value:function(e){e.detail.index!==this._currTabIndex&&(this._currTabIndex=e.detail.index)}},{kind:"get",static:!0,key:"styles",value:function(){return[m.yu,i.iv`
ha-dialog {
--dialog-surface-position: static;
--dialog-content-position: static;
}
ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
flex-shrink: 0;
display: block;
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-header-bar {
--mdc-theme-primary: var(--app-header-background-color);
--mdc-theme-on-primary: var(--app-header-text-color, white);
border-bottom: none;
}
}
.heading {
border-bottom: 1px solid
var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12));
}
@media all and (min-width: 451px) and (min-height: 501px) {
ha-dialog {
--mdc-dialog-max-width: 90vw;
}
.content {
width: 352px;
}
ha-header-bar {
width: 400px;
}
.main-title {
overflow: hidden;
text-overflow: ellipsis;
cursor: default;
}
ha-dialog[data-domain="camera"] .content,
ha-dialog[data-domain="camera"] ha-header-bar {
width: auto;
}
:host([large]) .content {
width: calc(90vw - 48px);
}
:host([large]) ha-dialog[data-domain="camera"] .content,
:host([large]) ha-header-bar {
width: 90vw;
}
}
ha-dialog[data-domain="camera"] {
--dialog-content-padding: 0;
}
state-card-content,
ha-more-info-history,
ha-more-info-logbook:not(:last-child) {
display: block;
margin-bottom: 16px;
}
`]}}]}}),i.oi)}))},4295:(e,t,r)=>{r.a(e,(async e=>{var t=r(83008),i=r(37500),n=r(72367),o=r(7323),s=r(47181),a=r(8330),l=r(77243),c=r(99990),d=e([c,l]);function u(){u=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!p(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=v(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:y(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=y(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function h(e){var t,r=v(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function f(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function p(e){return e.decorators&&e.decorators.length}function m(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function y(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function v(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function b(e,t,r){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},b(e,t,r||e)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}[c,l]=d.then?await d:d;!function(e,t,r,i){var n=u();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(m(o.descriptor)||m(n.descriptor)){if(p(o)||p(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(p(o)){if(p(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}f(o,n)}else t.push(o)}return t}(s.d.map(h)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-history")],(function(e,r){class l extends r{constructor(...t){super(...t),e(this)}}return{F:l,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_stateHistory",value:void 0},{kind:"field",key:"_showMoreHref",value:()=>""},{kind:"field",key:"_throttleGetStateHistory",value(){return(0,a.P)((()=>{this._getStateHistory()}),1e4)}},{kind:"method",key:"render",value:function(){return this.entityId?i.dy`${(0,o.p)(this.hass,"history")?i.dy` <div class="header">
<div class="title">
${this.hass.localize("ui.dialogs.more_info_control.history")}
</div>
<a href=${this._showMoreHref} @click=${this._close}
>${this.hass.localize("ui.dialogs.more_info_control.show_more")}</a
>
</div>
<state-history-charts
up-to-now
.hass=${this.hass}
.historyData=${this._stateHistory}
.isLoadingData=${!this._stateHistory}
></state-history-charts>`:""}`:i.dy``}},{kind:"method",key:"updated",value:function(e){if(b(w(l.prototype),"updated",this).call(this,e),e.has("entityId")){if(this._stateHistory=void 0,!this.entityId)return;return this._showMoreHref=`/history?entity_id=${this.entityId}&start_date=${(0,t.Z)().toISOString()}`,void this._throttleGetStateHistory()}if(!this.entityId||!e.has("hass"))return;const r=e.get("hass");r&&this.hass.states[this.entityId]!==(null==r?void 0:r.states[this.entityId])&&setTimeout(this._throttleGetStateHistory,1e3)}},{kind:"method",key:"_getStateHistory",value:async function(){(0,o.p)(this.hass,"history")&&(this._stateHistory=await(0,c.W)(this.hass,this.entityId,{cacheKey:`more_info.${this.entityId}`,hoursToShow:24},this.hass.localize,this.hass.language))}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,s.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[i.iv`
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.header > a,
a:visited {
color: var(--primary-color);
}
.title {
font-family: var(--paper-font-title_-_font-family);
-webkit-font-smoothing: var(
--paper-font-title_-_-webkit-font-smoothing
);
font-size: var(--paper-font-subhead_-_font-size);
font-weight: var(--paper-font-title_-_font-weight);
letter-spacing: var(--paper-font-title_-_letter-spacing);
line-height: var(--paper-font-title_-_line-height);
}
`]}}]}}),i.oi)}))},93797:(e,t,r)=>{r.a(e,(async e=>{var t=r(83008),i=r(37500),n=r(72367),o=r(7323),s=r(47181),a=r(22311),l=r(8330),c=(r(31206),r(55422)),d=r(97389),u=r(65253),h=r(97740),f=r(11654),p=e([c,h]);function m(){m=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!g(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=k(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:w(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=w(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function y(e){var t,r=k(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function v(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function g(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function w(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function k(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function E(e,t,r){return E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},E(e,t,r||e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}[c,h]=p.then?await p:p;!function(e,t,r,i){var n=m();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(b(o.descriptor)||b(n.descriptor)){if(g(o)||g(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(g(o)){if(g(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}v(o,n)}else t.push(o)}return t}(s.d.map(y)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-more-info-logbook")],(function(e,r){class h extends r{constructor(...t){super(...t),e(this)}}return{F:h,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"entityId",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_logbookEntries",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_traceContexts",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_userIdToName",value:()=>({})},{kind:"field",key:"_lastLogbookDate",value:void 0},{kind:"field",key:"_fetchUserPromise",value:void 0},{kind:"field",key:"_error",value:void 0},{kind:"field",key:"_showMoreHref",value:()=>""},{kind:"field",key:"_throttleGetLogbookEntries",value(){return(0,l.P)((()=>{this._getLogBookData()}),1e4)}},{kind:"method",key:"render",value:function(){if(!this.entityId)return i.dy``;return this.hass.states[this.entityId]?i.dy`
${(0,o.p)(this.hass,"logbook")?this._error?i.dy`<div class="no-entries">
${`${this.hass.localize("ui.components.logbook.retrieval_error")}: ${this._error}`}
</div>`:this._logbookEntries?this._logbookEntries.length?i.dy`
<div class="header">
<div class="title">
${this.hass.localize("ui.dialogs.more_info_control.logbook")}
</div>
<a href=${this._showMoreHref} @click=${this._close}
>${this.hass.localize("ui.dialogs.more_info_control.show_more")}</a
>
</div>
<ha-logbook
narrow
no-icon
no-name
relative-time
.hass=${this.hass}
.entries=${this._logbookEntries}
.traceContexts=${this._traceContexts}
.userIdToName=${this._userIdToName}
></ha-logbook>
`:i.dy`<div class="no-entries">
${this.hass.localize("ui.components.logbook.entries_not_found")}
</div>`:i.dy`
<ha-circular-progress
active
alt=${this.hass.localize("ui.common.loading")}
></ha-circular-progress>
`:""}
`:i.dy``}},{kind:"method",key:"firstUpdated",value:function(){this._fetchUserPromise=this._fetchUserNames()}},{kind:"method",key:"updated",value:function(e){if(E(P(h.prototype),"updated",this).call(this,e),e.has("entityId")){if(this._lastLogbookDate=void 0,this._logbookEntries=void 0,!this.entityId)return;return this._showMoreHref=`/logbook?entity_id=${this.entityId}&start_date=${(0,t.Z)().toISOString()}`,void this._throttleGetLogbookEntries()}if(!this.entityId||!e.has("hass"))return;const r=e.get("hass");r&&this.hass.states[this.entityId]!==(null==r?void 0:r.states[this.entityId])&&setTimeout(this._throttleGetLogbookEntries,1e3)}},{kind:"method",key:"_getLogBookData",value:async function(){if(!(0,o.p)(this.hass,"logbook"))return;const e=this._lastLogbookDate||new Date((new Date).getTime()-864e5),t=new Date;let r,i;try{var n;[r,i]=await Promise.all([(0,c.rM)(this.hass,e.toISOString(),t.toISOString(),this.entityId,!0),null!==(n=this.hass.user)&&void 0!==n&&n.is_admin?(0,d.U_)(this.hass):{},this._fetchUserPromise])}catch(e){this._error=e.message}this._logbookEntries=this._logbookEntries?[...r,...this._logbookEntries]:r,this._lastLogbookDate=t,this._traceContexts=i}},{kind:"method",key:"_fetchUserNames",value:async function(){var e;const t={},r=(null===(e=this.hass.user)||void 0===e?void 0:e.is_admin)&&(0,u.uh)(this.hass);if(Object.values(this.hass.states).forEach((e=>{e.attributes.user_id&&"person"===(0,a.N)(e)&&(this._userIdToName[e.attributes.user_id]=e.attributes.friendly_name)})),r){const e=await r;for(const r of e)r.id in t||(t[r.id]=r.name)}this._userIdToName=t}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,s.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,i.iv`
.no-entries {
text-align: center;
padding: 16px;
color: var(--secondary-text-color);
}
ha-logbook {
--logbook-max-height: 250px;
}
@media all and (max-width: 450px), all and (max-height: 500px) {
ha-logbook {
--logbook-max-height: unset;
}
}
ha-circular-progress {
display: flex;
justify-content: center;
}
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.header > a,
a:visited {
color: var(--primary-color);
}
.title {
font-family: var(--paper-font-title_-_font-family);
-webkit-font-smoothing: var(
--paper-font-title_-_-webkit-font-smoothing
);
font-size: var(--paper-font-subhead_-_font-size);
font-weight: var(--paper-font-title_-_font-weight);
letter-spacing: var(--paper-font-title_-_letter-spacing);
line-height: var(--paper-font-title_-_line-height);
}
`]}}]}}),i.oi)}))},10122:(e,t,r)=>{r.a(e,(async e=>{var t=r(37500),i=r(72367),n=r(80910),o=r(49686),s=r(82791),a=e([o]);function l(){l=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!u(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=p(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:f(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=f(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function c(e){var t,r=p(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function d(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function u(e){return e.decorators&&e.decorators.length}function h(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function f(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function y(e,t,r){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(r):n.value}},y(e,t,r||e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}o=(a.then?await a:a)[0];let g=function(e,t,r,i){var n=l();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(h(o.descriptor)||h(n.descriptor)){if(u(o)||u(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(u(o)){if(u(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}d(o,n)}else t.push(o)}return t}(s.d.map(c)),e);return n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}(null,(function(e,t){class r extends t{constructor(...t){super(...t),e(this)}}return{F:r,d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",key:"_detachedChild",value:void 0},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"update",value:function(e){y(v(r.prototype),"update",this).call(this,e);const t=this.stateObj,i=this.hass;if(!t||!i)return void(this.lastChild&&(this._detachedChild=this.lastChild,this.removeChild(this.lastChild)));let a;if(this._detachedChild&&(this.appendChild(this._detachedChild),this._detachedChild=void 0),t.attributes&&"custom_ui_more_info"in t.attributes)a=t.attributes.custom_ui_more_info;else{const e=(0,s.S)(t);(0,o.importMoreInfoControl)(e),a="hidden"===e?void 0:`more-info-${e}`}a&&(0,n.Z)(this,a.toUpperCase(),{hass:i,stateObj:t})}}]}}),t.fl);customElements.define("more-info-content",g)}))},82791:(e,t,r)=>{r.d(t,{S:()=>s,n3:()=>a,ST:()=>l});var i=r(49706),n=r(22311);const o={alarm_control_panel:()=>r.e(81838).then(r.bind(r,81838)),automation:()=>r.e(35513).then(r.bind(r,35513)),camera:()=>Promise.all([r.e(54040),r.e(14920)]).then(r.bind(r,14920)),climate:()=>Promise.all([r.e(75009),r.e(42955),r.e(5632),r.e(9823)]).then(r.bind(r,9823)),configurator:()=>Promise.all([r.e(4940),r.e(42949)]).then(r.bind(r,94433)),counter:()=>r.e(6850).then(r.bind(r,6850)),cover:()=>Promise.all([r.e(31811),r.e(97148)]).then(r.bind(r,97148)),fan:()=>Promise.all([r.e(75009),r.e(42955),r.e(6038),r.e(31811),r.e(69626)]).then(r.bind(r,69626)),group:()=>Promise.all([r.e(75009),r.e(42955),r.e(46002),r.e(18449),r.e(11789),r.e(39902)]).then(r.bind(r,39902)),humidifier:()=>Promise.all([r.e(75009),r.e(42955),r.e(79277),r.e(35317)]).then(r.bind(r,35317)),input_datetime:()=>Promise.all([r.e(75009),r.e(42955),r.e(88985),r.e(36215),r.e(51522),r.e(56127)]).then(r.bind(r,56127)),light:()=>Promise.all([r.e(75009),r.e(42955),r.e(92887),r.e(31811),r.e(29598)]).then(r.bind(r,29598)),lock:()=>Promise.all([r.e(31811),r.e(85083)]).then(r.bind(r,85083)),media_player:()=>Promise.all([r.e(75009),r.e(42955),r.e(22946),r.e(46684)]).then(r.bind(r,46684)),person:()=>Promise.all([r.e(31811),r.e(23956),r.e(95993)]).then(r.bind(r,95993)),remote:()=>Promise.all([r.e(75009),r.e(42955),r.e(5713),r.e(31811),r.e(6514)]).then(r.bind(r,6514)),script:()=>r.e(71593).then(r.bind(r,71593)),sun:()=>r.e(66369).then(r.bind(r,66369)),timer:()=>Promise.all([r.e(31811),r.e(69491)]).then(r.bind(r,69491)),vacuum:()=>Promise.all([r.e(75009),r.e(42955),r.e(11139),r.e(31811),r.e(17184)]).then(r.bind(r,17184)),water_heater:()=>Promise.all([r.e(75009),r.e(42955),r.e(52994)]).then(r.bind(r,52994)),weather:()=>r.e(8914).then(r.bind(r,8914))},s=e=>{const t=(0,n.N)(e);return a(t)},a=e=>i.l.includes(e)?e:i.tm.includes(e)?"hidden":"default",l=e=>{e in o&&o[e]()}},94458:(e,t,r)=>{r.d(t,{T:()=>n,R:()=>s});var i=r(47181);const n=()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(29907),r.e(68200),r.e(88985),r.e(30879),r.e(28055),r.e(46976),r.e(22001),r.e(82376),r.e(28007),r.e(16023),r.e(68101),r.e(640),r.e(1929),r.e(49499)]).then(r.bind(r,49499)),o=()=>document.querySelector("home-assistant").shadowRoot.querySelector("dialog-entity-editor"),s=(e,t)=>((0,i.B)(e,"show-dialog",{dialogTag:"dialog-entity-editor",dialogImport:n,dialogParams:t}),o)},97740:(e,t,r)=>{r.a(e,(async e=>{var t=r(196),i=r(37500),n=r(72367),o=r(228),s=r(49706),a=r(12198),l=r(49684),c=r(25516),d=r(47181),u=r(58831),h=r(16023),f=r(87744),p=(r(3143),r(31206),r(42952)),m=r(11654),y=e([l,a,p]);function v(){v=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var n=t.placement;if(t.kind===i&&("static"===n||"prototype"===n)){var o="static"===n?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var i=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],i=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!w(e))return r.push(e);var t=this.decorateElement(e,n);r.push(t.element),r.push.apply(r,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:r,finishers:i};var o=this.decorateConstructor(r,t);return i.push.apply(i,o.finishers),o.finishers=i,o},addElementPlacement:function(e,t,r){var i=t[e.placement];if(!r&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var r=[],i=[],n=e.decorators,o=n.length-1;o>=0;o--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,n[o])(a)||a);e=l.element,this.addElementPlacement(e,t),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:i,extras:r}},decorateConstructor:function(e,t){for(var r=[],i=t.length-1;i>=0;i--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(n)||n);if(void 0!==o.finisher&&r.push(o.finisher),void 0!==o.elements){e=o.elements;for(var s=0;s<e.length-1;s++)for(var a=s+1;a<e.length;a++)if(e[s].key===e[a].key&&e[s].placement===e[a].placement)throw new TypeError("Duplicated element ("+e[s].key+")")}}return{elements:e,finishers:r}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var r=E(e.key),i=String(e.placement);if("static"!==i&&"prototype"!==i&&"own"!==i)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+i+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:i,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:_(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var r=_(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var i=(0,t[r])(e);if(void 0!==i){if("function"!=typeof i)throw new TypeError("Finishers must return a constructor.");e=i}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function g(e){var t,r=E(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var i={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(i.decorators=e.decorators),"field"===e.kind&&(i.initializer=e.value),i}function b(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function w(e){return e.decorators&&e.decorators.length}function k(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function _(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function E(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}[l,a,p]=y.then?await y:y;!function(e,t,r,i){var n=v();if(i)for(var o=0;o<i.length;o++)n=i[o](n);var s=t((function(e){n.initializeInstanceElements(e,a.elements)}),r),a=n.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},i=0;i<e.length;i++){var n,o=e[i];if("method"===o.kind&&(n=t.find(r)))if(k(o.descriptor)||k(n.descriptor)){if(w(o)||w(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(w(o)){if(w(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}b(o,n)}else t.push(o)}return t}(s.d.map(g)),e);n.initializeClassElements(s.F,a.elements),n.runClassFinishers(s.F,a.finishers)}([(0,n.Mo)("ha-logbook")],(function(e,r){return{F:class extends r{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"userIdToName",value:()=>({})},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"traceContexts",value:()=>({})},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"entries",value:()=>[]},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"narrow"})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"rtl",type:Boolean})],key:"_rtl",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"virtualize",reflect:!0})],key:"virtualize",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-icon"})],key:"noIcon",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-name"})],key:"noName",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"relative-time"})],key:"relativeTime",value:()=>!1},{kind:"field",decorators:[(0,c.i)(".container")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"shouldUpdate",value:function(e){const t=e.get("hass"),r=void 0===t||t.locale!==this.hass.locale;return e.has("entries")||e.has("traceContexts")||r}},{kind:"method",key:"updated",value:function(e){const t=e.get("hass");void 0!==t&&t.language===this.hass.language||(this._rtl=(0,f.HE)(this.hass))}},{kind:"method",key:"render",value:function(){var e;return null!==(e=this.entries)&&void 0!==e&&e.length?i.dy`
<div
class="container ha-scrollbar ${(0,o.$)({narrow:this.narrow,rtl:this._rtl,"no-name":this.noName,"no-icon":this.noIcon})}"
@scroll=${this._saveScrollPos}
>
${this.virtualize?(0,t.AR)({items:this.entries,layout:t.bW,renderItem:(e,t)=>this._renderLogbookItem(e,t)}):this.entries.map(((e,t)=>this._renderLogbookItem(e,t)))}
</div>
`:i.dy`
<div class="container no-entries" .dir=${(0,f.$3)(this._rtl)}>
${this.hass.localize("ui.components.logbook.entries_not_found")}
</div>
`}},{kind:"method",key:"_renderLogbookItem",value:function(e,t){if(void 0===t)return i.dy``;const r=this.entries[t-1],n=e.entity_id?this.hass.states[e.entity_id]:void 0,c=e.context_user_id&&this.userIdToName[e.context_user_id],d=e.entity_id?(0,u.M)(e.entity_id):e.domain;return i.dy`
<div class="entry-container">
${0===t||null!=e&&e.when&&null!=r&&r.when&&new Date(e.when).toDateString()!==new Date(r.when).toDateString()?i.dy`
<h4 class="date">
${(0,a.p6)(new Date(e.when),this.hass.locale)}
</h4>
`:i.dy``}
<div class="entry ${(0,o.$)({"no-entity":!e.entity_id})}">
<div class="icon-message">
${this.noIcon?"":i.dy`
<state-badge
.hass=${this.hass}
.overrideIcon=${e.icon||(e.domain&&!n?(0,h.K)(e.domain):void 0)}
.overrideImage=${s.iY.has(d)?"":(null==n?void 0:n.attributes.entity_picture_local)||(null==n?void 0:n.attributes.entity_picture)}
.stateObj=${n}
.stateColor=${!1}
></state-badge>
`}
<div class="message-relative_time">
<div class="message">
${this.noName?"":i.dy`<a
href="#"
@click=${this._entityClicked}
.entityId=${e.entity_id}
><span class="name">${e.name}</span></a
>`}
${e.message}
${c?` ${this.hass.localize("ui.components.logbook.by")} ${c}`:e.context_event_type?"call_service"===e.context_event_type?` ${this.hass.localize("ui.components.logbook.by_service")}\n ${e.context_domain}.${e.context_service}`:e.context_entity_id===e.entity_id?` ${this.hass.localize("ui.components.logbook.by")}\n ${e.context_name?e.context_name:e.context_event_type}`:i.dy` ${this.hass.localize("ui.components.logbook.by")}
<a
href="#"
@click=${this._entityClicked}
.entityId=${e.context_entity_id}
class="name"
>${e.context_entity_id_name}</a
>`:""}
</div>
<div class="secondary">
<span
>${(0,l.Vu)(new Date(e.when),this.hass.locale)}</span
>
-
<ha-relative-time
.hass=${this.hass}
.datetime=${e.when}
capitalize
></ha-relative-time>
${"automation"===e.domain&&e.context_id in this.traceContexts?i.dy`
-
<a
href=${`/config/automation/trace/${this.traceContexts[e.context_id].item_id}?run_id=${this.traceContexts[e.context_id].run_id}`}
@click=${this._close}
>${this.hass.localize("ui.components.logbook.show_trace")}</a
>
`:""}
</div>
</div>
</div>
</div>
</div>
`}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_entityClicked",value:function(e){const t=e.currentTarget.entityId;t&&(e.preventDefault(),e.stopPropagation(),(0,d.B)(this,"hass-more-info",{entityId:t}))}},{kind:"method",key:"_close",value:function(){setTimeout((()=>(0,d.B)(this,"closed")),500)}},{kind:"get",static:!0,key:"styles",value:function(){return[m.Qx,m.$c,i.iv`
:host([virtualize]) {
display: block;
height: 100%;
}
.rtl {
direction: ltr;
}
.entry-container {
width: 100%;
}
.entry {
display: flex;
width: 100%;
line-height: 2em;
padding: 8px 16px;
box-sizing: border-box;
border-top: 1px solid var(--divider-color);
}
.entry.no-entity,
.no-name .entry {
cursor: default;
}
.entry:hover {
background-color: rgba(var(--rgb-primary-text-color), 0.04);
}
.narrow:not(.no-icon) .time {
margin-left: 32px;
}
.message-relative_time {
display: flex;
flex-direction: column;
}
.secondary {
font-size: 12px;
line-height: 1.7;
}
.secondary a {
color: var(--secondary-text-color);
}
.date {
margin: 8px 0;
padding: 0 16px;
}
.narrow .date {
padding: 0 8px;
}
.rtl .date {
direction: rtl;
}
.icon-message {
display: flex;
align-items: center;
}
.no-entries {
text-align: center;
color: var(--secondary-text-color);
}
state-badge {
margin-right: 16px;
flex-shrink: 0;
color: var(--state-icon-color);
}
.message {
color: var(--primary-text-color);
}
.no-name .message:first-letter {
text-transform: capitalize;
}
a {
color: var(--primary-color);
}
.container {
max-height: var(--logbook-max-height);
}
:host([virtualize]) .container {
height: 100%;
}
.narrow .entry {
line-height: 1.5;
padding: 8px;
}
.narrow .icon-message state-badge {
margin-left: 0;
}
`]}}]}}),i.oi)}))},73953:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{J:()=>l});var i=r(71948),n=r(7778),o=e([i]);i=(o.then?await o:o)[0];const s=new Set(["error","state-label"]),a={"entity-filter":()=>r.e(68045).then(r.bind(r,68045))},l=e=>(0,n.Tw)("badge",e,s,a,void 0,"state-label")}))},51153:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{l$:()=>y,Z6:()=>v,Do:()=>g});var i=r(10175),n=(r(80251),r(89894)),o=r(14888),s=r(69377),a=r(95035),l=r(6169),c=r(41043),d=r(57464),u=(r(24617),r(82778)),h=r(7778),f=e([u,d,c,l,a,s,o,n,i]);[u,d,c,l,a,s,o,n,i]=f.then?await f:f;const p=new Set(["entity","entities","button","entity-button","glance","grid","light","sensor","thermostat","weather-forecast"]),m={"alarm-panel":()=>r.e(77639).then(r.bind(r,77639)),area:()=>Promise.all([r.e(319),r.e(97282),r.e(65131)]).then(r.bind(r,95795)),calendar:()=>Promise.resolve().then(r.bind(r,80251)),conditional:()=>r.e(68857).then(r.bind(r,68857)),"empty-state":()=>r.e(67284).then(r.bind(r,67284)),"energy-carbon-consumed-gauge":()=>Promise.all([r.e(91573),r.e(55424),r.e(31523),r.e(43283),r.e(19490)]).then(r.bind(r,19490)),"energy-date-selection":()=>Promise.all([r.e(71250),r.e(55424),r.e(82649),r.e(10346)]).then(r.bind(r,10346)),"energy-devices-graph":()=>Promise.all([r.e(5287),r.e(55424),r.e(62336),r.e(77251)]).then(r.bind(r,47420)),"energy-distribution":()=>Promise.all([r.e(55424),r.e(32191)]).then(r.bind(r,9928)),"energy-gas-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(41305)]).then(r.bind(r,41305)),"energy-grid-neutrality-gauge":()=>Promise.all([r.e(31752),r.e(55424),r.e(31523),r.e(32176)]).then(r.bind(r,32176)),"energy-solar-consumed-gauge":()=>Promise.all([r.e(86087),r.e(55424),r.e(31523),r.e(43283),r.e(85930)]).then(r.bind(r,85930)),"energy-solar-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(70310)]).then(r.bind(r,70310)),"energy-sources-table":()=>Promise.all([r.e(57646),r.e(55424),r.e(62336),r.e(17595),r.e(16938)]).then(r.bind(r,16938)),"energy-usage-graph":()=>Promise.all([r.e(55424),r.e(62336),r.e(2053),r.e(9897)]).then(r.bind(r,9897)),"entity-filter":()=>r.e(33688).then(r.bind(r,33688)),error:()=>Promise.all([r.e(77426),r.e(55796)]).then(r.bind(r,55796)),gauge:()=>Promise.all([r.e(31523),r.e(43283)]).then(r.bind(r,43283)),"history-graph":()=>Promise.all([r.e(62336),r.e(25825),r.e(38026)]).then(r.bind(r,38026)),"horizontal-stack":()=>r.e(89173).then(r.bind(r,89173)),humidifier:()=>r.e(68558).then(r.bind(r,68558)),iframe:()=>r.e(95018).then(r.bind(r,95018)),logbook:()=>Promise.all([r.e(196),r.e(81855),r.e(90851)]).then(r.bind(r,8436)),map:()=>Promise.all([r.e(23956),r.e(60076)]).then(r.bind(r,60076)),markdown:()=>Promise.all([r.e(4940),r.e(26607)]).then(r.bind(r,51282)),"media-control":()=>Promise.all([r.e(28611),r.e(11866)]).then(r.bind(r,11866)),"picture-elements":()=>Promise.all([r.e(54909),r.e(319),r.e(97282),r.e(99810),r.e(44121)]).then(r.bind(r,83358)),"picture-entity":()=>Promise.all([r.e(319),r.e(97282),r.e(25917)]).then(r.bind(r,41500)),"picture-glance":()=>Promise.all([r.e(319),r.e(97282),r.e(7015)]).then(r.bind(r,66621)),picture:()=>r.e(45338).then(r.bind(r,45338)),"plant-status":()=>r.e(48723).then(r.bind(r,48723)),"safe-mode":()=>r.e(24503).then(r.bind(r,24503)),"shopping-list":()=>Promise.all([r.e(54040),r.e(43376)]).then(r.bind(r,43376)),starting:()=>r.e(47873).then(r.bind(r,47873)),"statistics-graph":()=>Promise.all([r.e(62336),r.e(17595),r.e(95396)]).then(r.bind(r,95396)),"vertical-stack":()=>r.e(26136).then(r.bind(r,26136))},y=e=>(0,h.Xm)("card",e,p,m,void 0,void 0),v=e=>(0,h.Tw)("card",e,p,m,void 0,void 0),g=e=>(0,h.ED)(e,"card",p,m)}))},7778:(e,t,r)=>{r.d(t,{N2:()=>o,Tw:()=>c,Xm:()=>d,ED:()=>u});var i=r(47181),n=r(9893);const o=(e,t)=>({type:"error",error:e,origConfig:t}),s=(e,t)=>{const r=document.createElement(e);return r.setConfig(t),r},a=(e,t)=>(e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.all([r.e(77426),r.e(55796)]).then(r.bind(r,55796)),customElements.whenDefined("hui-error-card").then((()=>{customElements.upgrade(t),t.setConfig(e)}))),t})(o(e,t)),l=e=>e.startsWith(n.Qo)?e.substr(n.Qo.length):void 0,c=(e,t,r,i,n,o)=>{try{return d(e,t,r,i,n,o)}catch(r){return console.error(e,t.type,r),a(r.message,t)}},d=(e,t,r,n,o,c)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||c||o&&"entity"in t))throw new Error("No card type configured");const d=t.type?l(t.type):void 0;if(d)return((e,t)=>{if(customElements.get(e))return s(e,t);const r=a(`Custom element doesn't exist: ${e}.`,t);if(!e.includes("-"))return r;r.style.display="None";const n=window.setTimeout((()=>{r.style.display=""}),2e3);return customElements.whenDefined(e).then((()=>{clearTimeout(n),(0,i.B)(r,"ll-rebuild")})),r})(d,t);let u;if(o&&!t.type&&t.entity){u=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else u=t.type||c;if(void 0===u)throw new Error("No type specified");const h=`hui-${u}-${e}`;if(n&&u in n)return n[u](),((e,t)=>{if(customElements.get(e))return s(e,t);const r=document.createElement(e);return customElements.whenDefined(e).then((()=>{try{customElements.upgrade(r),r.setConfig(t)}catch(e){(0,i.B)(r,"ll-rebuild")}})),r})(h,t);if(r&&r.has(u))return s(h,t);throw new Error(`Unknown type encountered: ${u}`)},u=async(e,t,r,i)=>{const n=l(e);if(n){const e=customElements.get(n);if(e)return e;if(!n.includes("-"))throw new Error(`Custom element not found: ${n}`);return new Promise(((e,t)=>{setTimeout((()=>t(new Error(`Custom element not found: ${n}`))),2e3),customElements.whenDefined(n).then((()=>e(customElements.get(n))))}))}const o=`hui-${e}-${t}`,s=customElements.get(o);if(r&&r.has(e))return s;if(i&&e in i)return s||i[e]().then((()=>customElements.get(o)));throw new Error(`Unknown type: ${e}`)}},89026:(e,t,r)=>{r.d(t,{t:()=>o,Q:()=>s});var i=r(7778);const n={picture:()=>r.e(69130).then(r.bind(r,69130)),buttons:()=>Promise.all([r.e(42109),r.e(32587)]).then(r.bind(r,32587)),graph:()=>r.e(28922).then(r.bind(r,28922))},o=e=>(0,i.Tw)("header-footer",e,void 0,n,void 0,void 0),s=e=>(0,i.ED)(e,"header-footer",void 0,n)},83320:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{w:()=>c});var i=r(7355),n=(r(26602),r(93479),r(51432),r(73089)),o=(r(8864),r(17875)),s=r(7778),a=e([o,n,i]);[o,n,i]=a.then?await a:a;const l=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),c=e=>(0,s.Tw)("element",e,l)}))},37482:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{m:()=>m,T:()=>y});var i=r(12141),n=r(31479),o=r(23266),s=r(65716),a=r(97600),l=r(83896),c=r(45340),d=(r(56427),r(23658),r(7778)),u=e([c,l,a,s,o,n,i]);[c,l,a,s,o,n,i]=u.then?await u:u;const h=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","text-entity","toggle-entity","button","call-service"]),f={"button-entity":()=>r.e(85611).then(r.bind(r,85611)),"climate-entity":()=>r.e(35642).then(r.bind(r,35642)),"cover-entity":()=>r.e(16755).then(r.bind(r,16755)),"group-entity":()=>r.e(81534).then(r.bind(r,81534)),"input-button-entity":()=>r.e(83968).then(r.bind(r,83968)),"humidifier-entity":()=>r.e(41102).then(r.bind(r,41102)),"input-datetime-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(88985),r.e(36215),r.e(51522),r.e(68559)]).then(r.bind(r,22350)),"input-number-entity":()=>r.e(12335).then(r.bind(r,12335)),"input-select-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(32950)]).then(r.bind(r,25675)),"input-text-entity":()=>r.e(73943).then(r.bind(r,73943)),"lock-entity":()=>r.e(61596).then(r.bind(r,61596)),"number-entity":()=>r.e(66778).then(r.bind(r,66778)),"select-entity":()=>Promise.all([r.e(75009),r.e(78161),r.e(42955),r.e(96596)]).then(r.bind(r,35994)),"timer-entity":()=>r.e(31203).then(r.bind(r,31203)),conditional:()=>r.e(97749).then(r.bind(r,97749)),"weather-entity":()=>r.e(71850).then(r.bind(r,71850)),divider:()=>r.e(41930).then(r.bind(r,41930)),section:()=>r.e(94832).then(r.bind(r,94832)),weblink:()=>r.e(44689).then(r.bind(r,44689)),cast:()=>r.e(25840).then(r.bind(r,25840)),buttons:()=>Promise.all([r.e(42109),r.e(82137)]).then(r.bind(r,82137)),attribute:()=>Promise.resolve().then(r.bind(r,45340)),text:()=>r.e(63459).then(r.bind(r,63459))},p={_domain_not_found:"text",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime",weather:"weather"},m=e=>(0,d.Tw)("row",e,h,f,p,void 0),y=e=>(0,d.ED)(e,"row",h,f)}))},49686:(e,t,r)=>{r.a(e,(async e=>{r.r(t),r.d(t,{importMoreInfoControl:()=>i.ST,createBadgeElement:()=>n.J,createCardElement:()=>o.Z6,createHeaderFooterElement:()=>s.t,createHuiElement:()=>a.w,createRowElement:()=>l.m});var i=r(82791),n=r(73953),o=r(51153),s=r(89026),a=r(83320),l=r(37482),c=e([l,a,o,n]);[l,a,o,n]=c.then?await c:c}))}}]);
//# sourceMappingURL=9f5922e0.js.map
@Eckart0 please keep your pastes a bit shorter, you are killing my inbox :D
The issue comes from two factors: 1) bad data + 2) bad error handling.
fix for 2 is wip and waiting to be released, currently on dev branch. You can do a ~hotfix on your db, without any warranty/promise that it will work..
The problem
Hello, after updating to latest version (but I can't be sure the problem existed also before the update) accessing the History page the loading hangs forever. Every access is followed by an error entry in the log file related to "components/system_log/init.py:190"
What version of Home Assistant Core has the issue?
Home Assistant 2022.2.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
History
Link to integration documentation on our website
https://www.home-assistant.io/integrations/history
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
After trying reboot, browser cache clearing and another fresh browser (Chrome) i decided to try to purge all the events from the database (Developer tools -> Services -> recorder.purge with keep_days: 0) and the problem disappeared.
What would be nice is if an invalid date/time is found in the recorded event in database, the History init should not hang but report that error (end eventually the entity with malformed date/time) to the error log so you can purge the single entity instead of loose the entire history of Home Assistant to solve the problem.
Thanks in advance.