iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 12.1 kB
JavaScript
/*! For license information please see 29628.aee3d2033830aa73.js.LICENSE.txt */
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[29628],{35370:function(t,e,o){var r=o(26198);t.exports=function(t,e,o){for(var n=0,i=arguments.length>2?o:r(e),s=new t(i);i>n;)s[n]=e[n++];return s}},52630:function(t,e,o){o.a(t,async function(t,r){try{o.d(e,{A:function(){return L}});o(74423),o(44114),o(18111),o(22489),o(3362),o(27495),o(62953);var n=o(5124),i=o(67576),s=o(6412),a=o(17051),l=o(42462),h=o(28438),d=o(98779),p=o(27259),c=o(25877),u=o(984),f=o(95010),w=o(9395),m=o(717),v=o(40158),b=o(51920),y=t([v]);v=(y.then?(await y)():y)[0];let A,E=t=>t;var g=Object.defineProperty,k=Object.getOwnPropertyDescriptor,C=(t,e,o,r)=>{for(var n,i=r>1?void 0:r?k(e,o):e,s=t.length-1;s>=0;s--)(n=t[s])&&(i=(r?n(e,o,i):n(i))||i);return r&&i&&g(e,o,i),i};let L=class extends m.A{connectedCallback(){super.connectedCallback(),this.eventController.signal.aborted&&(this.eventController=new AbortController),this.addEventListener("mouseout",this.handleMouseOut),this.open&&(this.open=!1,this.updateComplete.then(()=>{this.open=!0})),this.id||(this.id=(0,f.N)("wa-tooltip-")),this.for&&this.anchor?(this.anchor=null,this.handleForChange()):this.for&&this.handleForChange()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),this.eventController.abort(),this.anchor&&this.removeFromAriaLabelledBy(this.anchor,this.id)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}addToAriaLabelledBy(t,e){const o=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(Boolean);o.includes(e)||(o.push(e),t.setAttribute("aria-labelledby",o.join(" ")))}removeFromAriaLabelledBy(t,e){const o=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(Boolean).filter(t=>t!==e);o.length>0?t.setAttribute("aria-labelledby",o.join(" ")):t.removeAttribute("aria-labelledby")}async handleOpenChange(){if(this.open){if(this.disabled)return;const t=new d.k;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.addEventListener("keydown",this.handleDocumentKeyDown,{signal:this.eventController.signal}),(0,c.AZ)(this),this.body.hidden=!1,this.popup.active=!0,await(0,p.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new l.q)}else{const t=new h.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),await(0,p.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.body.hidden=!0,this.dispatchEvent(new a.Z)}}handleForChange(){const t=this.getRootNode();if(!t)return;const e=this.for?t.getElementById(this.for):null,o=this.anchor;if(e===o)return;const{signal:r}=this.eventController;e&&(this.addToAriaLabelledBy(e,this.id),e.addEventListener("blur",this.handleBlur,{capture:!0,signal:r}),e.addEventListener("focus",this.handleFocus,{capture:!0,signal:r}),e.addEventListener("click",this.handleClick,{signal:r}),e.addEventListener("mouseover",this.handleMouseOver,{signal:r}),e.addEventListener("mouseout",this.handleMouseOut,{signal:r})),o&&(this.removeFromAriaLabelledBy(o,this.id),o.removeEventListener("blur",this.handleBlur,{capture:!0}),o.removeEventListener("focus",this.handleFocus,{capture:!0}),o.removeEventListener("click",this.handleClick),o.removeEventListener("mouseover",this.handleMouseOver),o.removeEventListener("mouseout",this.handleMouseOut)),this.anchor=e}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,(0,u.l)(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,(0,u.l)(this,"wa-after-hide")}render(){return(0,n.qy)(A||(A=E` <wa-popup part="base" exportparts="
popup:base__popup,
arrow:base__arrow
" class="${0}" placement="${0}" distance="${0}" skidding="${0}" flip shift ?arrow="${0}" hover-bridge .anchor="${0}"> <div part="body" class="body"> <slot></slot> </div> </wa-popup> `),(0,s.H)({tooltip:!0,"tooltip-open":this.open}),this.placement,this.distance,this.skidding,!this.withoutArrow,this.anchor)}constructor(){super(...arguments),this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.showDelay=150,this.hideDelay=0,this.trigger="hover focus",this.withoutArrow=!1,this.for=null,this.anchor=null,this.eventController=new AbortController,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,c.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{this.hasTrigger("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),this.showDelay))},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){var t;const e=Boolean(null===(t=this.anchor)||void 0===t?void 0:t.matches(":hover")),o=this.matches(":hover");if(e||o)return;clearTimeout(this.hoverTimeout),e||o||(this.hoverTimeout=window.setTimeout(()=>{this.hide()},this.hideDelay))}}}};L.css=b.A,L.dependencies={"wa-popup":v.A},C([(0,i.P)("slot:not([name])")],L.prototype,"defaultSlot",2),C([(0,i.P)(".body")],L.prototype,"body",2),C([(0,i.P)("wa-popup")],L.prototype,"popup",2),C([(0,i.MZ)()],L.prototype,"placement",2),C([(0,i.MZ)({type:Boolean,reflect:!0})],L.prototype,"disabled",2),C([(0,i.MZ)({type:Number})],L.prototype,"distance",2),C([(0,i.MZ)({type:Boolean,reflect:!0})],L.prototype,"open",2),C([(0,i.MZ)({type:Number})],L.prototype,"skidding",2),C([(0,i.MZ)({attribute:"show-delay",type:Number})],L.prototype,"showDelay",2),C([(0,i.MZ)({attribute:"hide-delay",type:Number})],L.prototype,"hideDelay",2),C([(0,i.MZ)()],L.prototype,"trigger",2),C([(0,i.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],L.prototype,"withoutArrow",2),C([(0,i.MZ)()],L.prototype,"for",2),C([(0,i.wk)()],L.prototype,"anchor",2),C([(0,w.w)("open",{waitUntilFirstUpdate:!0})],L.prototype,"handleOpenChange",1),C([(0,w.w)("for")],L.prototype,"handleForChange",1),C([(0,w.w)(["distance","placement","skidding"])],L.prototype,"handleOptionsChange",1),C([(0,w.w)("disabled")],L.prototype,"handleDisabledChange",1),L=C([(0,i.EM)("wa-tooltip")],L),r()}catch(A){r(A)}})},51920:function(t,e,o){o.d(e,{A:function(){return n}});let r;var n=(0,o(5124).AH)(r||(r=(t=>t)`:host{--max-width:30ch;display:inline-block;position:absolute;color:var(--wa-tooltip-content-color);font-size:var(--wa-tooltip-font-size);line-height:var(--wa-tooltip-line-height);text-align:start;white-space:normal}.tooltip{--arrow-size:var(--wa-tooltip-arrow-size);--arrow-color:var(--wa-tooltip-background-color)}.tooltip::part(popup){z-index:1000}.tooltip[placement^=top]::part(popup){transform-origin:bottom}.tooltip[placement^=bottom]::part(popup){transform-origin:top}.tooltip[placement^=left]::part(popup){transform-origin:right}.tooltip[placement^=right]::part(popup){transform-origin:left}.body{display:block;width:max-content;max-width:var(--max-width);border-radius:var(--wa-tooltip-border-radius);background-color:var(--wa-tooltip-background-color);border:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color);padding:.25em .5em;user-select:none;-webkit-user-select:none}.tooltip{--popup-border-width:var(--wa-tooltip-border-width)}.tooltip::part(arrow){border-bottom:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color);border-right:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color)}`))},984:function(t,e,o){o.d(e,{l:function(){return r}});o(3362);function r(t,e){return new Promise(o=>{t.addEventListener(e,function r(n){n.target===t&&(t.removeEventListener(e,r),o())})})}},95010:function(t,e,o){o.d(e,{q:function(){return n},N:function(){return i}});o(54743),o(11745),o(16573),o(78100),o(77936),o(21489),o(48140),o(75044),o(21903),o(91134),o(28845),o(373),o(37467),o(44732),o(79577),o(16632),o(34226),o(9486),o(20456);let r=(t=21)=>{let e="",o=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&o[t]];return e};function n(t,e,o){const r=t=>Object.is(t,-0)?0:t;return r(t<e?e:t>o?o:t)}function i(t=""){return`${t}${r()}`}},28225:function(t,e,o){o.d(e,{U:function(){return r}});o(74423),o(62953);function r(t,e){const o=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"!==t.key||o||setTimeout(()=>{t.defaultPrevented||t.isComposing||function(t){let e=null;"form"in t&&(e=t.form);!e&&"getForm"in t&&(e=t.getForm());if(!e)return;const o=[...e.elements];if(1===o.length)return void e.requestSubmit(null);const r=o.find(t=>"submit"===t.type&&!t.matches(":disabled"));if(!r)return;["input","button"].includes(r.localName)?e.requestSubmit(r):r.click()}(e)})}},15477:function(t,e,o){o.d(e,{A:function(){return n}});let r;var n=(0,o(5124).AH)(r||(r=(t=>t)`: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}`))},95192:function(t,e,o){o.d(e,{IU:function(){return h},Jt:function(){return a},Yd:function(){return r},hZ:function(){return l},y$:function(){return n}});o(44114),o(18111),o(7588),o(61701),o(3362),o(62953);function r(t){return new Promise((e,o)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>o(t.error)})}function n(t,e){let o;return(n,i)=>(()=>{if(o)return o;const n=indexedDB.open(t);return n.onupgradeneeded=()=>n.result.createObjectStore(e),o=r(n),o.then(t=>{t.onclose=()=>o=void 0},()=>{}),o})().then(t=>i(t.transaction(e,n).objectStore(e)))}let i;function s(){return i||(i=n("keyval-store","keyval")),i}function a(t,e=s()){return e("readonly",e=>r(e.get(t)))}function l(t,e,o=s()){return o("readwrite",o=>(o.put(e,t),r(o.transaction)))}function h(t=s()){return t("readwrite",t=>(t.clear(),r(t.transaction)))}},89784:function(t,e,o){o.d(e,{W:function(){return a}});o(16280),o(74423),o(72712),o(18111),o(18237),o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);var r=o(5055),n=o(42017);const i="important",s=" !"+i,a=(0,n.u$)(class extends n.WL{render(t){return Object.keys(t).reduce((e,o)=>{const r=t[o];return null==r?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)null==e[r]&&(this.ft.delete(r),r.includes("-")?o.removeProperty(r):o[r]=null);for(const r in e){const t=e[r];if(null!=t){this.ft.add(r);const e="string"==typeof t&&t.endsWith(s);r.includes("-")||e?o.setProperty(r,e?t.slice(0,-11):t,e?i:""):o[r]=t}}return r.c0}constructor(t){var e;if(super(t),t.type!==n.OA.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}}]);