UNPKG

iobroker.lovelace

Version:

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

5 lines 25 kB
/*! For license information please see 16787.f84eb3128166d48e.js.LICENSE.txt */ export const __rspack_esm_id=16787;export const __rspack_esm_ids=[16787];export const __webpack_modules__={35370(e,t,o){var r=o(26198);e.exports=function(e,t,o){for(var n=0,i=arguments.length>2?o:r(t),a=new e(i);i>n;)a[n]=t[n++];return a}},1126(e,t,o){o.a(e,async function(e,t){try{var r=o(5124),n=o(22441),i=o(6412),a=o(63672),s=o(17051),d=o(42462),l=o(28438),c=o(98779),h=o(27259),p=o(25877),u=o(31247),w=o(4444),f=o(92070),m=o(9395),b=o(717),v=o(17060),g=o(88496),y=o(57024),k=e([g,v]);[g,v]=k.then?(await k)():k;var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=(e,t,o,r)=>{for(var n,i=r>1?void 0:r?x(t,o):t,a=e.length-1;a>=0;a--)(n=e[a])&&(i=(r?n(t,o,i):n(i))||i);return r&&i&&C(t,o,i),i};let A=class extends b.A{firstUpdated(){r.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,w.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,w.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new l.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,w.I7)(this);const o=this.originalTrigger;"function"==typeof o?.focus&&setTimeout(()=>o.focus()),this.dispatchEvent(new s.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.drawer.classList.contains("hide")&&e.target===this.drawer&&(0,p.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(e){const t=e.target.closest('[data-drawer="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,h.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}async show(){const e=new c.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.drawer.showModal(),(0,w.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.drawer.focus()}),await(0,h.Ud)(this.drawer,"show"),this.dispatchEvent(new d.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return r.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,a.J)(this.ariaDescribedby)}" part="dialog" class="${(0,i.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?r.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?r.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new v.c(this),this.hasSlotController=new f.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.drawer))}}};A.css=y.A,$([(0,n.P)(".drawer")],A.prototype,"drawer",2),$([(0,n.MZ)({type:Boolean,reflect:!0})],A.prototype,"open",2),$([(0,n.MZ)({reflect:!0})],A.prototype,"label",2),$([(0,n.MZ)({reflect:!0})],A.prototype,"placement",2),$([(0,n.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],A.prototype,"withoutHeader",2),$([(0,n.MZ)({attribute:"light-dismiss",type:Boolean})],A.prototype,"lightDismiss",2),$([(0,n.MZ)({attribute:"aria-labelledby"})],A.prototype,"ariaLabelledby",2),$([(0,n.MZ)({attribute:"aria-describedby"})],A.prototype,"ariaDescribedby",2),$([(0,n.MZ)({attribute:"with-footer",type:Boolean})],A.prototype,"withFooter",2),$([(0,m.w)("open",{waitUntilFirstUpdate:!0})],A.prototype,"handleOpenChange",1),A=$([(0,n.EM)("wa-drawer")],A),r.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-drawer]");if(t instanceof Element){const[e,o]=(0,u.v)(t.getAttribute("data-drawer")||"");if("open"===e&&o?.length){const e=t.getRootNode().getElementById(o);"wa-drawer"===e?.localName?e.open=!0:console.warn(`A drawer with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},57024(e,t,o){o.d(t,{A:()=>r});var r=o(5124).AH`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{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: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{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(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::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.01}100%{scale:1}}@keyframes show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.drawer{border:solid 1px #fff}}`},61366(e,t,o){o.a(e,async function(e,t){try{o(74423),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var r=o(5124),n=o(22441),i=o(6412),a=o(63672),s=o(17051),d=o(42462),l=o(28438),c=o(98779),h=o(27259),p=o(25877),u=o(984),w=o(95010),f=o(9395),m=o(717),b=o(40158),v=o(10416),g=e([b]);b=(g.then?(await g)():g)[0];var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,C=(e,t,o,r)=>{for(var n,i=r>1?void 0:r?k(t,o):t,a=e.length-1;a>=0;a--)(n=e[a])&&(i=(r?n(t,o,i):n(i))||i);return r&&i&&y(t,o,i),i};const x=new Set;let $=class extends m.A{connectedCallback(){super.connectedCallback(),this.id||(this.id=(0,w.N)("wa-popover-")),this.eventController.signal.aborted&&(this.eventController=new AbortController),this.for&&this.anchor&&(this.anchor=null,this.handleForChange())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this),this.eventController.abort()}firstUpdated(){this.open&&this.handleOpenChange()}updated(e){e.has("open")&&this.customStates.set("open",this.open)}async handleOpenChange(){if(this.open){const e=new c.k;if(this.dispatchEvent(e),e.defaultPrevented)return void(this.open=!1);x.forEach(e=>e.open=!1),document.addEventListener("keydown",this.handleDocumentKeyDown,{signal:this.eventController.signal}),document.addEventListener("click",this.handleDocumentClick,{signal:this.eventController.signal}),this.trapFocus?this.dialog.showModal():this.dialog.show(),this.popup.active=!0,x.add(this),(0,p.AZ)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),this.popup.popup||await this.popup.updateComplete,await(0,h.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new d.q)}else{const e=new l.L;if(this.dispatchEvent(e),e.defaultPrevented)return void(this.open=!0);document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("click",this.handleDocumentClick),x.delete(this),(0,p.Fw)(this),await(0,h.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.dialog.close(),this.dispatchEvent(new s.Z)}}handleForChange(){const e=this.getRootNode();if(!e)return;const t=this.for?e.getElementById(this.for):null,o=this.anchor;if(t===o)return;const{signal:r}=this.eventController;t&&t.addEventListener("click",this.handleAnchorClick,{signal:r}),o&&o.removeEventListener("click",this.handleAnchorClick),this.anchor=t,this.for&&!t&&console.warn(`A popover was assigned to an element with an ID of "${this.for}" but the element could not be found.`,this)}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}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")}handleDialogCancel(e){e.preventDefault(),this.dialog.classList.contains("hide")||(this.open=!1)}render(){return r.qy` <dialog aria-labelledby="${(0,a.J)(this.ariaLabelledby)}" aria-describedby="${(0,a.J)(this.ariaDescribedby)}" part="dialog" class="dialog" @cancel="${this.handleDialogCancel}"> <wa-popup part="popup" exportparts=" popup:popup__popup, arrow:popup__arrow " class="${(0,i.H)({popover:!0,"popover-open":this.open})}" placement="${this.placement}" distance="${this.distance}" skidding="${this.skidding}" flip shift ?arrow="${!this.withoutArrow}" .anchor="${this.anchor}" .autoSize="${this.autoSize}" .autoSizePadding="${this.autoSizePadding}"> <div part="body" class="body" @click="${this.handleBodyClick}"> <slot></slot> </div> </wa-popup> </dialog> `}constructor(){super(...arguments),this.anchor=null,this.placement="top",this.open=!1,this.distance=8,this.skidding=0,this.for=null,this.withoutArrow=!1,this.autoSizePadding=0,this.trapFocus=!1,this.eventController=new AbortController,this.handleAnchorClick=()=>{this.open=!this.open},this.handleBodyClick=e=>{e.stopPropagation();e.target.closest('[data-popover="close"]')&&(this.open=!1)},this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.open=!1,this.anchor&&"function"==typeof this.anchor.focus&&this.anchor.focus())},this.handleDocumentClick=e=>{this.anchor&&e.composedPath().includes(this.anchor)||e.composedPath().includes(this)||(this.open=!1)}}};$.css=v.A,$.dependencies={"wa-popup":b.A},C([(0,n.P)("dialog")],$.prototype,"dialog",2),C([(0,n.P)(".body")],$.prototype,"body",2),C([(0,n.P)("wa-popup")],$.prototype,"popup",2),C([(0,n.wk)()],$.prototype,"anchor",2),C([(0,n.MZ)()],$.prototype,"placement",2),C([(0,n.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",2),C([(0,n.MZ)({type:Number})],$.prototype,"distance",2),C([(0,n.MZ)({type:Number})],$.prototype,"skidding",2),C([(0,n.MZ)()],$.prototype,"for",2),C([(0,n.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],$.prototype,"withoutArrow",2),C([(0,n.MZ)({attribute:"auto-size"})],$.prototype,"autoSize",2),C([(0,n.MZ)({attribute:"auto-size-padding",type:Number})],$.prototype,"autoSizePadding",2),C([(0,n.MZ)({attribute:"trap-focus",type:Boolean})],$.prototype,"trapFocus",2),C([(0,n.MZ)({attribute:"aria-labelledby"})],$.prototype,"ariaLabelledby",2),C([(0,n.MZ)({attribute:"aria-describedby"})],$.prototype,"ariaDescribedby",2),C([(0,f.w)("open",{waitUntilFirstUpdate:!0})],$.prototype,"handleOpenChange",1),C([(0,f.w)("for")],$.prototype,"handleForChange",1),C([(0,f.w)(["distance","placement","skidding"])],$.prototype,"handleOptionsChange",1),$=C([(0,n.EM)("wa-popover")],$),t()}catch(e){t(e)}})},10416(e,t,o){o.d(t,{A:()=>r});var r=o(5124).AH`:host{--arrow-size:0.375rem;--max-width:25rem;--show-duration:100ms;--hide-duration:100ms;display:contents;font-size:var(--wa-font-size-m);line-height:var(--wa-line-height-normal);text-align:start;white-space:normal}.dialog{display:none;position:fixed;inset:0;width:100%;height:100%;margin:0;padding:0;border:none;background:0 0;overflow:visible;pointer-events:none}.dialog:focus{outline:0}.dialog[open]{display:block}.popover{--arrow-size:inherit;--popup-border-width:var(--wa-panel-border-width);--show-duration:inherit;--hide-duration:inherit;pointer-events:auto}.popover::part(arrow){background-color:var(--wa-color-surface-default);border-top:none;border-left:none;border-bottom:solid var(--wa-panel-border-width) var(--wa-color-surface-border);border-right:solid var(--wa-panel-border-width) var(--wa-color-surface-border);box-shadow:none}.popover[placement^=top]::part(popup){transform-origin:bottom}.popover[placement^=bottom]::part(popup){transform-origin:top}.popover[placement^=left]::part(popup){transform-origin:right}.popover[placement^=right]::part(popup){transform-origin:left}.body{display:flex;flex-direction:column;width:auto;max-width:min(var(--max-width),100vw);padding:var(--wa-space-l);background-color:var(--wa-color-surface-default);border:var(--wa-panel-border-width) solid var(--wa-color-surface-border);border-radius:var(--wa-panel-border-radius);border-style:var(--wa-panel-border-style);box-shadow:var(--wa-shadow-l);color:var(--wa-color-text-normal);user-select:none;-webkit-user-select:none}.popover[data-current-placement^=bottom] .body,.popover[data-current-placement^=top] .body{max-width:min(var(--max-width),100vw - (var(--wa-space-m) * 2));margin-inline:var(--wa-space-m)}.popover[data-current-placement^=left] .body,.popover[data-current-placement^=right] .body{max-height:calc(100vh - (var(--wa-space-m) * 2));margin-block:var(--wa-space-m)}`},95010(e,t,o){o.d(t,{q:()=>r,N:()=>n});o(16573),o(78100),o(77936),o(37467),o(44732),o(79577),o(16632),o(34226),o(9486),o(20456);function r(e,t,o){const r=e=>Object.is(e,-0)?0:e;return r(e<t?t:e>o?o:e)}function n(e=""){return`${e}${((e=21)=>{let t="",o=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&o[e]];return t})()}`}},4444(e,t,o){o.d(t,{JG:()=>n,Rt:()=>a,I7:()=>i});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const r=new Set;function n(e){if(r.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 i(e){r.delete(e),0===r.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function a(e,t,o="vertical",r="smooth"){const n=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),i=n.top+t.scrollTop,a=n.left+t.scrollLeft,s=t.scrollLeft,d=t.scrollLeft+t.offsetWidth,l=t.scrollTop,c=t.scrollTop+t.offsetHeight;"horizontal"!==o&&"both"!==o||(a<s?t.scrollTo({left:a,behavior:r}):a+e.clientWidth>d&&t.scrollTo({left:a-t.offsetWidth+e.clientWidth,behavior:r})),"vertical"!==o&&"both"!==o||(i<l?t.scrollTo({top:i,behavior:r}):i+e.clientHeight>c&&t.scrollTo({top:i-t.offsetHeight+e.clientHeight,behavior:r}))}},88696(e,t,o){o.d(t,{P:()=>i});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var r=o(37540),n=o(42017);class i{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:r,skipInitial:n}){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=n??this.o,this.callback=r,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,n.u$)(class extends r.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}})},99731(e,t,o){o.d(t,{Y:()=>l});var r=o(62826),n=o(22441),i=(o(18111),o(22489),o(20116),o(5124)),a=o(99591);class s extends i.WF{get chips(){return this.childElements.filter(e=>e instanceof a.v)}render(){return i.qy`<slot @slotchange="${this.updateTabIndices}"></slot>`}handleKeyDown(e){const t="ArrowLeft"===e.key,o="ArrowRight"===e.key,r="Home"===e.key,n="End"===e.key;if(!(t||o||r||n))return;const{chips:i}=this;if(i.length<2)return;if(e.preventDefault(),r||n){return i[r?0:i.length-1].focus({trailing:n}),void this.updateTabIndices()}const a="rtl"===getComputedStyle(this).direction?t:o,s=i.find(e=>e.matches(":focus-within"));if(!s){return(a?i[0]:i[i.length-1]).focus({trailing:!a}),void this.updateTabIndices()}const d=i.indexOf(s);let l=a?d+1:d-1;for(;l!==d;){l>=i.length?l=0:l<0&&(l=i.length-1);const e=i[l];if(!e.disabled||e.alwaysFocusable){e.focus({trailing:!a}),this.updateTabIndices();break}a?l++:l--}}updateTabIndices(){const{chips:e}=this;let t;for(const o of e){const e=o.alwaysFocusable||!o.disabled;o.matches(":focus-within")&&e?t=o:(e&&!t&&(t=o),o.tabIndex=-1)}t&&(t.tabIndex=0)}constructor(){super(),this.internals=this.attachInternals(),i.S$||(this.addEventListener("focusin",this.updateTabIndices.bind(this)),this.addEventListener("update-focus",this.updateTabIndices.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.internals.role="toolbar")}}(0,r.Cg)([(0,n.KN)()],s.prototype,"childElements",void 0);const d=i.AH`:host{display:flex;flex-wrap:wrap;gap:8px}`;let l=class extends s{};l.styles=[d],l=(0,r.Cg)([(0,n.EM)("md-chip-set")],l)},27525(e,t,o){function r(e,t=u){const o=s(e,t);return o&&(o.tabIndex=0,o.focus()),o}function n(e,t=u){const o=d(e,t);return o&&(o.tabIndex=0,o.focus()),o}function i(e,t=u){const o=a(e,t);return o&&(o.item.tabIndex=-1),o}function a(e,t=u){for(let o=0;o<e.length;o++){const r=e[o];if(0===r.tabIndex&&t(r))return{item:r,index:o}}return null}function s(e,t=u){for(const o of e)if(t(o))return o;return null}function d(e,t=u){for(let o=e.length-1;o>=0;o--){const r=e[o];if(t(r))return r}return null}function l(e,t,o=u,n=!0){if(t){const r=function(e,t,o=u,r=!0){for(let n=1;n<e.length;n++){const i=(n+t)%e.length;if(i<t&&!r)return null;const a=e[i];if(o(a))return a}return e[t]?e[t]:null}(e,t.index,o,n);return r&&(r.tabIndex=0,r.focus()),r}return r(e,o)}function c(e,t,o=u,r=!0){if(t){const n=function(e,t,o=u,r=!0){for(let n=1;n<e.length;n++){const i=(t-n+e.length)%e.length;if(i>t&&!r)return null;const a=e[i];if(o(a))return a}return e[t]?e[t]:null}(e,t.index,o,r);return n&&(n.tabIndex=0,n.focus()),n}return n(e,o)}function h(){return new Event("deactivate-items",{bubbles:!0,composed:!0})}function p(){return new Event("request-activation",{bubbles:!0,composed:!0})}function u(e){return!e.disabled}o.d(t,{A6:()=>a,Ex:()=>d,RN:()=>h,RZ:()=>n,c7:()=>s,cG:()=>p,u9:()=>c,ub:()=>i,wm:()=>l,zT:()=>r})},95192(e,t,o){o.d(t,{IU:()=>l,Jt:()=>s,Yd:()=>r,hZ:()=>d,y$:()=>n});o(44114),o(18111),o(7588),o(61701);function r(e){return new Promise((t,o)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>o(e.error)})}function n(e,t){let o;return(n,i)=>(()=>{if(o)return o;const n=indexedDB.open(e);return n.onupgradeneeded=()=>n.result.createObjectStore(t),o=r(n),o.then(e=>{e.onclose=()=>o=void 0},()=>{}),o})().then(e=>i(e.transaction(t,n).objectStore(t)))}let i;function a(){return i||(i=n("keyval-store","keyval")),i}function s(e,t=a()){return t("readonly",t=>r(t.get(e)))}function d(e,t,o=a()){return o("readwrite",o=>(o.put(t,e),r(o.transaction)))}function l(e=a()){return e("readwrite",e=>(e.clear(),r(e.transaction)))}},37540(e,t,o){o.d(t,{Kq:()=>h});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var r=o(63937),n=o(42017);const i=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const e of o)e._$AO?.(t,!1),i(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)},s=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),c(t)}};function d(e){void 0!==this._$AN?(a(this),this._$AM=e,s(this)):this._$AM=e}function l(e,t=!1,o=0){const r=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(t)if(Array.isArray(r))for(let e=o;e<r.length;e++)i(r[e],!1),a(r[e]);else null!=r&&(i(r,!1),a(r));else i(this,e)}const c=e=>{e.type==n.OA.CHILD&&(e._$AP??=l,e._$AQ??=d)};class h extends n.WL{_$AT(e,t,o){super._$AT(e,t,o),s(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(i(this,e),a(this))}setValue(e){if((0,r.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}}}};