iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 5.26 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[6354],{91107:(t,e,n)=>{"use strict";n.d(e,{Jj:()=>u});const r=Symbol("Comlink.proxy"),o=Symbol("Comlink.endpoint"),a=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.thrown"),i=t=>"object"==typeof t&&null!==t||"function"==typeof t,c=new Map([["proxy",{canHandle:t=>i(t)&&t[r],serialize(t){const{port1:e,port2:n}=new MessageChannel;return u(t,e),[n,[n]]},deserialize(t){return t.start(),f(t,[],e);var e}}],["throw",{canHandle:t=>i(t)&&s in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function u(t,e=self){e.addEventListener("message",(function n(o){if(!o||!o.data)return;const{id:a,type:i,path:c}=Object.assign({path:[]},o.data),p=(o.data.argumentList||[]).map(g);let f;try{const e=c.slice(0,-1).reduce(((t,e)=>t[e]),t),n=c.reduce(((t,e)=>t[e]),t);switch(i){case 0:f=n;break;case 1:e[c.slice(-1)[0]]=g(o.data.value),f=!0;break;case 2:f=n.apply(e,p);break;case 3:f=function(t){return Object.assign(t,{[r]:!0})}(new n(...p));break;case 4:{const{port1:e,port2:n}=new MessageChannel;u(t,n),f=function(t,e){return h.set(t,e),t}(e,[e])}break;case 5:f=void 0}}catch(y){f={value:y,[s]:0}}Promise.resolve(f).catch((t=>({value:t,[s]:0}))).then((t=>{const[r,o]=d(t);e.postMessage(Object.assign(Object.assign({},r),{id:a}),o),5===i&&(e.removeEventListener("message",n),l(e))}))})),e.start&&e.start()}function l(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function p(t){if(t)throw new Error("Proxy has been released and is not useable")}function f(t,e=[],n=function(){}){let r=!1;const s=new Proxy(n,{get(n,o){if(p(r),o===a)return()=>b(t,{type:5,path:e.map((t=>t.toString()))}).then((()=>{l(t),r=!0}));if("then"===o){if(0===e.length)return{then:()=>s};const n=b(t,{type:0,path:e.map((t=>t.toString()))}).then(g);return n.then.bind(n)}return f(t,[...e,o])},set(n,o,a){p(r);const[s,i]=d(a);return b(t,{type:1,path:[...e,o].map((t=>t.toString())),value:s},i).then(g)},apply(n,a,s){p(r);const i=e[e.length-1];if(i===o)return b(t,{type:4}).then(g);if("bind"===i)return f(t,e.slice(0,-1));const[c,u]=y(s);return b(t,{type:2,path:e.map((t=>t.toString())),argumentList:c},u).then(g)},construct(n,o){p(r);const[a,s]=y(o);return b(t,{type:3,path:e.map((t=>t.toString())),argumentList:a},s).then(g)}});return s}function y(t){const e=t.map(d);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const h=new WeakMap;function d(t){for(const[e,n]of c)if(n.canHandle(t)){const[r,o]=n.serialize(t);return[{type:3,name:e,value:r},o]}return[{type:0,value:t},h.get(t)||[]]}function g(t){switch(t.type){case 3:return c.get(t.name).deserialize(t.value);case 0:return t.value}}function b(t,e,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(n){n.data&&n.data.id&&n.data.id===o&&(t.removeEventListener("message",e),r(n.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:o},e),n)}))}},58556:(t,e,n)=>{"use strict";var r;(r="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)||"undefined"!=typeof navigator&&"ReactNative"===navigator.product?global:self).Proxy||(r.Proxy=n(87082)(),r.Proxy.revocable=r.Proxy.revocable)},87082:t=>{t.exports=function(){let t,e=null;function n(t){return!!t&&("object"==typeof t||"function"==typeof t)}return t=function(t,r){if(!n(t)||!n(r))throw new TypeError("Cannot create proxy with a non-object as target or handler");let o=function(){};e=function(){t=null,o=function(t){throw new TypeError(`Cannot perform '${t}' on a proxy that has been revoked`)}},setTimeout((function(){e=null}),0);const a=r;r={get:null,set:null,apply:null,construct:null};for(let e in a){if(!(e in r))throw new TypeError(`Proxy polyfill does not support trap '${e}'`);r[e]=a[e]}"function"==typeof a&&(r.apply=a.apply.bind(a));let s=this,i=!1,c=!1;"function"==typeof t?(s=function(){const e=this&&this.constructor===s,n=Array.prototype.slice.call(arguments);if(o(e?"construct":"apply"),e&&r.construct)return r.construct.call(this,t,n);if(!e&&r.apply)return r.apply(t,this,n);if(e){n.unshift(t);return new(t.bind.apply(t,n))}return t.apply(this,n)},i=!0):t instanceof Array&&(s=[],c=!0);const u=r.get?function(t){return o("get"),r.get(this,t,s)}:function(t){return o("get"),this[t]},l=r.set?function(t,e){o("set");r.set(this,t,e,s)}:function(t,e){o("set"),this[t]=e},p=Object.getOwnPropertyNames(t),f={};p.forEach((function(e){if((i||c)&&e in s)return;const n={enumerable:!!Object.getOwnPropertyDescriptor(t,e).enumerable,get:u.bind(t,e),set:l.bind(t,e)};Object.defineProperty(s,e,n),f[e]=!0}));let y=!0;if(Object.setPrototypeOf?Object.setPrototypeOf(s,Object.getPrototypeOf(t)):s.__proto__?s.__proto__=t.__proto__:y=!1,r.get||!y)for(let e in t)f[e]||Object.defineProperty(s,e,{get:u.bind(t,e)});return Object.seal(t),Object.seal(s),s},t.revocable=function(n,r){return{proxy:new t(n,r),revoke:e}},t}}}]);
//# sourceMappingURL=chunk.e635202febe6d244874d.js.map