UNPKG

iobroker.lovelace

Version:

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

2 lines 15.2 kB
/*! For license information please see 59250.2d349ff0b462f8a1.js.LICENSE.txt */ export const __rspack_esm_id=59250;export const __rspack_esm_ids=[59250];export const __webpack_modules__={48646(e,t,i){var o=i(69565),a=i(28551),s=i(1767),n=i(50851);e.exports=function(e,t){t&&"string"==typeof e||a(e);var i=n(e);return s(a(void 0!==i?o(i,e):e))}},30531(e,t,i){var o=i(46518),a=i(69565),s=i(79306),n=i(28551),r=i(1767),l=i(48646),c=i(19462),d=i(9539),h=i(96395),p=i(30684),u=i(84549);var f=!h&&!p("flatMap",function(){}),g=!h&&!f&&u("flatMap",TypeError),b=h||f||g||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(e){return!0}}(),v=c(function(){for(var e,t,i=this.iterator,o=this.mapper;;){if(t=this.inner)try{if(!(e=n(a(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){d(i,"throw",e)}if(e=n(a(this.next,i)),this.done=!!e.done)return;try{this.inner=l(o(e.value,this.counter++),!1)}catch(e){d(i,"throw",e)}}});o({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function(e){n(this);try{s(e)}catch(e){d(this,"throw",e)}return g?a(g,this,e):new v(r(this),{mapper:e,inner:null})}})},93900(e,t,i){i.a(e,async function(e,t){try{var o=i(5124),a=i(22441),s=i(6412),n=i(63672),r=i(17051),l=i(42462),c=i(28438),d=i(98779),h=i(27259),p=i(25877),u=i(31247),f=i(4444),g=i(92070),b=i(9395),v=i(717),w=i(17060),y=i(88496),m=i(91470),k=e([y,w]);[y,w]=k.then?(await k)():k;var x=Object.defineProperty,A=Object.getOwnPropertyDescriptor,C=(e,t,i,o)=>{for(var a,s=o>1?void 0:o?A(t,i):t,n=e.length-1;n>=0;n--)(a=e[n])&&(s=(o?a(t,i,s):a(s))||s);return o&&s&&x(t,i,s),s};let E=class extends v.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,f.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,f.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new c.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,f.I7)(this);const i=this.originalTrigger;"function"==typeof i?.focus&&setTimeout(()=>i.focus()),this.dispatchEvent(new r.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(e){const t=e.target.closest('[data-dialog="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,h.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const e=new d.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return o.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="${(0,s.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?o.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?o.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new g.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};E.css=m.A,C([(0,a.P)(".dialog")],E.prototype,"dialog",2),C([(0,a.MZ)({type:Boolean,reflect:!0})],E.prototype,"open",2),C([(0,a.MZ)({reflect:!0})],E.prototype,"label",2),C([(0,a.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],E.prototype,"withoutHeader",2),C([(0,a.MZ)({attribute:"light-dismiss",type:Boolean})],E.prototype,"lightDismiss",2),C([(0,a.MZ)({attribute:"aria-labelledby"})],E.prototype,"ariaLabelledby",2),C([(0,a.MZ)({attribute:"aria-describedby"})],E.prototype,"ariaDescribedby",2),C([(0,a.MZ)({attribute:"with-footer",type:Boolean})],E.prototype,"withFooter",2),C([(0,b.w)("open",{waitUntilFirstUpdate:!0})],E.prototype,"handleOpenChange",1),E=C([(0,a.EM)("wa-dialog")],E),o.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,i]=(0,u.v)(t.getAttribute("data-dialog")||"");if("open"===e&&i?.length){const e=t.getRootNode().getElementById(i);"wa-dialog"===e?.localName?e.open=!0:console.warn(`A dialog with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},91470(e,t,i){i.d(t,{A:()=>o});var o=i(5124).AH`:host{--width:31rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));color:inherit;background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0}@media screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`},88696(e,t,i){i.d(t,{P:()=>s});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(37540),a=i(42017);class s{handleChanges(e){this.value=this.callback?.(e,this.u)}hostConnected(){for(const e of this.t)this.observe(e)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(e){this.t.add(e),this.u.observe(e,this.l),this.i=!0,this.h.requestUpdate()}unobserve(e){this.t.delete(e),this.u.unobserve(e)}disconnect(){this.u.disconnect()}target(e){return n(this,e)}constructor(e,{target:t,config:i,callback:o,skipInitial:a}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,null!==t&&this.t.add(t??e),this.l=i,this.o=a??this.o,this.callback=o,window.ResizeObserver?(this.u=new ResizeObserver(e=>{this.handleChanges(e),this.h.requestUpdate()}),e.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const n=(0,a.u$)(class extends o.Kq{render(e,t){}update(e,[t,i]){this.controller=t,this.part=e,this.observe=i,!1===i?(t.unobserve(e.element),this.observing=!1):!1===this.observing&&(t.observe(e.element),this.observing=!0)}disconnected(){this.controller?.unobserve(this.part.element),this.observing=!1}reconnected(){!1!==this.observe&&!1===this.observing&&(this.controller?.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}})},2209(e,t,i){i.d(t,{LV:()=>p});i(18111),i(61701),i(18237),i(45367),i(92731),i(88454),i(29452);const o=Symbol("Comlink.proxy"),a=Symbol("Comlink.endpoint"),s=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.finalizer"),r=Symbol("Comlink.thrown"),l=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>l(e)&&e[o],serialize(e){const{port1:t,port2:i}=new MessageChannel;return d(e,t),[i,[i]]},deserialize:e=>(e.start(),p(e))}],["throw",{canHandle:e=>l(e)&&r 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 d(e,t=globalThis,i=["*"]){t.addEventListener("message",function a(s){if(!s||!s.data)return;if(!function(e,t){for(const i of e){if(t===i||"*"===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}return!1}(i,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:l,type:c,path:p}=Object.assign({path:[]},s.data),u=(s.data.argumentList||[]).map(k);let f;try{const t=p.slice(0,-1).reduce((e,t)=>e[t],e),i=p.reduce((e,t)=>e[t],e);switch(c){case"GET":f=i;break;case"SET":t[p.slice(-1)[0]]=k(s.data.value),f=!0;break;case"APPLY":f=i.apply(t,u);break;case"CONSTRUCT":f=function(e){return Object.assign(e,{[o]:!0})}(new i(...u));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;d(e,i),f=function(e,t){return y.set(e,t),e}(t,[t])}break;case"RELEASE":f=void 0;break;default:return}}catch(e){f={value:e,[r]:0}}Promise.resolve(f).catch(e=>({value:e,[r]:0})).then(i=>{const[o,s]=m(i);t.postMessage(Object.assign(Object.assign({},o),{id:l}),s),"RELEASE"===c&&(t.removeEventListener("message",a),h(t),n in e&&"function"==typeof e[n]&&e[n]())}).catch(e=>{const[i,o]=m({value:new TypeError("Unserializable return value"),[r]:0});t.postMessage(Object.assign(Object.assign({},i),{id:l}),o)})}),t.start&&t.start()}function h(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function p(e,t){const i=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const o=i.get(t.id);if(o)try{o(t)}finally{i.delete(t.id)}}),v(e,i,[],t)}function u(e){if(e)throw new Error("Proxy has been released and is not useable")}function f(e){return x(e,new Map,{type:"RELEASE"}).then(()=>{h(e)})}const g=new WeakMap,b="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(g.get(e)||0)-1;g.set(e,t),0===t&&f(e)});function v(e,t,i=[],o=function(){}){let n=!1;const r=new Proxy(o,{get(o,a){if(u(n),a===s)return()=>{!function(e){b&&b.unregister(e)}(r),f(e),t.clear(),n=!0};if("then"===a){if(0===i.length)return{then:()=>r};const o=x(e,t,{type:"GET",path:i.map(e=>e.toString())}).then(k);return o.then.bind(o)}return v(e,t,[...i,a])},set(o,a,s){u(n);const[r,l]=m(s);return x(e,t,{type:"SET",path:[...i,a].map(e=>e.toString()),value:r},l).then(k)},apply(o,s,r){u(n);const l=i[i.length-1];if(l===a)return x(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return v(e,t,i.slice(0,-1));const[c,d]=w(r);return x(e,t,{type:"APPLY",path:i.map(e=>e.toString()),argumentList:c},d).then(k)},construct(o,a){u(n);const[s,r]=w(a);return x(e,t,{type:"CONSTRUCT",path:i.map(e=>e.toString()),argumentList:s},r).then(k)}});return function(e,t){const i=(g.get(t)||0)+1;g.set(t,i),b&&b.register(e,t,e)}(r,e),r}function w(e){const t=e.map(m);return[t.map(e=>e[0]),(i=t.map(e=>e[1]),Array.prototype.concat.apply([],i))];var i}const y=new WeakMap;function m(e){for(const[t,i]of c)if(i.canHandle(e)){const[o,a]=i.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},y.get(e)||[]]}function k(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function x(e,t,i,o){return new Promise(a=>{const s=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(s,a),e.start&&e.start(),e.postMessage(Object.assign({id:s},i),o)})}},37540(e,t,i){i.d(t,{Kq:()=>h});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(63937),a=i(42017);const s=(e,t)=>{const i=e._$AN;if(void 0===i)return!1;for(const e of i)e._$AO?.(t,!1),s(e,t);return!0},n=e=>{let t,i;do{if(void 0===(t=e._$AM))break;i=t._$AN,i.delete(e),e=t}while(0===i?.size)},r=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),d(t)}};function l(e){void 0!==this._$AN?(n(this),this._$AM=e,r(this)):this._$AM=e}function c(e,t=!1,i=0){const o=this._$AH,a=this._$AN;if(void 0!==a&&0!==a.size)if(t)if(Array.isArray(o))for(let e=i;e<o.length;e++)s(o[e],!1),n(o[e]);else null!=o&&(s(o,!1),n(o));else s(this,e)}const d=e=>{e.type==a.OA.CHILD&&(e._$AP??=c,e._$AQ??=l)};class h extends a.WL{_$AT(e,t,i){super._$AT(e,t,i),r(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(s(this,e),n(this))}setValue(e){if((0,o.Rt)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}}};