UNPKG

iobroker.lovelace

Version:

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

3 lines 22.8 kB
/*! For license information please see chunk.dbcd554837bf9e4e75b2.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[4302],{24731:function(e,t,r){"use strict";r.d(t,{s:function(){return n.s}});var n=r(78389)},13690:function(e,t,r){"use strict";r.d(t,{r:function(){return m}});var n=r(99602),o=r(55122),i=r(57724);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==r)return;var n,o,i=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(c){a=!0,o=c}finally{try{s||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||c(e,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.")}()}function c(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p(e);if(t){var o=p(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=function(e,t,r){for(var n=new Map,o=t;o<=r;o++)n.set(e[o],o);return n},m=(0,o.XM)(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(p,e);var t,r,s,l=h(p);function p(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),t=l.call(this,e),e.type!==o.pX.CHILD)throw Error("repeat() can only be used in text expressions");return d(t)}return t=p,(r=[{key:"Mt",value:function(e,t,r){var n;void 0===r?r=t:void 0!==t&&(n=t);var o,i=[],s=[],a=0,l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}(e);try{for(l.s();!(o=l.n()).done;){var u=o.value;i[a]=n?n(u,a):a,s[a]=r(u,a),a++}}catch(f){l.e(f)}finally{l.f()}return{values:s,keys:i}}},{key:"render",value:function(e,t,r){return this.Mt(e,t,r).values}},{key:"update",value:function(e,t){var r,o=a(t,3),s=o[0],c=o[1],l=o[2],u=(0,i.i9)(e),f=this.Mt(s,c,l),h=f.values,d=f.keys;if(!u)return this.Pt=d,h;for(var p,m,v=null!==(r=this.Pt)&&void 0!==r?r:this.Pt=[],b=[],g=0,k=u.length-1,w=0,_=h.length-1;g<=k&&w<=_;)if(null===u[g])g++;else if(null===u[k])k--;else if(v[g]===d[w])b[w]=(0,i.fk)(u[g],h[w]),g++,w++;else if(v[k]===d[_])b[_]=(0,i.fk)(u[k],h[_]),k--,_--;else if(v[g]===d[_])b[_]=(0,i.fk)(u[g],h[_]),(0,i._Y)(e,b[_+1],u[g]),g++,_--;else if(v[k]===d[w])b[w]=(0,i.fk)(u[k],h[w]),(0,i._Y)(e,u[g],u[k]),k--,w++;else if(void 0===p&&(p=y(d,w,_),m=y(v,g,k)),p.has(v[g]))if(p.has(v[k])){var E=m.get(d[w]),S=void 0!==E?u[E]:null;if(null===S){var P=(0,i._Y)(e,u[g]);(0,i.fk)(P,h[w]),b[w]=P}else b[w]=(0,i.fk)(S,h[w]),(0,i._Y)(e,u[g],S),u[E]=null;w++}else(0,i.ws)(u[k]),k--;else(0,i.ws)(u[g]),g++;for(;w<=_;){var O=(0,i._Y)(e,b[_+1]);(0,i.fk)(O,h[w]),b[w++]=O}for(;g<=k;){var j=u[g++];null!==j&&(0,i.ws)(j)}return this.Pt=d,(0,i.hl)(e,b),n.Jb}}])&&u(t.prototype,r),s&&u(t,s),p}(o.Xe))},25516:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n=function(e){return function(t){return{kind:"method",placement:"prototype",key:t.key,descriptor:{set:function(e){this["__".concat(String(t.key))]=e},get:function(){return this["__".concat(String(t.key))]},enumerable:!0,configurable:!0},finisher:function(r){var n=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){if(n.call(this),this[t.key]){var r=this.renderRoot.querySelector(e);if(!r)return;r.scrollTop=this[t.key]}}}}}}},8436:function(e,t,r){"use strict";r.r(t),r.d(t,{HuiLogbookCard:function(){return U}});var n,o,i,s,a,c,l,u=r(50424),f=r(55358),h=r(76666),d=r(7323),p=r(62877),y=r(22311),m=r(8330),v=(r(22098),r(31206),r(55422)),b=(r(97740),r(15688)),g=r(90271);r(75502);function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e){return function(e){if(Array.isArray(e))return M(e)}(e)||F(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function E(e,t,r,n,o,i,s){try{var a=e[i](s),c=a.value}catch(l){return void r(l)}a.done?t(c):Promise.resolve(c).then(n,o)}function S(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){E(i,n,o,s,a,"next",e)}function a(e){E(i,n,o,s,a,"throw",e)}s(void 0)}))}}function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Y(e);if(t){var o=Y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return x(this,r)}}function x(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?A(e):t}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(){D=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(n){t.forEach((function(t){var o=t.placement;if(t.kind===n&&("static"===o||"prototype"===o)){var i="static"===o?e:r;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!R(e))return r.push(e);var t=this.decorateElement(e,o);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var i=this.decorateConstructor(r,t);return n.push.apply(n,i.finishers),i.finishers=n,i},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],o=e.decorators,i=o.length-1;i>=0;i--){var s=t[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,o[i])(a)||a);e=c.element,this.addElementPlacement(e,t),c.finisher&&n.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);r.push.apply(r,l)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[n])(o)||o);if(void 0!==i.finisher&&r.push(i.finisher),void 0!==i.elements){e=i.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)||F(t)||B(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=L(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)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 "'+n+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:r,placement:n,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:I(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=I(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}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=L(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 n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function T(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function R(e){return e.decorators&&e.decorators.length}function z(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function I(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 L(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}function B(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}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function F(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function N(e,t,r){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Y(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var U=function(e,t,r,n){var o=D();if(n)for(var i=0;i<n.length;i++)o=n[i](o);var s=t((function(e){o.initializeInstanceElements(e,a.elements)}),r),a=o.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},n=0;n<e.length;n++){var o,i=e[n];if("method"===i.kind&&(o=t.find(r)))if(z(i.descriptor)||z(o.descriptor)){if(R(i)||R(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(R(i)){if(R(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}T(i,o)}else t.push(i)}return t}(s.d.map(C)),e);return o.initializeClassElements(s.F,a.elements),o.runClassFinishers(s.F,a.finishers)}([(0,f.Mo)("hui-logbook-card")],(function(e,t){var k,E,x=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(n,t);var r=j(n);function n(){var t;P(this,n);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return t=r.call.apply(r,[this].concat(i)),e(A(t)),t}return n}(t);return{F:x,d:[{kind:"method",static:!0,key:"getConfigElement",value:(E=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r.e(5009),r.e(2955),r.e(8161),r.e(1041),r.e(1657),r.e(4268),r.e(3098),r.e(6087),r.e(4159),r.e(4535),r.e(6902),r.e(5703),r.e(4237)]).then(r.bind(r,74237));case 2:return e.abrupt("return",document.createElement("hui-logbook-card-editor"));case 3:case"end":return e.stop()}}),e)}))),function(){return E.apply(this,arguments)})},{kind:"method",static:!0,key:"getStubConfig",value:function(e,t,r){return{entities:(0,b.j)(e,3,t,r,["light","switch"])}}},{kind:"field",decorators:[(0,f.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_config",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_logbookEntries",value:void 0},{kind:"field",decorators:[(0,f.SB)()],key:"_persons",value:function(){return{}}},{kind:"field",decorators:[(0,f.SB)()],key:"_configEntities",value:void 0},{kind:"field",key:"_lastLogbookDate",value:void 0},{kind:"field",key:"_throttleGetLogbookEntries",value:function(){var e=this;return(0,m.P)((function(){e._getLogBookData()}),1e4)}},{kind:"method",key:"getCardSize",value:function(){var e;return 9+(null!==(e=this._config)&&void 0!==e&&e.title?1:0)}},{kind:"method",key:"setConfig",value:function(e){if(!e.entities.length)throw new Error("Entities must be specified");this._configEntities=(0,g.A)(e.entities),this._config=Object.assign({hours_to_show:24},e)}},{kind:"method",key:"shouldUpdate",value:function(e){if(e.has("_config")||e.has("_persons")||e.has("_logbookEntries"))return!0;var t=e.get("hass");if(!this._configEntities||!t||t.themes!==this.hass.themes||t.locale!==this.hass.locale)return!0;var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=B(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}(this._configEntities);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(t.states[o.entity]!==this.hass.states[o.entity])return!0}}catch(i){n.e(i)}finally{n.f()}return!1}},{kind:"method",key:"firstUpdated",value:function(){this._fetchPersonNames()}},{kind:"method",key:"updated",value:function(e){var t=this;if(N(Y(x.prototype),"updated",this).call(this,e),this._config&&this.hass){var r=e.has("_config"),n=e.has("hass"),o=e.get("hass"),i=e.get("_config");if((n&&(null==o?void 0:o.themes)!==this.hass.themes||r&&(null==i?void 0:i.theme)!==this._config.theme)&&(0,p.R)(this,this.hass.themes,this._config.theme),!r||(null==i?void 0:i.entities)===this._config.entities&&(null==i?void 0:i.hours_to_show)===this._config.hours_to_show)o&&this._configEntities.some((function(e){return o.states[e.entity]!==t.hass.states[e.entity]}))&&setTimeout(this._throttleGetLogbookEntries,1e3);else{if(this._logbookEntries=void 0,this._lastLogbookDate=void 0,!this._configEntities)return;this._throttleGetLogbookEntries()}}}},{kind:"method",key:"render",value:function(){return this.hass&&this._config?(0,d.p)(this.hass,"logbook")?(0,u.dy)(i||(i=_(["\n <ha-card\n .header=","\n class=",'\n >\n <div class="content">\n ',"\n </div>\n </ha-card>\n "])),this._config.title,(0,h.$)({"no-header":!this._config.title}),this._logbookEntries?this._logbookEntries.length?(0,u.dy)(a||(a=_(["\n <ha-logbook\n narrow\n relative-time\n virtualize\n .hass=","\n .entries=","\n .userIdToName=","\n ></ha-logbook>\n "])),this.hass,this._logbookEntries,this._persons):(0,u.dy)(c||(c=_(['\n <div class="no-entries">\n ',"\n </div>\n "])),this.hass.localize("ui.components.logbook.entries_not_found")):(0,u.dy)(s||(s=_(["\n <ha-circular-progress\n active\n alt=","\n ></ha-circular-progress>\n "])),this.hass.localize("ui.common.loading"))):(0,u.dy)(o||(o=_(["\n <hui-warning>\n ","</hui-warning\n >\n "])),this.hass.localize("ui.components.logbook.component_not_loaded")):(0,u.dy)(n||(n=_([""])))}},{kind:"method",key:"_getLogBookData",value:(k=S(regeneratorRuntime.mark((function e(){var t,r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hass&&this._config&&(0,d.p)(this.hass,"logbook")){e.next=2;break}return e.abrupt("return");case 2:return t=new Date((new Date).getTime()-60*this._config.hours_to_show*60*1e3),r=this._lastLogbookDate||t,n=new Date,e.next=7,(0,v.rM)(this.hass,r.toISOString(),n.toISOString(),this._configEntities.map((function(e){return e.entity})).toString(),!0);case 7:o=e.sent,i=this._logbookEntries?[].concat(w(o),w(this._logbookEntries)):o,this._logbookEntries=i.filter((function(e){return new Date(e.when)>t})),this._lastLogbookDate=n;case 11:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{kind:"method",key:"_fetchPersonNames",value:function(){var e=this;this.hass&&Object.values(this.hass.states).forEach((function(t){t.attributes.user_id&&"person"===(0,y.N)(t)&&(e._persons[t.attributes.user_id]=t.attributes.friendly_name)}))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,u.iv)(l||(l=_(["\n ha-card {\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n\n .content {\n padding: 0 16px 16px;\n }\n\n .no-header .content {\n padding-top: 16px;\n }\n\n .no-entries {\n text-align: center;\n padding: 16px;\n color: var(--secondary-text-color);\n }\n\n ha-logbook {\n height: 385px;\n display: block;\n }\n\n ha-circular-progress {\n display: flex;\n justify-content: center;\n }\n "])))]}}]}}),u.oi)}}]); //# sourceMappingURL=chunk.dbcd554837bf9e4e75b2.js.map