UNPKG

iobroker.lovelace

Version:

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

1 lines 6.94 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[25950],{63533:function(e,n,t){t.d(n,{C5:function(){return i},Ik:function(){return _},KC:function(){return P},NW:function(){return N},OR:function(){return g},P_:function(){return z},YO:function(){return O},YP:function(){return M},Yj:function(){return C},ai:function(){return E},bz:function(){return j},eu:function(){return $},kp:function(){return b},lq:function(){return S},me:function(){return A},vA:function(){return p},vP:function(){return w},zM:function(){return k}});var r=t(86518);t(16280),t(74423),t(44114),t(18111),t(61701),t(33110),t(45367),t(92731),t(84864),t(57465),t(27495),t(17642),t(58004),t(33853),t(45876),t(32475),t(15024),t(31698),t(42762),t(62953);const o=["message","explanation"];class i extends TypeError{constructor(e,n){let t;const{message:i,explanation:c}=e,s=(0,r.A)(e,o),{path:u}=e,a=0===u.length?i:`At path: ${u.join(".")} -- ${i}`;super(null!=c?c:a),null!=c&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>null!=t?t:t=[e,...n()]}}function c(e){return"object"==typeof e&&null!=e}function s(e){return c(e)&&!Array.isArray(e)}function u(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}function a(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function f(e,n,t,r){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:i}=n,{type:c}=t,{refinement:s,message:u=`Expected a value of type \`${c}\`${s?` with refinement \`${s}\``:""}, but received: \`${a(r)}\``}=e;return Object.assign(Object.assign({value:r,type:c,refinement:s,key:o[o.length-1],path:o,branch:i},e),{},{message:u})}function*l(e,n,t,r){var o;c(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const i of e){const e=f(i,n,t,r);e&&(yield e)}}function*d(e,n,t={}){const{path:r=[],branch:o=[e],coerce:i=!1,mask:s=!1}=t,u={path:r,branch:o,mask:s};i&&(e=n.coercer(e,u));let a="valid";for(const c of n.validator(e,u))c.explanation=t.message,a="not_valid",yield[c,void 0];for(let[f,l,y]of n.entries(e,u)){const n=d(l,y,{path:void 0===f?r:[...r,f],branch:void 0===f?o:[...o,l],coerce:i,mask:s,message:t.message});for(const t of n)t[0]?(a=null!=t[0].refinement?"not_refined":"not_valid",yield[t[0],void 0]):i&&(l=t[1],void 0===f?e=l:e instanceof Map?e.set(f,l):e instanceof Set?e.add(l):c(e)&&(void 0!==l||f in e)&&(e[f]=l))}if("not_valid"!==a)for(const c of n.refiner(e,u))c.explanation=t.message,a="not_refined",yield[c,void 0];"valid"===a&&(yield[void 0,e])}class y{assert(e,n){return p(e,this,n)}create(e,n){return function(e,n,t){const r=h(e,n,{coerce:!0,message:t});if(r[0])throw r[0];return r[1]}(e,this,n)}is(e){return v(e,this)}mask(e,n){return function(e,n,t){const r=h(e,n,{coerce:!0,mask:!0,message:t});if(r[0])throw r[0];return r[1]}(e,this,n)}validate(e,n={}){return h(e,this,n)}constructor(e){const{type:n,schema:t,validator:r,refiner:o,coercer:i=e=>e,entries:c=function*(){}}=e;this.type=n,this.schema=t,this.entries=c,this.coercer=i,this.validator=r?(e,n)=>l(r(e,n),n,this,e):()=>[],this.refiner=o?(e,n)=>l(o(e,n),n,this,e):()=>[]}}function p(e,n,t){const r=h(e,n,{message:t});if(r[0])throw r[0]}function v(e,n){return!h(e,n)[0]}function h(e,n,t={}){const r=d(e,n,t),o=function(e){const{done:n,value:t}=e.next();return n?void 0:t}(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 b(...e){const n="type"===e[0].type,t=e.map(e=>e.schema),r=Object.assign({},...t);return n?N(r):_(r)}function m(e,n){return new y({type:e,schema:null,validator:n})}function g(e){return new y({type:"dynamic",schema:null,*entries(n,t){const r=e(n,t);yield*r.entries(n,t)},validator(n,t){return e(n,t).validator(n,t)},coercer(n,t){return e(n,t).coercer(n,t)},refiner(n,t){return e(n,t).refiner(n,t)}})}function j(){return m("any",()=>!0)}function O(e){return new y({type:"array",schema:e,*entries(n){if(e&&Array.isArray(n))for(const[t,r]of n.entries())yield[t,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 k(){return m("boolean",e=>"boolean"==typeof e)}function w(e){const n={},t=e.map(e=>a(e)).join();for(const r of e)n[r]=r;return new y({type:"enums",schema:n,validator(n){return e.includes(n)||`Expected one of \`${t}\`, but received: ${a(n)}`}})}function $(e){const n=a(e),t=typeof e;return new y({type:"literal",schema:"string"===t||"number"===t||"boolean"===t?e:null,validator(t){return t===e||`Expected the literal \`${n}\`, but received: ${a(t)}`}})}function x(){return m("never",()=>!1)}function A(e){return new y(Object.assign(Object.assign({},e),{},{validator:(n,t)=>null===n||e.validator(n,t),refiner:(n,t)=>null===n||e.refiner(n,t)}))}function E(){return m("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${a(e)}`)}function _(e){const n=e?Object.keys(e):[],t=x();return new y({type:"object",schema:e||null,*entries(r){if(e&&c(r)){const o=new Set(Object.keys(r));for(const t of n)o.delete(t),yield[t,r[t],e[t]];for(const e of o)yield[e,r[e],t]}},validator(e){return s(e)||`Expected an object, but received: ${a(e)}`},coercer(n,t){if(!s(n))return n;const r=Object.assign({},n);if(t.mask&&e)for(const o in r)void 0===e[o]&&delete r[o];return r}})}function S(e){return new y(Object.assign(Object.assign({},e),{},{validator:(n,t)=>void 0===n||e.validator(n,t),refiner:(n,t)=>void 0===n||e.refiner(n,t)}))}function C(){return m("string",e=>"string"==typeof e||`Expected a string, but received: ${a(e)}`)}function N(e){const n=Object.keys(e);return new y({type:"type",schema:e,*entries(t){if(c(t))for(const r of n)yield[r,t[r],e[r]]},validator(e){return s(e)||`Expected an object, but received: ${a(e)}`},coercer(e){return s(e)?Object.assign({},e):e}})}function P(e){const n=e.map(e=>e.type).join(" | ");return new y({type:"union",schema:null,coercer(n,t){for(const r of e){const[e,o]=r.validate(n,{coerce:!0,mask:t.mask});if(!e)return o}return n},validator(t,r){const o=[];for(const n of e){const[...e]=d(t,n,r),[i]=e;if(!i[0])return[];for(const[n]of e)n&&o.push(n)}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${a(t)}`,...o]}})}function Y(e,n,t){return new y(Object.assign(Object.assign({},e),{},{coercer:(r,o)=>v(r,n)?e.coercer(t(r,o),o):e.coercer(r,o)}))}function z(e,n,t={}){return Y(e,m("unknown",()=>!0),e=>{const r="function"==typeof n?n():n;if(void 0===e)return r;if(!t.strict&&u(e)&&u(r)){const n=Object.assign({},e);let t=!1;for(const e in r)void 0===n[e]&&(n[e]=r[e],t=!0);if(t)return n}return e})}function M(e,n,t){return new y(Object.assign(Object.assign({},e),{},{*refiner(r,o){yield*e.refiner(r,o);const i=l(t(r,o),o,e,r);for(const e of i)yield Object.assign(Object.assign({},e),{},{refinement:n})}}))}}}]);