@sbb-esta/lyne-elements-dev 5.13.0-dev.1793553480 → 5.13.0-dev.1793604746

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- import{__esDecorate as e,__runInitializers as t}from"tslib";import{ResizeController as n}from"@lit-labs/observers/resize-controller.js";import{html as r,isServer as i,nothing as a,unsafeCSS as o}from"lit";import{property as s}from"lit/decorators.js";import{ref as ee}from"lit/directives/ref.js";import{SbbActionBaseElement as c,SbbDisabledMixin as l,SbbElement as u,SbbEscapableOverlayController as te,SbbNegativeMixin as d,SbbOpenCloseBaseElement as f,SbbPropertyWatcherController as p,forceType as m,getNextElementIndex as h,idReference as g,isEventOnElement as _,isSafari as v,isZeroAnimationDuration as y,popoverResetStyles as b,removeAriaComboBoxAttributes as x,scrollbarStyles as S,setAriaComboBoxAttributes as C,setOverlayPosition as w}from"./core.js";import{optionPanelStyles as T}from"./option.pure.js";import{miniButtonStyle as E}from"./button.pure.js";import{SbbIconNameMixin as D}from"./icon.pure.js";var O=`:host{display:none}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){display:block}
2
- `;const k=v;var A=class extends Event{get option(){return this._option}constructor(e){super(`inputAutocomplete`,{bubbles:!0,composed:!0}),this._option=e}};let j=(()=>{let c=d(f),l,u=[],h=[],v,C=[],E=[],D,j=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B=[],V=[],H,U=[],W=[],G,K=[],q=[],J,Y=[],X=[],Z,Q=[],$=[];return class extends c{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;l=[g(),s()],v=[g(),s()],D=[m(),s({attribute:`preserve-icon-space`,reflect:!0,type:Boolean})],N=[m(),s({attribute:`auto-active-first-option`,type:Boolean})],I=[s({attribute:!1})],z=[s({reflect:!0})],H=[m(),s({attribute:`auto-select-active-option`,type:Boolean})],G=[m(),s({attribute:`auto-select-active-option-on-blur`,type:Boolean})],J=[m(),s({attribute:`require-selection`,type:Boolean})],Z=[s()],e(this,null,l,{kind:`accessor`,name:`origin`,static:!1,private:!1,access:{has:e=>`origin`in e,get:e=>e.origin,set:(e,t)=>{e.origin=t}},metadata:t},u,h),e(this,null,v,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},C,E),e(this,null,D,{kind:`accessor`,name:`preserveIconSpace`,static:!1,private:!1,access:{has:e=>`preserveIconSpace`in e,get:e=>e.preserveIconSpace,set:(e,t)=>{e.preserveIconSpace=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`autoActiveFirstOption`,static:!1,private:!1,access:{has:e=>`autoActiveFirstOption`in e,get:e=>e.autoActiveFirstOption,set:(e,t)=>{e.autoActiveFirstOption=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},L,R),e(this,null,z,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},B,V),e(this,null,H,{kind:`accessor`,name:`autoSelectActiveOption`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOption`in e,get:e=>e.autoSelectActiveOption,set:(e,t)=>{e.autoSelectActiveOption=t}},metadata:t},U,W),e(this,null,G,{kind:`accessor`,name:`autoSelectActiveOptionOnBlur`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOptionOnBlur`in e,get:e=>e.autoSelectActiveOptionOnBlur,set:(e,t)=>{e.autoSelectActiveOptionOnBlur=t}},metadata:t},K,q),e(this,null,J,{kind:`accessor`,name:`requireSelection`,static:!1,private:!1,access:{has:e=>`requireSelection`in e,get:e=>e.requireSelection,set:(e,t)=>{e.requireSelection=t}},metadata:t},Y,X),e(this,null,Z,{kind:`accessor`,name:`position`,static:!1,private:!1,access:{has:e=>`position`in e,get:e=>e.position,set:(e,t)=>{e.position=t}},metadata:t},Q,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[b,S,T,o(O)]}#e;get origin(){return this.#e}set origin(e){this.#e=e}#t;get trigger(){return this.#t}set trigger(e){this.#t=e}#n;get preserveIconSpace(){return this.#n}set preserveIconSpace(e){this.#n=e}#r;get autoActiveFirstOption(){return this.#r}set autoActiveFirstOption(e){this.#r=e}#i;get displayWith(){return this.#i}set displayWith(e){this.#i=e}#a;get size(){return this.#a}set size(e){this.#a=e}#o;get autoSelectActiveOption(){return this.#o}set autoSelectActiveOption(e){this.#o=e}#s;get autoSelectActiveOptionOnBlur(){return this.#s}set autoSelectActiveOptionOnBlur(e){this.#s=e}#c;get requireSelection(){return this.#c}set requireSelection(e){this.#c=e}#l;get position(){return this.#l}set position(e){this.#l=e}get originElement(){return this.origin??this.closest?.(`sbb-form-field`)?.shadowRoot?.querySelector?.(`#overlay-anchor`)??this.trigger??null}get triggerElement(){return this._triggerElement??null}get overlayId(){return`${this.id}-overlay`}constructor(){super(),this.#e=t(this,u,null),this.#t=(t(this,h),t(this,C,null)),this.#n=(t(this,E),t(this,j,!1)),this.#r=(t(this,M),t(this,P,!1)),this.#i=(t(this,F),t(this,L,null)),this.#a=(t(this,R),t(this,B,null)),this.#o=(t(this,V),t(this,U,!1)),this.#s=(t(this,W),t(this,K,!1)),this.#c=(t(this,q),t(this,Y,!1)),this.#l=(t(this,X),t(this,Q,`auto`)),this._triggerElement=t(this,$),this.activeOption=null,this.pendingAutoSelectedOption=null,this._resizeObserver=new n(this,{target:null,skipInitial:!0,callback:(()=>{let e;return()=>{clearTimeout(e),e=setTimeout(()=>{this.state!==`closed`&&this._setOverlayPosition()},10)}})()}),this._triggerAttributeObserver=i?null:new MutationObserver(e=>{let t=e[0].target;(t.hasAttribute(`disabled`)||t.hasAttribute(`readonly`))&&this.close()}),this._isPointerDownEventOnMenu=!1,this._escapableOverlayController=new te(this),this._optionsCount=0,this._lastUserInput=null,this._isCustomChangeEvent=!1,this._pointerDownListener=e=>{this._isPointerDownEventOnMenu=_(this._overlay,e)},this._closeOnBackdropClick=e=>{this._isPointerDownEventOnMenu||_(this._overlay,e)||_(this.originElement,e)||this.close()},this.addEventListener?.(`optionselected`,e=>this.onOptionSelected(e)),this.addEventListener?.(`ɵoptgroupslotchange`,()=>this._handleSlotchange(),{capture:!0}),this.addController(new p(this,()=>this.closest(`sbb-form-field`),{negative:e=>{this.negative=e.negative,this.syncNegative()},borderless:e=>this.toggleState(`option-panel-origin-borderless`,e.borderless)}))}open(){if(this.state===`opening`||this.state===`opened`||!this._overlay||this.options.length===0||this._readonly()||!this.dispatchBeforeOpenEvent())return;this.showPopover?.(),this.state=`opening`,this.triggerElement?.toggleAttribute(`data-expanded`,!0);let e=this.originElement;if(!e)throw Error(`Cannot find the origin element. Please specify a valid element or check the usage of the "origin" property from the documentation`);this._setOverlayPosition(e),this._setNextActiveOptionIfAutoActiveFirstOption(),this._attachOpenPanelEvents(),this._escapableOverlayController.connect(),this._isZeroAnimationDuration()&&this._handleOpening()}close(){this.state!==`closing`&&this.state!==`closed`&&this.dispatchBeforeCloseEvent()&&(this.pendingAutoSelectedOption&&(this.pendingAutoSelectedOption.selected=!0,this._setValueAndDispatchEvents(this.pendingAutoSelectedOption,!0)),this.state=`closing`,this.triggerElement?.removeAttribute(`data-expanded`),this._openPanelEventsController.abort(),this.originElement&&this._resizeObserver.unobserve(this.originElement),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return y(this,`--sbb-options-panel-animation-duration`)}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.id||=this.generatedId,this.hasUpdated&&this._componentSetup(),this.syncNegative()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this.syncNegative(),e.has(`autoActiveFirstOption`)&&this.isOpen&&this._setNextActiveOptionIfAutoActiveFirstOption()}firstUpdated(e){super.firstUpdated(e),this._componentSetup()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openPanelEventsController?.abort()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&this.hasUpdated&&(!e||e===`trigger`?this._configureTrigger():(!e||e===`origin`)&&this.isOpen&&this._setOverlayPosition())}onOptionSelected(e){let t=e.target;this._setValueAndDispatchEvents(t),this.close()}setPendingSelection(e){this.pendingAutoSelectedOption=e,this._setInputValue(e)}_setValueAndDispatchEvents(e,t=!1){this.options.filter(t=>t!==e&&t.selected).forEach(e=>e.selected=!1),this.pendingAutoSelectedOption=null,this.triggerElement&&(this._setInputValue(e),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this._lastUserInput=null,this.triggerElement.dispatchEvent(new A(e)),t||this.triggerElement.focus())}_setInputValue(e){if(!this.triggerElement)return;let t=this.displayWith?.(e.value)??e.value;Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,t)}_handleSlotchange(){this._highlightOptions(this.triggerElement?.value);let e=Array.from(this.querySelectorAll(`*`));this._previousElements?.forEach(e=>this._resizeObserver.unobserve(e)),this._previousElements=e,this._previousElements.forEach(e=>this._resizeObserver.observe(e)),this.isOpen?(this._setOverlayPosition(),this._setNextActiveOptionIfAutoActiveFirstOption(),this._optionsCount>0&&this.options.length===0&&this.close()):document?.activeElement===this.triggerElement&&this._optionsCount===0&&this.options.length>0&&this.open(),this._optionsCount=this.options.length}_setNextActiveOptionIfAutoActiveFirstOption(){this.autoActiveFirstOption&&(this.resetActiveElement(),this.setNextActiveOption())}_readonly(){return this.triggerElement?.hasAttribute(`readonly`)??!1}_componentSetup(){i||this._configureTrigger()}_configureTrigger(){let e=this.trigger??this.closest?.(`sbb-form-field`)?.querySelector(`input`);if(e===this.triggerElement||(this._triggerAbortController?.abort(),x(this.triggerElement),this.triggerElement?.removeAttribute(`data-expanded`),this._triggerElement=e,!this.triggerElement))return;let t=this.originElement;this.triggerElement===t&&this.isOpen&&this._setOverlayPosition(t),this._triggerAttributeObserver?.observe(this.triggerElement,{attributes:!0,attributeFilter:[`disabled`,`readonly`]}),this.setTriggerAttributes(this.triggerElement),this._triggerAbortController=new AbortController,this.triggerElement.addEventListener(`focus`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`input`,e=>{let t=e.target.value;t&&e.isTrusted&&this.open(),this._highlightOptions(t),this._lastUserInput=t,this.pendingAutoSelectedOption=null},{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`change`,e=>{this.requireSelection&&!this._isCustomChangeEvent&&e.stopImmediatePropagation(),this._isCustomChangeEvent=!1},{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`keydown`,e=>this._closedPanelKeyboardInteraction(e),{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`blur`,e=>{this.contains(e.relatedTarget)||(this.autoSelectActiveOptionOnBlur&&this.activeOption&&this._lastUserInput&&this.triggerElement?.value&&(this.activeOption.selected=!0,this._setValueAndDispatchEvents(this.activeOption,!0)),this.requireSelection&&this.triggerElement&&this._lastUserInput!=null&&!this.pendingAutoSelectedOption&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,``),this._highlightOptions(``),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))),this.close())},{signal:this._triggerAbortController.signal,capture:!0})}_setOverlayPosition(e=this.originElement){e&&w(this._overlay,e,this._overlay,this.shadowRoot.querySelector(`.sbb-option-panel__overlay-container`),this,this.position)}_onAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_handleOpening(){this.state=`opened`,this.originElement&&this._resizeObserver.observe(this.originElement),this.triggerElement?.setAttribute(`aria-expanded`,`true`),this.dispatchOpenEvent()}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.triggerElement?.setAttribute(`aria-expanded`,`false`),this.resetActiveElement(),this._overlay.scrollTop=0,this._escapableOverlayController.disconnect(),this.dispatchCloseEvent()}_attachOpenPanelEvents(){this._openPanelEventsController=new AbortController,document.addEventListener(`scroll`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerdown`,e=>this._pointerDownListener(e),{signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerup`,e=>this._closeOnBackdropClick(e),{signal:this._openPanelEventsController.signal}),this.addEventListener(`ɵdisabledchange`,()=>{this.activeOption?.disabled&&this.resetActiveElement(),this._setNextActiveOptionIfAutoActiveFirstOption()},{signal:this._openPanelEventsController.signal}),this.triggerElement?.addEventListener(`keydown`,e=>this.openedPanelKeyboardInteraction(e),{signal:this._openPanelEventsController.signal,capture:!0})}_closedPanelKeyboardInteraction(e){if(this.state!==`opening`&&this.state!==`opened`)switch(e.key){case`ArrowDown`:case`ArrowUp`:this.open()}}_highlightOptions(e){e!=null&&this.options.forEach(t=>t.highlight(e))}render(){return r`
1
+ import{__esDecorate as e,__runInitializers as t}from"tslib";import{ResizeController as n}from"@lit-labs/observers/resize-controller.js";import{html as r,isServer as i,nothing as a,unsafeCSS as o}from"lit";import{property as s}from"lit/decorators.js";import{ref as c}from"lit/directives/ref.js";import{SbbActionBaseElement as l,SbbDisabledMixin as u,SbbElement as d,SbbEscapableOverlayController as f,SbbNegativeMixin as p,SbbOpenCloseBaseElement as m,SbbPropertyWatcherController as h,forceType as g,getNextElementIndex as _,idReference as v,isAndroid as y,isEventOnElement as b,isSafari as x,isZeroAnimationDuration as S,popoverResetStyles as C,removeAriaComboBoxAttributes as ee,scrollbarStyles as te,setAriaComboBoxAttributes as w,setOverlayPosition as T}from"./core.js";import{optionPanelStyles as E}from"./option.pure.js";import{miniButtonStyle as D}from"./button.pure.js";import{SbbIconNameMixin as O}from"./icon.pure.js";var k=`:host{display:none}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){display:block}
2
+ `;const A=x;var j=class extends Event{get option(){return this._option}constructor(e){super(`inputAutocomplete`,{bubbles:!0,composed:!0}),this._option=e}};let M=(()=>{let l=p(m),u,d=[],_=[],y,x=[],w=[],D,O=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B=[],V=[],H,U=[],W=[],G,K=[],q=[],J,Y=[],X=[],Z,Q=[],$=[];return class extends l{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;u=[v(),s()],y=[v(),s()],D=[g(),s({attribute:`preserve-icon-space`,reflect:!0,type:Boolean})],N=[g(),s({attribute:`auto-active-first-option`,type:Boolean})],I=[s({attribute:!1})],z=[s({reflect:!0})],H=[g(),s({attribute:`auto-select-active-option`,type:Boolean})],G=[g(),s({attribute:`auto-select-active-option-on-blur`,type:Boolean})],J=[g(),s({attribute:`require-selection`,type:Boolean})],Z=[s()],e(this,null,u,{kind:`accessor`,name:`origin`,static:!1,private:!1,access:{has:e=>`origin`in e,get:e=>e.origin,set:(e,t)=>{e.origin=t}},metadata:t},d,_),e(this,null,y,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},x,w),e(this,null,D,{kind:`accessor`,name:`preserveIconSpace`,static:!1,private:!1,access:{has:e=>`preserveIconSpace`in e,get:e=>e.preserveIconSpace,set:(e,t)=>{e.preserveIconSpace=t}},metadata:t},O,M),e(this,null,N,{kind:`accessor`,name:`autoActiveFirstOption`,static:!1,private:!1,access:{has:e=>`autoActiveFirstOption`in e,get:e=>e.autoActiveFirstOption,set:(e,t)=>{e.autoActiveFirstOption=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},L,R),e(this,null,z,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:t},B,V),e(this,null,H,{kind:`accessor`,name:`autoSelectActiveOption`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOption`in e,get:e=>e.autoSelectActiveOption,set:(e,t)=>{e.autoSelectActiveOption=t}},metadata:t},U,W),e(this,null,G,{kind:`accessor`,name:`autoSelectActiveOptionOnBlur`,static:!1,private:!1,access:{has:e=>`autoSelectActiveOptionOnBlur`in e,get:e=>e.autoSelectActiveOptionOnBlur,set:(e,t)=>{e.autoSelectActiveOptionOnBlur=t}},metadata:t},K,q),e(this,null,J,{kind:`accessor`,name:`requireSelection`,static:!1,private:!1,access:{has:e=>`requireSelection`in e,get:e=>e.requireSelection,set:(e,t)=>{e.requireSelection=t}},metadata:t},Y,X),e(this,null,Z,{kind:`accessor`,name:`position`,static:!1,private:!1,access:{has:e=>`position`in e,get:e=>e.position,set:(e,t)=>{e.position=t}},metadata:t},Q,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[C,te,E,o(k)]}#e;get origin(){return this.#e}set origin(e){this.#e=e}#t;get trigger(){return this.#t}set trigger(e){this.#t=e}#n;get preserveIconSpace(){return this.#n}set preserveIconSpace(e){this.#n=e}#r;get autoActiveFirstOption(){return this.#r}set autoActiveFirstOption(e){this.#r=e}#i;get displayWith(){return this.#i}set displayWith(e){this.#i=e}#a;get size(){return this.#a}set size(e){this.#a=e}#o;get autoSelectActiveOption(){return this.#o}set autoSelectActiveOption(e){this.#o=e}#s;get autoSelectActiveOptionOnBlur(){return this.#s}set autoSelectActiveOptionOnBlur(e){this.#s=e}#c;get requireSelection(){return this.#c}set requireSelection(e){this.#c=e}#l;get position(){return this.#l}set position(e){this.#l=e}get originElement(){return this.origin??this.closest?.(`sbb-form-field`)?.shadowRoot?.querySelector?.(`#overlay-anchor`)??this.trigger??null}get triggerElement(){return this._triggerElement??null}get overlayId(){return`${this.id}-overlay`}constructor(){super(),this.#e=t(this,d,null),this.#t=(t(this,_),t(this,x,null)),this.#n=(t(this,w),t(this,O,!1)),this.#r=(t(this,M),t(this,P,!1)),this.#i=(t(this,F),t(this,L,null)),this.#a=(t(this,R),t(this,B,null)),this.#o=(t(this,V),t(this,U,!1)),this.#s=(t(this,W),t(this,K,!1)),this.#c=(t(this,q),t(this,Y,!1)),this.#l=(t(this,X),t(this,Q,`auto`)),this._triggerElement=t(this,$),this.activeOption=null,this.pendingAutoSelectedOption=null,this._resizeObserver=new n(this,{target:null,skipInitial:!0,callback:(()=>{let e;return()=>{clearTimeout(e),e=setTimeout(()=>{this.state!==`closed`&&this._setOverlayPosition()},10)}})()}),this._triggerAttributeObserver=i?null:new MutationObserver(e=>{let t=e[0].target;(t.hasAttribute(`disabled`)||t.hasAttribute(`readonly`))&&this.close()}),this._isPointerDownEventOnMenu=!1,this._escapableOverlayController=new f(this),this._optionsCount=0,this._lastUserInput=null,this._isCustomChangeEvent=!1,this._pointerDownListener=e=>{this._isPointerDownEventOnMenu=b(this._overlay,e)},this._closeOnBackdropClick=e=>{this._isPointerDownEventOnMenu||b(this._overlay,e)||b(this.originElement,e)||this.close()},this.addEventListener?.(`optionselected`,e=>this.onOptionSelected(e)),this.addEventListener?.(`ɵoptgroupslotchange`,()=>this._handleSlotchange(),{capture:!0}),this.addController(new h(this,()=>this.closest(`sbb-form-field`),{negative:e=>{this.negative=e.negative,this.syncNegative()},borderless:e=>this.toggleState(`option-panel-origin-borderless`,e.borderless)}))}open(){if(this.state===`opening`||this.state===`opened`||!this._overlay||this.options.length===0||this._readonly()||!this.dispatchBeforeOpenEvent())return;this.showPopover?.(),this.state=`opening`,this.triggerElement?.toggleAttribute(`data-expanded`,!0);let e=this.originElement;if(!e)throw Error(`Cannot find the origin element. Please specify a valid element or check the usage of the "origin" property from the documentation`);this._setOverlayPosition(e),this._setNextActiveOptionIfAutoActiveFirstOption(),this._attachOpenPanelEvents(),this._escapableOverlayController.connect(),this._isZeroAnimationDuration()&&this._handleOpening()}close(){this.state!==`closing`&&this.state!==`closed`&&this.dispatchBeforeCloseEvent()&&(this.pendingAutoSelectedOption&&(this.pendingAutoSelectedOption.selected=!0,this._setValueAndDispatchEvents(this.pendingAutoSelectedOption,!0)),this.state=`closing`,this.triggerElement?.removeAttribute(`data-expanded`),this._openPanelEventsController.abort(),this.originElement&&this._resizeObserver.unobserve(this.originElement),this._isZeroAnimationDuration()&&this._handleClosing())}_isZeroAnimationDuration(){return S(this,`--sbb-options-panel-animation-duration`)}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.id||=this.generatedId,this.hasUpdated&&this._componentSetup(),this.syncNegative()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this.syncNegative(),e.has(`autoActiveFirstOption`)&&this.isOpen&&this._setNextActiveOptionIfAutoActiveFirstOption()}firstUpdated(e){super.firstUpdated(e),this._componentSetup()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openPanelEventsController?.abort()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&this.hasUpdated&&(!e||e===`trigger`?this._configureTrigger():(!e||e===`origin`)&&this.isOpen&&this._setOverlayPosition())}onOptionSelected(e){let t=e.target;this._setValueAndDispatchEvents(t),this.close()}setPendingSelection(e){this.pendingAutoSelectedOption=e,this._setInputValue(e)}_setValueAndDispatchEvents(e,t=!1){this.options.filter(t=>t!==e&&t.selected).forEach(e=>e.selected=!1),this.pendingAutoSelectedOption=null,this.triggerElement&&(this._setInputValue(e),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this._lastUserInput=null,this.triggerElement.dispatchEvent(new j(e)),t||this.triggerElement.focus())}_setInputValue(e){if(!this.triggerElement)return;let t=this.displayWith?.(e.value)??e.value;Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,t)}_handleSlotchange(){this._highlightOptions(this.triggerElement?.value);let e=Array.from(this.querySelectorAll(`*`));this._previousElements?.forEach(e=>this._resizeObserver.unobserve(e)),this._previousElements=e,this._previousElements.forEach(e=>this._resizeObserver.observe(e)),this.isOpen?(this._setOverlayPosition(),this._setNextActiveOptionIfAutoActiveFirstOption(),this._optionsCount>0&&this.options.length===0&&this.close()):document?.activeElement===this.triggerElement&&this._optionsCount===0&&this.options.length>0&&this.open(),this._optionsCount=this.options.length}_setNextActiveOptionIfAutoActiveFirstOption(){this.autoActiveFirstOption&&(this.resetActiveElement(),this.setNextActiveOption())}_readonly(){return this.triggerElement?.hasAttribute(`readonly`)??!1}_componentSetup(){i||this._configureTrigger()}_configureTrigger(){let e=this.trigger??this.closest?.(`sbb-form-field`)?.querySelector(`input`);if(e===this.triggerElement||(this._triggerAbortController?.abort(),ee(this.triggerElement),this.triggerElement?.removeAttribute(`data-expanded`),this._triggerElement=e,!this.triggerElement))return;let t=this.originElement;this.triggerElement===t&&this.isOpen&&this._setOverlayPosition(t),this._triggerAttributeObserver?.observe(this.triggerElement,{attributes:!0,attributeFilter:[`disabled`,`readonly`]}),this.setTriggerAttributes(this.triggerElement),this._triggerAbortController=new AbortController,this.triggerElement.addEventListener(`focus`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`input`,e=>{let t=e.target.value;t&&e.isTrusted&&this.open(),this._highlightOptions(t),this._lastUserInput=t,this.pendingAutoSelectedOption=null},{signal:this._triggerAbortController.signal}),this.triggerElement.addEventListener(`change`,e=>{this.requireSelection&&!this._isCustomChangeEvent&&e.stopImmediatePropagation(),this._isCustomChangeEvent=!1},{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`keydown`,e=>this._closedPanelKeyboardInteraction(e),{signal:this._triggerAbortController.signal,capture:!0}),this.triggerElement.addEventListener(`blur`,e=>{this.contains(e.relatedTarget)||(this.autoSelectActiveOptionOnBlur&&this.activeOption&&this._lastUserInput&&this.triggerElement?.value&&(this.activeOption.selected=!0,this._setValueAndDispatchEvents(this.activeOption,!0)),this.requireSelection&&this.triggerElement&&this._lastUserInput!=null&&!this.pendingAutoSelectedOption&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(this.triggerElement,``),this._highlightOptions(``),this._isCustomChangeEvent=!0,this.triggerElement.dispatchEvent(new Event(`change`,{bubbles:!0})),this.triggerElement.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))),this.close())},{signal:this._triggerAbortController.signal,capture:!0})}_setOverlayPosition(e=this.originElement){e&&T(this._overlay,e,this._overlay,this.shadowRoot.querySelector(`.sbb-option-panel__overlay-container`),this,this.position)}_onAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_handleOpening(){this.state=`opened`,this.originElement&&this._resizeObserver.observe(this.originElement),this.triggerElement?.setAttribute(`aria-expanded`,`true`),this.dispatchOpenEvent()}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.triggerElement?.setAttribute(`aria-expanded`,`false`),this.resetActiveElement(),this._overlay.scrollTop=0,this._escapableOverlayController.disconnect(),this.dispatchCloseEvent()}_attachOpenPanelEvents(){this._openPanelEventsController=new AbortController,document.addEventListener(`scroll`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setOverlayPosition(),{passive:!0,signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerdown`,e=>this._pointerDownListener(e),{signal:this._openPanelEventsController.signal}),window.addEventListener(`pointerup`,e=>this._closeOnBackdropClick(e),{signal:this._openPanelEventsController.signal}),this.addEventListener(`ɵdisabledchange`,()=>{this.activeOption?.disabled&&this.resetActiveElement(),this._setNextActiveOptionIfAutoActiveFirstOption()},{signal:this._openPanelEventsController.signal}),this.triggerElement?.addEventListener(`keydown`,e=>this.openedPanelKeyboardInteraction(e),{signal:this._openPanelEventsController.signal,capture:!0})}_closedPanelKeyboardInteraction(e){if(this.state!==`opening`&&this.state!==`opened`)switch(e.key){case`ArrowDown`:case`ArrowUp`:this.open()}}_highlightOptions(e){e!=null&&this.options.forEach(t=>t.highlight(e))}render(){return r`
3
3
  <div class="sbb-option-panel__overlay-container">
4
4
  <div
5
5
  class="sbb-option-panel__overlay ${this.negative?`sbb-scrollbar-negative`:`sbb-scrollbar`}"
6
- role=${k?a:this.panelRole}
7
- id=${k?a:this.overlayId}
6
+ role=${A?a:this.panelRole}
7
+ id=${A?a:this.overlayId}
8
8
  tabindex="-1"
9
9
  @animationend=${this._onAnimationEnd}
10
- ${ee(e=>this._overlay=e)}
10
+ ${c(e=>this._overlay=e)}
11
11
  >
12
12
  <slot @slotchange=${this._handleSlotchange}></slot>
13
13
  </div>
14
14
  </div>
15
- `}}})();var M=class extends l(d(D(c))){static{this.elementName=`sbb-autocomplete-button`}static{this.role=`button`}static{this.styles=[E]}get option(){return this.closest(`sbb-autocomplete-row`)?.querySelector(`sbb-option`)}get optgroup(){return this.closest(`sbb-optgroup`)}constructor(){super(),this.internals.states.add(`button`),i||(this.setupBaseEventHandlers(),this.addController(new p(this,()=>this.closest(`sbb-optgroup`),{disabled:()=>this._updateInternals()})),this.addController(new p(this,()=>this.closest(`sbb-autocomplete`),{negative:e=>this.negative=e.negative})))}setActive(e){this.toggleState(`focus-visible`,e)}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this._updateInternals()}isDisabledExternally(){return this.optgroup?.disabled??!1}_updateInternals(){this.disabled||this.optgroup?.disabled?(this.internals.states.add(`disabled`),this.internals.ariaDisabled=`true`):(this.internals.states.delete(`disabled`),this.internals.ariaDisabled=null)}renderTemplate(){return super.renderIconSlot()}},N=`:host{align-items:center;gap:var(--sbb-autocomplete-row-gap);color:var(--sbb-option-color);background-color:var(--sbb-option-background-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color);padding-inline-end:var(--sbb-autocomplete-row-padding-inline-end);display:flex}:host(:is(:state(negative),[state--negative])){--sbb-option-color:var(--sbb-color-3-negative);--sbb-option-background-color-hover:var(--sbb-background-color-3-negative);--sbb-option-disabled-border-color:var(--sbb-border-color-5);--sbb-option-disabled-background-color:var(--sbb-background-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}@media (any-hover:hover){:host(:hover:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color:var(--sbb-option-background-color-hover)}}:host(:is(:state(disabled),[state--disabled])){--sbb-option-cursor:var(--sbb-cursor-default);position:relative}:host(:is(:state(disabled),[state--disabled])):before{content:"";inset:var(--sbb-option-disabled-inset);border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-option-disabled-border-radius);background-color:var(--sbb-option-disabled-background-color);display:block;position:absolute}@media (forced-colors:active){:host(:is(:state(disabled),[state--disabled])):before{--sbb-option-disabled-border-color:GrayText}}::slotted(sbb-option){--sbb-option-background-color-active:var(--sbb-option-background-color-hover);--sbb-option-disabled-display:none;margin-right:calc(-1 * var(--sbb-spacing-fixed-2x));flex:auto;overflow-x:hidden}
16
- `,P=class extends u{static{this.elementName=`sbb-autocomplete-row`}static{this.styles=[o(N)]}constructor(){super(),this.addController(new p(this,()=>this.closest(`sbb-autocomplete`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new p(this,()=>this.querySelector(`sbb-option`),{disabled:e=>this.toggleState(`disabled`,e.disabled)}))}render(){return r`<slot></slot>`}};let F=0;const I=v;var L=class extends j{constructor(){super(...arguments),this.generatedId=`sbb-autocomplete-${++F}`,this.panelRole=`listbox`,this._activeColumnIndex=0}static{this.elementName=`sbb-autocomplete`}static{this.role=I?`listbox`:null}get options(){return Array.from(this.querySelectorAll?.(`sbb-option`)??[])}syncNegative(){this.querySelectorAll?.(`sbb-divider, sbb-option-hint`).forEach(e=>e.negative=this.negative)}openedPanelKeyboardInteraction(e){if(this.isOpen)switch(e.key){case`Enter`:this.selectByKeyboard(e);break;case`ArrowDown`:case`ArrowUp`:this.setNextActiveOption(e);break;case`ArrowRight`:case`ArrowLeft`:this._setNextHorizontalActiveElement(e)}}selectByKeyboard(e){this.activeOption&&(e.preventDefault(),this._activeColumnIndex===0?this.activeOption.selectViaUserInteraction(!0):this._elementsInRow()[this._activeColumnIndex]?.click())}setNextActiveOption(e){let t=this.options.filter(e=>!e.matches(`:is(:state(disabled),[state--disabled])`));if(this.activeOption?.setActive(!1),this._resetActiveButton(),this.triggerElement.ariaActiveDescendantElement=null,!t.length){this.activeOption=null;return}let n=this.activeOption?t.indexOf(this.activeOption):-1,r=h(e,n,t.length);this.activeOption=t[r],this.activeOption.setActive(!0),this.triggerElement.ariaActiveDescendantElement=this.activeOption,this.activeOption.scrollIntoView({block:`nearest`}),e&&e.preventDefault(),this.autoSelectActiveOption&&e&&this.setPendingSelection(this.activeOption)}_setNextHorizontalActiveElement(e){if(!this.activeOption)return;let t=this._elementsInRow();if(t.length<2)return;e.preventDefault();let n=h(e,this._activeColumnIndex,t.length),r=t[this._activeColumnIndex],i=t[n];r.setActive(!1),i.setActive(!0),this.triggerElement&&(this.triggerElement.ariaActiveDescendantElement=i),i.scrollIntoView({block:`nearest`}),this._activeColumnIndex=n}_resetActiveButton(){this._activeColumnIndex!==0&&(this._activeColumnIndex=0,this.activeOption?.closest(`sbb-autocomplete-row`)?.querySelectorAll(`sbb-autocomplete-button`).forEach(e=>e.setActive(!1)))}_elementsInRow(e=this.activeOption){return Array.from(e?.closest(`sbb-autocomplete-row`)?.querySelectorAll(`sbb-option, sbb-autocomplete-button`)??[]).filter(e=>!e.matches(`:is(:state(disabled),[state--disabled])`))}resetActiveElement(){this._resetActiveButton(),this.activeOption?.setActive(!1),this.activeOption=null,this.triggerElement&&(this.triggerElement.ariaActiveDescendantElement=null)}setTriggerAttributes(e){C(e,I?this.id:this.overlayId,!1)}};export{j as SbbAutocompleteBaseElement,M as SbbAutocompleteButtonElement,L as SbbAutocompleteElement,P as SbbAutocompleteRowElement,A as SbbInputAutocompleteEvent};
15
+ `}}})();var N=class extends u(p(O(l))){static{this.elementName=`sbb-autocomplete-button`}static{this.role=`button`}static{this.styles=[D]}get option(){return this.closest(`sbb-autocomplete-row`)?.querySelector(`sbb-option`)}get optgroup(){return this.closest(`sbb-optgroup`)}constructor(){super(),this.internals.states.add(`button`),i||(this.setupBaseEventHandlers(),this.addController(new h(this,()=>this.closest(`sbb-optgroup`),{disabled:()=>this._updateInternals()})),this.addController(new h(this,()=>this.closest(`sbb-autocomplete`),{negative:e=>this.negative=e.negative})))}setActive(e){this.toggleState(`focus-visible`,e)}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this._updateInternals()}connectedCallback(){super.connectedCallback(),y&&(this.tabIndex=-1)}isDisabledExternally(){return this.optgroup?.disabled??!1}_updateInternals(){this.disabled||this.optgroup?.disabled?(this.internals.states.add(`disabled`),this.internals.ariaDisabled=`true`):(this.internals.states.delete(`disabled`),this.internals.ariaDisabled=null)}renderTemplate(){return super.renderIconSlot()}},P=`:host{align-items:center;gap:var(--sbb-autocomplete-row-gap);color:var(--sbb-option-color);background-color:var(--sbb-option-background-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color);padding-inline-end:var(--sbb-autocomplete-row-padding-inline-end);display:flex}:host(:is(:state(negative),[state--negative])){--sbb-option-color:var(--sbb-color-3-negative);--sbb-option-background-color-hover:var(--sbb-background-color-3-negative);--sbb-option-disabled-border-color:var(--sbb-border-color-5);--sbb-option-disabled-background-color:var(--sbb-background-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}@media (any-hover:hover){:host(:hover:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color:var(--sbb-option-background-color-hover)}}:host(:is(:state(disabled),[state--disabled])){--sbb-option-cursor:var(--sbb-cursor-default);position:relative}:host(:is(:state(disabled),[state--disabled])):before{content:"";inset:var(--sbb-option-disabled-inset);border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-option-disabled-border-radius);background-color:var(--sbb-option-disabled-background-color);display:block;position:absolute}@media (forced-colors:active){:host(:is(:state(disabled),[state--disabled])):before{--sbb-option-disabled-border-color:GrayText}}::slotted(sbb-option){--sbb-option-background-color-active:var(--sbb-option-background-color-hover);--sbb-option-disabled-display:none;margin-right:calc(-1 * var(--sbb-spacing-fixed-2x));flex:auto;overflow-x:hidden}
16
+ `,F=class extends d{static{this.elementName=`sbb-autocomplete-row`}static{this.styles=[o(P)]}constructor(){super(),this.addController(new h(this,()=>this.closest(`sbb-autocomplete`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new h(this,()=>this.querySelector(`sbb-option`),{disabled:e=>this.toggleState(`disabled`,e.disabled)}))}render(){return r`<slot></slot>`}};let I=0;const L=x;var R=class extends M{constructor(){super(...arguments),this.generatedId=`sbb-autocomplete-${++I}`,this.panelRole=`listbox`,this._activeColumnIndex=0}static{this.elementName=`sbb-autocomplete`}static{this.role=L?`listbox`:null}get options(){return Array.from(this.querySelectorAll?.(`sbb-option`)??[])}syncNegative(){this.querySelectorAll?.(`sbb-divider, sbb-option-hint`).forEach(e=>e.negative=this.negative)}openedPanelKeyboardInteraction(e){if(this.isOpen)switch(e.key){case`Enter`:this.selectByKeyboard(e);break;case`ArrowDown`:case`ArrowUp`:this.setNextActiveOption(e);break;case`ArrowRight`:case`ArrowLeft`:this._setNextHorizontalActiveElement(e)}}selectByKeyboard(e){this.activeOption&&(e.preventDefault(),this._activeColumnIndex===0?this.activeOption.selectViaUserInteraction(!0):this._elementsInRow()[this._activeColumnIndex]?.click())}setNextActiveOption(e){let t=this.options.filter(e=>!e.matches(`:is(:state(disabled),[state--disabled])`));if(this.activeOption?.setActive(!1),this._resetActiveButton(),this.triggerElement.ariaActiveDescendantElement=null,!t.length){this.activeOption=null;return}let n=this.activeOption?t.indexOf(this.activeOption):-1,r=_(e,n,t.length);this.activeOption=t[r],this.activeOption.setActive(!0),this.triggerElement.ariaActiveDescendantElement=this.activeOption,this.activeOption.scrollIntoView({block:`nearest`}),e&&e.preventDefault(),this.autoSelectActiveOption&&e&&this.setPendingSelection(this.activeOption)}_setNextHorizontalActiveElement(e){if(!this.activeOption)return;let t=this._elementsInRow();if(t.length<2)return;e.preventDefault();let n=_(e,this._activeColumnIndex,t.length),r=t[this._activeColumnIndex],i=t[n];r.setActive(!1),i.setActive(!0),this.triggerElement&&(this.triggerElement.ariaActiveDescendantElement=i),i.scrollIntoView({block:`nearest`}),this._activeColumnIndex=n}_resetActiveButton(){this._activeColumnIndex!==0&&(this._activeColumnIndex=0,this.activeOption?.closest(`sbb-autocomplete-row`)?.querySelectorAll(`sbb-autocomplete-button`).forEach(e=>e.setActive(!1)))}_elementsInRow(e=this.activeOption){return Array.from(e?.closest(`sbb-autocomplete-row`)?.querySelectorAll(`sbb-option, sbb-autocomplete-button`)??[]).filter(e=>!e.matches(`:is(:state(disabled),[state--disabled])`))}resetActiveElement(){this._resetActiveButton(),this.activeOption?.setActive(!1),this.activeOption=null,this.triggerElement&&(this.triggerElement.ariaActiveDescendantElement=null)}setTriggerAttributes(e){w(e,L?this.id:this.overlayId,!1)}};export{M as SbbAutocompleteBaseElement,N as SbbAutocompleteButtonElement,R as SbbAutocompleteElement,F as SbbAutocompleteRowElement,j as SbbInputAutocompleteEvent};
package/core.js CHANGED
@@ -40,7 +40,7 @@ let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._cr
40
40
  `;let Bn=(()=>{let e=V(H(P)),t,r=[],i=[],c,u=[],f=[],p,m=[],h=[];return class extends e{static{let n=typeof Symbol==`function`&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[l()],c=[l({attribute:`horizontal-from`,reflect:!0})],p=[l({reflect:!0})],o(this,null,t,{kind:`accessor`,name:`size`,static:!1,private:!1,access:{has:e=>`size`in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:n},r,i),o(this,null,c,{kind:`accessor`,name:`horizontalFrom`,static:!1,private:!1,access:{has:e=>`horizontalFrom`in e,get:e=>e.horizontalFrom,set:(e,t)=>{e.horizontalFrom=t}},metadata:n},u,f),o(this,null,p,{kind:`accessor`,name:`orientation`,static:!1,private:!1,access:{has:e=>`orientation`in e,get:e=>e.orientation,set:(e,t)=>{e.orientation=t}},metadata:n},m,h),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}static{this.styles=[a(zn)]}#e=s(this,r,null);get size(){return this.#e}set size(e){this.#e=e}#t=(s(this,i),s(this,u,null));get horizontalFrom(){return this.#t}set horizontalFrom(e){this.#t=e}#n=(s(this,f),s(this,m,`horizontal`));get orientation(){return this.#n}set orientation(e){this.#n=e}get selectionElements(){return Array.from(this.querySelectorAll?.(this.selectionElementSelectors)??[]).filter(e=>e.closest?.(this.localName)===this)}constructor(){super(),s(this,h),this.addController(new d(this,{config:{childList:!0,subtree:!0},callback:()=>this.toggleState(`has-panel`,!!this.querySelector?.(this.panelElementSelector))}))}onSlotChange(){}render(){return n`
41
41
  <slot @slotchange=${()=>this.onSlotChange()}></slot>
42
42
  <slot name="error"></slot>
43
- `}}})();var Vn=class{get size(){return this._handlers.size}constructor(e,t){this._host=e,this._property=t,this._handlers=/* @__PURE__ */ new Set,this._hostDefinedPromise=null,r||(customElements.get(this._host.localName)?customElements.upgrade(this._host):this._hostDefinedPromise=customElements.whenDefined(this._host.localName).then(()=>{customElements.upgrade(this._host),this._hostDefinedPromise=null})),this._value=this._host[this._property]}addHandler(e){this._handlers.size||(this._host.addController?this._host.addController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.addController(this))),this._handlers.add(e),this._hostDefinedPromise?this._hostDefinedPromise.then(()=>e(this._host)):e(this._host)}removeHandler(e){this._handlers.delete(e),this._handlers.size||(this._host.removeController?this._host.removeController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.removeController(this)))}hostUpdate(){let e=this._host[this._property];if(this._value!==e){this._value=e;for(let e of this._handlers)e(this._host)}}};const U=/* @__PURE__ */ new WeakMap;var Hn=class{constructor(e,t,n){this._host=e,this._referenceResolver=t,this._handlers=n,this._host.addController(this)}hostConnected(){this.connect()}hostDisconnected(){this._reference!==this._referenceResolver()&&this.disconnect()}connect(){let e=this._referenceResolver();if(this._reference===e||(this.disconnect(),this._reference=e,!this._reference))return;let t=U.get(this._reference);t||(t=/* @__PURE__ */ new Map,U.set(this._reference,t)),this._watchers=t;for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers.get(e);n||(n=new Vn(this._reference,e),this._watchers.set(e,n)),n.addHandler(t)}}disconnect(){if(this._reference){for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers?.get(e);n&&(n.removeHandler(t),n.size||(this._watchers.delete(e),!this._watchers.size&&this._reference&&U.delete(this._reference)))}this._reference=null}}};const Un=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Un.at(-1)?.escapeStrategy())});var Wn=class{constructor(e,t=Un){this._host=e,this._overlayStack=t,this._host.addController?.(this)}hostDisconnected(){this.disconnect()}connect(){this.disconnect(),this._overlayStack.push(this._host)}disconnect(){if(this._overlayStack.length){let e=this._overlayStack.findIndex(e=>e===this._host);e!==-1&&this._overlayStack.splice(e,1)}}};const Gn=/* @__PURE__ */ new WeakMap;var Kn=class{constructor(e,t,n=Gn){this._host=e,this._idRef=t,this._observers=n,this._rootNode=null,this._host.addController(this)}hostConnected(){if(r)return;this._rootNode=this._host.getRootNode();let e=this._observers.get(this._rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)n.add(e.oldValue),n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>n.add(e.id)));for(let t of e){let e=t._host[t._idRef];e&&typeof e==`string`&&n.has(e)&&t._host.requestUpdate()}});t.observe(this._rootNode,{attributeFilter:[`id`],childList:!0,subtree:!0,attributeOldValue:!0}),this._observers.set(this._rootNode,{observer:t,controllers:e})}}hostDisconnected(){if(r||!this._rootNode)return;let e=this._observers.get(this._rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),this._observers.delete(this._rootNode))),this._rootNode=null}find(){if(r||!this._rootNode)return null;{let e=this._host[this._idRef];return typeof e==`string`?this._rootNode?.getElementById(e):null}}};const qn=[`script`,`head`,`template`,`style`,`link`],Jn=/* @__PURE__ */ new Set,Yn=/* @__PURE__ */ new Set,Xn=/* @__PURE__ */ new Set;var Zn=class{constructor(e,t=Jn,n=Xn,r=Yn){this._host=e,this._inertElements=t,this._inertOverlays=n,this._exemptedElements=r,this._host.addController?.(this)}hostConnected(){this._host.isOpen&&this.activate()}hostDisconnected(){this.isInert()&&this.deactivate()}activate(){this._inertOverlays.size&&this._removeAllInertAttributes(),this._inertOverlays.add(this._host),this._addAllInertAttributes()}deactivate(){this._currentOverlay()===this._host?(this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()):this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host)}isInert(){return this._inertOverlays.has(this._host)}exempt(e){this._inertElements.has(e)&&!this._exemptedElements.has(e)&&(this._removeInertAttributes(e),this._inertElements.delete(e),this._exemptedElements.add(e))}restoreAllExempted(){this._exemptedElements.forEach(e=>this._addInertAttributes(e)),this._exemptedElements.clear()}_currentOverlay(){return[...this._inertOverlays].pop()??null}_removeAllInertAttributes(){this._inertElements.forEach(e=>this._removeInertAttributes(e)),this._inertElements.clear()}_removeInertAttributes(e){e&&(e.hasAttribute(`data-sbb-inert`)&&(e.inert=!1,e.removeAttribute(`data-sbb-inert`)),e.hasAttribute(`data-sbb-aria-hidden`)&&(e.removeAttribute(`aria-hidden`),e.removeAttribute(`data-sbb-aria-hidden`)))}_addAllInertAttributes(){let e=this._currentOverlay(),t=e?[e]:[],n=[document.documentElement];for(;n.length>0;)for(let e of n.shift().querySelectorAll(`*`))e.matches(`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`)&&t.push(e),e.shadowRoot&&n.push(e.shadowRoot);let r=[],i=e=>r.push(...e.composedPath());for(let e of t)e.addEventListener(`ɵinert`,i,{once:!0}),e.dispatchEvent(new Event(`ɵinert`,{composed:!0}));let a=new Set(r),o=/* @__PURE__ */ new Set;for(let e of a)for(let t of e.parentNode?.childNodes??[])t.nodeType===Node.ELEMENT_NODE&&!qn.includes(t.localName)&&!a.has(t)&&o.add(t);for(let e of o)this._addInertAttributes(e)}_addInertAttributes(e){this._inertElements.add(e),e.inert||(e.inert=!0,e.toggleAttribute(`data-sbb-inert`,!0)),e.hasAttribute(`aria-hidden`)||(e.setAttribute(`aria-hidden`,`true`),e.toggleAttribute(`data-sbb-aria-hidden`,!0))}};const Qn=`(forced-colors: active)`,W=`(prefers-color-scheme: dark)`,$n=`(any-hover: hover)`,er=`(pointer: coarse)`,tr=`(min-width: 0rem)`,nr=`(min-width: 37.5rem)`,rr=`(min-width: 64rem)`,ir=`(min-width: 90rem)`,ar=`(max-width: 63.9375rem)`,or=`(max-width: 89.9375rem)`,G=/* @__PURE__ */ new Map;var sr=class{constructor(e,t){this._queries=t,e.addController(this)}matches(e){return r?null:matchMedia(e).matches}hostConnected(){if(!r)for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);if(n)n.handlers.add(t);else{let n=matchMedia(e),r=/* @__PURE__ */ new Set([t]),i=e=>r.forEach(t=>t(e.matches));n.addEventListener(`change`,i),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},cr=class e extends sr{static{this._currentMode=this._readLightDarkClass()}static{this._observer=r?null:new MutationObserver(t=>{if(t[0].oldValue!==document.documentElement.getAttribute(`class`)){let t=this._readLightDarkClass();this._currentMode!==t&&(e.requestUpdate(),this._currentMode=t)}})}static{this._observerConfig={attributeFilter:[`class`],attributeOldValue:!0}}constructor(e,t){let n=()=>{t(this.matches()),this._host.toggleState?.(`dark`,this.matches())};super(e,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const lr=!r&&CSS.supports(`anchor-name`,`--test`),ur=[`top`,`bottom`,`left`,`right`,`top span-left`,`top span-right`,`bottom span-left`,`bottom span-right`,`left span-top`,`left span-bottom`,`right span-top`,`right span-bottom`],dr=[`block-start`,`block-end`,`inline-start`,`inline-end`,`block-start span-inline-start`,`block-start span-inline-end`,`block-end span-inline-start`,`block-end span-inline-end`,`inline-start span-block-start`,`inline-start span-block-end`,`inline-end span-block-start`,`inline-end span-block-end`],fr={"block-start":`block-start`,"block-end":`block-end`,"inline-start":`inline-end`,"inline-end":`inline-start`,"block-start span-inline-start":`block-start span-inline-end`,"block-start span-inline-end":`block-start span-inline-start`,"block-end span-inline-start":`block-end span-inline-end`,"block-end span-inline-end":`block-end span-inline-start`,"inline-start span-block-start":`inline-end span-block-start`,"inline-start span-block-end":`inline-end span-block-end`,"inline-end span-block-start":`inline-start span-block-start`,"inline-end span-block-end":`inline-start span-block-end`};[...ur,...dr];let pr=0;var mr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!lr){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++pr}`,this._positions=[],e.addController(this),this._overlay=e}hostConnected(){this._usePolyfill?this._overlay.style.setProperty(`position-area`,`initial`):this._overlay.style.setProperty(`position-anchor`,this._anchorName)}hostUpdate(){r||this._readPositionsFromCss()}connect(e){r||(this._anchor&&this.disconnect(),this._anchor=e,this._usePolyfill||this._anchor.style.setProperty(`anchor-name`,this._anchorName),this._readPositionsFromCss(),this._calculatePosition(),this._abortController?.abort(),this._abortController=new AbortController,document.addEventListener(`scroll`,()=>this._requestCalculatePosition(),{capture:!0,passive:!0,signal:this._abortController.signal}),window.addEventListener(`resize`,()=>this._requestCalculatePosition(),{passive:!0,signal:this._abortController.signal}),this._resizeObserver.observe(e,{box:`border-box`}),this._resizeObserver.observe(this._overlay,{box:`border-box`}))}disconnect(){this._anchor?.style.removeProperty(`anchor-name`),this._anchor=void 0,this._abortController?.abort(),this._resizeObserver.disconnect()}_requestCalculatePosition(){this._frame??=requestAnimationFrame(()=>{this._calculatePosition(),this._frame=void 0})}_calculatePosition(){if(this._anchor){if(this._usePolyfill){let e=this._getOptimalPosition(this._positions);this._applyOverlayPosition(e.position,e.left,e.top)}this._overlay.setAttribute(`data-position`,this.currentPosition)}}_getOptimalPosition(e){let{offsetHeight:t,offsetWidth:n}=this._overlay,{innerHeight:r,innerWidth:i}=window,{top:a,left:o,height:s,width:c}=this._anchor.getBoundingClientRect(),l=this._overlay.matches(`:dir(rtl)`),u=a,d=r-s-a,f=o,p=i-c-o,m=n-c,h=t-s,g=m/2,_=h/2;this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-height`,`${s}px`),this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-width`,`${c}px`);let v={left:0,top:0,position:``},y;for(let r of e){switch(l&&dr.includes(r)?fr[r]:r){default:case`bottom`:case`block-end`:v={position:r,left:o-g,top:a+s,fits:t<=d&&g<=f&&g<=p};break;case`top`:case`block-start`:v={position:r,left:o-g,top:a-t,fits:t<=u&&g<=f&&g<=p};break;case`right`:case`inline-end`:v={position:r,left:o+c,top:a-_,fits:n<=p&&_<=u&&_<=d};break;case`left`:case`inline-start`:v={position:r,left:o-n,top:a-_,fits:n<=f&&_<=u&&_<=d};break;case`top span-left`:case`block-start span-inline-start`:v={position:r,left:o-m,top:a-t,fits:t<=u&&m<=f};break;case`top span-right`:case`block-start span-inline-end`:v={position:r,left:o,top:a-t,fits:t<=u&&m<=p};break;case`bottom span-left`:case`block-end span-inline-start`:v={position:r,left:o-m,top:a+s,fits:t<=d&&m<=f};break;case`bottom span-right`:case`block-end span-inline-end`:v={position:r,left:o,top:a+s,fits:t<=d&&m<=p};break;case`left span-top`:case`inline-start span-block-start`:v={position:r,left:o-n,top:a+s-t,fits:n<=f&&h<=u};break;case`left span-bottom`:case`inline-start span-block-end`:v={position:r,left:o-n,top:a,fits:n<=f&&h<=d};break;case`right span-top`:case`inline-end span-block-start`:v={position:r,left:o+c,top:a+s-t,fits:n<=p&&h<=u};break;case`right span-bottom`:case`inline-end span-block-end`:v={position:r,left:o+c,top:a,fits:n<=p&&h<=d}}if(v.fits)return v;y??=v}return y}_applyOverlayPosition(e,t,n){this._lastPosition=e,this._overlay.style.left=`${t}px`,this._overlay.style.top=`${n}px`}_readPositionsFromCss(){if(!this._usePolyfill)return;this._overlayStyles??=getComputedStyle(this._overlay);let e=[this._overlayStyles.getPropertyValue(`--sbb-overlay-position-area`)||`block-end`,...this._overlayStyles.getPropertyValue(`--sbb-overlay-position-try-fallbacks`).split(`,`).map(e=>e.trim()).filter(e=>!!e)];this._positions=e,this._lastPosition&&!this._positions.includes(this._lastPosition)&&(this._lastPosition=void 0)}};const hr=/* @__PURE__ */ new Set;var gr=class{constructor(e,t=hr){this._host=e,this._lockers=t,this._locked=!1,this._scrollProperties={scrollPosition:0,touchStartY:0},this._touchStart=e=>{this._scrollProperties.touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=this._findScrollableAncestor(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._scrollProperties.touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()},this._host.addController?.(this)}_isVerticallyScrollable(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}_findScrollableAncestor(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&this._isVerticallyScrollable(t))return t}return null}hostDisconnected(){this.enableScroll()}disableScroll(){if(this._locked)return;this._locked=!0;let e=this._lockers.size===0;if(this._lockers.add(this._host),!e)return;this._scrollProperties.scrollPosition=window.scrollY||document.documentElement.scrollTop,this._scrollProperties.savedPosition=document.body.style.position,this._scrollProperties.savedTop=document.body.style.top,this._scrollProperties.savedInsetInline=document.body.style.insetInline,this._scrollProperties.savedOverflow=document.body.style.overflow,this._scrollProperties.savedMinHeight=document.body.style.minHeight;let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollProperties.scrollPosition}px`,document.body.style.insetInline=`0 ${t}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${t}px`),document.body.style.minHeight=`100dvh`,document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){this._locked&&(this._locked=!1,this._lockers.delete(this._host),!(this._lockers.size>0)&&(document.body.style.position=this._scrollProperties.savedPosition||``,document.body.style.top=this._scrollProperties.savedTop||``,document.body.style.insetInline=this._scrollProperties.savedInsetInline||``,document.body.style.overflow=this._scrollProperties.savedOverflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.body.style.minHeight=this._scrollProperties.savedMinHeight||``,document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollProperties.scrollPosition)))}};const _r=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,vr=/([0-9]{2})([0-9]{2})([0-9]{4})/,yr=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,br=1,xr=2,Sr=3,Cr=4,wr=5,Tr=6,Er=0;var K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(yr);try{t=n?this.createDate(+n[1],+n[2],+n[3]):null}catch{}if(this.isValid(t))return t;let r=e.replace(/\D/g,` `).trim()?.match(_r)??e.match(vr);try{t=r?this.createDate(+r[3],+r[2],+r[1]):null}catch{}if(!r||r.index!==0||r.length<=2||r.some(e=>e===void 0)||!this.isValid(t))return null;let i=+r[3];if(typeof i==`number`&&i<100&&i>=0){let e=this.getYear(this.today())-2e3+this._cutoffYearOffset;i=i<=e?2e3+i:1900+i}return this.createDate(i,+r[2],+r[1])}format(e,t){if(!this.isValid(e))return``;let n=/* @__PURE__ */ new Date(this.toIso8601(e)+`T00:00:00`),r=new Intl.DateTimeFormat(`de-CH`,{day:`2-digit`,month:`2-digit`,year:`numeric`});if(t?.weekdayStyle===`none`)return r.format(n);let i=t?.weekdayStyle??`short`,a=this.getDayOfWeekNames(i)[this.getDayOfWeek(e)];return a=a.charAt(0).toUpperCase()+a.substring(1),i===`short`&&(a=a.substring(0,2)),`${a}, ${r.format(n)}`}toIso8601(e){let t=(e,t=2)=>`${e}`.padStart(t,`0`);return`${t(this.getYear(e),4)}-${t(this.getMonth(e))}-${t(this.getDate(e))}`}getValidDateOrNull(e){return this.isDateInstance(e)&&this.isValid(e)?e:null}getFirstWeekOffset(e){let t=this.createDate(this.getYear(e),this.getMonth(e),1);return(7+this.getDayOfWeek(t)-this.getFirstDayOfWeek())%7}compareDate(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)}sameDate(e,t){if(e&&t){let n=this.isValid(e),r=this.isValid(t);return n&&r?!this.compareDate(e,t):n==r}return e==t}clampDate(e,t,n){return t&&this.compareDate(e,t)<0?t:n&&this.compareDate(e,n)>0?n:e}};const Dr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Or=class extends K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date((/* @__PURE__ */ new Date()).setHours(0,0,0,0))}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);let r=this._createDateWithOverflow(e,t-1,n);if(r.getMonth()+1!==t)throw Error(`Invalid day "${n}" for month "${t}".`);return r}isDateInstance(e){return e instanceof Date}isValid(e){return!!e&&!isNaN(e.valueOf())}clone(e){return new Date(e.valueOf())}addCalendarYears(e,t){return this.addCalendarMonths(e,t*12)}addCalendarMonths(e,t){let n=e.getMonth()+t,r=new Date(e.getFullYear(),n,1,0,0,0,0),i=this.getNumDaysInMonth(r);return new Date(this.clone(e).setMonth(n,Math.min(i,e.getDate())))}addCalendarDays(e,t){let n=e.getDate()+t;return new Date(e.getFullYear(),e.getMonth(),n,0,0,0,0)}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Dr.test(e))return this.getValidDateOrNull(new Date(e.includes(`T`)?e:e+`T00:00:00`))}return super.deserialize(e)}invalid(){return/* @__PURE__ */ new Date(NaN)}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}_createDateWithOverflow(e,t,n){let r=new Date(e,t,n);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}};const q=new Or,kr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Ar=class extends K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(kr.test(e))return this.getValidDateOrNull(Temporal.PlainDate.from(e.split(`T`)[0]))}return super.deserialize(e)}invalid(){return null}toIso8601(e){return e.toJSON()}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}};const jr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{get(){let n=t.get.call(this);return e(this,n)}};throw Error(`Unsupported decorator location: ${r}`)},Mr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(r){let i=n.access.get(this);t.set.call(this,r);let a=n.access.get(this);a!==i&&e(this,a,i)}};throw Error(`Unsupported decorator location: ${r}`)},J=/* @__PURE__ */ new WeakMap,Y=/* @__PURE__ */ new WeakMap,Nr=()=>(e,t)=>{let{kind:n,metadata:i,name:a}=t;if(n===`accessor`){if(r)return{};let n=globalThis.litPropertyMetadata.get(i)?.get(a)?.attribute,o=typeof n==`string`?n:a;return t.addInitializer(function(){this.addController({host:this,rootNode:null,checkIdReference(e){let n=this.host.getAttribute(o)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)e.oldValue&&n.add(e.oldValue),e.target.id&&n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(t.id&&n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>{e.id&&n.add(e.id)}));e.forEach(e=>e.checkIdReference(n))});t.observe(this.rootNode,{attributeFilter:[`id`],attributeOldValue:!0,childList:!0,subtree:!0}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode))),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Pr={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;return n.isValid(e)?n.toIso8601(e):null}},Fr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ir(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function Lr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Rr(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function zr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Br(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&zr(t))return t}return null}var Vr=class{constructor(){this._scrollPosition=0,this._touchStartY=0,this._touchStart=e=>{this._touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=Br(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()}}disableScroll(){if(Z())return;this._scrollPosition=window.scrollY||document.documentElement.scrollTop,this._position=document.body.style.position,this._top=document.body.style.top,this._insetInline=document.body.style.insetInline,this._overflow=document.body.style.overflow;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollPosition}px`,document.body.style.insetInline=`0 ${e}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${e}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.position=this._position||``,document.body.style.top=this._top||``,document.body.style.insetInline=this._insetInline||``,document.body.style.overflow=this._overflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollPosition))}};function Hr(e){e.key===` `&&e.preventDefault()}function Ur(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Wr=e=>{class t extends e{constructor(){super(...arguments),this.isAnimating=!1,this._animationPromise=Promise.resolve()}get animationComplete(){return this._animationPromise}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){this.isAnimating||(this._animationPromise=this._enqueueAnimation())}stopAnimation(){}async _enqueueAnimation(){this.isAnimating=!0;let e=this.stopAnimation,t=new Promise(t=>{this.stopAnimation=()=>{e(),this.isAnimating=!1,t()}});try{await this._animationPromise}catch(e){Promise.reject(e)}return t}}return t},Gr=e=>(()=>{let n=V(H(L(e))),r=[],i;return class extends n{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;i=[l({type:Boolean,converter:{...t,fromAttribute:(e,n)=>({value:t.fromAttribute?.(e,n),attribute:!0})}})],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,r),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`checkbox`}set checked(e){let t=typeof e==`object`&&e.attribute;t&&(e=e.value),this.hasUpdated&&!t&&(this._attributeMutationBlocked=!0),this._checked=!!e,this.updateFormValue()}get checked(){return this._checked}get type(){return`checkbox`}constructor(){super(),this._attributeMutationBlocked=(s(this,r),!1),this._languageController=new z(this),this._checked=!1,this._handleKeyboardInteraction=e=>{e.key===` `&&this._handleUserInteraction()},this._handleUserInteraction=()=>{this.disabled||(this.withUserInteraction?.(),this.checked=!this.checked,this._attributeMutationBlocked=!0,this.dispatchEvent(new InputEvent(`input`,{composed:!0,bubbles:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},this.addEventListener?.(`click`,this._handleUserInteraction),this.addEventListener?.(`keydown`,Hr),this.addEventListener?.(`keyup`,this._handleKeyboardInteraction)}connectedCallback(){super.connectedCallback(),this.tabIndex=0}attributeChangedCallback(e,t,n){e===`checked`&&this._attributeMutationBlocked||super.attributeChangedCallback(e,t,n)}formResetCallback(){this.checked=this.hasAttribute(`checked`),this._attributeMutationBlocked=!1}formStateRestoreCallback(e,t){e&&(this.checked=e===`true`)}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}formState(){return`${this.checked}`}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){super.validate(),this.required&&!this.checked?this.setValidityFlag(`valueMissing`,fn[this._languageController.current]):this.removeValidityFlag(`valueMissing`)}}})(),Kr=e=>(()=>{let t=e,n=[],r;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l({type:Boolean,attribute:`readonly`})],o(this,null,r,{kind:`setter`,name:`readOnly`,static:!1,private:!1,access:{has:e=>`readOnly`in e,set:(e,t)=>{e.readOnly=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}set readOnly(e){this.#e=!!e,this.toggleAttribute(`readonly`,this.#e)}get readOnly(){return this.#e}#e=(s(this,n),!1)}})(),qr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Jr=e=>(()=>{let t=Kr(V(H(L(e)))),i=[],a,u,d;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;a=[l()],u=[l({attribute:!1})],d=[c({passive:!0})],o(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:e},null,i),o(this,null,u,{kind:`setter`,name:`placeholder`,static:!1,private:!1,access:{has:e=>`placeholder`in e,set:(e,t)=>{e.placeholder=t}},metadata:e},null,i),o(this,null,d,{kind:`method`,name:`_cleanChildren`,static:!1,private:!1,access:{has:e=>`_cleanChildren`in e,get:e=>e._cleanChildren},metadata:e},null,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`textbox`}static{this.formFieldAssociated=!0}get type(){return`text`}set value(e){this._value=this._cleanText(e),this.hasUpdated&&this._assignValue(this._value),this.dispatchEvent(new Event(`displayvaluechange`,{bubbles:!0,composed:!0}))}get value(){return this._value??``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this.internals.ariaPlaceholder=e||null}get placeholder(){return this.getAttribute(`placeholder`)??``}constructor(){super(),this._shouldEmitChange=(s(this,i),!1),this._shouldTriggerSubmit=!1,this.language=new z(this),this._value=``,this.addEventListener?.(`input`,()=>{let e=this._value;this._value=this._cleanText(this.textContent??``),this.requestUpdate(`value`,e),this.internals.states.add(`interacted`),this._shouldEmitChange=!0},{capture:!0}),this.addEventListener?.(`change`,()=>this._shouldEmitChange=!1,{capture:!0}),this.addEventListener?.(`keydown`,e=>{if(this._requiresEmptyPatch()&&this._assignValue(``),(e.key===`Enter`||e.key===`
43
+ `}}})();var Vn=class{get size(){return this._handlers.size}constructor(e,t){this._host=e,this._property=t,this._handlers=/* @__PURE__ */ new Set,this._hostDefinedPromise=null,r||(customElements.get(this._host.localName)?customElements.upgrade(this._host):this._hostDefinedPromise=customElements.whenDefined(this._host.localName).then(()=>{customElements.upgrade(this._host),this._hostDefinedPromise=null})),this._value=this._host[this._property]}addHandler(e){this._handlers.size||(this._host.addController?this._host.addController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.addController(this))),this._handlers.add(e),this._hostDefinedPromise?this._hostDefinedPromise.then(()=>e(this._host)):e(this._host)}removeHandler(e){this._handlers.delete(e),this._handlers.size||(this._host.removeController?this._host.removeController(this):this._hostDefinedPromise&&this._hostDefinedPromise.then(()=>this._host.removeController(this)))}hostUpdate(){let e=this._host[this._property];if(this._value!==e){this._value=e;for(let e of this._handlers)e(this._host)}}};const U=/* @__PURE__ */ new WeakMap;var Hn=class{constructor(e,t,n){this._host=e,this._referenceResolver=t,this._handlers=n,this._host.addController(this)}hostConnected(){this.connect()}hostDisconnected(){this._reference!==this._referenceResolver()&&this.disconnect()}connect(){let e=this._referenceResolver();if(this._reference===e||(this.disconnect(),this._reference=e,!this._reference))return;let t=U.get(this._reference);t||(t=/* @__PURE__ */ new Map,U.set(this._reference,t)),this._watchers=t;for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers.get(e);n||(n=new Vn(this._reference,e),this._watchers.set(e,n)),n.addHandler(t)}}disconnect(){if(this._reference){for(let[e,t]of Object.entries(this._handlers)){let n=this._watchers?.get(e);n&&(n.removeHandler(t),n.size||(this._watchers.delete(e),!this._watchers.size&&this._reference&&U.delete(this._reference)))}this._reference=null}}};const Un=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Un.at(-1)?.escapeStrategy())});var Wn=class{constructor(e,t=Un){this._host=e,this._overlayStack=t,this._host.addController?.(this)}hostDisconnected(){this.disconnect()}connect(){this.disconnect(),this._overlayStack.push(this._host)}disconnect(){if(this._overlayStack.length){let e=this._overlayStack.findIndex(e=>e===this._host);e!==-1&&this._overlayStack.splice(e,1)}}};const Gn=/* @__PURE__ */ new WeakMap;var Kn=class{constructor(e,t,n=Gn){this._host=e,this._idRef=t,this._observers=n,this._rootNode=null,this._host.addController(this)}hostConnected(){if(r)return;this._rootNode=this._host.getRootNode();let e=this._observers.get(this._rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)n.add(e.oldValue),n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>n.add(e.id)));for(let t of e){let e=t._host[t._idRef];e&&typeof e==`string`&&n.has(e)&&t._host.requestUpdate()}});t.observe(this._rootNode,{attributeFilter:[`id`],childList:!0,subtree:!0,attributeOldValue:!0}),this._observers.set(this._rootNode,{observer:t,controllers:e})}}hostDisconnected(){if(r||!this._rootNode)return;let e=this._observers.get(this._rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),this._observers.delete(this._rootNode))),this._rootNode=null}find(){if(r||!this._rootNode)return null;{let e=this._host[this._idRef];return typeof e==`string`?this._rootNode?.getElementById(e):null}}};const qn=[`script`,`head`,`template`,`style`,`link`],Jn=/* @__PURE__ */ new Set,Yn=/* @__PURE__ */ new Set,Xn=/* @__PURE__ */ new Set;var Zn=class{constructor(e,t=Jn,n=Xn,r=Yn){this._host=e,this._inertElements=t,this._inertOverlays=n,this._exemptedElements=r,this._host.addController?.(this)}hostConnected(){this._host.isOpen&&this.activate()}hostDisconnected(){this.isInert()&&this.deactivate()}activate(){this._inertOverlays.size&&this._removeAllInertAttributes(),this._inertOverlays.add(this._host),this._addAllInertAttributes()}deactivate(){this._currentOverlay()===this._host?(this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()):this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host)}isInert(){return this._inertOverlays.has(this._host)}exempt(e){this._inertElements.has(e)&&!this._exemptedElements.has(e)&&(this._removeInertAttributes(e),this._inertElements.delete(e),this._exemptedElements.add(e))}restoreAllExempted(){this._exemptedElements.forEach(e=>this._addInertAttributes(e)),this._exemptedElements.clear()}_currentOverlay(){return[...this._inertOverlays].pop()??null}_removeAllInertAttributes(){this._inertElements.forEach(e=>this._removeInertAttributes(e)),this._inertElements.clear()}_removeInertAttributes(e){e&&(e.hasAttribute(`data-sbb-inert`)&&(e.inert=!1,e.removeAttribute(`data-sbb-inert`)),e.hasAttribute(`data-sbb-aria-hidden`)&&(e.removeAttribute(`aria-hidden`),e.removeAttribute(`data-sbb-aria-hidden`)))}_addAllInertAttributes(){let e=this._currentOverlay(),t=e?[e]:[],n=[document.documentElement];for(;n.length>0;)for(let e of n.shift().querySelectorAll(`*`))e.matches(`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`)&&t.push(e),e.shadowRoot&&n.push(e.shadowRoot);let r=[],i=e=>r.push(...e.composedPath());for(let e of t)e.addEventListener(`ɵinert`,i,{once:!0}),e.dispatchEvent(new Event(`ɵinert`,{composed:!0}));let a=new Set(r),o=/* @__PURE__ */ new Set;for(let e of a)for(let t of e.parentNode?.childNodes??[])t.nodeType===Node.ELEMENT_NODE&&!qn.includes(t.localName)&&!a.has(t)&&o.add(t);for(let e of o)this._addInertAttributes(e)}_addInertAttributes(e){this._inertElements.add(e),e.inert||(e.inert=!0,e.toggleAttribute(`data-sbb-inert`,!0)),e.hasAttribute(`aria-hidden`)||(e.setAttribute(`aria-hidden`,`true`),e.toggleAttribute(`data-sbb-aria-hidden`,!0))}};const Qn=`(forced-colors: active)`,W=`(prefers-color-scheme: dark)`,$n=`(any-hover: hover)`,er=`(pointer: coarse)`,tr=`(min-width: 0rem)`,nr=`(min-width: 37.5rem)`,rr=`(min-width: 64rem)`,ir=`(min-width: 90rem)`,ar=`(max-width: 63.9375rem)`,or=`(max-width: 89.9375rem)`,G=/* @__PURE__ */ new Map;var sr=class{constructor(e,t){this._queries=t,e.addController(this)}matches(e){return r?null:matchMedia(e).matches}hostConnected(){if(!r)for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);if(n)n.handlers.add(t);else{let n=matchMedia(e),r=/* @__PURE__ */ new Set([t]),i=e=>r.forEach(t=>t(e.matches));n.addEventListener(`change`,i),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},cr=class e extends sr{static{this._currentMode=this._readLightDarkClass()}static{this._observer=r?null:new MutationObserver(t=>{if(t[0].oldValue!==document.documentElement.getAttribute(`class`)){let t=this._readLightDarkClass();this._currentMode!==t&&(e.requestUpdate(),this._currentMode=t)}})}static{this._observerConfig={attributeFilter:[`class`],attributeOldValue:!0}}constructor(e,t){let n=()=>{t(this.matches()),this._host.toggleState?.(`dark`,this.matches())};super(e,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const lr=!r&&CSS.supports(`anchor-name`,`--test`),ur=[`top`,`bottom`,`left`,`right`,`top span-left`,`top span-right`,`bottom span-left`,`bottom span-right`,`left span-top`,`left span-bottom`,`right span-top`,`right span-bottom`],dr=[`block-start`,`block-end`,`inline-start`,`inline-end`,`block-start span-inline-start`,`block-start span-inline-end`,`block-end span-inline-start`,`block-end span-inline-end`,`inline-start span-block-start`,`inline-start span-block-end`,`inline-end span-block-start`,`inline-end span-block-end`],fr={"block-start":`block-start`,"block-end":`block-end`,"inline-start":`inline-end`,"inline-end":`inline-start`,"block-start span-inline-start":`block-start span-inline-end`,"block-start span-inline-end":`block-start span-inline-start`,"block-end span-inline-start":`block-end span-inline-end`,"block-end span-inline-end":`block-end span-inline-start`,"inline-start span-block-start":`inline-end span-block-start`,"inline-start span-block-end":`inline-end span-block-end`,"inline-end span-block-start":`inline-start span-block-start`,"inline-end span-block-end":`inline-start span-block-end`};[...ur,...dr];let pr=0;var mr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!lr){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++pr}`,this._positions=[],e.addController(this),this._overlay=e}hostConnected(){this._usePolyfill?this._overlay.style.setProperty(`position-area`,`initial`):this._overlay.style.setProperty(`position-anchor`,this._anchorName)}hostUpdate(){r||this._readPositionsFromCss()}connect(e){r||(this._anchor&&this.disconnect(),this._anchor=e,this._usePolyfill||this._anchor.style.setProperty(`anchor-name`,this._anchorName),this._readPositionsFromCss(),this._calculatePosition(),this._abortController?.abort(),this._abortController=new AbortController,document.addEventListener(`scroll`,()=>this._requestCalculatePosition(),{capture:!0,passive:!0,signal:this._abortController.signal}),window.addEventListener(`resize`,()=>this._requestCalculatePosition(),{passive:!0,signal:this._abortController.signal}),this._resizeObserver.observe(e,{box:`border-box`}),this._resizeObserver.observe(this._overlay,{box:`border-box`}))}disconnect(){this._anchor?.style.removeProperty(`anchor-name`),this._anchor=void 0,this._abortController?.abort(),this._resizeObserver.disconnect()}_requestCalculatePosition(){this._frame??=requestAnimationFrame(()=>{this._calculatePosition(),this._frame=void 0})}_calculatePosition(){if(this._anchor){if(this._usePolyfill){let e=this._getOptimalPosition(this._positions);this._applyOverlayPosition(e.position,e.left,e.top)}this._overlay.setAttribute(`data-position`,this.currentPosition)}}_getOptimalPosition(e){let{offsetHeight:t,offsetWidth:n}=this._overlay,{innerHeight:r,innerWidth:i}=window,{top:a,left:o,height:s,width:c}=this._anchor.getBoundingClientRect(),l=this._overlay.matches(`:dir(rtl)`),u=a,d=r-s-a,f=o,p=i-c-o,m=n-c,h=t-s,g=m/2,_=h/2;this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-height`,`${s}px`),this._overlay.style.setProperty(`--sbb-overlay-controller-trigger-width`,`${c}px`);let v={left:0,top:0,position:``},y;for(let r of e){switch(l&&dr.includes(r)?fr[r]:r){default:case`bottom`:case`block-end`:v={position:r,left:o-g,top:a+s,fits:t<=d&&g<=f&&g<=p};break;case`top`:case`block-start`:v={position:r,left:o-g,top:a-t,fits:t<=u&&g<=f&&g<=p};break;case`right`:case`inline-end`:v={position:r,left:o+c,top:a-_,fits:n<=p&&_<=u&&_<=d};break;case`left`:case`inline-start`:v={position:r,left:o-n,top:a-_,fits:n<=f&&_<=u&&_<=d};break;case`top span-left`:case`block-start span-inline-start`:v={position:r,left:o-m,top:a-t,fits:t<=u&&m<=f};break;case`top span-right`:case`block-start span-inline-end`:v={position:r,left:o,top:a-t,fits:t<=u&&m<=p};break;case`bottom span-left`:case`block-end span-inline-start`:v={position:r,left:o-m,top:a+s,fits:t<=d&&m<=f};break;case`bottom span-right`:case`block-end span-inline-end`:v={position:r,left:o,top:a+s,fits:t<=d&&m<=p};break;case`left span-top`:case`inline-start span-block-start`:v={position:r,left:o-n,top:a+s-t,fits:n<=f&&h<=u};break;case`left span-bottom`:case`inline-start span-block-end`:v={position:r,left:o-n,top:a,fits:n<=f&&h<=d};break;case`right span-top`:case`inline-end span-block-start`:v={position:r,left:o+c,top:a+s-t,fits:n<=p&&h<=u};break;case`right span-bottom`:case`inline-end span-block-end`:v={position:r,left:o+c,top:a,fits:n<=p&&h<=d}}if(v.fits)return v;y??=v}return y}_applyOverlayPosition(e,t,n){this._lastPosition=e,this._overlay.style.left=`${t}px`,this._overlay.style.top=`${n}px`}_readPositionsFromCss(){if(!this._usePolyfill)return;this._overlayStyles??=getComputedStyle(this._overlay);let e=[this._overlayStyles.getPropertyValue(`--sbb-overlay-position-area`)||`block-end`,...this._overlayStyles.getPropertyValue(`--sbb-overlay-position-try-fallbacks`).split(`,`).map(e=>e.trim()).filter(e=>!!e)];this._positions=e,this._lastPosition&&!this._positions.includes(this._lastPosition)&&(this._lastPosition=void 0)}};const hr=/* @__PURE__ */ new Set;var gr=class{constructor(e,t=hr){this._host=e,this._lockers=t,this._locked=!1,this._scrollProperties={scrollPosition:0,touchStartY:0},this._touchStart=e=>{this._scrollProperties.touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=this._findScrollableAncestor(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._scrollProperties.touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()},this._host.addController?.(this)}_isVerticallyScrollable(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}_findScrollableAncestor(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&this._isVerticallyScrollable(t))return t}return null}hostDisconnected(){this.enableScroll()}disableScroll(){if(this._locked)return;this._locked=!0;let e=this._lockers.size===0;if(this._lockers.add(this._host),!e)return;this._scrollProperties.scrollPosition=window.scrollY||document.documentElement.scrollTop,this._scrollProperties.savedPosition=document.body.style.position,this._scrollProperties.savedTop=document.body.style.top,this._scrollProperties.savedInsetInline=document.body.style.insetInline,this._scrollProperties.savedOverflow=document.body.style.overflow,this._scrollProperties.savedMinHeight=document.body.style.minHeight;let t=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollProperties.scrollPosition}px`,document.body.style.insetInline=`0 ${t}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${t}px`),document.body.style.minHeight=`100dvh`,document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){this._locked&&(this._locked=!1,this._lockers.delete(this._host),this._lockers.size>0||(document.body.style.position=this._scrollProperties.savedPosition||``,document.body.style.top=this._scrollProperties.savedTop||``,document.body.style.insetInline=this._scrollProperties.savedInsetInline||``,document.body.style.overflow=this._scrollProperties.savedOverflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.body.style.minHeight=this._scrollProperties.savedMinHeight||``,document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollProperties.scrollPosition)))}};const _r=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,vr=/([0-9]{2})([0-9]{2})([0-9]{4})/,yr=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,br=1,xr=2,Sr=3,Cr=4,wr=5,Tr=6,Er=0;var K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(yr);try{t=n?this.createDate(+n[1],+n[2],+n[3]):null}catch{}if(this.isValid(t))return t;let r=e.replace(/\D/g,` `).trim()?.match(_r)??e.match(vr);try{t=r?this.createDate(+r[3],+r[2],+r[1]):null}catch{}if(!r||r.index!==0||r.length<=2||r.some(e=>e===void 0)||!this.isValid(t))return null;let i=+r[3];if(typeof i==`number`&&i<100&&i>=0){let e=this.getYear(this.today())-2e3+this._cutoffYearOffset;i=i<=e?2e3+i:1900+i}return this.createDate(i,+r[2],+r[1])}format(e,t){if(!this.isValid(e))return``;let n=/* @__PURE__ */ new Date(this.toIso8601(e)+`T00:00:00`),r=new Intl.DateTimeFormat(`de-CH`,{day:`2-digit`,month:`2-digit`,year:`numeric`});if(t?.weekdayStyle===`none`)return r.format(n);let i=t?.weekdayStyle??`short`,a=this.getDayOfWeekNames(i)[this.getDayOfWeek(e)];return a=a.charAt(0).toUpperCase()+a.substring(1),i===`short`&&(a=a.substring(0,2)),`${a}, ${r.format(n)}`}toIso8601(e){let t=(e,t=2)=>`${e}`.padStart(t,`0`);return`${t(this.getYear(e),4)}-${t(this.getMonth(e))}-${t(this.getDate(e))}`}getValidDateOrNull(e){return this.isDateInstance(e)&&this.isValid(e)?e:null}getFirstWeekOffset(e){let t=this.createDate(this.getYear(e),this.getMonth(e),1);return(7+this.getDayOfWeek(t)-this.getFirstDayOfWeek())%7}compareDate(e,t){return this.getYear(e)-this.getYear(t)||this.getMonth(e)-this.getMonth(t)||this.getDate(e)-this.getDate(t)}sameDate(e,t){if(e&&t){let n=this.isValid(e),r=this.isValid(t);return n&&r?!this.compareDate(e,t):n==r}return e==t}clampDate(e,t,n){return t&&this.compareDate(e,t)<0?t:n&&this.compareDate(e,n)>0?n:e}};const Dr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Or=class extends K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date((/* @__PURE__ */ new Date()).setHours(0,0,0,0))}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);let r=this._createDateWithOverflow(e,t-1,n);if(r.getMonth()+1!==t)throw Error(`Invalid day "${n}" for month "${t}".`);return r}isDateInstance(e){return e instanceof Date}isValid(e){return!!e&&!isNaN(e.valueOf())}clone(e){return new Date(e.valueOf())}addCalendarYears(e,t){return this.addCalendarMonths(e,t*12)}addCalendarMonths(e,t){let n=e.getMonth()+t,r=new Date(e.getFullYear(),n,1,0,0,0,0),i=this.getNumDaysInMonth(r);return new Date(this.clone(e).setMonth(n,Math.min(i,e.getDate())))}addCalendarDays(e,t){let n=e.getDate()+t;return new Date(e.getFullYear(),e.getMonth(),n,0,0,0,0)}deserialize(e){if(typeof e==`string`){if(!e)return null;if(Dr.test(e))return this.getValidDateOrNull(new Date(e.includes(`T`)?e:e+`T00:00:00`))}return super.deserialize(e)}invalid(){return/* @__PURE__ */ new Date(NaN)}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}_createDateWithOverflow(e,t,n){let r=new Date(e,t,n);return e>=0&&e<100&&r.setFullYear(this.getYear(r)-1900),r}};const q=new Or,kr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Ar=class extends K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(kr.test(e))return this.getValidDateOrNull(Temporal.PlainDate.from(e.split(`T`)[0]))}return super.deserialize(e)}invalid(){return null}toIso8601(e){return e.toJSON()}_range(e,t){return Array.from({length:e},(e,n)=>t(n))}};const jr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{get(){let n=t.get.call(this);return e(this,n)}};throw Error(`Unsupported decorator location: ${r}`)},Mr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(r){let i=n.access.get(this);t.set.call(this,r);let a=n.access.get(this);a!==i&&e(this,a,i)}};throw Error(`Unsupported decorator location: ${r}`)},J=/* @__PURE__ */ new WeakMap,Y=/* @__PURE__ */ new WeakMap,Nr=()=>(e,t)=>{let{kind:n,metadata:i,name:a}=t;if(n===`accessor`){if(r)return{};let n=globalThis.litPropertyMetadata.get(i)?.get(a)?.attribute,o=typeof n==`string`?n:a;return t.addInitializer(function(){this.addController({host:this,rootNode:null,checkIdReference(e){let n=this.host.getAttribute(o)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=/* @__PURE__ */ new Set([this]),t=new MutationObserver(t=>{let n=/* @__PURE__ */ new Set;for(let e of t)if(e.type===`attributes`)e.oldValue&&n.add(e.oldValue),e.target.id&&n.add(e.target.id);else if(e.type===`childList`)for(let t of[...e.addedNodes,...e.removedNodes])t instanceof HTMLElement&&(t.id&&n.add(t.id),t.querySelectorAll(`[id]`).forEach(e=>{e.id&&n.add(e.id)}));e.forEach(e=>e.checkIdReference(n))});t.observe(this.rootNode,{attributeFilter:[`id`],attributeOldValue:!0,childList:!0,subtree:!0}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);e&&(e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode))),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Pr={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;return n.isValid(e)?n.toIso8601(e):null}},Fr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ir(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function Lr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Rr(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function zr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Br(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&zr(t))return t}return null}var Vr=class{constructor(){this._scrollPosition=0,this._touchStartY=0,this._touchStart=e=>{this._touchStartY=e.touches[0]?.clientY??0},this._touchMove=e=>{let t=e.touches[0];if(!t)return;let n=Br(e.composedPath());if(!n){e.preventDefault();return}let r=t.clientY-this._touchStartY,i=n.scrollTop<=0,a=n.scrollTop+n.clientHeight>=n.scrollHeight;(i&&r>0||a&&r<0)&&e.preventDefault()}}disableScroll(){if(Z())return;this._scrollPosition=window.scrollY||document.documentElement.scrollTop,this._position=document.body.style.position,this._top=document.body.style.top,this._insetInline=document.body.style.insetInline,this._overflow=document.body.style.overflow;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.position=`fixed`,document.body.style.top=`-${this._scrollPosition}px`,document.body.style.insetInline=`0 ${e}px`,document.body.style.overflow=`hidden`,document.body.style.setProperty(`--sbb-scrollbar-reserved-space`,`${e}px`),document.addEventListener(`touchstart`,this._touchStart,{passive:!0}),document.addEventListener(`touchmove`,this._touchMove,{passive:!1}),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.position=this._position||``,document.body.style.top=this._top||``,document.body.style.insetInline=this._insetInline||``,document.body.style.overflow=this._overflow||``,document.body.style.removeProperty(`--sbb-scrollbar-reserved-space`),document.removeEventListener(`touchstart`,this._touchStart),document.removeEventListener(`touchmove`,this._touchMove),document.body.removeAttribute(`data-sbb-scroll-disabled`),window.scrollTo(0,this._scrollPosition))}};function Hr(e){e.key===` `&&e.preventDefault()}function Ur(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Wr=e=>{class t extends e{constructor(){super(...arguments),this.isAnimating=!1,this._animationPromise=Promise.resolve()}get animationComplete(){return this._animationPromise}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){this.isAnimating||(this._animationPromise=this._enqueueAnimation())}stopAnimation(){}async _enqueueAnimation(){this.isAnimating=!0;let e=this.stopAnimation,t=new Promise(t=>{this.stopAnimation=()=>{e(),this.isAnimating=!1,t()}});try{await this._animationPromise}catch(e){Promise.reject(e)}return t}}return t},Gr=e=>(()=>{let n=V(H(L(e))),r=[],i;return class extends n{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;i=[l({type:Boolean,converter:{...t,fromAttribute:(e,n)=>({value:t.fromAttribute?.(e,n),attribute:!0})}})],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,r),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`checkbox`}set checked(e){let t=typeof e==`object`&&e.attribute;t&&(e=e.value),this.hasUpdated&&!t&&(this._attributeMutationBlocked=!0),this._checked=!!e,this.updateFormValue()}get checked(){return this._checked}get type(){return`checkbox`}constructor(){super(),this._attributeMutationBlocked=(s(this,r),!1),this._languageController=new z(this),this._checked=!1,this._handleKeyboardInteraction=e=>{e.key===` `&&this._handleUserInteraction()},this._handleUserInteraction=()=>{this.disabled||(this.withUserInteraction?.(),this.checked=!this.checked,this._attributeMutationBlocked=!0,this.dispatchEvent(new InputEvent(`input`,{composed:!0,bubbles:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0})))},this.addEventListener?.(`click`,this._handleUserInteraction),this.addEventListener?.(`keydown`,Hr),this.addEventListener?.(`keyup`,this._handleKeyboardInteraction)}connectedCallback(){super.connectedCallback(),this.tabIndex=0}attributeChangedCallback(e,t,n){e===`checked`&&this._attributeMutationBlocked||super.attributeChangedCallback(e,t,n)}formResetCallback(){this.checked=this.hasAttribute(`checked`),this._attributeMutationBlocked=!1}formStateRestoreCallback(e,t){e&&(this.checked=e===`true`)}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}formState(){return`${this.checked}`}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){super.validate(),this.required&&!this.checked?this.setValidityFlag(`valueMissing`,fn[this._languageController.current]):this.removeValidityFlag(`valueMissing`)}}})(),Kr=e=>(()=>{let t=e,n=[],r;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l({type:Boolean,attribute:`readonly`})],o(this,null,r,{kind:`setter`,name:`readOnly`,static:!1,private:!1,access:{has:e=>`readOnly`in e,set:(e,t)=>{e.readOnly=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}set readOnly(e){this.#e=!!e,this.toggleAttribute(`readonly`,this.#e)}get readOnly(){return this.#e}#e=(s(this,n),!1)}})(),qr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Jr=e=>(()=>{let t=Kr(V(H(L(e)))),i=[],a,u,d;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;a=[l()],u=[l({attribute:!1})],d=[c({passive:!0})],o(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:e},null,i),o(this,null,u,{kind:`setter`,name:`placeholder`,static:!1,private:!1,access:{has:e=>`placeholder`in e,set:(e,t)=>{e.placeholder=t}},metadata:e},null,i),o(this,null,d,{kind:`method`,name:`_cleanChildren`,static:!1,private:!1,access:{has:e=>`_cleanChildren`in e,get:e=>e._cleanChildren},metadata:e},null,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`textbox`}static{this.formFieldAssociated=!0}get type(){return`text`}set value(e){this._value=this._cleanText(e),this.hasUpdated&&this._assignValue(this._value),this.dispatchEvent(new Event(`displayvaluechange`,{bubbles:!0,composed:!0}))}get value(){return this._value??``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this.internals.ariaPlaceholder=e||null}get placeholder(){return this.getAttribute(`placeholder`)??``}constructor(){super(),this._shouldEmitChange=(s(this,i),!1),this._shouldTriggerSubmit=!1,this.language=new z(this),this._value=``,this.addEventListener?.(`input`,()=>{let e=this._value;this._value=this._cleanText(this.textContent??``),this.requestUpdate(`value`,e),this.internals.states.add(`interacted`),this._shouldEmitChange=!0},{capture:!0}),this.addEventListener?.(`change`,()=>this._shouldEmitChange=!1,{capture:!0}),this.addEventListener?.(`keydown`,e=>{if(this._requiresEmptyPatch()&&this._assignValue(``),(e.key===`Enter`||e.key===`
44
44
  `)&&e.isTrusted)e.preventDefault(),e.stopImmediatePropagation(),this._shouldTriggerSubmit=this.dispatchEvent(new KeyboardEvent(`keydown`,e));else if(A&&this.value&&(e.key===`Backspace`||e.key===`Delete`)&&e.isTrusted){if(e.preventDefault(),e.stopImmediatePropagation(),!this.dispatchEvent(new KeyboardEvent(`keydown`,e)))return;let t=window.getSelection()?.getRangeAt(0);if(!t)return;t.startOffset===t.endOffset?e.key===`Backspace`&&t.startOffset>0?(t.setStart(t.startContainer,t.startOffset-1),t.deleteContents(),this._dispatchInputEvent()):e.key===`Delete`&&t.endOffset<this.value.length&&(t.setEnd(t.endContainer,t.endOffset+1),t.deleteContents(),this._dispatchInputEvent()):(t.deleteContents(),this._dispatchInputEvent())}},{capture:!0}),this.addEventListener?.(`keyup`,e=>{e.key===`Enter`||e.key===`
45
45
  `?(this._emitChangeIfNecessary(),this._shouldTriggerSubmit&&(this._shouldTriggerSubmit=!1,this.form?.requestSubmit())):this._requiresEmptyPatch()&&this._setCursorAt(0)},{capture:!0}),this.addEventListener?.(`paste`,e=>{e.preventDefault(),this._requiresEmptyPatch()&&this._assignValue(``);let t=this._cleanText(e.clipboardData?.getData(`text/plain`)??``),n=window.getSelection()?.getRangeAt(0);n&&t&&(n.deleteContents(),n.insertNode(document.createTextNode(this.preparePastedText(t))),n.setStart(n.endContainer,n.endOffset),this._dispatchInputEvent())}),this.addEventListener?.(`focus`,()=>{T.mostRecentModality===`keyboard`&&window.getSelection()?.selectAllChildren(this)}),this.addEventListener?.(`touchend`,()=>{this._requiresEmptyPatch()&&(this._assignValue(`&nbsp;`),this._setCursorAt(0))}),this.addEventListener?.(`click`,()=>{this._requiresEmptyPatch()&&T.mostRecentModality===`touch`&&this._setCursorAt(0)}),this.addEventListener?.(`blur`,()=>{window.getSelection()?.removeAllRanges(),this.value===``&&this._assignValue(``),this._emitChangeIfNecessary(),this.scrollLeft=0},{capture:!0})}isDisabledExternally(){return this.formDisabled}connectedCallback(){super.connectedCallback(),this.internals.ariaMultiLine=`false`,this._updateContenteditable(),this._assignValue(this.value)}focus(e){if(super.focus(e),this._canSelect()){let e=window.getSelection();if(!e)return;let t=e.rangeCount>0?e.getRangeAt(0):null;if(t&&t.startOffset!==0)return;this._setCursorAt(this.textContent.length)}}attributeChangedCallback(e,t,n){e===`value`&&this.matches?.(`:is(:state(interacted),[state--interacted])`)||super.attributeChangedCallback(e,t,n)}formResetCallback(){this.internals.states.delete(`interacted`),this.value=this.getAttribute(`value`)??``}formStateRestoreCallback(e,t){e&&typeof e==`string`&&(this.value=e)}select(){window.getSelection()?.selectAllChildren(this)}firstUpdated(e){super.firstUpdated(e),this.value&&!this.innerHTML.length&&this._assignValue(this.value)}requestUpdate(e,t,n){super.requestUpdate(e,t,n),this.isConnected&&(e===`disabled`||e===`formDisabled`||e===`readOnly`)&&this._updateContenteditable()}shouldValidate(e){return super.shouldValidate(e)||e===`value`||e===`required`}validate(){super.validate(),this.required&&!this.value?this.setValidityFlag(`valueMissing`,hn[this.language.current]):this.removeValidityFlag(`valueMissing`)}isSelected(){if(r)return!1;let e=window.getSelection();return!!e&&e.rangeCount>0&&this.contains(e.anchorNode)}preparePastedText(e){return e}_requiresEmptyPatch(){return!r&&k&&this.value===``&&window.matchMedia(`(pointer: coarse)`).matches}_assignValue(e){this.innerHTML=e}_setCursorAt(e){let t=window.getSelection();if(!this.firstChild||!t)return;let n=document.createRange();n.setStart(this.firstChild,e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}_cleanText(e){return e===null?``:`${e}`.replace(/[\n\r]+/g,``)}_dispatchInputEvent(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}_cleanChildren(){if(this.childElementCount)for(let e of this.children)e.remove()}_updateContenteditable(){if(!r&&this.isConnected){this.internals.ariaReadOnly=this.readOnly?`true`:null,this.internals.ariaDisabled=this.disabled?`true`:null;let e=this.disabled||this.readOnly?`false`:qr?`plaintext-only`:`true`;this.setAttribute(`contenteditable`,e),this.readOnly?this.setAttribute(`tabindex`,`0`):this.removeAttribute(`tabindex`)}}_emitChangeIfNecessary(){this._shouldEmitChange&&(this._shouldEmitChange=!1,this.dispatchEvent(new Event(`change`,{bubbles:!0})))}_canSelect(){return!r&&!this.disabled&&!this.readOnly&&!!this.value}render(){return n`<slot @slotchange=${this._cleanChildren}></slot>`}}})(),Q=/* @__PURE__ */ new WeakMap,Yr=e=>(()=>{let t=V(H(L(e))),n=[],i,a;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;i=[l({type:Boolean})],a=[l()],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,n),o(this,null,a,{kind:`setter`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,set:(e,t)=>{e.name=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`radio`}set checked(e){this._checked=!!e,this.toggleState(`checked`,this.checked),this.internals.ariaChecked=this.checked.toString(),this.updateFormValue(),this._synchronizeGroupState()}get checked(){return this._checked}set name(e){let t=this.name;e!==t&&(super.name=e,this._disconnectFromRegistry(t),this._connectToRegistry(),this._synchronizeGroupState())}get name(){return super.name}get type(){return`radio`}constructor(){super(),this._checked=(s(this,n),!1),this._languageController=new z(this),this.addEventListener?.(`keydown`,e=>this._handleArrowKeyDown(e))}connectedCallback(){super.connectedCallback(),this._connectToRegistry(),this._synchronizeGroupState()}disconnectedCallback(){super.disconnectedCallback(),this._disconnectFromRegistry(this.name)}formResetCallback(){this.checked=this.hasAttribute(`checked`)}formStateRestoreCallback(e,t){typeof e==`string`||e==null?this.checked=e===this.value:e instanceof FormData&&this._readFormData(e).then(e=>{this.checked=e===this.value})}async _readFormData(e){let t=e.get(this.name);return t instanceof Blob?JSON.parse(await t.text()):t}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.updateFocusableRadios()}firstUpdated(e){super.firstUpdated(e),this.updateFocusableRadios()}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){if(super.validate(),!this.associatedRadioButtons)return;let e=!1,t=!1;for(let n of this.associatedRadioButtons)e||=n.required,t||=n.checked;e&&!t?this.associatedRadioButtons.forEach(e=>e.setValidityFlag(`valueMissing`,pn[this._languageController.current])):this.associatedRadioButtons.forEach(e=>e.removeValidityFlag(`valueMissing`))}updateFocusableRadios(){if(!this.hasUpdated)return;let e=this._interactableGroupedRadios(),t=e.findIndex(e=>e.checked&&!e.disabled&&!e.formDisabled),n=t===-1?e.findIndex(e=>!e.disabled&&!e.formDisabled):t;n!==-1&&(e[n].tabIndex=0,e.splice(n,1)),e.forEach(e=>e.removeAttribute(`tabindex`))}async navigateByKeyboard(e){e.checked=!0,this.emitChangeEvents(),await e.updateComplete,e.focus()}emitChangeEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_synchronizeGroupState(){this.checked&&this._deselectGroupedRadios(),this.updateFocusableRadios()}_connectToRegistry(){if(!this.name||r)return;let e=this.form??this.getRootNode();this._radioButtonGroupsMap=Q.get(e),this._radioButtonGroupsMap||(this._radioButtonGroupsMap=/* @__PURE__ */ new Map,Q.set(e,this._radioButtonGroupsMap)),this.associatedRadioButtons=this._radioButtonGroupsMap.get(this.name),this.associatedRadioButtons||(this.associatedRadioButtons=/* @__PURE__ */ new Set,this._radioButtonGroupsMap.set(this.name,this.associatedRadioButtons));let t=Array.from(this.associatedRadioButtons);this.associatedRadioButtons.clear();let n=t.findIndex(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING);n===-1?t.push(this):t.splice(n,0,this),t.forEach(e=>this.associatedRadioButtons.add(e)),this.validate()}_disconnectFromRegistry(e){this.associatedRadioButtons?.delete(this),this.associatedRadioButtons?.size===0?this._radioButtonGroupsMap?.delete(e):this.validate(),this.associatedRadioButtons=void 0,this._radioButtonGroupsMap=void 0}_interactableGroupedRadios(){return Array.from(this.associatedRadioButtons??[]).filter(e=>M.isVisible(e))}_deselectGroupedRadios(){Array.from(this.associatedRadioButtons??[]).filter(e=>e!==this).forEach(e=>e.checked=!1)}async _handleArrowKeyDown(e){if(!p(e))return;e.preventDefault();let t=this._interactableGroupedRadios().filter(e=>!e.disabled&&!e.formDisabled),n=y(e,t.indexOf(this),t.length);await this.navigateByKeyboard(t[n])}}})();var Xr=`:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-width:var(--sbb-spacing-fixed-3x);--sbb-scrollbar-thumb-width:.125rem;--sbb-scrollbar-thumb-width-hover:.25rem;--sbb-scrollbar-width-firefox:thin;--sbb-scrollbar-color:light-dark(color-mix(in srgb, var(--sbb-color-black) 30%, transparent),color-mix(in srgb, var(--sbb-color-white) 30%, transparent));--sbb-scrollbar-color-hover:light-dark(color-mix(in srgb, var(--sbb-color-black) 60%, transparent),color-mix(in srgb, var(--sbb-color-white) 60%, transparent));--sbb-scrollbar-track-color:transparent}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color,transparent)}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color,transparent)}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color,currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover,currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-button,:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible)::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){:is(.sbb-scrollbar,.sbb-scrollbar-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-negative,.sbb-scrollbar-track-visible,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color,currentcolor) var(--sbb-scrollbar-track-color,transparent)}}:is(.sbb-scrollbar-negative,.sbb-scrollbar-thick-negative,.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-color:color-mix(in srgb, var(--sbb-color-white) 30%, transparent);--sbb-scrollbar-color-hover:color-mix(in srgb, var(--sbb-color-white) 60%, transparent)}:is(.sbb-scrollbar-thick-negative,.sbb-scrollbar-thick,.sbb-scrollbar-thick-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-thumb-width:.5rem;--sbb-scrollbar-thumb-width-hover:var(--sbb-scrollbar-thumb-width);--sbb-scrollbar-width-firefox:auto}:is(.sbb-scrollbar-track-visible,.sbb-scrollbar-thick-track-visible){--sbb-scrollbar-track-color:var(--sbb-background-color-4)}:is(.sbb-scrollbar-negative-track-visible,.sbb-scrollbar-thick-negative-track-visible){--sbb-scrollbar-track-color:var(--sbb-background-color-4-negative)}
46
46
  `,Zr=`button{appearance:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent;color:inherit;background:0 0;border:none;border-radius:0;outline:none;margin:0;padding:0}
@@ -22,6 +22,7 @@ export declare class SbbAutocompleteButtonElement extends SbbAutocompleteButtonE
22
22
  */
23
23
  setActive(value: boolean): void;
24
24
  protected willUpdate(changedProperties: PropertyValues<this>): void;
25
+ connectedCallback(): void;
25
26
  protected isDisabledExternally(): boolean;
26
27
  private _updateInternals;
27
28
  protected renderTemplate(): TemplateResult;
@@ -3,7 +3,7 @@ import { ResizeController } from "@lit-labs/observers/resize-controller.js";
3
3
  import { html, isServer, nothing, unsafeCSS } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
  import { ref } from "lit/directives/ref.js";
6
- import { SbbActionBaseElement, SbbDisabledMixin, SbbElement, SbbEscapableOverlayController, SbbNegativeMixin, SbbOpenCloseBaseElement, SbbPropertyWatcherController, forceType, getNextElementIndex, idReference, isEventOnElement, isSafari, isZeroAnimationDuration, popoverResetStyles, removeAriaComboBoxAttributes, scrollbarStyles, setAriaComboBoxAttributes, setOverlayPosition } from "./core.js";
6
+ import { SbbActionBaseElement, SbbDisabledMixin, SbbElement, SbbEscapableOverlayController, SbbNegativeMixin, SbbOpenCloseBaseElement, SbbPropertyWatcherController, forceType, getNextElementIndex, idReference, isAndroid, isEventOnElement, isSafari, isZeroAnimationDuration, popoverResetStyles, removeAriaComboBoxAttributes, scrollbarStyles, setAriaComboBoxAttributes, setOverlayPosition } from "./core.js";
7
7
  import { optionPanelStyles } from "./option.pure.js";
8
8
  import { miniButtonStyle } from "./button.pure.js";
9
9
  import { SbbIconNameMixin } from "./icon.pure.js";
@@ -738,6 +738,10 @@ var SbbAutocompleteButtonElement = class extends SbbDisabledMixin(SbbNegativeMix
738
738
  super.willUpdate(changedProperties);
739
739
  if (changedProperties.has("disabled")) this._updateInternals();
740
740
  }
741
+ connectedCallback() {
742
+ super.connectedCallback();
743
+ if (isAndroid) this.tabIndex = -1;
744
+ }
741
745
  isDisabledExternally() {
742
746
  return this.optgroup?.disabled ?? false;
743
747
  }
@@ -513,7 +513,7 @@ let SbbOptionBaseElement = (() => {
513
513
  super.requestUpdate(name, oldValue, options);
514
514
  if (name === "disabled" || name === "disabledFromGroup") {
515
515
  this.toggleState("disabled", this.disabled || this.disabledFromGroup);
516
- if (!this.closest?.("sbb-select")) setOrRemoveAttribute(this, "tabindex", isAndroid && !this.disabled && !this.disabledFromGroup ? 0 : null);
516
+ if (!this.closest?.("sbb-select")) setOrRemoveAttribute(this, "tabindex", isAndroid && !this.disabled && !this.disabledFromGroup ? -1 : null);
517
517
  this.updateAriaDisabled();
518
518
  }
519
519
  }
package/option.pure.js CHANGED
@@ -14,7 +14,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,not
14
14
  <slot></slot>
15
15
  </span>
16
16
  `}};const E=i(`:host{--sbb-options-panel-position-x:0;--sbb-options-panel-position-y:0;--sbb-options-pointer-events:all;--_sbb-options-panel-max-height:min(var(--sbb-options-panel-max-height-calculated), var(--sbb-options-panel-max-height,100000em));--sbb-options-panel-min-height:1em;--sbb-options-panel-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));--sbb-options-panel-internal-z-index:var(--sbb-select-z-index,var(--sbb-overlay-default-z-index));font-weight:400}:host([negative]){--sbb-options-panel-box-shadow:var(--sbb-box-shadow-level-9-hard-negative);--sbb-options-panel-background-color:var(--sbb-background-color-2-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}:host(:not(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))),:host(:is(:state(state-closed),[state--state-closed])){--sbb-options-panel-visibility:hidden;--sbb-options-pointer-events:none}:host(:is(:state(state-opening),[state--state-opening])){--sbb-options-panel-animation-name:open}:host(:is(:state(state-closing),[state--state-closing])){--sbb-options-panel-animation-name:close}:host(:is(:state(options-panel-position-below),[state--options-panel-position-below])){--sbb-options-panel-animation-translate:var(--sbb-spacing-fixed-2x)}:host(:is(:state(options-panel-position-above),[state--options-panel-position-above])){--sbb-options-panel-animation-translate:calc(-1 * var(--sbb-spacing-fixed-2x));--_sbb-options-panel-offset:calc(-1 * var(--sbb-options-panel-offset))}:host([preserve-icon-space]){--sbb-option-icon-container-display:block}::slotted(sbb-divider){margin-block:var(--sbb-options-panel-divider-margin-block)}.sbb-option-panel__overlay-container{pointer-events:none;z-index:var(--sbb-options-panel-internal-z-index);position:fixed;inset:0}.sbb-option-panel__overlay-container:after{content:"";top:var(--sbb-options-panel-origin-position-y);left:var(--sbb-options-panel-origin-position-x);width:var(--sbb-options-panel-width);height:var(--sbb-options-panel-origin-height);border-radius:var(--sbb-options-panel-border-radius);transition:box-shadow var(--sbb-options-panel-animation-duration) var(--sbb-options-panel-animation-timing-function);background-color:#0000;display:block;position:absolute}:host(:is(:is(:state(state-opened),[state--state-opened]),:is(:state(state-opening),[state--state-opening])):is(:state(option-panel-origin-borderless),[state--option-panel-origin-borderless])) .sbb-option-panel__overlay-container:after{box-shadow:var(--sbb-options-panel-box-shadow)}.sbb-option-panel__overlay{visibility:var(--sbb-options-panel-visibility,visible);border-radius:var(--sbb-options-panel-border-radius);top:var(--sbb-options-panel-position-y);left:var(--sbb-options-panel-position-x);width:var(--sbb-options-panel-width,fit-content);transition:box-shadow var(--sbb-options-panel-animation-duration) var(--sbb-options-panel-animation-timing-function);box-shadow:var(--sbb-options-panel-box-shadow);background-color:var(--sbb-options-panel-background-color);padding-block:var(--sbb-options-panel-padding-block);max-height:var(--_sbb-options-panel-max-height);min-height:var(--sbb-options-panel-min-height);pointer-events:var(--sbb-options-pointer-events);animation-name:var(--sbb-options-panel-animation-name);animation-duration:var(--sbb-options-panel-animation-duration);animation-timing-function:var(--sbb-options-panel-animation-timing-function);border:none;margin-block-start:var(--_sbb-options-panel-offset,var(--sbb-options-panel-offset));padding-inline:0;display:block;position:absolute;overflow:hidden auto}@media (forced-colors:active){.sbb-option-panel__overlay{border:var(--sbb-border-width-1x) solid CanvasText}}@keyframes open{0%{translate:0 var(--sbb-options-panel-animation-translate);opacity:0}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{translate:0 var(--sbb-options-panel-animation-translate);opacity:0}}
17
- `),D=m,O={childList:!0,subtree:!0,characterData:!0};let k=(()=>{let i=s(v(c)),l=[],d,m,y,b=[],x=[],S,C=[],w=[],T,E=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[];return class extends i{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;d=[a()],m=[a({type:Boolean})],y=[o()],S=[o()],T=[o()],A=[o()],N=[o()],I=[o()],e(this,null,d,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,l),e(this,null,m,{kind:`setter`,name:`selected`,static:!1,private:!1,access:{has:e=>`selected`in e,set:(e,t)=>{e.selected=t}},metadata:t},null,l),e(this,null,y,{kind:`accessor`,name:`disabledFromGroup`,static:!1,private:!1,access:{has:e=>`disabledFromGroup`in e,get:e=>e.disabledFromGroup,set:(e,t)=>{e.disabledFromGroup=t}},metadata:t},b,x),e(this,null,S,{kind:`accessor`,name:`groupLabel`,static:!1,private:!1,access:{has:e=>`groupLabel`in e,get:e=>e.groupLabel,set:(e,t)=>{e.groupLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`label`,static:!1,private:!1,access:{has:e=>`label`in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:t},E,k),e(this,null,A,{kind:`accessor`,name:`disableLabelHighlight`,static:!1,private:!1,access:{has:e=>`disableLabelHighlight`in e,get:e=>e.disableLabelHighlight,set:(e,t)=>{e.disableLabelHighlight=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`_highlightString`,static:!1,private:!1,access:{has:e=>`_highlightString`in e,get:e=>e._highlightString,set:(e,t)=>{e._highlightString=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`_inertAriaGroups`,static:!1,private:!1,access:{has:e=>`_inertAriaGroups`in e,get:e=>e._inertAriaGroups,set:(e,t)=>{e._inertAriaGroups=t}},metadata:t},L,R),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.events={optionselected:`optionselected`}}static{this.styles=[h]}set value(e){typeof e==`string`?(this.setAttribute(`value`,`${e}`),this._value=null):this._value=e,this.dispatchEvent(new Event(`ɵoptionvaluechange`,{bubbles:!0}))}get value(){return this._value??this.getAttribute(`value`)}set selected(e){this.toggleAttribute(`selected`,e),this._updateAriaSelected()}get selected(){return this.hasAttribute(`selected`)}#e;get disabledFromGroup(){return this.#e}set disabledFromGroup(e){this.#e=e}#t;get groupLabel(){return this.#t}set groupLabel(e){this.#t=e}#n;get label(){return this.#n}set label(e){this.#n=e}#r;get disableLabelHighlight(){return this.#r}set disableLabelHighlight(e){this.#r=e}#i;get _highlightString(){return this.#i}set _highlightString(e){this.#i=e}#a;get _inertAriaGroups(){return this.#a}set _inertAriaGroups(e){this.#a=e}constructor(){super(),this._value=(t(this,l),null),this.#e=t(this,b,!1),this.#t=(t(this,x),t(this,C,``)),this.#n=(t(this,w),t(this,E,void 0)),this.#r=(t(this,k),t(this,j,!1)),this.#i=(t(this,M),t(this,P,null)),this.#a=(t(this,F),t(this,L,!1)),this._previousSize=(t(this,R),null),this.addEventListener?.(`click`,e=>this.selectByClick(e),{passive:!0}),this.addController(new _(this,{config:O,callback:()=>{this.handleHighlightState(),this.dispatchEvent(new Event(`optionLabelChanged`,{bubbles:!0}))}})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid, sbb-select`),{size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}})),D&&(this.hydrationRequired?this.hydrationComplete.then(()=>this._inertAriaGroups=D):this._inertAriaGroups=D)}attributeChangedCallback(e,t,n){(e!==`value`||t!==n)&&super.attributeChangedCallback(e,t,n)}highlight(e){this._highlightString=e}selectViaUserInteraction(e){this.selected=e,this.selected&&this.dispatchEvent(new Event(`optionselected`,{bubbles:!0,composed:!0}))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),(e===`disabled`||e===`disabledFromGroup`)&&(this.toggleState(`disabled`,this.disabled||this.disabledFromGroup),this.closest?.(`sbb-select`)||g(this,`tabindex`,f&&!this.disabled&&!this.disabledFromGroup?0:null),this.updateAriaDisabled())}firstUpdated(e){super.firstUpdated(e),this._updateAriaSelected()}updateDisableHighlight(e){this.disableLabelHighlight=e,this.toggleState(`disable-highlight`,e)}setActive(e){this.toggleState(`active`,e)}updateAriaDisabled(){this.internals.ariaDisabled=this.disabled||this.disabledFromGroup?`true`:null,this.dispatchEvent(new Event(`ɵdisabledchange`,{bubbles:!0}))}_updateAriaSelected(){this.internals.ariaSelected=`${this.selected}`}handleHighlightState(){let e=Array.from(this.childNodes??[]).filter(e=>e.nodeType!==Node.COMMENT_NODE&&(!(e instanceof Element)||e.slot!==`icon`)),t=e.filter(e=>e.nodeType===Node.TEXT_NODE);t.length===0||e.filter(e=>!(e instanceof Element)||e.localName!==`template`).length!==t.length?this.updateDisableHighlight(!0):this.label=t.map(e=>e.wholeText).filter(e=>e.trim()).join(``)}getHighlightedLabel(){if(!this._highlightString||!this._highlightString.trim())return n`${this.label}`;let e=this.label.toLowerCase().indexOf(this._highlightString.toLowerCase());if(e===-1)return n`${this.label}`;let t=this.label.substring(0,e),r=this.label.substring(e,e+this._highlightString.length),i=this.label.substring(e+this._highlightString.length);return n`
17
+ `),D=m,O={childList:!0,subtree:!0,characterData:!0};let k=(()=>{let i=s(v(c)),l=[],d,m,y,b=[],x=[],S,C=[],w=[],T,E=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[];return class extends i{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;d=[a()],m=[a({type:Boolean})],y=[o()],S=[o()],T=[o()],A=[o()],N=[o()],I=[o()],e(this,null,d,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,l),e(this,null,m,{kind:`setter`,name:`selected`,static:!1,private:!1,access:{has:e=>`selected`in e,set:(e,t)=>{e.selected=t}},metadata:t},null,l),e(this,null,y,{kind:`accessor`,name:`disabledFromGroup`,static:!1,private:!1,access:{has:e=>`disabledFromGroup`in e,get:e=>e.disabledFromGroup,set:(e,t)=>{e.disabledFromGroup=t}},metadata:t},b,x),e(this,null,S,{kind:`accessor`,name:`groupLabel`,static:!1,private:!1,access:{has:e=>`groupLabel`in e,get:e=>e.groupLabel,set:(e,t)=>{e.groupLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`label`,static:!1,private:!1,access:{has:e=>`label`in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:t},E,k),e(this,null,A,{kind:`accessor`,name:`disableLabelHighlight`,static:!1,private:!1,access:{has:e=>`disableLabelHighlight`in e,get:e=>e.disableLabelHighlight,set:(e,t)=>{e.disableLabelHighlight=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`_highlightString`,static:!1,private:!1,access:{has:e=>`_highlightString`in e,get:e=>e._highlightString,set:(e,t)=>{e._highlightString=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`_inertAriaGroups`,static:!1,private:!1,access:{has:e=>`_inertAriaGroups`in e,get:e=>e._inertAriaGroups,set:(e,t)=>{e._inertAriaGroups=t}},metadata:t},L,R),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.events={optionselected:`optionselected`}}static{this.styles=[h]}set value(e){typeof e==`string`?(this.setAttribute(`value`,`${e}`),this._value=null):this._value=e,this.dispatchEvent(new Event(`ɵoptionvaluechange`,{bubbles:!0}))}get value(){return this._value??this.getAttribute(`value`)}set selected(e){this.toggleAttribute(`selected`,e),this._updateAriaSelected()}get selected(){return this.hasAttribute(`selected`)}#e;get disabledFromGroup(){return this.#e}set disabledFromGroup(e){this.#e=e}#t;get groupLabel(){return this.#t}set groupLabel(e){this.#t=e}#n;get label(){return this.#n}set label(e){this.#n=e}#r;get disableLabelHighlight(){return this.#r}set disableLabelHighlight(e){this.#r=e}#i;get _highlightString(){return this.#i}set _highlightString(e){this.#i=e}#a;get _inertAriaGroups(){return this.#a}set _inertAriaGroups(e){this.#a=e}constructor(){super(),this._value=(t(this,l),null),this.#e=t(this,b,!1),this.#t=(t(this,x),t(this,C,``)),this.#n=(t(this,w),t(this,E,void 0)),this.#r=(t(this,k),t(this,j,!1)),this.#i=(t(this,M),t(this,P,null)),this.#a=(t(this,F),t(this,L,!1)),this._previousSize=(t(this,R),null),this.addEventListener?.(`click`,e=>this.selectByClick(e),{passive:!0}),this.addController(new _(this,{config:O,callback:()=>{this.handleHighlightState(),this.dispatchEvent(new Event(`optionLabelChanged`,{bubbles:!0}))}})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid`),{negative:e=>this.toggleState(`negative`,e.negative)})),this.addController(new u(this,()=>this.closest(`sbb-autocomplete, sbb-autocomplete-grid, sbb-select`),{size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}})),D&&(this.hydrationRequired?this.hydrationComplete.then(()=>this._inertAriaGroups=D):this._inertAriaGroups=D)}attributeChangedCallback(e,t,n){(e!==`value`||t!==n)&&super.attributeChangedCallback(e,t,n)}highlight(e){this._highlightString=e}selectViaUserInteraction(e){this.selected=e,this.selected&&this.dispatchEvent(new Event(`optionselected`,{bubbles:!0,composed:!0}))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),(e===`disabled`||e===`disabledFromGroup`)&&(this.toggleState(`disabled`,this.disabled||this.disabledFromGroup),this.closest?.(`sbb-select`)||g(this,`tabindex`,f&&!this.disabled&&!this.disabledFromGroup?-1:null),this.updateAriaDisabled())}firstUpdated(e){super.firstUpdated(e),this._updateAriaSelected()}updateDisableHighlight(e){this.disableLabelHighlight=e,this.toggleState(`disable-highlight`,e)}setActive(e){this.toggleState(`active`,e)}updateAriaDisabled(){this.internals.ariaDisabled=this.disabled||this.disabledFromGroup?`true`:null,this.dispatchEvent(new Event(`ɵdisabledchange`,{bubbles:!0}))}_updateAriaSelected(){this.internals.ariaSelected=`${this.selected}`}handleHighlightState(){let e=Array.from(this.childNodes??[]).filter(e=>e.nodeType!==Node.COMMENT_NODE&&(!(e instanceof Element)||e.slot!==`icon`)),t=e.filter(e=>e.nodeType===Node.TEXT_NODE);t.length===0||e.filter(e=>!(e instanceof Element)||e.localName!==`template`).length!==t.length?this.updateDisableHighlight(!0):this.label=t.map(e=>e.wholeText).filter(e=>e.trim()).join(``)}getHighlightedLabel(){if(!this._highlightString||!this._highlightString.trim())return n`${this.label}`;let e=this.label.toLowerCase().indexOf(this._highlightString.toLowerCase());if(e===-1)return n`${this.label}`;let t=this.label.substring(0,e),r=this.label.substring(e,e+this._highlightString.length),i=this.label.substring(e+this._highlightString.length);return n`
18
18
  <span class="sbb-option__label--highlight">${t}</span><span>${r}</span
19
19
  ><span class="sbb-option__label--highlight">${i}</span>
20
20
  `}renderIcon(){return n`<span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}renderLabel(){return this.label&&!this.disableLabelHighlight?this.getHighlightedLabel():r}renderTick(){return r}render(){return n`
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-dev",
3
- "version": "5.13.0-dev.1793553480",
3
+ "version": "5.13.0-dev.1793604746",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
- "https://github.com/sbb-design-systems/lyne-components/commit/9a128ae6f6a449b6fe750f188fafb0e3b2ee4f50"
9
+ "https://github.com/sbb-design-systems/lyne-components/commit/ac4cd44bf6a0d408fe986cf8006f8c37e37a754a"
10
10
  ],
11
11
  "type": "module",
12
12
  "exports": {
@@ -1,6 +1,6 @@
1
1
  import{html as e,isServer as t,unsafeCSS as n}from"lit";import{SbbElement as r,SbbLanguageController as i,i18nTimetableFormSwapButtonLabel as a}from"./core.js";import{SbbFormFieldElement as o}from"./form-field.pure.js";import{SbbSecondaryButtonElement as s}from"./button.pure.js";var c=`:host{--_sbb-timetable-form-details-padding-inline-start:calc(var(--sbb-size-icon-ui-small) + var(--sbb-spacing-responsive-xxxs));align-items:center;gap:var(--sbb-timetable-form-details-gap);border-block-start:var(--sbb-timetable-form-details-border-block-start);padding-block:var(--sbb-timetable-form-details-padding-block);flex-wrap:wrap;padding-inline-start:var(--_sbb-timetable-form-details-padding-inline-start);display:flex}::slotted(sbb-form-field){--sbb-form-field-border-radius:var(--sbb-border-radius-6x);--sbb-form-field-outline-offset:-.3125rem}::slotted(sbb-divider[orientation=vertical]){height:var(--sbb-timetable-form-details-horizontal-divider-height)}::slotted(:last-child){margin-inline-end:var(--sbb-timetable-form-details-padding-inline)}
2
2
  `,l=class extends r{static{this.elementName=`sbb-timetable-form-details`}static{this.styles=[n(c)]}render(){return e`<slot></slot>`}},u=`:host{--_sbb-timetable-form-field-start-icon-connecting-line-offset:.1875rem;--_sbb-timetable-form-field-start-icon-connecting-line-width:calc((var(--sbb-form-field-min-height) - var(--sbb-icon-svg-height)) / 2 + var(--_sbb-timetable-form-field-start-icon-connecting-line-offset));--sbb-form-field-border-radius:var(--sbb-border-radius-6x);--sbb-form-field-outline-offset:-.3125rem;display:flex}:host(:first-of-type){--sbb-timetable-form-field-route-icon-rotate:90deg}:host(:last-of-type){--sbb-timetable-form-field-route-icon-rotate:-90deg;--sbb-timetable-form-field-route-icon-translate:-.0625rem 0}.sbb-form-field__wrapper:after{inset-inline-end:0}:host(:where(:not(:last-of-type))) .sbb-form-field__wrapper:after{content:""}:host(:not(:is(:state(focus),[state--focus]),:is(:state(disabled),[state--disabled]))) .sbb-form-field__wrapper:after{border-color:var(--sbb-border-color-4-inverted)}.sbb-timetable-form-field__start-route-icon{rotate:var(--sbb-timetable-form-field-route-icon-rotate);translate:var(--sbb-timetable-form-field-route-icon-translate);align-self:center;margin-inline-start:var(--sbb-form-field-padding-inline)}.sbb-timetable-form-field__start-route-icon:after{content:"";border-block-start:var(--sbb-border-width-1x) solid var(--sbb-timetable-form-field-route-icon-color);width:var(--_sbb-timetable-form-field-start-icon-connecting-line-width);margin-left:calc(var(--_sbb-timetable-form-field-start-icon-connecting-line-offset) * -1);position:absolute;inset-block-start:50%}.sbb-timetable-form-field__via-route-icon{width:var(--sbb-timetable-form-field-route-via-icon-width);align-self:stretch;margin-inline-start:var(--sbb-form-field-padding-inline);position:relative}.sbb-timetable-form-field__via-route-icon:before{content:"";border-inline-start:var(--sbb-border-width-1x) solid var(--sbb-timetable-form-field-route-icon-color);height:100%;margin-inline-start:-.0625rem;position:absolute;inset-inline-start:50%}.sbb-timetable-form-field__via-route-icon:after{content:"";width:var(--sbb-timetable-form-field-route-via-after-dimension);height:var(--sbb-timetable-form-field-route-via-after-dimension);border:var(--sbb-border-width-1x) solid var(--sbb-timetable-form-field-route-icon-color);border-radius:var(--sbb-border-radius-infinity);background-color:var(--sbb-timetable-form-field-route-icon-background-color);margin-inline-start:-.03125rem;position:absolute;inset-block-start:50%;inset-inline-start:50%;translate:-50% -50%}.sbb-form-field__space-wrapper{flex-grow:1}
3
- `,d=class extends o{static{this.elementName=`sbb-timetable-form-field`}static{this.styles=[n(u)]}constructor(){super(),this._routeIcon=!1,this.borderless=!0,this.floatingLabel=!0,this.width=`collapse`,this.size=`l`}connectedCallback(){super.connectedCallback(),!t&&this.hydrationComplete.then(()=>this._routeIcon=this.matches(`:first-of-type, :last-of-type`))}render(){return e`
3
+ `,d=class extends o{static{this.elementName=`sbb-timetable-form-field`}static{this.styles=[n(u)]}constructor(){super(),this._routeIcon=!1,this.borderless=!0,this.floatingLabel=!0,this.width=`collapse`,this.size=`l`}connectedCallback(){super.connectedCallback(),t||this.hydrationComplete.then(()=>this._routeIcon=this.matches(`:first-of-type, :last-of-type`))}render(){return e`
4
4
  ${this._routeIcon?e` <sbb-icon
5
5
  name="route-circle-start-small"
6
6
  class="sbb-timetable-form-field__start-route-icon"
package/tooltip.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isServer as r,unsafeCSS as i}from"lit";import{property as a}from"lit/decorators.js";import{SbbDisabledMixin as o,SbbEscapableOverlayController as s,SbbOpenCloseBaseElement as c,SbbOverlayPositionController as l,appendAriaElements as u,idReference as d,isAndroid as f,isIOS as p,isZeroAnimationDuration as m,popoverResetStyles as h,queueDomContentLoaded as g,readConfig as _,removeAriaElements as v,sbbInputModalityDetector as y,sbbOverlayOutsidePointerEventListener as b}from"./core.js";var x=`:host{--sbb-tooltip-max-width:min(25rem, calc(100vw - var(--sbb-spacing-fixed-2x)));--sbb-tooltip-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));position-area:var(--sbb-overlay-position-area);position-try-fallbacks:var(--sbb-overlay-position-try-fallbacks);pointer-events:var(--sbb-tooltip-pointer-events,all);z-index:var(--sbb-tooltip-z-index,var(--sbb-overlay-default-z-index));animation-name:var(--sbb-tooltip-animation-name);animation-duration:var(--sbb-tooltip-animation-duration);animation-timing-function:var(--sbb-tooltip-animation-easing);font-size:var(--sbb-tooltip-font-size);letter-spacing:var(--sbb-letter-spacing-text);line-height:var(--sbb-typo-line-height-text);display:none;position:fixed}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){--sbb-tooltip-animation-name:open;display:block}:host(:is(:state(state-closing),[state--state-closing])){--sbb-tooltip-animation-name:close;--sbb-tooltip-pointer-events:none}:host(:is([data-position~=block-end],[data-position~=bottom],[data-position^=end])){padding-block-start:var(--sbb-tooltip-gap)}:host(:is([data-position~=block-start],[data-position~=top],[data-position^=start])){padding-block-end:var(--sbb-tooltip-gap)}:host(:is([data-position~=inline-start],[data-position~=inline-end],[data-position~=left],[data-position~=right],[data-position$=\\ start],[data-position$=\\ end])){padding-inline:var(--sbb-tooltip-gap)}.sbb-tooltip{box-shadow:var(--sbb-box-shadow-level-5-soft);border:var(--sbb-border-width-1x) solid var(--sbb-tooltip-border-color);border-radius:var(--sbb-tooltip-border-radius);padding:var(--sbb-tooltip-padding);color:var(--sbb-tooltip-color);background-color:var(--sbb-tooltip-background-color);min-width:var(--sbb-tooltip-min-width);max-width:var(--sbb-tooltip-max-width)}@keyframes open{0%{opacity:0;translate:var(--sbb-tooltip-animation-translate)}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{opacity:0;translate:var(--sbb-tooltip-animation-translate)}}
2
- `;const S=f||p,C=/* @__PURE__ */ new WeakMap;let w=(()=>{let f=o(c),p=[],w,T=[],E=[],D,O,k;return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;w=[d(),a()],D=[a({attribute:`open-delay`,type:Number})],O=[a({attribute:`close-delay`,type:Number})],k=[a({attribute:`long-press-close-delay`,type:Number})],e(this,null,w,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},T,E),e(this,null,D,{kind:`setter`,name:`openDelay`,static:!1,private:!1,access:{has:e=>`openDelay`in e,set:(e,t)=>{e.openDelay=t}},metadata:t},null,p),e(this,null,O,{kind:`setter`,name:`closeDelay`,static:!1,private:!1,access:{has:e=>`closeDelay`in e,set:(e,t)=>{e.closeDelay=t}},metadata:t},null,p),e(this,null,k,{kind:`setter`,name:`longPressCloseDelay`,static:!1,private:!1,access:{has:e=>`longPressCloseDelay`in e,set:(e,t)=>{e.longPressCloseDelay=t}},metadata:t},null,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tooltip`}static{this.role=`tooltip`}static{this.styles=[h,i(x)]}static{r||g(()=>this._initializeTooltipOutlet())}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}set openDelay(e){this._openDelay=e}get openDelay(){return this._openDelay??_().tooltip?.openDelay??0}set closeDelay(e){this._closeDelay=e}get closeDelay(){return this._closeDelay??_().tooltip?.closeDelay??0}set longPressCloseDelay(e){this._longPressCloseDelay=+e}get longPressCloseDelay(){return this._longPressCloseDelay??_().tooltip?.longPressCloseDelay??1500}constructor(){super(),this.#e=(t(this,p),t(this,T,null)),this._openDelay=(t(this,E),null),this._closeDelay=null,this._triggerElement=null,this._escapableOverlayController=new s(this),this._overlayController=new l(this),this.addEventListener(`mouseleave`,e=>{this.state!==`opened`&&this.state!==`opening`||e.relatedTarget&&this._triggerElement?.contains(e.relatedTarget)||this._delayedClose()},{passive:!0}),this.addEventListener(`overlayOutsidePointer`,()=>this.close(),{passive:!0}),this.addEventListener(`animationend`,e=>this._onTooltipAnimationEnd(e),{passive:!0})}static _initializeTooltipOutlet(){this._tooltipOutlet=document.createElement(`div`),this._tooltipOutlet.classList.add(`sbb-overlay-outlet`),document.body.appendChild(this._tooltipOutlet),new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`)this._handleTooltipTrigger(t.target);else if(t.type===`childList`)for(let e of[...t.addedNodes,...t.removedNodes].filter(e=>e.nodeType===e.ELEMENT_NODE))this._handleTooltipTrigger(e),this._findAndHandleTooltipTriggers(e)}).observe(document.documentElement,{attributeFilter:[`sbb-tooltip`,`sbb-tooltip-open-delay`,`sbb-tooltip-close-delay`,`sbb-tooltip-position`],childList:!0,subtree:!0}),this._findAndHandleTooltipTriggers(document.body)}static _findAndHandleTooltipTriggers(e){e.querySelectorAll(`[sbb-tooltip]`).forEach(e=>this._handleTooltipTrigger(e))}static _handleTooltipTrigger(e){let t=e.getAttribute(`sbb-tooltip`),n=C.get(e);if(t&&e.isConnected){n||(n=document.createElement(`sbb-tooltip`),C.set(e,n),this._tooltipOutlet.appendChild(n),n.trigger=e),n.textContent=t,n.openDelay=e.hasAttribute(`sbb-tooltip-open-delay`)?+e.getAttribute(`sbb-tooltip-open-delay`):null,n.closeDelay=e.hasAttribute(`sbb-tooltip-close-delay`)?+e.getAttribute(`sbb-tooltip-close-delay`):null;let r=e.hasAttribute(`sbb-tooltip-position`)?e.getAttribute(`sbb-tooltip-position`).split(`,`).map(e=>e.trim()):e.tooltipPositions;r&&r.length>0?(n.style.setProperty(`--sbb-overlay-position-area`,r[0]),n.style.setProperty(`--sbb-overlay-position-try-fallbacks`,r.slice(1).join(`, `))):(n.style.removeProperty(`--sbb-overlay-position-area`),n.style.removeProperty(`--sbb-overlay-position-try-fallbacks`))}else n&&(C.delete(e),n._destroy?.())}connectedCallback(){super.connectedCallback(),this.popover=`manual`,this.state=`closed`,b.connect(this),this.hasUpdated&&this.trigger&&this._attach(this.trigger)}disconnectedCallback(){super.disconnectedCallback(),b.disconnect(this),this._detach()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),r||e&&e!==`trigger`||!this.hasUpdated||this._attach(this.trigger)}firstUpdated(e){super.firstUpdated(e),this._attach(this.trigger)}open(){this._resetOpenCloseTimeout(),!(this.state!==`closed`&&this.state!==`closing`||this.disabled||!this.trigger||!this.dispatchBeforeOpenEvent())&&(this.showPopover?.(),this.state=`opening`,this._overlayController.connect(this.trigger),this._isZeroAnimationDuration()&&this._handleOpening())}close(){this._resetOpenCloseTimeout(),(this.state===`opened`||this.state===`opening`)&&(this.dispatchBeforeCloseEvent(),this.state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_delayedOpen(){this._resetOpenCloseTimeout(),this._openTimeout=setTimeout(()=>this.open(),this.openDelay)}_handleOpening(){this.state=`opened`,this._escapableOverlayController.connect(),this.dispatchOpenEvent()}_delayedClose(){this._resetOpenCloseTimeout(),this._closeTimeout=setTimeout(()=>this.close(),this.closeDelay)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this._overlayController.disconnect(),this._escapableOverlayController.disconnect(),this.dispatchCloseEvent(),this._openStateController?.abort()}_onTooltipAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_attach(e){this._triggerElement&&this._detach(),this._triggerElement=e,this._triggerElement&&(this._triggerElement.ariaDescribedByElements=u(this._triggerElement.ariaDescribedByElements,this),this._addTriggerEventHandlers())}_detach(){this._triggerAbortController?.abort(),this._openStateController?.abort(),this._resetOpenCloseTimeout(),clearTimeout(this._longPressOpenTimeout),clearTimeout(this._longPressCloseTimeout),this._triggerElement&&=(this._triggerElement.ariaDescribedByElements=v(this._triggerElement.ariaDescribedByElements,this),null)}_destroy(){this._detach(),this.remove()}_addTriggerEventHandlers(){let e=this._triggerElement;if(!e)return;this._triggerAbortController?.abort(),this._triggerAbortController=new AbortController;let t={signal:this._triggerAbortController.signal,passive:!0};S||(e.addEventListener(`mouseenter`,()=>this._delayedOpen(),t),e.addEventListener(`mouseleave`,e=>{let t=e.relatedTarget;t&&t===this||this._delayedClose()},t),e.addEventListener(`blur`,()=>this.close(),t),e.addEventListener(`focus`,()=>{y.mostRecentModality===`keyboard`&&this._delayedOpen()},t)),e.addEventListener(`touchstart`,()=>{clearTimeout(this._longPressOpenTimeout),clearTimeout(this._longPressCloseTimeout),this._longPressOpenTimeout=setTimeout(()=>this.open(),500)},t),e.addEventListener(`touchend`,()=>{clearTimeout(this._longPressOpenTimeout),this._longPressCloseTimeout=setTimeout(()=>this.close(),this.longPressCloseDelay)},t),e.addEventListener(`touchcancel`,()=>{clearTimeout(this._longPressOpenTimeout)},t)}_isZeroAnimationDuration(){return m(this,`--sbb-tooltip-animation-duration`)}_resetOpenCloseTimeout(){clearTimeout(this._openTimeout),clearTimeout(this._closeTimeout)}render(){return n`
2
+ `;const S=f||p,C=/* @__PURE__ */ new WeakMap;let w=(()=>{let f=o(c),p=[],w,T=[],E=[],D,O,k;return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;w=[d(),a()],D=[a({attribute:`open-delay`,type:Number})],O=[a({attribute:`close-delay`,type:Number})],k=[a({attribute:`long-press-close-delay`,type:Number})],e(this,null,w,{kind:`accessor`,name:`trigger`,static:!1,private:!1,access:{has:e=>`trigger`in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:t},T,E),e(this,null,D,{kind:`setter`,name:`openDelay`,static:!1,private:!1,access:{has:e=>`openDelay`in e,set:(e,t)=>{e.openDelay=t}},metadata:t},null,p),e(this,null,O,{kind:`setter`,name:`closeDelay`,static:!1,private:!1,access:{has:e=>`closeDelay`in e,set:(e,t)=>{e.closeDelay=t}},metadata:t},null,p),e(this,null,k,{kind:`setter`,name:`longPressCloseDelay`,static:!1,private:!1,access:{has:e=>`longPressCloseDelay`in e,set:(e,t)=>{e.longPressCloseDelay=t}},metadata:t},null,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-tooltip`}static{this.role=`tooltip`}static{this.styles=[h,i(x)]}static{r||g(()=>this._initializeTooltipOutlet())}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}set openDelay(e){this._openDelay=e}get openDelay(){return this._openDelay??_().tooltip?.openDelay??0}set closeDelay(e){this._closeDelay=e}get closeDelay(){return this._closeDelay??_().tooltip?.closeDelay??0}set longPressCloseDelay(e){this._longPressCloseDelay=+e}get longPressCloseDelay(){return this._longPressCloseDelay??_().tooltip?.longPressCloseDelay??1500}constructor(){super(),this.#e=(t(this,p),t(this,T,null)),this._openDelay=(t(this,E),null),this._closeDelay=null,this._triggerElement=null,this._escapableOverlayController=new s(this),this._overlayController=new l(this),this.addEventListener(`mouseleave`,e=>{this.state!==`opened`&&this.state!==`opening`||e.relatedTarget&&this._triggerElement?.contains(e.relatedTarget)||this._delayedClose()},{passive:!0}),this.addEventListener(`overlayOutsidePointer`,()=>this.close(),{passive:!0}),this.addEventListener(`animationend`,e=>this._onTooltipAnimationEnd(e),{passive:!0})}static _initializeTooltipOutlet(){this._tooltipOutlet=document.createElement(`div`),this._tooltipOutlet.classList.add(`sbb-overlay-outlet`),document.body.appendChild(this._tooltipOutlet),new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`)this._handleTooltipTrigger(t.target);else if(t.type===`childList`)for(let e of[...t.addedNodes,...t.removedNodes].filter(e=>e.nodeType===e.ELEMENT_NODE))this._handleTooltipTrigger(e),this._findAndHandleTooltipTriggers(e)}).observe(document.documentElement,{attributeFilter:[`sbb-tooltip`,`sbb-tooltip-open-delay`,`sbb-tooltip-close-delay`,`sbb-tooltip-position`],childList:!0,subtree:!0}),this._findAndHandleTooltipTriggers(document.body)}static _findAndHandleTooltipTriggers(e){e.querySelectorAll(`[sbb-tooltip]`).forEach(e=>this._handleTooltipTrigger(e))}static _handleTooltipTrigger(e){let t=e.getAttribute(`sbb-tooltip`),n=C.get(e);if(t&&e.isConnected){n||(n=document.createElement(`sbb-tooltip`),C.set(e,n),this._tooltipOutlet.appendChild(n),n.trigger=e),n.textContent=t,n.openDelay=e.hasAttribute(`sbb-tooltip-open-delay`)?+e.getAttribute(`sbb-tooltip-open-delay`):null,n.closeDelay=e.hasAttribute(`sbb-tooltip-close-delay`)?+e.getAttribute(`sbb-tooltip-close-delay`):null;let r=e.hasAttribute(`sbb-tooltip-position`)?e.getAttribute(`sbb-tooltip-position`).split(`,`).map(e=>e.trim()):e.tooltipPositions;r&&r.length>0?(n.style.setProperty(`--sbb-overlay-position-area`,r[0]),n.style.setProperty(`--sbb-overlay-position-try-fallbacks`,r.slice(1).join(`, `))):(n.style.removeProperty(`--sbb-overlay-position-area`),n.style.removeProperty(`--sbb-overlay-position-try-fallbacks`))}else n&&(C.delete(e),n._destroy?.())}connectedCallback(){super.connectedCallback(),this.popover=`manual`,this.state=`closed`,b.connect(this),this.hasUpdated&&this.trigger&&this._attach(this.trigger)}disconnectedCallback(){super.disconnectedCallback(),b.disconnect(this),this._detach()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),r||(!e||e===`trigger`)&&this.hasUpdated&&this._attach(this.trigger)}firstUpdated(e){super.firstUpdated(e),this._attach(this.trigger)}open(){this._resetOpenCloseTimeout(),this.state!==`closed`&&this.state!==`closing`||this.disabled||!this.trigger||!this.dispatchBeforeOpenEvent()||(this.showPopover?.(),this.state=`opening`,this._overlayController.connect(this.trigger),this._isZeroAnimationDuration()&&this._handleOpening())}close(){this._resetOpenCloseTimeout(),(this.state===`opened`||this.state===`opening`)&&(this.dispatchBeforeCloseEvent(),this.state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_delayedOpen(){this._resetOpenCloseTimeout(),this._openTimeout=setTimeout(()=>this.open(),this.openDelay)}_handleOpening(){this.state=`opened`,this._escapableOverlayController.connect(),this.dispatchOpenEvent()}_delayedClose(){this._resetOpenCloseTimeout(),this._closeTimeout=setTimeout(()=>this.close(),this.closeDelay)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this._overlayController.disconnect(),this._escapableOverlayController.disconnect(),this.dispatchCloseEvent(),this._openStateController?.abort()}_onTooltipAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_attach(e){this._triggerElement&&this._detach(),this._triggerElement=e,this._triggerElement&&(this._triggerElement.ariaDescribedByElements=u(this._triggerElement.ariaDescribedByElements,this),this._addTriggerEventHandlers())}_detach(){this._triggerAbortController?.abort(),this._openStateController?.abort(),this._resetOpenCloseTimeout(),clearTimeout(this._longPressOpenTimeout),clearTimeout(this._longPressCloseTimeout),this._triggerElement&&=(this._triggerElement.ariaDescribedByElements=v(this._triggerElement.ariaDescribedByElements,this),null)}_destroy(){this._detach(),this.remove()}_addTriggerEventHandlers(){let e=this._triggerElement;if(!e)return;this._triggerAbortController?.abort(),this._triggerAbortController=new AbortController;let t={signal:this._triggerAbortController.signal,passive:!0};S||(e.addEventListener(`mouseenter`,()=>this._delayedOpen(),t),e.addEventListener(`mouseleave`,e=>{let t=e.relatedTarget;t&&t===this||this._delayedClose()},t),e.addEventListener(`blur`,()=>this.close(),t),e.addEventListener(`focus`,()=>{y.mostRecentModality===`keyboard`&&this._delayedOpen()},t)),e.addEventListener(`touchstart`,()=>{clearTimeout(this._longPressOpenTimeout),clearTimeout(this._longPressCloseTimeout),this._longPressOpenTimeout=setTimeout(()=>this.open(),500)},t),e.addEventListener(`touchend`,()=>{clearTimeout(this._longPressOpenTimeout),this._longPressCloseTimeout=setTimeout(()=>this.close(),this.longPressCloseDelay)},t),e.addEventListener(`touchcancel`,()=>{clearTimeout(this._longPressOpenTimeout)},t)}_isZeroAnimationDuration(){return m(this,`--sbb-tooltip-animation-duration`)}_resetOpenCloseTimeout(){clearTimeout(this._openTimeout),clearTimeout(this._closeTimeout)}render(){return n`
3
3
  <div class="sbb-tooltip">
4
4
  <slot></slot>
5
5
  </div>