iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 18.8 kB
JavaScript
/*! For license information please see 72826.6e2d26da25673d82.js.LICENSE.txt */
export const __rspack_esm_id=72826;export const __rspack_esm_ids=[72826];export const __webpack_modules__={12451(e,t,o){o.d(t,{O:()=>n,i:()=>i.is});var s=o(5124),i=o(12130);class n extends s.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130(e,t,o){o.d(t,{SE:()=>c,U9:()=>l,hP:()=>s,is:()=>i});o(44114);const s=e=>e.nodeType===Node.ELEMENT_NODE;function i(e){return{addClass:t=>{e.classList.add(t)},removeClass:t=>{e.classList.remove(t)},hasClass:t=>e.classList.contains(t)}}let n=!1;const a=()=>{},r={get passive(){return n=!0,!1}};document.addEventListener("x",a,r),document.removeEventListener("x",a);const l=(e=window.document)=>{let t=e.activeElement;const o=[];if(!t)return o;for(;t&&(o.push(t),t.shadowRoot);)t=t.shadowRoot.activeElement;return o},c=e=>{const t=l();if(!t.length)return!1;const o=t[t.length-1],s=new Event("check-if-focused",{bubbles:!0,composed:!0});let i=[];const n=e=>{i=e.composedPath()};return document.body.addEventListener("check-if-focused",n),o.dispatchEvent(s),document.body.removeEventListener("check-if-focused",n),-1!==i.indexOf(e)}},35370(e,t,o){var s=o(26198);e.exports=function(e,t,o){for(var i=0,n=arguments.length>2?o:s(t),a=new e(n);n>i;)a[i]=t[i++];return a}},77957(e,t,o){var s=o(76080),i=o(79504),n=o(47055),a=o(48981),r=o(56969),l=o(26198),c=o(2360),d=o(35370),h=Array,u=i([].push);e.exports=function(e,t,o,i){for(var p,f,g,m=a(e),b=n(m),v=s(t,o),w=c(null),y=l(b),k=0;y>k;k++)g=b[k],(f=r(v(g,k,m)))in w?u(w[f],g):w[f]=[g];if(i&&(p=i(m))!==h)for(f in w)w[f]=d(p,w[f]);return w}},46058(e,t,o){var s=o(46518),i=o(77957),n=o(6469);s({target:"Array",proto:!0},{group:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n("group")},93900(e,t,o){o.a(e,async function(e,t){try{var s=o(5124),i=o(22441),n=o(6412),a=o(63672),r=o(17051),l=o(42462),c=o(28438),d=o(98779),h=o(27259),u=o(25877),p=o(31247),f=o(4444),g=o(92070),m=o(9395),b=o(717),v=o(17060),w=o(88496),y=o(91470),k=e([w,v]);[w,v]=k.then?(await k)():k;var E=Object.defineProperty,C=Object.getOwnPropertyDescriptor,x=(e,t,o,s)=>{for(var i,n=s>1?void 0:s?C(t,o):t,a=e.length-1;a>=0;a--)(i=e[a])&&(n=(s?i(t,o,n):i(n))||n);return s&&n&&E(t,o,n),n};let A=class extends b.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 o=this.originalTrigger;"function"==typeof o?.focus&&setTimeout(()=>o.focus()),this.dispatchEvent(new r.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,u.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 s.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,a.J)(this.ariaDescribedby)}" part="dialog" class="${(0,n.H)({dialog:!0,open:this.open})}" ="${this.handleDialogCancel}" ="${this.handleDialogClick}" ="${this.handleDialogPointerDown}"> ${e?s.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" ="${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?s.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new v.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,u.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};A.css=y.A,x([(0,i.P)(".dialog")],A.prototype,"dialog",2),x([(0,i.MZ)({type:Boolean,reflect:!0})],A.prototype,"open",2),x([(0,i.MZ)({reflect:!0})],A.prototype,"label",2),x([(0,i.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],A.prototype,"withoutHeader",2),x([(0,i.MZ)({attribute:"light-dismiss",type:Boolean})],A.prototype,"lightDismiss",2),x([(0,i.MZ)({attribute:"aria-labelledby"})],A.prototype,"ariaLabelledby",2),x([(0,i.MZ)({attribute:"aria-describedby"})],A.prototype,"ariaDescribedby",2),x([(0,i.MZ)({attribute:"with-footer",type:Boolean})],A.prototype,"withFooter",2),x([(0,m.w)("open",{waitUntilFirstUpdate:!0})],A.prototype,"handleOpenChange",1),A=x([(0,i.EM)("wa-dialog")],A),s.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,o]=(0,p.v)(t.getAttribute("data-dialog")||"");if("open"===e&&o?.length){const e=t.getRootNode().getElementById(o);"wa-dialog"===e?.localName?e.open=!0:console.warn(`A dialog with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},91470(e,t,o){o.d(t,{A:()=>s});var s=o(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} 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)} pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}} show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}} show-backdrop{from{opacity:0}to{opacity:1}} (forced-colors:active){.dialog{border:solid 1px #fff}}`},31247(e,t,o){o.d(t,{v:()=>s});o(18111),o(22489),o(61701);function s(e){return e.split(" ").map(e=>e.trim()).filter(e=>""!==e)}},4444(e,t,o){o.d(t,{JG:()=>i,Rt:()=>a,I7:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const s=new Set;function i(e){if(s.add(e),!document.documentElement.classList.contains("wa-scroll-lock")){const e=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+function(){const e=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(e)||!e?0:e}();let t=getComputedStyle(document.documentElement).scrollbarGutter;t&&"auto"!==t||(t="stable"),e<2&&(t=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",t),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${e}px`)}}function n(e){s.delete(e),0===s.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function a(e,t,o="vertical",s="smooth"){const i=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),n=i.top+t.scrollTop,a=i.left+t.scrollLeft,r=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==o&&"both"!==o||(a<r?t.scrollTo({left:a,behavior:s}):a+e.clientWidth>l&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:s})),"vertical"!==o&&"both"!==o||(n<c?t.scrollTo({top:n,behavior:s}):n+e.clientHeight>d&&t.scrollTo({top:n-t.offsetHeight+e.clientHeight,behavior:s}))}},88696(e,t,o){o.d(t,{P:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var s=o(37540),i=o(42017);class n{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 a(this,e)}constructor(e,{target:t,config:o,callback:s,skipInitial:i}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,null!==t&&this.t.add(t??e),this.l=o,this.o=i??this.o,this.callback=s,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 a=(0,i.u$)(class extends s.Kq{render(e,t){}update(e,[t,o]){this.controller=t,this.part=e,this.observe=o,!1===o?(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,o){o.d(t,{LV:()=>u});o(18111),o(61701),o(18237),o(45367),o(92731),o(88454),o(29452);const s=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),a=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[s],serialize(e){const{port1:t,port2:o}=new MessageChannel;return d(e,t),[o,[o]]},deserialize:e=>(e.start(),u(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,o=["*"]){t.addEventListener("message",function i(n){if(!n||!n.data)return;if(!function(e,t){for(const o of e){if(t===o||"*"===o)return!0;if(o instanceof RegExp&&o.test(t))return!0}return!1}(o,n.origin))return void console.warn(`Invalid origin '${n.origin}' for comlink proxy`);const{id:l,type:c,path:u}=Object.assign({path:[]},n.data),p=(n.data.argumentList||[]).map(k);let f;try{const t=u.slice(0,-1).reduce((e,t)=>e[t],e),o=u.reduce((e,t)=>e[t],e);switch(c){case"GET":f=o;break;case"SET":t[u.slice(-1)[0]]=k(n.data.value),f=!0;break;case"APPLY":f=o.apply(t,p);break;case"CONSTRUCT":f=function(e){return Object.assign(e,{[s]:!0})}(new o(...p));break;case"ENDPOINT":{const{port1:t,port2:o}=new MessageChannel;d(e,o),f=function(e,t){return w.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(o=>{const[s,n]=y(o);t.postMessage(Object.assign(Object.assign({},s),{id:l}),n),"RELEASE"===c&&(t.removeEventListener("message",i),h(t),a in e&&"function"==typeof e[a]&&e[a]())}).catch(e=>{const[o,s]=y({value:new TypeError("Unserializable return value"),[r]:0});t.postMessage(Object.assign(Object.assign({},o),{id:l}),s)})}),t.start&&t.start()}function h(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function u(e,t){const o=new Map;return e.addEventListener("message",function(e){const{data:t}=e;if(!t||!t.id)return;const s=o.get(t.id);if(s)try{s(t)}finally{o.delete(t.id)}}),b(e,o,[],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(()=>{h(e)})}const g=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(g.get(e)||0)-1;g.set(e,t),0===t&&f(e)});function b(e,t,o=[],s=function(){}){let a=!1;const r=new Proxy(s,{get(s,i){if(p(a),i===n)return()=>{!function(e){m&&m.unregister(e)}(r),f(e),t.clear(),a=!0};if("then"===i){if(0===o.length)return{then:()=>r};const s=E(e,t,{type:"GET",path:o.map(e=>e.toString())}).then(k);return s.then.bind(s)}return b(e,t,[...o,i])},set(s,i,n){p(a);const[r,l]=y(n);return E(e,t,{type:"SET",path:[...o,i].map(e=>e.toString()),value:r},l).then(k)},apply(s,n,r){p(a);const l=o[o.length-1];if(l===i)return E(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return b(e,t,o.slice(0,-1));const[c,d]=v(r);return E(e,t,{type:"APPLY",path:o.map(e=>e.toString()),argumentList:c},d).then(k)},construct(s,i){p(a);const[n,r]=v(i);return E(e,t,{type:"CONSTRUCT",path:o.map(e=>e.toString()),argumentList:n},r).then(k)}});return function(e,t){const o=(g.get(t)||0)+1;g.set(t,o),m&&m.register(e,t,e)}(r,e),r}function v(e){const t=e.map(y);return[t.map(e=>e[0]),(o=t.map(e=>e[1]),Array.prototype.concat.apply([],o))];var o}const w=new WeakMap;function y(e){for(const[t,o]of c)if(o.canHandle(e)){const[s,i]=o.serialize(e);return[{type:"HANDLER",name:t,value:s},i]}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,o,s){return new Promise(i=>{const n=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");t.set(n,i),e.start&&e.start(),e.postMessage(Object.assign({id:n},o),s)})}},37540(e,t,o){o.d(t,{Kq:()=>h});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var s=o(63937),i=o(42017);const n=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const e of o)e._$AO?.(t,!1),n(e,t);return!0},a=e=>{let t,o;do{if(void 0===(t=e._$AM))break;o=t._$AN,o.delete(e),e=t}while(0===o?.size)},r=e=>{for(let t;t=e._$AM;e=t){let o=t._$AN;if(void 0===o)t._$AN=o=new Set;else if(o.has(e))break;o.add(e),d(t)}};function l(e){void 0!==this._$AN?(a(this),this._$AM=e,r(this)):this._$AM=e}function c(e,t=!1,o=0){const s=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(s))for(let e=o;e<s.length;e++)n(s[e],!1),a(s[e]);else null!=s&&(n(s,!1),a(s));else n(this,e)}const d=e=>{e.type==i.OA.CHILD&&(e._$AP??=c,e._$AQ??=l)};class h extends i.WL{_$AT(e,t,o){super._$AT(e,t,o),r(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(n(this,e),a(this))}setValue(e){if((0,s.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}}},89784(e,t,o){o.d(t,{W:()=>r});o(74423),o(18111),o(18237),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var s=o(5055),i=o(42017);const n="important",a=" !"+n,r=(0,i.u$)(class extends i.WL{render(e){return Object.keys(e).reduce((t,o)=>{const s=e[o];return null==s?t:t+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[t]){const{style:o}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?o.removeProperty(e):o[e]=null);for(const e in t){const s=t[e];if(null!=s){this.ft.add(e);const t="string"==typeof s&&s.endsWith(a);e.includes("-")||t?o.setProperty(e,t?s.slice(0,-11):s,t?n:""):o[e]=s}}return s.c0}constructor(e){if(super(e),e.type!==i.OA.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}};