UNPKG

iobroker.lovelace

Version:

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

2 lines 6.24 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["71588"],{62900:function(e,t,n){n.d(t,{AG:()=>x,D8:()=>b,DD:()=>i,G0:()=>N,IX:()=>j,O7:()=>w,Rx:()=>E,Ry:()=>A,Yj:()=>g,Z_:()=>S,dt:()=>D,f0:()=>v,hu:()=>y,i0:()=>$,is:()=>h,jt:()=>_,kE:()=>O,lF:()=>C});var r=n(58814);n(52247),n(19083),n(71695),n(92745),n(9359),n(70104),n(77439),n(19423),n(69235),n(12385),n(19134),n(5740),n(11740),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(61006),n(81804),n(47021);const o=["message","explanation"];class i extends TypeError{constructor(e,t){let n;const{message:i,explanation:s}=e,c=(0,r.Z)(e,o),{path:a}=e,u=0===a.length?i:`At path: ${a.join(".")} -- ${i}`;super(null!=s?s:u),null!=s&&(this.cause=u),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>null!=n?n:n=[e,...t()]}}function s(e){return"object"==typeof e&&null!=e}function c(e){return s(e)&&!Array.isArray(e)}function a(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function u(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:s}=n,{refinement:c,message:u=`Expected a value of type \`${s}\`${c?` with refinement \`${c}\``:""}, but received: \`${a(r)}\``}=e;return Object.assign(Object.assign({value:r,type:s,refinement:c,key:o[o.length-1],path:o,branch:i},e),{},{message:u})}function*f(e,t,n,r){var o;s(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const i of e){const e=u(i,t,n,r);e&&(yield e)}}function*l(e,t,n={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:c=!1}=n,a={path:r,branch:o,mask:c};i&&(e=t.coercer(e,a));let u="valid";for(const s of t.validator(e,a))s.explanation=n.message,u="not_valid",yield[s,void 0];for(let[f,d,y]of t.entries(e,a)){const t=l(d,y,{path:void 0===f?r:[...r,f],branch:void 0===f?o:[...o,d],coerce:i,mask:c,message:n.message});for(const n of t)n[0]?(u=null!=n[0].refinement?"not_refined":"not_valid",yield[n[0],void 0]):i&&(d=n[1],void 0===f?e=d:e instanceof Map?e.set(f,d):e instanceof Set?e.add(d):s(e)&&(void 0!==d||f in e)&&(e[f]=d))}if("not_valid"!==u)for(const s of t.refiner(e,a))s.explanation=n.message,u="not_refined",yield[s,void 0];"valid"===u&&(yield[void 0,e])}class d{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=e=>e,entries:s=function*(){}}=e;this.type=t,this.schema=n,this.entries=s,this.coercer=i,this.validator=r?(e,t)=>f(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>f(o(e,t),t,this,e):()=>[]}assert(e,t){return y(e,this,t)}create(e,t){return function(e,t,n){const r=p(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}is(e){return h(e,this)}mask(e,t){return function(e,t,n){const r=p(e,t,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(e,this,t)}validate(e,t={}){return p(e,this,t)}}function y(e,t,n){const r=p(e,t,{message:n});if(r[0])throw r[0]}function h(e,t){return!p(e,t)[0]}function p(e,t,n={}){const r=l(e,t,n),o=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(r);if(o[0]){return[new i(o[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function v(...e){const t="type"===e[0].type,n=e.map((e=>e.schema)),r=Object.assign({},...n);return t?D(r):A(r)}function m(e,t){return new d({type:e,schema:null,validator:t})}function b(e){return new d({type:"dynamic",schema:null,*entries(t,n){const r=e(t,n);yield*r.entries(t,n)},validator(t,n){return e(t,n).validator(t,n)},coercer(t,n){return e(t,n).coercer(t,n)},refiner(t,n){return e(t,n).refiner(t,n)}})}function g(){return m("any",(()=>!0))}function j(e){return new d({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${a(e)}`}})}function w(){return m("boolean",(e=>"boolean"==typeof e))}function O(e){const t={},n=e.map((e=>a(e))).join();for(const r of e)t[r]=r;return new d({type:"enums",schema:t,validator(t){return e.includes(t)||`Expected one of \`${n}\`, but received: ${a(t)}`}})}function $(e){const t=a(e),n=typeof e;return new d({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${a(n)}`}})}function k(){return m("never",(()=>!1))}function x(e){return new d(Object.assign(Object.assign({},e),{},{validator:(t,n)=>null===t||e.validator(t,n),refiner:(t,n)=>null===t||e.refiner(t,n)}))}function E(){return m("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${a(e)}`))}function A(e){const t=e?Object.keys(e):[],n=k();return new d({type:"object",schema:e||null,*entries(r){if(e&&s(r)){const o=new Set(Object.keys(r));for(const n of t)o.delete(n),yield[n,r[n],e[n]];for(const e of o)yield[e,r[e],n]}},validator(e){return c(e)||`Expected an object, but received: ${a(e)}`},coercer(t,n){if(!c(t))return t;const r=Object.assign({},t);if(n.mask&&e)for(const o in r)void 0===e[o]&&delete r[o];return r}})}function _(e){return new d(Object.assign(Object.assign({},e),{},{validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)}))}function S(){return m("string",(e=>"string"==typeof e||`Expected a string, but received: ${a(e)}`))}function D(e){const t=Object.keys(e);return new d({type:"type",schema:e,*entries(n){if(s(n))for(const r of t)yield[r,n[r],e[r]]},validator(e){return c(e)||`Expected an object, but received: ${a(e)}`},coercer(e){return c(e)?Object.assign({},e):e}})}function N(e){const t=e.map((e=>e.type)).join(" | ");return new d({type:"union",schema:null,coercer(t,n){for(const r of e){const[e,o]=r.validate(t,{coerce:!0,mask:n.mask});if(!e)return o}return t},validator(n,r){const o=[];for(const t of e){const[...e]=l(n,t,r),[i]=e;if(!i[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${a(n)}`,...o]}})}function C(e,t,n){return new d(Object.assign(Object.assign({},e),{},{*refiner(r,o){yield*e.refiner(r,o);const i=f(n(r,o),o,e,r);for(const e of i)yield Object.assign(Object.assign({},e),{},{refinement:t})}}))}}}]); //# sourceMappingURL=71588.22a97951c517694a.js.map