iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 14.4 kB
JavaScript
/*! For license information please see 43935.495c03fc991ed836.js.LICENSE.txt */
export const __rspack_esm_id=43935;export const __rspack_esm_ids=[43935];export const __webpack_modules__={48646(t,e,o){var i=o(69565),s=o(28551),a=o(1767),n=o(50851);t.exports=function(t,e){e&&"string"==typeof t||s(t);var o=n(t);return a(s(void 0!==o?i(o,t):t))}},65213(t,e,o){var i=o(44576),s=o(79039),a=i.RegExp,n=!s(function(){var t=!0;try{a(".","d")}catch(e){t=!1}var e={},o="",i=t?"dgimsy":"gimsy",s=function(t,i){Object.defineProperty(e,t,{get:function(){return o+=i,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var r in t&&(n.hasIndices="d"),n)s(r,n[r]);return Object.getOwnPropertyDescriptor(a.prototype,"flags").get.call(e)!==i||o!==i});t.exports={correct:n}},67979(t,e,o){var i=o(28551);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},30531(t,e,o){var i=o(46518),s=o(69565),a=o(79306),n=o(28551),r=o(1767),l=o(48646),c=o(19462),d=o(9539),h=o(96395),p=o(30684),u=o(84549);var f=!h&&!p("flatMap",function(){}),g=!h&&!f&&u("flatMap",TypeError),b=h||f||g||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(t){return!0}}(),v=c(function(){for(var t,e,o=this.iterator,i=this.mapper;;){if(e=this.inner)try{if(!(t=n(s(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){d(o,"throw",t)}if(t=n(s(this.next,o)),this.done=!!t.done)return;try{this.inner=l(i(t.value,this.counter++),!1)}catch(t){d(o,"throw",t)}}});i({target:"Iterator",proto:!0,real:!0,forced:b},{flatMap:function(t){n(this);try{a(t)}catch(t){d(this,"throw",t)}return g?s(g,this,t):new v(r(this),{mapper:t,inner:null})}})},69479(t,e,o){var i=o(43724),s=o(62106),a=o(65213),n=o(67979);i&&!a.correct&&(s(RegExp.prototype,"flags",{configurable:!0,get:n}),a.correct=!0)},93900(t,e,o){o.a(t,async function(t,e){try{var i=o(5124),s=o(22441),a=o(6412),n=o(63672),r=o(17051),l=o(42462),c=o(28438),d=o(98779),h=o(27259),p=o(25877),u=o(31247),f=o(4444),g=o(92070),b=o(9395),v=o(717),w=o(17060),m=o(88496),y=o(91470),k=t([m,w]);[m,w]=k.then?(await k)():k;var x=Object.defineProperty,$=Object.getOwnPropertyDescriptor,C=(t,e,o,i)=>{for(var s,a=i>1?void 0:i?$(e,o):e,n=t.length-1;n>=0;n--)(s=t[n])&&(a=(i?s(e,o,a):s(a))||a);return i&&a&&x(e,o,a),a};let _=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(t){const e=new c.L({source:t});if(this.dispatchEvent(e),e.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,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(t){t.preventDefault(),!this.dialog.classList.contains("hide")&&t.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(t){const e=t.target.closest('[data-dialog="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.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 t=new d.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){const t=!this.withoutHeader,e=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return i.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,n.J)(this.ariaDescribedby)}" part="dialog" class="${(0,a.H)({dialog:!0,open:this.open})}" ="${this.handleDialogCancel}" ="${this.handleDialogClick}" ="${this.handleDialogPointerDown}"> ${t?i.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" ="${t=>this.requestClose(t.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> ${e?i.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=t=>{"Escape"===t.key&&this.open&&(0,p.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};_.css=y.A,C([(0,s.P)(".dialog")],_.prototype,"dialog",2),C([(0,s.MZ)({type:Boolean,reflect:!0})],_.prototype,"open",2),C([(0,s.MZ)({reflect:!0})],_.prototype,"label",2),C([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],_.prototype,"withoutHeader",2),C([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],_.prototype,"lightDismiss",2),C([(0,s.MZ)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledby",2),C([(0,s.MZ)({attribute:"aria-describedby"})],_.prototype,"ariaDescribedby",2),C([(0,s.MZ)({attribute:"with-footer",type:Boolean})],_.prototype,"withFooter",2),C([(0,b.w)("open",{waitUntilFirstUpdate:!0})],_.prototype,"handleOpenChange",1),_=C([(0,s.EM)("wa-dialog")],_),i.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog]");if(e instanceof Element){const[t,o]=(0,u.v)(e.getAttribute("data-dialog")||"");if("open"===t&&o?.length){const t=e.getRootNode().getElementById(o);"wa-dialog"===t?.localName?t.open=!0:console.warn(`A dialog with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(t){e(t)}})},91470(t,e,o){o.d(e,{A:()=>i});var i=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(t,e,o){o.d(e,{v:()=>i});o(18111),o(22489),o(61701);function i(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444(t,e,o){o.d(e,{JG:()=>s,Rt:()=>n,I7:()=>a});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=new Set;function s(t){if(i.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function a(t){i.delete(t),0===i.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function n(t,e,o="vertical",i="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),a=s.top+e.scrollTop,n=s.left+e.scrollLeft,r=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,d=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(n<r?e.scrollTo({left:n,behavior:i}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:i})),"vertical"!==o&&"both"!==o||(a<c?e.scrollTo({top:a,behavior:i}):a+t.clientHeight>d&&e.scrollTo({top:a-e.offsetHeight+t.clientHeight,behavior:i}))}},88696(t,e,o){o.d(e,{P:()=>a});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(37540),s=o(42017);class a{handleChanges(t){this.value=this.callback?.(t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}target(t){return n(this,t)}constructor(t,{target:e,config:o,callback:i,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=o,this.o=s??this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const n=(0,s.u$)(class extends i.Kq{render(t,e){}update(t,[e,o]){this.controller=e,this.part=t,this.observe=o,!1===o?(e.unobserve(t.element),this.observing=!1):!1===this.observing&&(e.observe(t.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}})},95192(t,e,o){o.d(e,{IU:()=>c,Jt:()=>r,Yd:()=>i,hZ:()=>l,y$:()=>s});o(44114),o(18111),o(7588),o(61701);function i(t){return new Promise((e,o)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>o(t.error)})}function s(t,e){let o;return(s,a)=>(()=>{if(o)return o;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),o=i(s),o.then(t=>{t.onclose=()=>o=void 0},()=>{}),o})().then(t=>a(t.transaction(e,s).objectStore(e)))}let a;function n(){return a||(a=s("keyval-store","keyval")),a}function r(t,e=n()){return e("readonly",e=>i(e.get(t)))}function l(t,e,o=n()){return o("readwrite",o=>(o.put(e,t),i(o.transaction)))}function c(t=n()){return t("readwrite",t=>(t.clear(),i(t.transaction)))}},37540(t,e,o){o.d(e,{Kq:()=>h});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(63937),s=o(42017);const a=(t,e)=>{const o=t._$AN;if(void 0===o)return!1;for(const t of o)t._$AO?.(e,!1),a(t,e);return!0},n=t=>{let e,o;do{if(void 0===(e=t._$AM))break;o=e._$AN,o.delete(t),t=e}while(0===o?.size)},r=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(void 0===o)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),d(e)}};function l(t){void 0!==this._$AN?(n(this),this._$AM=t,r(this)):this._$AM=t}function c(t,e=!1,o=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let t=o;t<i.length;t++)a(i[t],!1),n(i[t]);else null!=i&&(a(i,!1),n(i));else a(this,t)}const d=t=>{t.type==s.OA.CHILD&&(t._$AP??=c,t._$AQ??=l)};class h extends s.WL{_$AT(t,e,o){super._$AT(t,e,o),r(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(a(this,t),n(this))}setValue(t){if((0,i.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}}};