iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 13.7 kB
JavaScript
/*! For license information please see 25614.228765617f498736.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[25614],{35370:function(e,t,n){var r=n(26198);e.exports=function(e,t,n){for(var a=0,i=arguments.length>2?n:r(t),o=new e(i);i>a;)o[a]=t[a++];return o}},13611:function(e,t,n){var r=n(46518),a=n(44576),i=n(62106),o=n(43724),s=TypeError,l=Object.defineProperty,c=a.self!==a;try{if(o){var h=Object.getOwnPropertyDescriptor(a,"self");!c&&h&&h.get&&h.enumerable||i(a,"self",{get:function(){return a},set:function(e){if(this!==a)throw new s("Illegal invocation");l(a,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else r({global:!0,simple:!0,forced:c},{self:a})}catch(u){}},29344:function(e,t,n){n.a(e,async function(e,r){try{n.d(t,{A:function(){return T}});n(27495),n(62953);var a=n(5124),i=n(67576),o=n(6412),s=n(63672),l=n(34514),c=n(40991),h=n(92070),u=n(41268),d=n(9395),p=n(62676),f=n(15477),b=n(31896),v=n(17060),g=n(19978),m=e([v]);v=(m.then?(await m)():m)[0];let E,C,A,O=e=>e;var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,k=(e,t,n,r)=>{for(var a,i=r>1?void 0:r?y(t,n):t,o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r?a(t,n,i):a(i))||i);return r&&i&&w(t,n,i),i};let T=class extends p.q{static get validators(){return[...super.validators,(0,u.i)()]}get value(){var e;return null!==(e=this._value)&&void 0!==e?e:"on"}set value(e){this._value=e}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){var e;return this.valueHasChanged?Boolean(this._checked):null!==(e=this._checked)&&void 0!==e?e:this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(e){const t="rtl"===this.localize.dir();"ArrowLeft"===e.key&&(e.preventDefault(),this.checked=t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===e.key&&(e.preventDefault(),this.checked=!t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}setValue(e,t){this.checked?this.internals.setFormValue(null!=e?e:"on",t):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,t=!!this.hint||!!e;return(0,a.qy)(E||(E=O` <label part="base" class="${0}"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .checked="${0}" .disabled="${0}" .required="${0}" role="switch" aria-checked="${0}" aria-describedby="hint" ="${0}" ="${0}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${0}" aria-hidden="${0}">${0}</slot> `),(0,o.H)({checked:this.checked,disabled:this.disabled}),this.title,(0,s.J)(this.name),(0,s.J)(this.value),(0,l.V)(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleKeyDown,(0,o.H)({"has-slotted":t}),t?"false":"true",this.hint)}constructor(){var e;super(...arguments),this.hasSlotController=new h.X(this,"hint"),this.localize=new v.c(this),this.title="",this.name=null,this._value=null!==(e=this.getAttribute("value"))&&void 0!==e?e:null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};T.shadowRootOptions=Object.assign(Object.assign({},p.q.shadowRootOptions),{},{delegatesFocus:!0}),T.css=[f.A,b.A,g.A],k([(0,i.P)('input[type="checkbox"]')],T.prototype,"input",2),k([(0,i.MZ)()],T.prototype,"title",2),k([(0,i.MZ)({reflect:!0})],T.prototype,"name",2),k([(0,i.MZ)({reflect:!0})],T.prototype,"value",1),k([(0,i.MZ)({reflect:!0})],T.prototype,"size",2),k([(0,d.w)("size")],T.prototype,"handleSizeChange",1),k([(0,i.MZ)({type:Boolean})],T.prototype,"disabled",2),k([(0,i.MZ)({type:Boolean,attribute:!1})],T.prototype,"checked",1),k([(0,i.MZ)({type:Boolean,attribute:"checked",reflect:!0})],T.prototype,"defaultChecked",2),k([(0,i.MZ)({type:Boolean,reflect:!0})],T.prototype,"required",2),k([(0,i.MZ)({attribute:"hint"})],T.prototype,"hint",2),k([(0,i.MZ)({attribute:"with-hint",type:Boolean})],T.prototype,"withHint",2),k([(0,d.w)(["checked","defaultChecked"])],T.prototype,"handleStateChange",1),k([(0,d.w)("disabled",{waitUntilFirstUpdate:!0})],T.prototype,"handleDisabledChange",1),T=k([(0,i.EM)("wa-switch")],T),null===(C=(A=T).disableWarning)||void 0===C||C.call(A,"change-in-update"),r()}catch(E){r(E)}})},19978:function(e,t,n){n.d(t,{A:function(){return a}});let r;var a=(0,n(5124).AH)(r||(r=(e=>e)`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)} (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`))},15477:function(e,t,n){n.d(t,{A:function(){return a}});let r;var a=(0,n(5124).AH)(r||(r=(e=>e)`:host{display:flex;flex-direction:column}[part~=form-control]{display:contents}:is([part~=form-control-label],[part~=label]).has-label,:is([part~=form-control-label],[part~=label]):has(:not(:empty)){display:inline-flex;color:var(--wa-form-control-label-color);font-weight:var(--wa-form-control-label-font-weight);line-height:var(--wa-form-control-label-line-height);margin-block-end:0.5em}:host([required]) :is([part~=form-control-label],[part~=label])::after{content:var(--wa-form-control-required-content);margin-inline-start:var(--wa-form-control-required-content-offset);color:var(--wa-form-control-required-content-color)}[part~=hint]{display:block;color:var(--wa-form-control-hint-color);font-weight:var(--wa-form-control-hint-font-weight);line-height:var(--wa-form-control-hint-line-height);margin-block-start:0.5em;font-size:var(--wa-font-size-smaller)}[part~=hint]:not(.has-slotted,.has-hint){display:none}`))},2209:function(e,t,n){n.d(t,{LV:function(){return d}});n(89463),n(16280),n(72712),n(55081),n(18111),n(61701),n(18237),n(45367),n(92731),n(3362),n(84864),n(57465),n(27495),n(88454),n(29452),n(62953);const r=Symbol("Comlink.proxy"),a=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.finalizer"),s=Symbol("Comlink.thrown"),l=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>l(e)&&e[r],serialize(e){const{port1:t,port2:n}=new MessageChannel;return h(e,t),[n,[n]]},deserialize(e){return e.start(),d(e)}}],["throw",{canHandle:e=>l(e)&&s 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 h(e,t=globalThis,n=["*"]){t.addEventListener("message",function a(i){if(!i||!i.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:l,type:c,path:d}=Object.assign({path:[]},i.data),p=(i.data.argumentList||[]).map(k);let f;try{const t=d.slice(0,-1).reduce((e,t)=>e[t],e),n=d.reduce((e,t)=>e[t],e);switch(c){case"GET":f=n;break;case"SET":t[d.slice(-1)[0]]=k(i.data.value),f=!0;break;case"APPLY":f=n.apply(t,p);break;case"CONSTRUCT":f=function(e){return Object.assign(e,{[r]:!0})}(new n(...p));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;h(e,n),f=function(e,t){return w.set(e,t),e}(t,[t])}break;case"RELEASE":f=void 0;break;default:return}}catch(b){f={value:b,[s]:0}}Promise.resolve(f).catch(e=>({value:e,[s]:0})).then(n=>{const[r,i]=y(n);t.postMessage(Object.assign(Object.assign({},r),{id:l}),i),"RELEASE"===c&&(t.removeEventListener("message",a),u(t),o in e&&"function"==typeof e[o]&&e[o]())}).catch(e=>{const[n,r]=y({value:new TypeError("Unserializable return value"),[s]:0});t.postMessage(Object.assign(Object.assign({},n),{id:l}),r)})}),t.start&&t.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function d(e,t){const n=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}}),g(e,n,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return E(e,new Map,{type:"RELEASE"}).then(()=>{u(e)})}const b=new WeakMap,v="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(b.get(e)||0)-1;b.set(e,t),0===t&&f(e)});function g(e,t,n=[],r=function(){}){let o=!1;const s=new Proxy(r,{get(r,a){if(p(o),a===i)return()=>{!function(e){v&&v.unregister(e)}(s),f(e),t.clear(),o=!0};if("then"===a){if(0===n.length)return{then:()=>s};const r=E(e,t,{type:"GET",path:n.map(e=>e.toString())}).then(k);return r.then.bind(r)}return g(e,t,[...n,a])},set(r,a,i){p(o);const[s,l]=y(i);return E(e,t,{type:"SET",path:[...n,a].map(e=>e.toString()),value:s},l).then(k)},apply(r,i,s){p(o);const l=n[n.length-1];if(l===a)return E(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return g(e,t,n.slice(0,-1));const[c,h]=m(s);return E(e,t,{type:"APPLY",path:n.map(e=>e.toString()),argumentList:c},h).then(k)},construct(r,a){p(o);const[i,s]=m(a);return E(e,t,{type:"CONSTRUCT",path:n.map(e=>e.toString()),argumentList:i},s).then(k)}});return function(e,t){const n=(b.get(t)||0)+1;b.set(t,n),v&&v.register(e,t,e)}(s,e),s}function m(e){const t=e.map(y);return[t.map(e=>e[0]),(n=t.map(e=>e[1]),Array.prototype.concat.apply([],n))];var n}const w=new WeakMap;function y(e){for(const[t,n]of c)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},w.get(e)||[]]}function k(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function E(e,t,n,r){return new Promise(a=>{const i=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(i,a),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),r)})}},34514:function(e,t,n){n.d(t,{V:function(){return o}});n(16280),n(62953);var r=n(5055),a=n(42017),i=n(63937);const o=(0,a.u$)(class extends a.WL{render(e){return e}update(e,[t]){if(t===r.c0||t===r.s6)return t;const n=e.element,o=e.name;if(e.type===a.OA.PROPERTY){if(t===n[o])return r.c0}else if(e.type===a.OA.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(o))return r.c0}else if(e.type===a.OA.ATTRIBUTE&&n.getAttribute(o)===t+"")return r.c0;return(0,i.mY)(e),t}constructor(e){if(super(e),e.type!==a.OA.PROPERTY&&e.type!==a.OA.ATTRIBUTE&&e.type!==a.OA.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(0,i.Rt)(e))throw Error("`live` bindings can only contain a single expression")}})}}]);