UNPKG

iobroker.lovelace

Version:

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

2 lines 34.1 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[8235],{95282:function(e,t,n){"use strict";n.d(t,{_:function(){return i},B:function(){return o}});var r=n(12902),i=function(e,t,n,i){if(e[t])return e[t];var o,a=0,s=(0,r.M)(),c=function(){return n(e).then((function(e){return s.setState(e,!0)}))},l=function(){return c().catch((function(t){if(e.connected)throw t}))};return e[t]={get state(){return s.state},refresh:c,subscribe:function(t){1===++a&&(i&&(o=i(e,s)),e.addEventListener("ready",l),l());var n=s.subscribe(t);return void 0!==s.state&&setTimeout((function(){return t(s.state)}),0),function(){n(),--a||(o&&o.then((function(e){e()})),e.removeEventListener("ready",c))}}},e[t]},o=function(e,t,n,r,o){return i(r,e,t,n).subscribe(o)}},12902:function(e,t,n){"use strict";n.d(t,{M:function(){return r}});var r=function(e){var t=[];function n(n,r){e=r?n:Object.assign(Object.assign({},e),n);for(var i=t,o=0;o<i.length;o++)i[o](e)}return{get state(){return e},action:function(t){function r(e){n(e,!1)}return function(){for(var n=[e],i=0;i<arguments.length;i++)n.push(arguments[i]);var o=t.apply(this,n);if(null!=o)return o instanceof Promise?o.then(r):r(o)}},setState:n,subscribe:function(e){return t.push(e),function(){!function(e){for(var n=[],r=0;r<t.length;r++)t[r]===e?e=null:n.push(t[r]);t=n}(e)}}}}},85415:function(e,t,n){"use strict";n.d(t,{q:function(){return r},w:function(){return i}});var r=function(e,t){return e<t?-1:e>t?1:0},i=function(e,t){return r(e.toLowerCase(),t.toLowerCase())}},81545:function(e,t,n){"use strict";n(6294);var r,i,o=n(50424),a=n(55358);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 c(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p(e);if(t){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(){m=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 i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,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=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!g(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},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=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.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 i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].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&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(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)?k(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=w(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 i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"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 n=_(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 y(e){var t,n=w(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 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 _(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 w(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}function k(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 i=m();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(b(o.descriptor)||b(i.descriptor)){if(g(o)||g(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(g(o)){if(g(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}v(o,i)}else t.push(o)}return t}(a.d.map(y)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,a.Mo)("ha-button-menu")],(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&&u(e,t)}(r,t);var n=f(r);function r(){var t;l(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(h(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,a.Cb)()],key:"corner",value:function(){return"TOP_START"}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"multi",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"activatable",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"fixed",value:function(){return!1}},{kind:"field",decorators:[(0,a.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"render",value:function(){return(0,o.dy)(r||(r=c(["\n <div @click=",'>\n <slot name="trigger"></slot>\n </div>\n <mwc-menu\n .corner=',"\n .fixed=","\n .multi=","\n .activatable=","\n >\n <slot></slot>\n </mwc-menu>\n "])),this._handleClick,this.corner,this.fixed,this.multi,this.activatable)}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",static:!0,key:"styles",value:function(){return(0,o.iv)(i||(i=c(["\n :host {\n display: inline-block;\n position: relative;\n }\n ::slotted([disabled]) {\n color: var(--disabled-text-color);\n }\n "])))}}]}}),o.oi)},57066:function(e,t,n){"use strict";n.d(t,{Lo:function(){return a},IO:function(){return s},qv:function(){return c},sG:function(){return f}});var r=n(95282),i=n(85415),o=n(38346),a=function(e,t){return e.callWS(Object.assign({type:"config/area_registry/create"},t))},s=function(e,t,n){return e.callWS(Object.assign({type:"config/area_registry/update",area_id:t},n))},c=function(e,t){return e.callWS({type:"config/area_registry/delete",area_id:t})},l=function(e){return e.sendMessagePromise({type:"config/area_registry/list"}).then((function(e){return e.sort((function(e,t){return(0,i.q)(e.name,t.name)}))}))},u=function(e,t){return e.subscribeEvents((0,o.D)((function(){return l(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"area_registry_updated")},f=function(e,t){return(0,r.B)("_areaRegistry",l,u,e,t)}},57292:function(e,t,n){"use strict";n.d(t,{jL:function(){return c},t1:function(){return l},q4:function(){return d}});var r=n(95282),i=n(91741),o=n(38346);function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){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,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}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}var c=function(e,t,n){return e.name_by_user||e.name||n&&function(e,t){var n,r=a(t||[]);try{for(r.s();!(n=r.n()).done;){var o=n.value,s="string"==typeof o?o:o.entity_id,c=e.states[s];if(c)return(0,i.C)(c)}}catch(l){r.e(l)}finally{r.f()}}(t,n)||t.localize("ui.panel.config.devices.unnamed_device")},l=function(e,t,n){return e.callWS(Object.assign({type:"config/device_registry/update",device_id:t},n))},u=function(e){return e.sendMessagePromise({type:"config/device_registry/list"})},f=function(e,t){return e.subscribeEvents((0,o.D)((function(){return u(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"device_registry_updated")},d=function(e,t){return(0,r.B)("_dr",u,f,e,t)}},74186:function(e,t,n){"use strict";n.d(t,{eD:function(){return a},Mw:function(){return s},vA:function(){return c},L3:function(){return l},Nv:function(){return u},z3:function(){return f},LM:function(){return p}});var r=n(95282);if(2143==n.j)var i=n(91741);var o=n(38346),a=function(e,t){return t.find((function(t){return e.states[t.entity_id]&&"battery"===e.states[t.entity_id].attributes.device_class}))},s=function(e,t){return t.find((function(t){return e.states[t.entity_id]&&"battery_charging"===e.states[t.entity_id].attributes.device_class}))},c=function(e,t){if(t.name)return t.name;var n=e.states[t.entity_id];return n?(0,i.C)(n):null},l=function(e,t){return e.callWS({type:"config/entity_registry/get",entity_id:t})},u=function(e,t,n){return e.callWS(Object.assign({type:"config/entity_registry/update",entity_id:t},n))},f=function(e,t){return e.callWS({type:"config/entity_registry/remove",entity_id:t})},d=function(e){return e.sendMessagePromise({type:"config/entity_registry/list"})},h=function(e,t){return e.subscribeEvents((0,o.D)((function(){return d(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"entity_registry_updated")},p=function(e,t){return(0,r.B)("_entityRegistry",d,h,e,t)}},41682:function(e,t,n){"use strict";function r(e){return(r="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)}n.d(t,{rY:function(){return i},js:function(){return o}});var i=function(e){return e.data},o=function(e){return"object"===r(e)?"object"===r(e.body)?e.body.message||"Unknown error, see supervisor logs":e.body||e.message||"Unknown error, see supervisor logs":e};new Set([502,503,504])},13930:function(e,t,n){"use strict";n.r(t),n.d(t,{HuiPictureEntityCardEditor:function(){return T}});n(8878),n(30879),n(53973),n(51095);var r,i,o,a=n(50424),s=n(55358),c=n(4268),l=n(47181),u=n(87744),f=(n(83927),n(43709),n(26431),n(1528),n(24673),n(85677)),d=n(45890);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 p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(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 n,r=w(e);if(t){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return b(this,n)}}function b(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?_(e):t}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(){k=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 i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,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=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!j(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},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=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.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 i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].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&&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 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)?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 n=O(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 i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:P(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=P(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 E(e){var t,n=O(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 S(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function j(e){return e.decorators&&e.decorators.length}function C(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function P(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 O(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 A(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}var z=(0,c.Ry)({type:(0,c.Z_)(),entity:(0,c.jt)((0,c.Z_)()),image:(0,c.jt)((0,c.Z_)()),name:(0,c.jt)((0,c.Z_)()),camera_image:(0,c.jt)((0,c.Z_)()),camera_view:(0,c.jt)((0,c.Z_)()),aspect_ratio:(0,c.jt)((0,c.Z_)()),tap_action:(0,c.jt)(f.C),hold_action:(0,c.jt)(f.C),show_name:(0,c.jt)((0,c.O7)()),show_state:(0,c.jt)((0,c.O7)()),theme:(0,c.jt)((0,c.Z_)())}),D=["camera"],T=function(e,t,n,r){var i=k();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(C(o.descriptor)||C(i.descriptor)){if(j(o)||j(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(j(o)){if(j(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}S(o,i)}else t.push(o)}return t}(a.d.map(E)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,s.Mo)("hui-picture-entity-card-editor")],(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&&v(e,t)}(r,t);var n=g(r);function r(){var t;y(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(_(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,c.hu)(e,z),this._config=e}},{kind:"get",key:"_entity",value:function(){return this._config.entity||""}},{kind:"get",key:"_name",value:function(){return this._config.name||""}},{kind:"get",key:"_image",value:function(){return this._config.image||""}},{kind:"get",key:"_camera_image",value:function(){return this._config.camera_image||""}},{kind:"get",key:"_camera_view",value:function(){return this._config.camera_view||"auto"}},{kind:"get",key:"_aspect_ratio",value:function(){return this._config.aspect_ratio||""}},{kind:"get",key:"_tap_action",value:function(){return this._config.tap_action||{action:"more-info"}}},{kind:"get",key:"_hold_action",value:function(){return this._config.hold_action}},{kind:"get",key:"_show_name",value:function(){var e;return null===(e=this._config.show_name)||void 0===e||e}},{kind:"get",key:"_show_state",value:function(){var e;return null===(e=this._config.show_state)||void 0===e||e}},{kind:"get",key:"_theme",value:function(){return this._config.theme||""}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return(0,a.dy)(r||(r=m([""])));var e=["more-info","toggle","navigate","call-service","none"],t=["auto","live"],n=(0,u.Zu)(this.hass);return(0,a.dy)(i||(i=m(['\n <div class="card-config">\n <ha-entity-picker\n .label="'," (",')"\n .hass=','\n .value="','"\n .configValue=','\n @value-changed="','"\n allow-custom-entity\n ></ha-entity-picker>\n <paper-input\n .label="'," (",')"\n .value="','"\n .configValue="','"\n @value-changed="','"\n ></paper-input>\n <paper-input\n .label="'," (",')"\n .value="','"\n .configValue="','"\n @value-changed="','"\n ></paper-input>\n <ha-entity-picker\n .label="'," (",')"\n .hass=','\n .value="','"\n .configValue=','\n @value-changed="','"\n .includeDomains=','\n allow-custom-entity\n ></ha-entity-picker>\n <div class="side-by-side">\n <paper-dropdown-menu\n .label="'," (",')"\n .configValue="','"\n @value-changed="','"\n >\n <paper-listbox\n slot="dropdown-content"\n .selected="','"\n >\n ','\n </paper-listbox>\n </paper-dropdown-menu>\n <paper-input\n .label="'," (",')"\n .value="','"\n .configValue="','"\n @value-changed="','"\n ></paper-input>\n </div>\n <div class="side-by-side">\n <div>\n <ha-formfield\n .label=',"\n .dir=",'\n >\n <ha-switch\n .checked="','"\n .configValue="','"\n @change="','"\n ></ha-switch\n ></ha-formfield>\n </div>\n <div>\n <ha-formfield\n .label=',"\n .dir=",'\n >\n <ha-switch\n .checked="','"\n .configValue="','"\n @change="','"\n ></ha-switch\n ></ha-formfield>\n </div>\n </div>\n <hui-theme-select-editor\n .hass=','\n .value="','"\n .configValue="','"\n @value-changed="','"\n ></hui-theme-select-editor>\n <div class="side-by-side">\n <hui-action-editor\n .label="'," (",')"\n .hass=','\n .config="','"\n .actions="','"\n .configValue="','"\n @value-changed="','"\n ></hui-action-editor>\n <hui-action-editor\n .label="'," (",')"\n .hass=','\n .config="','"\n .actions="','"\n .configValue="','"\n @value-changed="','"\n ></hui-action-editor>\n </div>\n </div>\n '])),this.hass.localize("ui.panel.lovelace.editor.card.generic.entity"),this.hass.localize("ui.panel.lovelace.editor.card.config.required"),this.hass,this._entity,"entity",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.name"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this._name,"name",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.image"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this._image,"image",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.camera_image"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this.hass,this._camera_image,"camera_image",this._valueChanged,D,this.hass.localize("ui.panel.lovelace.editor.card.generic.camera_view"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),"camera_view",this._valueChanged,t.indexOf(this._camera_view),t.map((function(e){return(0,a.dy)(o||(o=m([" <paper-item>","</paper-item> "])),e)})),this.hass.localize("ui.panel.lovelace.editor.card.generic.aspect_ratio"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this._aspect_ratio,"aspect_ratio",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.show_name"),n,!1!==this._config.show_name,"show_name",this._change,this.hass.localize("ui.panel.lovelace.editor.card.generic.show_state"),n,!1!==this._config.show_state,"show_state",this._change,this.hass,this._theme,"theme",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.tap_action"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this.hass,this._tap_action,e,"tap_action",this._valueChanged,this.hass.localize("ui.panel.lovelace.editor.card.generic.hold_action"),this.hass.localize("ui.panel.lovelace.editor.card.config.optional"),this.hass,this._hold_action,e,"hold_action",this._valueChanged)}},{kind:"method",key:"_change",value:function(e){if(this._config&&this.hass){var t=e.target,n=t.checked;this["_".concat(t.configValue)]!==n&&(this._config=Object.assign({},this._config,p({},t.configValue,n)),(0,l.B)(this,"config-changed",{config:this._config}))}}},{kind:"method",key:"_valueChanged",value:function(e){if(this._config&&this.hass){var t=e.target,n=e.detail.value;this["_".concat(t.configValue)]!==n&&(t.configValue&&(!1===n||n?this._config=Object.assign({},this._config,p({},t.configValue,n)):(this._config=Object.assign({},this._config),delete this._config[t.configValue])),(0,l.B)(this,"config-changed",{config:this._config}))}}},{kind:"get",static:!0,key:"styles",value:function(){return d.A}}]}}),a.oi)}}]); //# sourceMappingURL=chunk.114e4194f37e06d19876.js.map