UNPKG

iobroker.lovelace

Version:

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

2 lines 26.6 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[1855],{5435:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=[60,60,24,7],o=["second","minute","hour","day"];function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.compareTime||new Date,a=(i.getTime()-e.getTime())/1e3,c=a>=0?"past":"future";a=Math.abs(a);var s=Math.round(a);if(0===s)return t("ui.components.relative_time.just_now");for(var l="week",u=0;u<r.length;u++){if(s<r[u]){l=o[u];break}a/=r[u],s=Math.round(a)}return t(!1===n.includeTense?"ui.components.relative_time.duration.".concat(l):"ui.components.relative_time.".concat(c,"_duration.").concat(l),"count",s)}},32075:function(e,t,n){"use strict";var r=n(87156),o=n(28426),i=n(5435);function a(e){return(a="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 c(e,t,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=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&&u(e,t)}(n,e);var t=f(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).updateRelative=e.updateRelative.bind(p(e)),e}return l(n,null,[{key:"properties",get:function(){return{hass:Object,datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:Object}}}]),l(n,[{key:"connectedCallback",value:function(){c(h(n.prototype),"connectedCallback",this).call(this),this.updateInterval=setInterval(this.updateRelative,6e4)}},{key:"disconnectedCallback",value:function(){c(h(n.prototype),"disconnectedCallback",this).call(this),clearInterval(this.updateInterval)}},{key:"datetimeChanged",value:function(e){this.parsedDateTime=e?new Date(e):null,this.updateRelative()}},{key:"datetimeObjChanged",value:function(e){this.parsedDateTime=e,this.updateRelative()}},{key:"updateRelative",value:function(){var e=(0,r.vz)(this);this.parsedDateTime?e.innerHTML=(0,i.Z)(this.parsedDateTime,this.localize):e.innerHTML=this.localize("ui.components.relative_time.never")}}]),n}((0,n(1265).Z)(o.H3));customElements.define("ha-relative-time",y)},55422:function(e,t,n){"use strict";n.d(t,{jV:function(){return d},rM:function(){return h},tf:function(){return v}});var r=n(49706),o=n(58831),i=n(29171),a=n(56007);function c(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(l){return void n(l)}c.done?t(s):Promise.resolve(s).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,c,"next",e)}function c(e){l(i,r,o,a,c,"throw",e)}a(void 0)}))}}var f="ui.components.logbook.messages",d=["proximity","sensor"],p={},h=function(){var e=u(regeneratorRuntime.mark((function e(t,n,r,i,a){var s,l,u,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y(t,n,r,i,a);case 2:s=e.sent,l=c(s);try{for(l.s();!(u=l.n()).done;)f=u.value,d=t.states[f.entity_id],f.state&&d&&(f.message=b(t,f.state,d,(0,o.M)(f.entity_id)))}catch(p){l.e(p)}finally{l.f()}return e.abrupt("return",s);case 6:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),y=function(){var e=u(regeneratorRuntime.mark((function e(t,n,r,o,i){var a,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a="*",o||(o=a),c="".concat(n).concat(r),p[c]||(p[c]={}),!p[c][o]){e.next=6;break}return e.abrupt("return",p[c][o]);case 6:if(o===a||!p[c][a]){e.next=11;break}return e.next=9,p[c][a];case 9:return s=e.sent,e.abrupt("return",s.filter((function(e){return e.entity_id===o})));case 11:return p[c][o]=m(t,n,r,o!==a?o:void 0,i).then((function(e){return e.reverse()})),e.abrupt("return",p[c][o]);case 13:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),m=function(){var e=u(regeneratorRuntime.mark((function e(t,n,r,o,i){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="logbook/".concat(n,"?end_time=").concat(r).concat(o?"&entity=".concat(o):"").concat(i?"&entity_matches_only":""),e.abrupt("return",t.callApi("GET",a));case 2:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),v=function(e,t){p["".concat(e).concat(t)]={}},b=function(e,t,n,o){switch(o){case"device_tracker":case"person":return"not_home"===t?e.localize("".concat(f,".was_away")):e.localize("".concat(f,".was_at_state"),"state",t);case"sun":return"above_horizon"===t?e.localize("".concat(f,".rose")):e.localize("".concat(f,".set"));case"binary_sensor":var c=t===r.uo,s=t===r.lC,l=n.attributes.device_class;switch(l){case"battery":if(c)return e.localize("".concat(f,".was_low"));if(s)return e.localize("".concat(f,".was_normal"));break;case"connectivity":if(c)return e.localize("".concat(f,".was_connected"));if(s)return e.localize("".concat(f,".was_disconnected"));break;case"door":case"garage_door":case"opening":case"window":if(c)return e.localize("".concat(f,".was_opened"));if(s)return e.localize("".concat(f,".was_closed"));break;case"lock":if(c)return e.localize("".concat(f,".was_unlocked"));if(s)return e.localize("".concat(f,".was_locked"));break;case"plug":if(c)return e.localize("".concat(f,".was_plugged_in"));if(s)return e.localize("".concat(f,".was_unplugged"));break;case"presence":if(c)return e.localize("".concat(f,".was_at_home"));if(s)return e.localize("".concat(f,".was_away"));break;case"safety":if(c)return e.localize("".concat(f,".was_unsafe"));if(s)return e.localize("".concat(f,".was_safe"));break;case"cold":case"gas":case"heat":case"colightld":case"moisture":case"motion":case"occupancy":case"power":case"problem":case"smoke":case"sound":case"vibration":if(c)return e.localize("".concat(f,".detected_device_class"),"device_class",l);if(s)return e.localize("".concat(f,".cleared_device_class"),"device_class",l)}break;case"cover":return"open"===t?e.localize("".concat(f,".was_opened")):e.localize("".concat(f,".was_closed"));case"lock":if("unlocked"===t)return e.localize("".concat(f,".was_unlocked"));if("locked"===t)return e.localize("".concat(f,".was_locked"))}return t===r.uo?e.localize("".concat(f,".turned_on")):t===r.lC?e.localize("".concat(f,".turned_off")):a.V_.includes(t)?e.localize("".concat(f,".became_unavailable")):e.localize("".concat(f,".changed_to_state"),"state",n?(0,i.D)(e.localize,n,e.language,t):t)}},97740:function(e,t,n){"use strict";var r=n(15652),o=n(81471),i=n(55755),a=n(12198),c=n(49684),s=n(25516),l=n(47181),u=n(58831),f=n(76151),d=n(87744),p=(n(31206),n(16509),n(32075),n(11654));function h(e){return(h="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 y(){var e=E(["\n :host {\n display: block;\n height: 100%;\n }\n\n .rtl {\n direction: ltr;\n }\n\n .entry-container {\n width: 100%;\n }\n\n .entry {\n display: flex;\n width: 100%;\n line-height: 2em;\n padding: 8px 16px;\n box-sizing: border-box;\n border-top: 1px solid var(--divider-color);\n }\n\n .entry.no-entity,\n .no-name .entry {\n cursor: default;\n }\n\n .entry:hover {\n background-color: rgba(var(--rgb-primary-text-color), 0.04);\n }\n\n .narrow:not(.no-icon) .time {\n margin-left: 32px;\n }\n\n .message-relative_time {\n display: flex;\n flex-direction: column;\n }\n\n .secondary {\n font-size: 12px;\n line-height: 1.7;\n }\n\n .date {\n margin: 8px 0;\n padding: 0 16px;\n }\n\n .narrow .date {\n padding: 0 8px;\n }\n\n .rtl .date {\n direction: rtl;\n }\n\n .icon-message {\n display: flex;\n align-items: center;\n }\n\n .no-entries {\n text-align: center;\n color: var(--secondary-text-color);\n }\n\n ha-icon {\n margin-right: 16px;\n flex-shrink: 0;\n color: var(--state-icon-color);\n }\n\n .message {\n color: var(--primary-text-color);\n }\n\n .no-name .message:first-letter {\n text-transform: capitalize;\n }\n\n a {\n color: var(--primary-color);\n }\n\n .uni-virtualizer-host {\n display: block;\n position: relative;\n contain: strict;\n height: 100%;\n overflow: auto;\n }\n\n .uni-virtualizer-host > * {\n box-sizing: border-box;\n }\n\n .narrow .entry {\n line-height: 1.5;\n padding: 8px;\n }\n\n .narrow .icon-message ha-icon {\n margin-left: 0;\n }\n "]);return y=function(){return e},e}function m(){var e=E([" ",'\n <a\n href="#"\n @click=',"\n .entityId=",'\n class="name"\n >',"</a\n >"]);return m=function(){return e},e}function v(){var e=E(['<a\n href="#"\n @click=',"\n .entityId=",'\n ><span class="name">',"</span></a\n >"]);return v=function(){return e},e}function b(){var e=E(["\n <ha-icon\n .icon=","\n ></ha-icon>\n "]);return b=function(){return e},e}function g(){var e=E([""]);return g=function(){return e},e}function w(){var e=E(['\n <h4 class="date">\n ',"\n </h4>\n "]);return w=function(){return e},e}function k(){var e=E(['\n <div class="entry-container">\n ','\n\n <div class="entry ','">\n <div class="icon-message">\n ','\n <div class="message-relative_time">\n <div class="message">\n ',"\n ","\n ",'\n </div>\n <div class="secondary">\n <span\n >',"</span\n >\n -\n <ha-relative-time\n .hass=","\n .datetime=","\n ></ha-relative-time>\n </div>\n </div>\n </div>\n </div>\n </div>\n "]);return k=function(){return e},e}function _(){var e=E([""]);return _=function(){return e},e}function x(){var e=E(['\n <div\n class="container ','"\n @scroll=',"\n >\n ","\n </div>\n "]);return x=function(){return e},e}function z(){var e=E(['\n <div class="container no-entries" .dir=',">\n ","\n </div>\n "]);return z=function(){return e},e}function E(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=j(e);if(t){var o=j(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?D(e):t}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(){T=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!I(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var c=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,o[i])(c)||c);e=s.element,this.addElementPlacement(e,t),s.finisher&&r.push(s.finisher);var l=s.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var c=a+1;c<e.length;c++)if(e[a].key===e[c].key&&e[a].placement===e[c].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},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&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(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 n=B(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)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 "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,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: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 n=F(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function R(e){var t,n=B(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 r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function A(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function I(e){return e.decorators&&e.decorators.length}function M(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function F(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function B(e){var t=function(e,t){if("object"!==h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===h(t)?t:String(t)}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t,n,r){var o=T();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t((function(e){o.initializeInstanceElements(e,c.elements)}),n),c=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(M(i.descriptor)||M(o.descriptor)){if(I(i)||I(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(I(i)){if(I(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}A(i,o)}else t.push(i)}return t}(a.d.map(R)),e);o.initializeClassElements(a.F,c.elements),o.runClassFinishers(a.F,c.finishers)}([(0,r.Mo)("ha-logbook")],(function(e,t){return{F: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&&C(e,t)}(r,t);var n=P(r);function r(){var t;O(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i)),e(D(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"userIdToName",value:function(){return{}}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"entries",value:function(){return[]}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"narrow"})],key:"narrow",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"rtl",type:Boolean})],key:"_rtl",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"virtualize",reflect:!0})],key:"virtualize",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-icon"})],key:"noIcon",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-name"})],key:"noName",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"relative-time"})],key:"relativeTime",value:function(){return!1}},{kind:"field",decorators:[(0,s.i)(".container")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"shouldUpdate",value:function(e){var t=e.get("hass"),n=void 0===t||t.language!==this.hass.language;return e.has("entries")||n}},{kind:"method",key:"updated",value:function(e){var t=e.get("hass");void 0!==t&&t.language===this.hass.language||(this._rtl=(0,d.HE)(this.hass))}},{kind:"method",key:"render",value:function(){var e,t=this;return(null===(e=this.entries)||void 0===e?void 0:e.length)?(0,r.dy)(x(),(0,o.$)({narrow:this.narrow,rtl:this._rtl,"no-name":this.noName,"no-icon":this.noIcon}),this._saveScrollPos,this.virtualize?(0,i.AR)({items:this.entries,renderItem:function(e,n){return t._renderLogbookItem(e,n)}}):this.entries.map((function(e,n){return t._renderLogbookItem(e,n)}))):(0,r.dy)(z(),(0,d.$3)(this._rtl),this.hass.localize("ui.components.logbook.entries_not_found"))}},{kind:"method",key:"_renderLogbookItem",value:function(e,t){var n;if(void 0===t)return(0,r.dy)(_());var i=this.entries[t-1],s=e.entity_id?this.hass.states[e.entity_id]:void 0,l=e.context_user_id&&this.userIdToName[e.context_user_id];return(0,r.dy)(k(),0===t||(null==e?void 0:e.when)&&(null==i?void 0:i.when)&&new Date(e.when).toDateString()!==new Date(i.when).toDateString()?(0,r.dy)(w(),(0,a.p)(new Date(e.when),this.hass.language)):(0,r.dy)(g()),(0,o.$)({"no-entity":!e.entity_id}),this.noIcon?"":(0,r.dy)(b(),null!==(n=e.icon)&&void 0!==n?n:(0,f.K)(e.entity_id?(0,u.M)(e.entity_id):e.domain,s,e.state)),this.noName?"":(0,r.dy)(v(),this._entityClicked,e.entity_id,e.name),e.message,l?" ".concat(this.hass.localize("ui.components.logbook.by")," ").concat(l):e.context_event_type?"call_service"===e.context_event_type?" ".concat(this.hass.localize("ui.components.logbook.by_service"),"\n ").concat(e.context_domain,".").concat(e.context_service):e.context_entity_id===e.entity_id?" ".concat(this.hass.localize("ui.components.logbook.by"),"\n ").concat(e.context_name?e.context_name:e.context_event_type):(0,r.dy)(m(),this.hass.localize("ui.components.logbook.by"),this._entityClicked,e.context_entity_id,e.context_entity_id_name):"",(0,c.V)(new Date(e.when),this.hass.language),this.hass,e.when)}},{kind:"method",decorators:[(0,r.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_entityClicked",value:function(e){var t=e.currentTarget.entityId;t&&(e.preventDefault(),e.stopPropagation(),(0,l.B)(this,"hass-more-info",{entityId:t}))}},{kind:"get",static:!0,key:"styles",value:function(){return[p.Qx,(0,r.iv)(y())]}}]}}),r.oi)}}]); //# sourceMappingURL=chunk.053cba1f061a800736a6.js.map