UNPKG

iobroker.lovelace

Version:

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

2 lines 17.4 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[3822],{53822:function(e,r,t){"use strict";var o,n=t(15652),i=t(47181);function a(e,r,t,o,n,i,a){try{var c=e[i](a),s=c.value}catch(l){return void t(l)}c.done?r(s):Promise.resolve(s).then(o,n)}var c=function(){var e,r=(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o||(o=Promise.all([t.e(8360),t.e(2528)]).then(t.bind(t,92914))),e.abrupt("return",o);case 2:case"end":return e.stop()}}),e)})),function(){var r=this,t=arguments;return new Promise((function(o,n){var i=e.apply(r,t);function c(e){a(i,o,n,c,s,"next",e)}function s(e){a(i,o,n,c,s,"throw",e)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();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 l(e,r,t,o,n,i,a){try{var c=e[i](a),s=c.value}catch(l){return void t(l)}c.done?r(s):Promise.resolve(s).then(o,n)}function u(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function d(e,r){return(d=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function f(e){var r=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 t,o=P(e);if(r){var n=P(this).constructor;t=Reflect.construct(o,arguments,n)}else t=o.apply(this,arguments);return p(this,t)}}function p(e,r){return!r||"object"!==s(r)&&"function"!=typeof r?m(e):r}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){h=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,r){["method","field"].forEach((function(t){r.forEach((function(r){r.kind===t&&"own"===r.placement&&this.defineClassElement(e,r)}),this)}),this)},initializeClassElements:function(e,r){var t=e.prototype;["method","field"].forEach((function(o){r.forEach((function(r){var n=r.placement;if(r.kind===o&&("static"===n||"prototype"===n)){var i="static"===n?e:t;this.defineClassElement(i,r)}}),this)}),this)},defineClassElement:function(e,r){var t=r.descriptor;if("field"===r.kind){var o=r.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===o?void 0:o.call(e)}}Object.defineProperty(e,r.key,t)},decorateClass:function(e,r){var t=[],o=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!b(e))return t.push(e);var r=this.decorateElement(e,n);t.push(r.element),t.push.apply(t,r.extras),o.push.apply(o,r.finishers)}),this),!r)return{elements:t,finishers:o};var i=this.decorateConstructor(t,r);return o.push.apply(o,i.finishers),i.finishers=o,i},addElementPlacement:function(e,r,t){var o=r[e.placement];if(!t&&-1!==o.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");o.push(e.key)},decorateElement:function(e,r){for(var t=[],o=[],n=e.decorators,i=n.length-1;i>=0;i--){var a=r[e.placement];a.splice(a.indexOf(e.key),1);var c=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,n[i])(c)||c);e=s.element,this.addElementPlacement(e,r),s.finisher&&o.push(s.finisher);var l=s.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],r);t.push.apply(t,l)}}return{element:e,finishers:o,extras:t}},decorateConstructor:function(e,r){for(var t=[],o=r.length-1;o>=0;o--){var n=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,r[o])(n)||n);if(void 0!==i.finisher&&t.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:t}},fromElementDescriptor:function(e){var r={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(r.initializer=e.initializer),r},toElementDescriptors:function(e){var r;if(void 0!==e)return(r=e,function(e){if(Array.isArray(e))return e}(r)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(r)||function(e,r){if(e){if("string"==typeof e)return E(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?E(e,r):void 0}}(r)||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 r=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),r}),this)},toElementDescriptor:function(e){var r=String(e.kind);if("method"!==r&&"field"!==r)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+r+'"');var t=w(e.key),o=String(e.placement);if("static"!==o&&"prototype"!==o&&"own"!==o)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 "'+o+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:r,key:t,placement:o,descriptor:Object.assign({},n)};return"field"!==r?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"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:k(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var r={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(r,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),r},toClassDescriptor:function(e){var r=String(e.kind);if("class"!==r)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+r+'"');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 t=k(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,r){for(var t=0;t<r.length;t++){var o=(0,r[t])(e);if(void 0!==o){if("function"!=typeof o)throw new TypeError("Finishers must return a constructor.");e=o}}return e},disallowProperty:function(e,r,t){if(void 0!==e[r])throw new TypeError(t+" can't have a ."+r+" property.")}};return e}function v(e){var r,t=w(e.key);"method"===e.kind?r={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?r={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?r={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(r={configurable:!0,writable:!0,enumerable:!0});var o={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:r};return e.decorators&&(o.decorators=e.decorators),"field"===e.kind&&(o.initializer=e.value),o}function y(e,r){void 0!==e.descriptor.get?r.descriptor.get=e.descriptor.get:r.descriptor.set=e.descriptor.set}function b(e){return e.decorators&&e.decorators.length}function g(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function k(e,r){var t=e[r];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+r+"' to be a function");return t}function w(e){var r=function(e,r){if("object"!==s(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,r||"default");if("object"!==s(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===s(r)?r:String(r)}function E(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function C(e,r,t){return(C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,r,t){var o=function(e,r){for(;!Object.prototype.hasOwnProperty.call(e,r)&&null!==(e=P(e)););return e}(e,r);if(o){var n=Object.getOwnPropertyDescriptor(o,r);return n.get?n.get.call(t):n.value}})(e,r,t||e)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,r,t,o){var n=h();if(o)for(var i=0;i<o.length;i++)n=o[i](n);var a=r((function(e){n.initializeInstanceElements(e,c.elements)}),t),c=n.decorateClass(function(e){for(var r=[],t=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},o=0;o<e.length;o++){var n,i=e[o];if("method"===i.kind&&(n=r.find(t)))if(g(i.descriptor)||g(n.descriptor)){if(b(i)||b(n))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");n.descriptor=i.descriptor}else{if(b(i)){if(b(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");n.decorators=i.decorators}y(i,n)}else r.push(i)}return r}(a.d.map(v)),e);n.initializeClassElements(a.F,c.elements),n.runClassFinishers(a.F,c.finishers)}([(0,n.Mo)("ha-code-editor")],(function(e,r){var t,o,a=function(r){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&d(e,r)}(o,r);var t=f(o);function o(){var r;u(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),e(m(r)),r}return o}(r);return{F:a,d:[{kind:"field",key:"codemirror",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"mode",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autofocus",value:function(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"readOnly",value:function(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"rtl",value:function(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"error",value:function(){return!1}},{kind:"field",decorators:[(0,n.sz)()],key:"_value",value:function(){return""}},{kind:"set",key:"value",value:function(e){this._value=e}},{kind:"get",key:"value",value:function(){return this.codemirror?this.codemirror.getValue():this._value}},{kind:"get",key:"hasComments",value:function(){return!!this.shadowRoot.querySelector("span.cm-comment")}},{kind:"method",key:"connectedCallback",value:function(){C(P(a.prototype),"connectedCallback",this).call(this),this.codemirror&&(this.codemirror.refresh(),!1!==this.autofocus&&this.codemirror.focus())}},{kind:"method",key:"update",value:function(e){C(P(a.prototype),"update",this).call(this,e),this.codemirror&&(e.has("mode")&&this.codemirror.setOption("mode",this.mode),e.has("autofocus")&&this.codemirror.setOption("autofocus",!1!==this.autofocus),e.has("_value")&&this._value!==this.value&&this.codemirror.setValue(this._value),e.has("rtl")&&(this.codemirror.setOption("gutters",this._calcGutters()),this._setScrollBarDirection()),e.has("error")&&this.classList.toggle("error-state",this.error))}},{kind:"method",key:"firstUpdated",value:function(e){C(P(a.prototype),"firstUpdated",this).call(this,e),this._blockKeyboardShortcuts(),this._load()}},{kind:"method",key:"_load",value:(t=regeneratorRuntime.mark((function e(){var r,t,o,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c();case 2:r=e.sent,t=r.codeMirror,(o=this.attachShadow({mode:"open"})).innerHTML="\n <style>\n ".concat(r.codeMirrorCss,"\n .CodeMirror {\n height: var(--code-mirror-height, auto);\n direction: var(--code-mirror-direction, ltr);\n font-family: var(--code-font-family, monospace);\n }\n .CodeMirror-scroll {\n max-height: var(--code-mirror-max-height, --code-mirror-height);\n }\n :host(.error-state) .CodeMirror-gutters {\n border-color: var(--error-state-color, red);\n }\n .CodeMirror-focused .CodeMirror-gutters {\n border-right: 2px solid var(--paper-input-container-focus-color, var(--primary-color));\n }\n .CodeMirror-linenumber {\n color: var(--paper-dialog-color, var(--secondary-text-color));\n }\n .rtl .CodeMirror-vscrollbar {\n right: auto;\n left: 0px;\n }\n .rtl-gutter {\n width: 20px;\n }\n .CodeMirror-gutters {\n border-right: 1px solid var(--paper-input-container-color, var(--secondary-text-color));\n background-color: var(--paper-dialog-background-color, var(--primary-background-color));\n transition: 0.2s ease border-right;\n }\n .cm-s-default.CodeMirror {\n background-color: var(--code-editor-background-color, var(--card-background-color));\n color: var(--primary-text-color);\n }\n .cm-s-default .CodeMirror-cursor {\n border-left: 1px solid var(--secondary-text-color);\n }\n \n .cm-s-default div.CodeMirror-selected, .cm-s-default.CodeMirror-focused div.CodeMirror-selected {\n background: rgba(var(--rgb-primary-color), 0.2);\n }\n \n .cm-s-default .CodeMirror-line::selection,\n .cm-s-default .CodeMirror-line>span::selection,\n .cm-s-default .CodeMirror-line>span>span::selection {\n background: rgba(var(--rgb-primary-color), 0.2);\n }\n \n .cm-s-default .cm-keyword {\n color: var(--codemirror-keyword, #6262FF);\n }\n \n .cm-s-default .cm-operator {\n color: var(--codemirror-operator, #cda869);\n }\n \n .cm-s-default .cm-variable-2 {\n color: var(--codemirror-variable-2, #690);\n }\n \n .cm-s-default .cm-builtin {\n color: var(--codemirror-builtin, #9B7536);\n }\n \n .cm-s-default .cm-atom {\n color: var(--codemirror-atom, #F90);\n }\n \n .cm-s-default .cm-number {\n color: var(--codemirror-number, #ca7841);\n }\n \n .cm-s-default .cm-def {\n color: var(--codemirror-def, #8DA6CE);\n }\n \n .cm-s-default .cm-string {\n color: var(--codemirror-string, #07a);\n }\n \n .cm-s-default .cm-string-2 {\n color: var(--codemirror-string-2, #bd6b18);\n }\n \n .cm-s-default .cm-comment {\n color: var(--codemirror-comment, #777);\n }\n \n .cm-s-default .cm-variable {\n color: var(--codemirror-variable, #07a);\n }\n \n .cm-s-default .cm-tag {\n color: var(--codemirror-tag, #997643);\n }\n \n .cm-s-default .cm-meta {\n color: var(--codemirror-meta, var(--primary-text-color));\n }\n \n .cm-s-default .cm-attribute {\n color: var(--codemirror-attribute, #d6bb6d);\n }\n \n .cm-s-default .cm-property {\n color: var(--codemirror-property, #905);\n }\n \n .cm-s-default .cm-qualifier {\n color: var(--codemirror-qualifier, #690);\n }\n \n .cm-s-default .cm-variable-3 {\n color: var(--codemirror-variable-3, #07a);\n }\n\n .cm-s-default .cm-type {\n color: var(--codemirror-type, #07a);\n }\n </style>"),this.codemirror=t(o,{value:this._value,lineNumbers:!0,tabSize:2,mode:this.mode,autofocus:!1!==this.autofocus,viewportMargin:1/0,readOnly:this.readOnly,extraKeys:{Tab:"indentMore","Shift-Tab":"indentLess"},gutters:this._calcGutters()}),this._setScrollBarDirection(),this.codemirror.on("changes",(function(){return n._onChange()}));case 9:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,r=arguments;return new Promise((function(o,n){var i=t.apply(e,r);function a(e){l(i,o,n,a,c,"next",e)}function c(e){l(i,o,n,a,c,"throw",e)}a(void 0)}))},function(){return o.apply(this,arguments)})},{kind:"method",key:"_blockKeyboardShortcuts",value:function(){this.addEventListener("keydown",(function(e){return e.stopPropagation()}))}},{kind:"method",key:"_onChange",value:function(){var e=this.value;e!==this._value&&(this._value=e,(0,i.B)(this,"value-changed",{value:this._value}))}},{kind:"method",key:"_calcGutters",value:function(){return this.rtl?["rtl-gutter","CodeMirror-linenumbers"]:[]}},{kind:"method",key:"_setScrollBarDirection",value:function(){this.codemirror&&this.codemirror.getWrapperElement().classList.toggle("rtl",this.rtl)}}]}}),n.f4)}}]); //# sourceMappingURL=chunk.0b44691686f00224fd61.js.map