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