UNPKG

iobroker.lovelace

Version:

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

2 lines 4.88 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[4268],{4268:(e,t,n)=>{"use strict";n.d(t,{DD:()=>r,Yj:()=>h,IX:()=>p,hu:()=>f,O7:()=>v,kE:()=>m,i0:()=>b,Rx:()=>g,Ry:()=>k,jt:()=>j,lF:()=>_,Z_:()=>x,dt:()=>E,G0:()=>A});class r extends TypeError{constructor(e,t){let n;const{message:r,...o}=e,{path:i}=e;super(0===i.length?r:"At path: "+i.join(".")+" -- "+r),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var r;return null!=(r=n)?r:n=[e,...t()]}}}function o(e){return"object"==typeof e&&null!=e}function i(e){return"string"==typeof e?JSON.stringify(e):""+e}function c(e,t,n,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:c}=t,{type:s}=n,{refinement:a,message:u="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+i(r)+"`"}=e;return{value:r,type:s,refinement:a,key:o[o.length-1],path:o,branch:c,...e,message:u}}function*s(e,t,n,r){var i;o(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]);for(const o of e){const e=c(o,t,n,r);e&&(yield e)}}function*a(e,t,n={}){const{path:r=[],branch:i=[e],coerce:c=!1,mask:s=!1}=n,u={path:r,branch:i};if(c&&(e=t.coercer(e,u),s&&"type"!==t.type&&o(t.schema)&&o(e)&&!Array.isArray(e)))for(const n in e)void 0===t.schema[n]&&delete e[n];let f=!0;for(const n of t.validator(e,u))f=!1,yield[n,void 0];for(let[n,d,l]of t.entries(e,u)){const t=a(d,l,{path:void 0===n?r:[...r,n],branch:void 0===n?i:[...i,d],coerce:c,mask:s});for(const r of t)r[0]?(f=!1,yield[r[0],void 0]):c&&(d=r[1],void 0===n?e=d:e instanceof Map?e.set(n,d):e instanceof Set?e.add(d):o(e)&&(e[n]=d))}if(f)for(const n of t.refiner(e,u))f=!1,yield[n,void 0];f&&(yield[void 0,e])}class u{constructor(e){const{type:t,schema:n,validator:r,refiner:o,coercer:i=(e=>e),entries:c=function*(){}}=e;this.type=t,this.schema=n,this.entries=c,this.coercer=i,this.validator=r?(e,t)=>s(r(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>s(o(e,t),t,this,e):()=>[]}assert(e){return f(e,this)}create(e){return function(e,t){const n=l(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}(e,this)}is(e){return d(e,this)}mask(e){return function(e,t){const n=l(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(e,this)}validate(e,t={}){return l(e,this,t)}}function f(e,t){const n=l(e,t);if(n[0])throw n[0]}function d(e,t){return!l(e,t)[0]}function l(e,t,n={}){const o=a(e,t,n),i=function(e){const{done:t,value:n}=e.next();return t?void 0:n}(o);if(i[0]){return[new r(i[0],(function*(){for(const e of o)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}function y(e,t){return new u({type:e,schema:null,validator:t})}function h(){return y("any",(()=>!0))}function p(e){return new u({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+i(e)})}function v(){return y("boolean",(e=>"boolean"==typeof e))}function m(e){const t={},n=e.map((e=>i(e))).join();for(const n of e)t[n]=n;return new u({type:"enums",schema:t,validator:t=>e.includes(t)||"Expected one of `"+n+"`, but received: "+i(t)})}function b(e){const t=i(e),n=typeof e;return new u({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?e:null,validator:n=>n===e||"Expected the literal `"+t+"`, but received: "+i(n)})}function w(){return y("never",(()=>!1))}function g(){return y("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+i(e)))}function k(e){const t=e?Object.keys(e):[],n=w();return new u({type:"object",schema:e||null,*entries(r){if(e&&o(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=>o(e)||"Expected an object, but received: "+i(e),coercer:e=>o(e)?{...e}:e})}function j(e){return new u({...e,validator:(t,n)=>void 0===t||e.validator(t,n),refiner:(t,n)=>void 0===t||e.refiner(t,n)})}function x(){return y("string",(e=>"string"==typeof e||"Expected a string, but received: "+i(e)))}function E(e){const t=Object.keys(e);return new u({type:"type",schema:e,*entries(n){if(o(n))for(const r of t)yield[r,n[r],e[r]]},validator:e=>o(e)||"Expected an object, but received: "+i(e)})}function A(e){const t=e.map((e=>e.type)).join(" | ");return new u({type:"union",schema:null,coercer:(t,n)=>(e.find((e=>{const[n]=e.validate(t,{coerce:!0});return!n}))||O()).coercer(t,n),validator(n,r){const o=[];for(const t of e){const[...e]=a(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: "+i(n),...o]}})}function O(){return y("unknown",(()=>!0))}function _(e,t,n){return new u({...e,*refiner(r,o){yield*e.refiner(r,o);const i=s(n(r,o),o,e,r);for(const e of i)yield{...e,refinement:t}}})}}}]); //# sourceMappingURL=chunk.d7afe247c54df217243c.js.map