@sbb-esta/lyne-elements-dev 5.9.0-dev.1789969822 → 5.9.0-dev.1789969922

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.
package/clock.pure.js CHANGED
@@ -3,7 +3,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
3
3
  `,u=`<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M55.1,64.5h-5.2l0.8-58h3.6L55.1,64.5z"/></svg>
4
4
  `,d=`<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M57.8,21.3c0-2.9-2.4-5.2-5.2-5.2s-5.3,2.3-5.3,5.2c0,2.7,2,4.8,4.5,5.2V69h1.5V26.5C55.8,26.2,57.8,24,57.8,21.3z"/></svg>
5
5
  `,f=`:host{aspect-ratio:1;contain:content;display:block;position:relative;overflow:hidden}.sbb-clock__face,.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds{transform-origin:50%;transform-style:preserve-3d;backface-visibility:hidden;position:absolute;inset:0;transform:rotate(0)}.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__face{fill:var(--sbb-clock-face-color)}.sbb-clock__hand-minutes{transition:transform var(--sbb-disable-animation-duration,.2s) cubic-bezier(.4, 2.08, .55, .44)}@supports not (aspect-ratio:1/1){.sbb-clock__hand-minutes{transform-origin:50% 49.625%}}.sbb-clock__hand-hours{animation-name:rotate;animation-duration:43200s;animation-timing-function:linear;animation-iteration-count:infinite;animation-play-state:var(--sbb-clock-animation-play-state,"paused")}.sbb-clock__hand-hours--initial-hour{animation-name:hand-hours-animation-initial-hour;animation-duration:var(--sbb-clock-hours-animation-duration,0s);animation-play-state:var(--sbb-clock-animation-play-state,"paused");animation-iteration-count:1}.sbb-clock__hand-minutes--no-transition{transition:none}.sbb-clock__hand-seconds{animation-name:hand-seconds-animation;animation-duration:60s;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state,"paused");fill:var(--sbb-clock-seconds-hand-color);animation-iteration-count:infinite}.sbb-clock__hand-seconds--initial-minute{animation-name:hand-seconds-animation-initial-minute;animation-duration:var(--sbb-clock-seconds-animation-duration,0s);animation-play-state:var(--sbb-clock-animation-play-state,"paused");animation-iteration-count:1}:host(:not(:is(:state(initialized),[state--initialized]))) :is(.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds){display:none}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes hand-hours-animation-initial-hour{0%{transform:rotateZ(var(--sbb-clock-hours-animation-start-angle,0deg))}to{transform:rotate(360deg)}}@keyframes hand-seconds-animation{0%{transform:rotate(0)}97.5%,to{transform:rotate(360deg)}}@keyframes hand-seconds-animation-initial-minute{0%{transform:rotateZ(var(--sbb-clock-seconds-animation-start-angle,0deg))}97.5%,to{transform:rotate(360deg)}}
6
- `;const p={once:!0,passive:!0};let m=(()=>{let m=s,h,g=[],_=[];return class extends m{constructor(){super(...arguments),this.#e=t(this,g,null),this._state=(t(this,_),`paused`),this._moveHoursHandFn=()=>this._moveHoursHand(),this._moveMinutesHandFn=()=>this._moveMinutesHand(),this._handlePageVisibilityChange=()=>{this.now||(document.visibilityState===`hidden`?this._stopClock():this._startClock())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;h=[a()],e(this,null,h,{kind:`accessor`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,get:e=>e.now,set:(e,t)=>{e.now=t}},metadata:t},g,_),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-clock`}static{this.styles=[i(f)]}#e;get now(){return this.#e}set now(e){this.#e=e}connectedCallback(){super.connectedCallback(),this._resetIntervalId=setInterval(()=>this._resetClock(),18e5)}willUpdate(e){super.willUpdate(e),!r&&this.hasUpdated&&e.has(`now`)&&this._startOrConfigureClock()}firstUpdated(e){super.firstUpdated(e),r||(document.addEventListener(`visibilitychange`,this._handlePageVisibilityChange,!1),this._startOrConfigureClock())}disconnectedCallback(){super.disconnectedCallback(),this._removeEventListeners(),clearInterval(this._resetIntervalId)}_startOrConfigureClock(){this.now?(this._stopClock(),this._resetSecondsHandAnimation(),this._setHandsStartingPosition()):this._startClock()}_startClock(){this._clockHandHours?.addEventListener(`animationend`,this._moveHoursHandFn,p),this._clockHandSeconds?.addEventListener(`animationend`,this._moveMinutesHandFn,p),this._setHandsStartingPosition(),this.style?.setProperty(`--sbb-clock-animation-play-state`,`running`),this._state=`running`}_stopClock(){clearInterval(this._handMovement),this._removeSecondsAnimationStyles(),this._removeHoursAnimationStyles(),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._clockHandMinutes?.classList.add(`sbb-clock__hand-minutes--no-transition`),this.style?.setProperty(`--sbb-clock-animation-play-state`,`paused`),this._state=`paused`}async _resetClock(){this._state===`running`&&(this._stopClock(),setTimeout(()=>this._startClock(),50))}_setHandsStartingPosition(){this._assignCurrentTime();let e=60-this._seconds,t=60-this._minutes,n=12-this._hours,r=0,i=0;e>0&&(r+=e,i=1),t>0&&(r+=(t-i)*60,i=1),n>0&&(r+=(n-i)*3600),this.style?.setProperty(`--sbb-clock-hours-animation-start-angle`,`${Math.ceil(this._hours*30+this._minutes/2)}deg`),this.style?.setProperty(`--sbb-clock-hours-animation-duration`,`${r}s`),this.style?.setProperty(`--sbb-clock-seconds-animation-start-angle`,`${Math.ceil(this._seconds*6.153846153846154)}deg`),this.style?.setProperty(`--sbb-clock-seconds-animation-duration`,`${e}s`),this._setMinutesHand(),this._clockHandSeconds?.classList.add(`sbb-clock__hand-seconds--initial-minute`),this._clockHandHours?.classList.add(`sbb-clock__hand-hours--initial-hour`),this.internals.states.add(`initialized`)}_assignCurrentTime(){let e=this.now?null:new Date,[t,n,r]=e?[e.getHours(),e.getMinutes(),e.getSeconds()]:this.now.split(`:`).map(e=>+e);this._hours=t%12,this._minutes=n,this._seconds=r}_setMinutesHand(){this._clockHandMinutes?.style.setProperty(`transform`,`rotateZ(${Math.ceil(this._minutes*6)}deg)`)}_moveHoursHand(){this._removeHoursAnimationStyles();let e=Math.ceil(this._hours*30+this._minutes/2);e>=360&&(e-=360),this._clockHandHours?.style.setProperty(`transform`,`rotateZ(${e}deg)`)}_moveMinutesHand(){this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._removeSecondsAnimationStyles(),this._addMinutesAndSetHands(),this._handMovement=setInterval(()=>this._addMinutesAndSetHands(),6e4)}_addMinutesAndSetHands(){this._minutes++,this._setMinutesHand()}_resetSecondsHandAnimation(){this._clockHandSeconds&&(this._clockHandSeconds.style.animation=``,this._clockHandSeconds.offsetHeight,this._clockHandSeconds.style.removeProperty(`animation`))}_removeEventListeners(){document?.removeEventListener(`visibilitychange`,this._handlePageVisibilityChange),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),clearInterval(this._handMovement)}_removeHoursAnimationStyles(){this._clockHandHours?.classList.remove(`sbb-clock__hand-hours--initial-hour`),this.style.removeProperty(`--sbb-clock-hours-animation-start-angle`),this.style.removeProperty(`--sbb-clock-hours-animation-duration`)}_removeSecondsAnimationStyles(){this._clockHandSeconds?.classList.remove(`sbb-clock__hand-seconds--initial-minute`),this._clockHandMinutes?.classList.remove(`sbb-clock__hand-minutes--no-transition`),this.style.removeProperty(`--sbb-clock-seconds-animation-start-angle`),this.style.removeProperty(`--sbb-clock-seconds-animation-duration`)}render(){return n`
6
+ `;const p={once:!0,passive:!0};let m=(()=>{let m=s,h,g=[],_=[];return class extends m{constructor(){super(...arguments),this.#e=t(this,g,null),this._state=(t(this,_),`paused`),this._moveHoursHandFn=()=>this._moveHoursHand(),this._moveMinutesHandFn=()=>this._moveMinutesHand(),this._handlePageVisibilityChange=()=>{this.now||(document.visibilityState===`hidden`?this._stopClock():this._startClock())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;h=[a()],e(this,null,h,{kind:`accessor`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,get:e=>e.now,set:(e,t)=>{e.now=t}},metadata:t},g,_),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-clock`}static{this.styles=[i(f)]}#e;get now(){return this.#e}set now(e){this.#e=e}connectedCallback(){super.connectedCallback(),this._resetIntervalId=setInterval(()=>this._resetClock(),18e5)}willUpdate(e){super.willUpdate(e),!r&&this.hasUpdated&&e.has(`now`)&&this._startOrConfigureClock()}firstUpdated(e){super.firstUpdated(e),r||(document.addEventListener(`visibilitychange`,this._handlePageVisibilityChange,!1),this._startOrConfigureClock())}disconnectedCallback(){super.disconnectedCallback(),this._removeEventListeners(),clearInterval(this._resetIntervalId)}_startOrConfigureClock(){this.now?(this._stopClock(),this._resetSecondsHandAnimation(),this._setHandsStartingPosition()):this._startClock()}_startClock(){this._clockHandHours?.addEventListener(`animationend`,this._moveHoursHandFn,p),this._clockHandSeconds?.addEventListener(`animationend`,this._moveMinutesHandFn,p),this._setHandsStartingPosition(),this.style?.setProperty(`--sbb-clock-animation-play-state`,`running`),this._state=`running`}_stopClock(){clearInterval(this._handMovement),this._removeSecondsAnimationStyles(),this._removeHoursAnimationStyles(),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._clockHandMinutes?.classList.add(`sbb-clock__hand-minutes--no-transition`),this.style?.setProperty(`--sbb-clock-animation-play-state`,`paused`),this._state=`paused`}async _resetClock(){this._state===`running`&&(this._stopClock(),setTimeout(()=>this._startClock(),50))}_setHandsStartingPosition(){this._assignCurrentTime();let e=60-this._seconds,t=60-this._minutes,n=12-this._hours,r=0,i=0;e>0&&(r+=e,i=1),t>0&&(r+=(t-i)*60,i=1),n>0&&(r+=(n-i)*3600),this.style?.setProperty(`--sbb-clock-hours-animation-start-angle`,`${Math.ceil(this._hours*30+this._minutes/2)}deg`),this.style?.setProperty(`--sbb-clock-hours-animation-duration`,`${r}s`),this.style?.setProperty(`--sbb-clock-seconds-animation-start-angle`,`${Math.ceil(this._seconds*6.153846153846154)}deg`),this.style?.setProperty(`--sbb-clock-seconds-animation-duration`,`${e}s`),this._setMinutesHand(),this._clockHandSeconds?.classList.add(`sbb-clock__hand-seconds--initial-minute`),this._clockHandHours?.classList.add(`sbb-clock__hand-hours--initial-hour`),this.internals.states.add(`initialized`)}_assignCurrentTime(){let e=this.now?null:/* @__PURE__ */ new Date,[t,n,r]=e?[e.getHours(),e.getMinutes(),e.getSeconds()]:this.now.split(`:`).map(e=>+e);this._hours=t%12,this._minutes=n,this._seconds=r}_setMinutesHand(){this._clockHandMinutes?.style.setProperty(`transform`,`rotateZ(${Math.ceil(this._minutes*6)}deg)`)}_moveHoursHand(){this._removeHoursAnimationStyles();let e=Math.ceil(this._hours*30+this._minutes/2);e>=360&&(e-=360),this._clockHandHours?.style.setProperty(`transform`,`rotateZ(${e}deg)`)}_moveMinutesHand(){this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._removeSecondsAnimationStyles(),this._addMinutesAndSetHands(),this._handMovement=setInterval(()=>this._addMinutesAndSetHands(),6e4)}_addMinutesAndSetHands(){this._minutes++,this._setMinutesHand()}_resetSecondsHandAnimation(){this._clockHandSeconds&&(this._clockHandSeconds.style.animation=``,this._clockHandSeconds.offsetHeight,this._clockHandSeconds.style.removeProperty(`animation`))}_removeEventListeners(){document?.removeEventListener(`visibilitychange`,this._handlePageVisibilityChange),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),clearInterval(this._handMovement)}_removeHoursAnimationStyles(){this._clockHandHours?.classList.remove(`sbb-clock__hand-hours--initial-hour`),this.style.removeProperty(`--sbb-clock-hours-animation-start-angle`),this.style.removeProperty(`--sbb-clock-hours-animation-duration`)}_removeSecondsAnimationStyles(){this._clockHandSeconds?.classList.remove(`sbb-clock__hand-seconds--initial-minute`),this._clockHandMinutes?.classList.remove(`sbb-clock__hand-minutes--no-transition`),this.style.removeProperty(`--sbb-clock-seconds-animation-start-angle`),this.style.removeProperty(`--sbb-clock-seconds-animation-duration`)}render(){return n`
7
7
  <span class="sbb-clock__face" .innerHTML=${c}></span>
8
8
  <span
9
9
  class="sbb-clock__hand-hours"
package/core/testing.js CHANGED
@@ -1 +1 @@
1
- import{isServer as e}from"lit";var t=class{get count(){return this._count}get events(){return this._events}get firstEvent(){return this.events.length?this.events[0]:null}get lastEvent(){return this.events.length?this.events[this.events.length-1]:null}constructor(e,t=null,n=null){this._event=e,this._target=t,this._options=n,this._count=0,this._events=[],this._promiseEventMap=new Map,this._target||=document,this._listenForEvent()}calledOnce(e){return this.calledTimes(1,e)}calledTimes(e,t=2e3){if(this.count>e)return Promise.reject(`Event '${this._event}' has been emitted more than expected (expected ${e}, actual ${this.count}`);if(this.count===e)return Promise.resolve(this.events[e-1]);if(this._promiseEventMap.has(e))return this._promiseEventMap.get(e).promise;{let n,r,i={promise:new Promise((e,t)=>{n=e,r=t}),resolve:n,reject:r};return this._promiseEventMap.set(e,i),this._wrapPromiseWithTimeout(i,e,t)}}_wrapPromiseWithTimeout(e,t,n){let r=setTimeout(()=>e.reject(`awaiting calledTimes(${t}) for event '${this._event}' results in timeout`),n);return e.promise.then(()=>clearTimeout(r)),e.promise}_listenForEvent(){this._target?.addEventListener(this._event,e=>{this._events.push(e),this._count++,this._promiseEventMap.get(this.count)?.resolve(e)},this._options??void 0)}};const n=(e,t,n)=>{if(e)return Mocha.describe(t,n)},r=(e,t,n)=>{if(e)return Mocha.test(t,n)};async function i(e,t=30,n=2e3){let r=new Date,i=0;function a(){return i++,e()}for(;!await a()&&r.getTime()+n>=new Date().getTime();)await new Promise(e=>setTimeout(e,t));return r.getTime()+n<new Date().getTime()?Promise.reject(`waitForCondition timeout: ${e.toString()}, attempts: ${i}, start: ${r.getTime()}, end: ${new Date().getTime()}`):Promise.resolve(!0)}let a;try{a=typeof Intl<`u`&&Intl.v8BreakIterator}catch{a=!1}const o=!e&&/(edge)/i.test(navigator.userAgent),s=!e&&/(msie|trident)/i.test(navigator.userAgent),c=!e&&!!(window.chrome||a)&&typeof CSS<`u`&&!o&&!s,l=!e&&/AppleWebKit/i.test(navigator.userAgent)&&!c&&!o&&!s;!e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&`MSStream`in window,!e&&/(Mac)/i.test(navigator.platform),!e&&/(firefox|minefield)/i.test(navigator.userAgent),!e&&/android/i.test(navigator.userAgent);const u=!e&&/safari/i.test(navigator.userAgent)&&l;async function d(e,t=2e3){let n=e.localName===`sbb-image`?e.shadowRoot?.querySelector(`.sbb-image__img`)??null:e;if(!n)throw Error(`img tag not found`);n.complete?u&&await n.decode():await new Promise((e,r)=>{let i=setTimeout(()=>r(`image loading timeout`),t);n.addEventListener(`load`,()=>{clearTimeout(i),!n.complete||u?n.decode().then(()=>e()):e()}),n.addEventListener(`error`,()=>{clearTimeout(i),r(`image error`)})})}const f=e=>!!e.updateComplete,p=Promise.resolve(),m=async e=>{let t=await e;(t.parentElement??t).querySelectorAll?.(`[defer-hydration]`).forEach(e=>e.removeAttribute(`defer-hydration`));let n=[t,...t.querySelectorAll(`*`)].filter(f).map(e=>[e.updateComplete,e.hydrationComplete??p,m(e.renderRoot)]).flat(1/0);return await Promise.all(n),t};export{t as EventSpy,n as describeIf,f as isReactiveElement,r as testIf,i as waitForCondition,d as waitForImageReady,m as waitForLitRender};
1
+ import{isServer as e}from"lit";var t=class{get count(){return this._count}get events(){return this._events}get firstEvent(){return this.events.length?this.events[0]:null}get lastEvent(){return this.events.length?this.events[this.events.length-1]:null}constructor(e,t=null,n=null){this._event=e,this._target=t,this._options=n,this._count=0,this._events=[],this._promiseEventMap=/* @__PURE__ */ new Map,this._target||=document,this._listenForEvent()}calledOnce(e){return this.calledTimes(1,e)}calledTimes(e,t=2e3){if(this.count>e)return Promise.reject(`Event '${this._event}' has been emitted more than expected (expected ${e}, actual ${this.count}`);if(this.count===e)return Promise.resolve(this.events[e-1]);if(this._promiseEventMap.has(e))return this._promiseEventMap.get(e).promise;{let n,r,i={promise:new Promise((e,t)=>{n=e,r=t}),resolve:n,reject:r};return this._promiseEventMap.set(e,i),this._wrapPromiseWithTimeout(i,e,t)}}_wrapPromiseWithTimeout(e,t,n){let r=setTimeout(()=>e.reject(`awaiting calledTimes(${t}) for event '${this._event}' results in timeout`),n);return e.promise.then(()=>clearTimeout(r)),e.promise}_listenForEvent(){this._target?.addEventListener(this._event,e=>{this._events.push(e),this._count++,this._promiseEventMap.get(this.count)?.resolve(e)},this._options??void 0)}};const n=(e,t,n)=>{if(e)return Mocha.describe(t,n)},r=(e,t,n)=>{if(e)return Mocha.test(t,n)};async function i(e,t=30,n=2e3){let r=/* @__PURE__ */ new Date,i=0;function a(){return i++,e()}for(;!await a()&&r.getTime()+n>=(/* @__PURE__ */ new Date()).getTime();)await new Promise(e=>setTimeout(e,t));return r.getTime()+n<(/* @__PURE__ */ new Date()).getTime()?Promise.reject(`waitForCondition timeout: ${e.toString()}, attempts: ${i}, start: ${r.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`):Promise.resolve(!0)}let a;try{a=typeof Intl<`u`&&Intl.v8BreakIterator}catch{a=!1}const o=!e&&/(edge)/i.test(navigator.userAgent),s=!e&&/(msie|trident)/i.test(navigator.userAgent),c=!e&&!!(window.chrome||a)&&typeof CSS<`u`&&!o&&!s,l=!e&&/AppleWebKit/i.test(navigator.userAgent)&&!c&&!o&&!s;!e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&`MSStream`in window,!e&&/(Mac)/i.test(navigator.platform),!e&&/(firefox|minefield)/i.test(navigator.userAgent),!e&&/android/i.test(navigator.userAgent);const u=!e&&/safari/i.test(navigator.userAgent)&&l;async function d(e,t=2e3){let n=e.localName===`sbb-image`?e.shadowRoot?.querySelector(`.sbb-image__img`)??null:e;if(!n)throw Error(`img tag not found`);n.complete?u&&await n.decode():await new Promise((e,r)=>{let i=setTimeout(()=>r(`image loading timeout`),t);n.addEventListener(`load`,()=>{clearTimeout(i),!n.complete||u?n.decode().then(()=>e()):e()}),n.addEventListener(`error`,()=>{clearTimeout(i),r(`image error`)})})}const f=e=>!!e.updateComplete,p=Promise.resolve(),m=async e=>{let t=await e;(t.parentElement??t).querySelectorAll?.(`[defer-hydration]`).forEach(e=>e.removeAttribute(`defer-hydration`));let n=[t,...t.querySelectorAll(`*`)].filter(f).map(e=>[e.updateComplete,e.hydrationComplete??p,m(e.renderRoot)]).flat(1/0);return await Promise.all(n),t};export{t as EventSpy,n as describeIf,f as isReactiveElement,r as testIf,i as waitForCondition,d as waitForImageReady,m as waitForLitRender};
package/core.js CHANGED
@@ -15,9 +15,9 @@ var ce=class{constructor(){this.ignoreVisibility=!1}},le=class{isDisabled(e){ret
15
15
  * found in the LICENSE file at https://angular.dev/license
16
16
  */
17
17
  let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._createLiveElement():document.addEventListener(`DOMContentLoaded`,()=>{this._liveElement=this._createLiveElement()}))}announce(e,...t){if(!this._liveElement)return Promise.resolve();let n={},r,i;return t.length===1&&typeof t[0]==`number`?i=t[0]:[r,i]=t,this.clear(),clearTimeout(this._previousTimeout),r??=n?.politeness??`polite`,i??=n?.duration,this._liveElement.setAttribute(`aria-live`,r),this._currentPromise??=new Promise(e=>this._currentResolve=e),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=e,typeof i==`number`&&(this._previousTimeout=setTimeout(()=>this.clear(),i)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise}clear(){this._liveElement&&(this._liveElement.textContent=``)}destroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){let e=`sbb-live-announcer-element`,t=document.getElementsByClassName(e),n=document.createElement(`div`);for(let e=0;e<t.length;e++)t[e].remove();return n.classList.add(e),n.classList.add(`sbb-screen-reader-only`),n.setAttribute(`aria-atomic`,`true`),n.setAttribute(`aria-live`,`polite`),n.id=`sbb-live-announcer-${xe++}`,document.body.appendChild(n),n}};const Ce=new Se;var we=`*,:before,:after{box-sizing:border-box}
18
- `;const Te=r||!CSS.supports(`selector(:state(loading))`)?class extends Set{constructor(e){super(),this._host=e,this._applied=r,this._host.addController(this),r||Promise.resolve().then(()=>this._applyStates())}add(e){return this._applied&&this._toggleState(e,!0),super.add(e)}delete(e){return this._toggleState(e,!1),super.delete(e)}clear(){this.forEach(e=>this.delete(e))}hostConnected(){this._applyStates()}_toggleState(e,t){this._host.toggleAttribute(`state--${e}`,t)}_applyStates(){this._applied||(this._applied=!0,this.forEach(e=>this._toggleState(e,!0)))}}:null;if(!r){let e=0,t=e=>e.shadowRoot?.host??(e instanceof Element?e:(()=>{throw Error(`Unable to resolve related element! This should never happen.`)})()),n={attributes:!0,attributeFilter:[`id`]},r=(t,n,r)=>{let i=r[Element.name]??r[ElementInternals.name];t.setAttribute(n,i.id||=`aria-ref-${e++}`)},i=(t,n,r)=>{t.setAttribute(n,Object.values(r).reduce((e,t)=>e.concat(t)).filter((e,t,n)=>n.indexOf(e)===t).map(t=>t.id||=`aria-ref-${e++}`).join(` `))};for(let e of[ElementInternals,Element]){let a=e.prototype;if(!(`ariaActiveDescendantElement`in a)){let i=`aria-activedescendant`,o=new WeakMap;Object.defineProperty(a,"ariaActiveDescendantElement",{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(i)?.split(/\s+/)[0]??null;return n?e.getRootNode().getElementById?.(n)??null:null},set(a){if(a!==null&&!(a instanceof Element))throw TypeError(`Failed to set the 'ariaActiveDescendantElement' property on '${e.name}': Failed to convert value to 'Element'.`);let s=t(this),c=o.get(s);if(c?.observer?.disconnect(),a===null)c&&(delete c.elements[e.name],Object.keys(c).length?c.observer.observe(Object.values(c.elements)[0],n):(o.delete(s),s.removeAttribute(i)));else if(c)c.elements[e.name]=a,r(s,i,c.elements),Object.values(c.elements).forEach(e=>c.observer.observe(e,n));else{let t={[e.name]:a};r(s,i,t);let c=new MutationObserver(()=>r(s,i,t));c.observe(a,n),o.set(s,{elements:t,observer:c})}}})}for(let r of[`ariaControlsElements`,`ariaDescribedByElements`,`ariaDetailsElements`,`ariaErrorMessageElements`,`ariaLabelledByElements`,`ariaOwnsElements`])if(!(r in a)){let o=new WeakMap,s=`aria-${r.slice(4,-8).toLowerCase()}`;Object.defineProperty(a,r,{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(s)?.split(/\s+/).filter((e,t,n)=>n.indexOf(e)===t).map(t=>e.getRootNode().getElementById?.(t)).filter(e=>e instanceof Element);return n?.length?Object.freeze(n):null},set(a){if(a!==null&&(!Array.isArray(a)||a.some(e=>!(e instanceof Element))))throw TypeError(`Failed to set the '${r}' property on '${e.name}': Failed to convert value to 'Element'.`);let c=t(this);a=a?.filter((e,t,n)=>n.indexOf(e)===t)??null;let l=o.get(c);if(l?.observer?.disconnect(),a===null)l&&(delete l.elements[e.name],Object.keys(l.elements).length?Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n)):o.delete(c));else if(l)l.elements[e.name]=a,i(c,s,l.elements),Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n));else{let t={[e.name]:a};i(c,s,t);let r=new MutationObserver(()=>i(c,s,t));a.forEach(e=>r.observe(e,n)),o.set(c,{elements:t,observer:r})}}})}}}const Ee=new WeakMap;function De(e){if(!e)return null;let t=Ee.get(e)?.states,n=function(e,t){t||t!==!1&&!this.has(e)?this.add(e):this.delete(e)};return t?{add(e){return t.add(e),this},delete:e=>t.delete(e),has:e=>t.has(e),toggle:n}:{add(t){return e.toggleAttribute(`state--${t}`,!0),this},delete:t=>e.toggleAttribute(`state--${t}`,!1),has:t=>e.hasAttribute(`state--${t}`),toggle:n}}var N=class extends Event{constructor(e){super(`slottedchange`,{composed:!0}),this.slot=e}};const Oe=(e,...t)=>{let n=t.filter(e=>!!e);return e?.length?e.concat(n):t.length?n:null},ke=(e,...t)=>{t=t.filter(e=>!!e);let n=e?.filter(e=>!t.includes(e))??null;return n?.length?n:null};var P=class extends e{static{this._$sbbElement$=!0}static{this.styles=[a(we)]}get hydrationComplete(){return this._hydrationComplete}get hydrationRequired(){return this._hydrationRequired}constructor(){if(super(),this.internals=this.attachInternals(),this._hydrationComplete=new Promise(e=>this._resolveHydration=e),Ee.set(this,this.internals),Te)Object.defineProperty(this.internals,"states",{value:new Te(this),writable:!1,configurable:!1,enumerable:!1});else for(let e of this.getAttributeNames().filter(e=>e.startsWith(`state--`)))this.internals.states.add(e.slice(7)),this.removeAttribute(e);let e=this.constructor.role;if(e&&(this.internals.role=e),this._hydrationRequired=!!this.shadowRoot,!this._hydrationRequired)this._resolveHydration(!1);else{let e=e=>{this._hydrationRequired&&e.stopImmediatePropagation()},t={capture:!0},n=this.shadowRoot?.querySelectorAll(`slot`);n?.length&&(n.forEach(n=>n.addEventListener(`slotchange`,e,t)),this.hydrationComplete.then(()=>n.forEach(n=>{n.removeEventListener(`slotchange`,e,t),n.assignedNodes().length&&n.dispatchEvent(new Event(`slotchange`,{bubbles:!0}))})))}}static define(){if(!this.elementName)throw Error(`The static property "elementName" is not defined on ${this.name}. Please define it to register the custom element.`);if(!customElements.get(this.elementName)){customElements.define(this.elementName,this);let e=[],t=this;for(;t._$sbbElement$;)Array.isArray(t.elementDependencies)&&e.push(...t.elementDependencies),t=Object.getPrototypeOf(t);new Set(e).forEach(e=>e.define())}}static finalizeStyles(t){let n=[],r=this;for(;r&&r!==e;)Object.hasOwn(r,`styles`)&&r.styles&&n.unshift(r.styles),r=Object.getPrototypeOf(r);return super.finalizeStyles(n)}createRenderRoot(){let e=super.createRenderRoot();return this.shadowRoot?.addEventListener(`slotchange`,e=>this._slotchangeHandler(e,e.target)),this.shadowRoot?.addEventListener(`slottedchange`,e=>this._slotchangeHandler(e,e.slot),{capture:!0}),this.shadowRoot?.querySelectorAll?.(`slot`).forEach(e=>this._handleSlotChangeForSlottedState(e)),e}addController(e){super.addController(e),(this._controllers??=new Set).add(e)}removeController(e){super.removeController(e),this._controllers?.delete(e)}requestUpdate(e,t,n,r,i){if(super.requestUpdate(e,t,n,r,i),e){let a={oldValue:t,value:r?i:this[e]};this._controllers?.forEach(t=>t.hostPropertyUpdate?.(e,a,n))}}update(e){super.update(e),this._hydrationRequired&&(this._hydrationRequired=!1,this._resolveHydration(!0))}toggleState(e,t){t||t!==!1&&!this.internals.states.has(e)?this.internals.states.add(e):this.internals.states.delete(e)}_slotchangeHandler(e,t){let n=this.shadowRoot.contains(t)?t:e.composedPath().find(e=>e instanceof HTMLSlotElement&&this.shadowRoot.contains(e));n&&this._handleSlotChangeForSlottedState(n)}_handleSlotChangeForSlottedState(e){this._updateSlottedState(e),e.name||this._observeTextNodesInSlot(e)}_updateSlottedState(e){let t=e.name?`slotted-${e.name}`:`slotted`,n=this._hasSlottedContent(e);n&&!this.internals.states.has(t)?(this.internals.states.add(t),this.dispatchEvent(new N(e))):!n&&this.internals.states.has(t)&&(this.internals.states.delete(t),this.dispatchEvent(new N(e)))}_observeTextNodesInSlot(e){this._textObserver?.disconnect(),this._textObserver??=new MutationObserver(()=>{let e=this.shadowRoot.querySelector(`slot:not([name])`);e?this._updateSlottedState(e):this._textObserver.disconnect()}),e.assignedNodes().filter(e=>e.nodeType===e.TEXT_NODE).forEach(e=>this._textObserver.observe(e,{characterData:!0}))}_hasSlottedContent(e){return e.name?e.assignedElements().some(e=>!(e instanceof HTMLSlotElement)||this._hasSlottedContent(e)):e.assignedNodes().some(e=>e instanceof HTMLSlotElement?this._hasSlottedContent(e):e.nodeType!==e.TEXT_NODE||!!e.textContent?.trim())}},F=class extends P{get maybeDisabled(){let e=this;return e.disabled||e.formDisabled}get maybeDisabledInteractive(){return this.disabledInteractive}constructor(){super(),this.internals.states.add(`action`)}connectedCallback(){super.connectedCallback()}setupBaseEventHandlers(){this.addEventListener(`click`,e=>{this.maybeDisabled&&!this.maybeDisabledInteractive&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0})}renderTemplate(){throw Error(`Implementation needed!`)}render(){return n`<span class="sbb-action-base ${this.localName}">${this.renderTemplate()}</span>`}};const I=e=>(t,n)=>{let{kind:r,metadata:i,name:a}=n,o=globalThis.litPropertyMetadata.get(i)?.get(a)?.type??String;if(e??=o,e===String?e=e=>e==null?``:String(e):e===Number&&(e=e=>e==null?NaN:Number(e)),r===`accessor`)return{set(n){t.set.call(this,e(n))}};if(r===`setter`)return function(n){t.call(this,e(n))};throw Error(`Unsupported decorator location: ${r}`)};async function Ae(e){return await new Promise(e=>setTimeout(e)),e.defaultPrevented}const je={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1};if(typeof ValidityState>`u`){let e=class{get valid(){return!0}constructor(){throw TypeError(`Illegal constructor`)}};Object.entries(je).forEach(([t,n])=>Object.assign(e.prototype,{get[t](){return n}})),globalThis.ValidityState=e}const L=e=>(()=>{let t=e,n=[],r,i,a=[],c=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l()],i=[u()],o(this,null,r,{kind:`setter`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,set:(e,t)=>{e.name=t}},metadata:e},null,n),o(this,null,i,{kind:`accessor`,name:`formDisabled`,static:!1,private:!1,access:{has:e=>`formDisabled`in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},a,c),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.formAssociated=!0}get form(){return this.internals.form}set name(e){this.setAttribute(`name`,`${e}`),this.updateFormValue()}get name(){return this.getAttribute(`name`)??``}get type(){return this.localName}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}#e;get formDisabled(){return this.#e}set formDisabled(e){this.#e=e}constructor(...e){super(...e),this._validityStates=(s(this,n),new Map),this.#e=s(this,a,!1),s(this,c),this.addEventListener?.(`invalid`,e=>e.preventDefault())}attributeChangedCallback(e,t,n){(e!==`name`||t!==n)&&super.attributeChangedCallback(e,t,n)}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}setCustomValidity(e){e?this.setValidityFlag(`customError`,e):this.removeValidityFlag(`customError`)}formDisabledCallback(e){this.formDisabled=this._hasDisabledAncestor()}_hasDisabledAncestor(){let e=this.parentElement;for(;e;){if(e.localName===`fieldset`&&e.hasAttribute(`disabled`))return!0;e=e.parentElement}return!1}requestUpdate(e,t,n){super.requestUpdate(e,t,n),e===`value`&&this.updateFormValue(),this.hasUpdated&&this.shouldValidate(e)&&this.validate()}firstUpdated(e){super.firstUpdated(e),this.validate()}updateFormValue(){let e,t=this.name??this.getAttribute(`name`);typeof this.value==`string`||this.value==null?e=this.value:Array.isArray(this.value)?(e=new FormData,this.value.forEach(n=>{e.append(t,typeof n==`string`?n:new Blob([JSON.stringify(n)],{type:`application/json`}))})):(e=new FormData,e.append(t,new Blob([JSON.stringify(this.value)],{type:`application/json`}))),this.internals.setFormValue(e,this.formState?.())}setValidityFlag(e,t,n){n??=!0;let r=this._validityStates.get(e);(!r||r.message!==t||r.flagValue!==n)&&(this._validityStates.set(e,{flagValue:n,message:t}),this._setInternalValidity())}removeValidityFlag(e){this._validityStates.has(e)&&(this._validityStates.delete(e),this._setInternalValidity())}validate(){}shouldValidate(e){return!e}_setInternalValidity(){let e=this._validityStates.get(`customError`)?.message,t={};this._validityStates.forEach(({flagValue:n,message:r},i)=>{t[i]=n,e||=r});let n=Object.keys(ValidityState.prototype).filter(e=>!(e in je)&&e!==`valid`);for(let e of n){let n=e in t&&t[e];Object.defineProperty(this.internals.validity,e,{value:n,configurable:!0}),n&&(t.customError=!0)}this.internals.setValidity(t,e),A&&Object.defineProperty(this.internals.validity,"customError",{value:this._validityStates.has(`customError`)||!!t.customError,configurable:!0}),this.dispatchEvent(new Event(`validity`))}}})();var Me=class extends L(F){static{this.role=`button`}constructor(){if(super(),this._preventScrollOnSpaceKeydown=e=>{e.key===` `&&(e.preventDefault(),this.internals.states.add(`active`))},this._removeActiveMarker=()=>{this.internals.states.delete(`active`)},this._dispatchClickEventOnSpaceKeyup=e=>{e.key===` `&&(this._removeActiveMarker(),this._dispatchClickEvent(e))},this._dispatchClickEvent=e=>{let{altKey:t,ctrlKey:n,metaKey:r,shiftKey:i}=e;e.target.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,pointerId:-1,pointerType:``,altKey:t,ctrlKey:n,metaKey:r,shiftKey:i}))},this.internals.states.add(`button`),!r){this.setupBaseEventHandlers();let e={passive:!0};this.addEventListener(`keydown`,this._preventScrollOnSpaceKeydown),this.addEventListener(`keyup`,this._dispatchClickEventOnSpaceKeyup,e),this.addEventListener(`blur`,this._removeActiveMarker,e),this.addEventListener(`keypress`,e=>{(e.key===`Enter`||e.key===`
18
+ `;const Te=r||!CSS.supports(`selector(:state(loading))`)?class extends Set{constructor(e){super(),this._host=e,this._applied=r,this._host.addController(this),r||Promise.resolve().then(()=>this._applyStates())}add(e){return this._applied&&this._toggleState(e,!0),super.add(e)}delete(e){return this._toggleState(e,!1),super.delete(e)}clear(){this.forEach(e=>this.delete(e))}hostConnected(){this._applyStates()}_toggleState(e,t){this._host.toggleAttribute(`state--${e}`,t)}_applyStates(){this._applied||(this._applied=!0,this.forEach(e=>this._toggleState(e,!0)))}}:null;if(!r){let e=0,t=e=>e.shadowRoot?.host??(e instanceof Element?e:(()=>{throw Error(`Unable to resolve related element! This should never happen.`)})()),n={attributes:!0,attributeFilter:[`id`]},r=(t,n,r)=>{let i=r[Element.name]??r[ElementInternals.name];t.setAttribute(n,i.id||=`aria-ref-${e++}`)},i=(t,n,r)=>{t.setAttribute(n,Object.values(r).reduce((e,t)=>e.concat(t)).filter((e,t,n)=>n.indexOf(e)===t).map(t=>t.id||=`aria-ref-${e++}`).join(` `))};for(let e of[ElementInternals,Element]){let a=e.prototype;if(!(`ariaActiveDescendantElement`in a)){let i=`aria-activedescendant`,o=/* @__PURE__ */ new WeakMap;Object.defineProperty(a,"ariaActiveDescendantElement",{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(i)?.split(/\s+/)[0]??null;return n?e.getRootNode().getElementById?.(n)??null:null},set(a){if(a!==null&&!(a instanceof Element))throw TypeError(`Failed to set the 'ariaActiveDescendantElement' property on '${e.name}': Failed to convert value to 'Element'.`);let s=t(this),c=o.get(s);if(c?.observer?.disconnect(),a===null)c&&(delete c.elements[e.name],Object.keys(c).length?c.observer.observe(Object.values(c.elements)[0],n):(o.delete(s),s.removeAttribute(i)));else if(c)c.elements[e.name]=a,r(s,i,c.elements),Object.values(c.elements).forEach(e=>c.observer.observe(e,n));else{let t={[e.name]:a};r(s,i,t);let c=new MutationObserver(()=>r(s,i,t));c.observe(a,n),o.set(s,{elements:t,observer:c})}}})}for(let r of[`ariaControlsElements`,`ariaDescribedByElements`,`ariaDetailsElements`,`ariaErrorMessageElements`,`ariaLabelledByElements`,`ariaOwnsElements`])if(!(r in a)){let o=/* @__PURE__ */ new WeakMap,s=`aria-${r.slice(4,-8).toLowerCase()}`;Object.defineProperty(a,r,{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(s)?.split(/\s+/).filter((e,t,n)=>n.indexOf(e)===t).map(t=>e.getRootNode().getElementById?.(t)).filter(e=>e instanceof Element);return n?.length?Object.freeze(n):null},set(a){if(a!==null&&(!Array.isArray(a)||a.some(e=>!(e instanceof Element))))throw TypeError(`Failed to set the '${r}' property on '${e.name}': Failed to convert value to 'Element'.`);let c=t(this);a=a?.filter((e,t,n)=>n.indexOf(e)===t)??null;let l=o.get(c);if(l?.observer?.disconnect(),a===null)l&&(delete l.elements[e.name],Object.keys(l.elements).length?Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n)):o.delete(c));else if(l)l.elements[e.name]=a,i(c,s,l.elements),Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n));else{let t={[e.name]:a};i(c,s,t);let r=new MutationObserver(()=>i(c,s,t));a.forEach(e=>r.observe(e,n)),o.set(c,{elements:t,observer:r})}}})}}}const Ee=/* @__PURE__ */ new WeakMap;function De(e){if(!e)return null;let t=Ee.get(e)?.states,n=function(e,t){t||t!==!1&&!this.has(e)?this.add(e):this.delete(e)};return t?{add(e){return t.add(e),this},delete:e=>t.delete(e),has:e=>t.has(e),toggle:n}:{add(t){return e.toggleAttribute(`state--${t}`,!0),this},delete:t=>e.toggleAttribute(`state--${t}`,!1),has:t=>e.hasAttribute(`state--${t}`),toggle:n}}var N=class extends Event{constructor(e){super(`slottedchange`,{composed:!0}),this.slot=e}};const Oe=(e,...t)=>{let n=t.filter(e=>!!e);return e?.length?e.concat(n):t.length?n:null},ke=(e,...t)=>{t=t.filter(e=>!!e);let n=e?.filter(e=>!t.includes(e))??null;return n?.length?n:null};var P=class extends e{static{this._$sbbElement$=!0}static{this.styles=[a(we)]}get hydrationComplete(){return this._hydrationComplete}get hydrationRequired(){return this._hydrationRequired}constructor(){if(super(),this.internals=this.attachInternals(),this._hydrationComplete=new Promise(e=>this._resolveHydration=e),Ee.set(this,this.internals),Te)Object.defineProperty(this.internals,"states",{value:new Te(this),writable:!1,configurable:!1,enumerable:!1});else for(let e of this.getAttributeNames().filter(e=>e.startsWith(`state--`)))this.internals.states.add(e.slice(7)),this.removeAttribute(e);let e=this.constructor.role;if(e&&(this.internals.role=e),this._hydrationRequired=!!this.shadowRoot,!this._hydrationRequired)this._resolveHydration(!1);else{let e=e=>{this._hydrationRequired&&e.stopImmediatePropagation()},t={capture:!0},n=this.shadowRoot?.querySelectorAll(`slot`);n?.length&&(n.forEach(n=>n.addEventListener(`slotchange`,e,t)),this.hydrationComplete.then(()=>n.forEach(n=>{n.removeEventListener(`slotchange`,e,t),n.assignedNodes().length&&n.dispatchEvent(new Event(`slotchange`,{bubbles:!0}))})))}}static define(){if(!this.elementName)throw Error(`The static property "elementName" is not defined on ${this.name}. Please define it to register the custom element.`);if(!customElements.get(this.elementName)){customElements.define(this.elementName,this);let e=[],t=this;for(;t._$sbbElement$;)Array.isArray(t.elementDependencies)&&e.push(...t.elementDependencies),t=Object.getPrototypeOf(t);new Set(e).forEach(e=>e.define())}}static finalizeStyles(t){let n=[],r=this;for(;r&&r!==e;)Object.hasOwn(r,`styles`)&&r.styles&&n.unshift(r.styles),r=Object.getPrototypeOf(r);return super.finalizeStyles(n)}createRenderRoot(){let e=super.createRenderRoot();return this.shadowRoot?.addEventListener(`slotchange`,e=>this._slotchangeHandler(e,e.target)),this.shadowRoot?.addEventListener(`slottedchange`,e=>this._slotchangeHandler(e,e.slot),{capture:!0}),this.shadowRoot?.querySelectorAll?.(`slot`).forEach(e=>this._handleSlotChangeForSlottedState(e)),e}addController(e){super.addController(e),(this._controllers??=/* @__PURE__ */ new Set).add(e)}removeController(e){super.removeController(e),this._controllers?.delete(e)}requestUpdate(e,t,n,r,i){if(super.requestUpdate(e,t,n,r,i),e){let a={oldValue:t,value:r?i:this[e]};this._controllers?.forEach(t=>t.hostPropertyUpdate?.(e,a,n))}}update(e){super.update(e),this._hydrationRequired&&(this._hydrationRequired=!1,this._resolveHydration(!0))}toggleState(e,t){t||t!==!1&&!this.internals.states.has(e)?this.internals.states.add(e):this.internals.states.delete(e)}_slotchangeHandler(e,t){let n=this.shadowRoot.contains(t)?t:e.composedPath().find(e=>e instanceof HTMLSlotElement&&this.shadowRoot.contains(e));n&&this._handleSlotChangeForSlottedState(n)}_handleSlotChangeForSlottedState(e){this._updateSlottedState(e),e.name||this._observeTextNodesInSlot(e)}_updateSlottedState(e){let t=e.name?`slotted-${e.name}`:`slotted`,n=this._hasSlottedContent(e);n&&!this.internals.states.has(t)?(this.internals.states.add(t),this.dispatchEvent(new N(e))):!n&&this.internals.states.has(t)&&(this.internals.states.delete(t),this.dispatchEvent(new N(e)))}_observeTextNodesInSlot(e){this._textObserver?.disconnect(),this._textObserver??=new MutationObserver(()=>{let e=this.shadowRoot.querySelector(`slot:not([name])`);e?this._updateSlottedState(e):this._textObserver.disconnect()}),e.assignedNodes().filter(e=>e.nodeType===e.TEXT_NODE).forEach(e=>this._textObserver.observe(e,{characterData:!0}))}_hasSlottedContent(e){return e.name?e.assignedElements().some(e=>!(e instanceof HTMLSlotElement)||this._hasSlottedContent(e)):e.assignedNodes().some(e=>e instanceof HTMLSlotElement?this._hasSlottedContent(e):e.nodeType!==e.TEXT_NODE||!!e.textContent?.trim())}},F=class extends P{get maybeDisabled(){let e=this;return e.disabled||e.formDisabled}get maybeDisabledInteractive(){return this.disabledInteractive}constructor(){super(),this.internals.states.add(`action`)}connectedCallback(){super.connectedCallback()}setupBaseEventHandlers(){this.addEventListener(`click`,e=>{this.maybeDisabled&&!this.maybeDisabledInteractive&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0})}renderTemplate(){throw Error(`Implementation needed!`)}render(){return n`<span class="sbb-action-base ${this.localName}">${this.renderTemplate()}</span>`}};const I=e=>(t,n)=>{let{kind:r,metadata:i,name:a}=n,o=globalThis.litPropertyMetadata.get(i)?.get(a)?.type??String;if(e??=o,e===String?e=e=>e==null?``:String(e):e===Number&&(e=e=>e==null?NaN:Number(e)),r===`accessor`)return{set(n){t.set.call(this,e(n))}};if(r===`setter`)return function(n){t.call(this,e(n))};throw Error(`Unsupported decorator location: ${r}`)};async function Ae(e){return await new Promise(e=>setTimeout(e)),e.defaultPrevented}const je={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1};if(typeof ValidityState>`u`){let e=class{get valid(){return!0}constructor(){throw TypeError(`Illegal constructor`)}};Object.entries(je).forEach(([t,n])=>Object.assign(e.prototype,{get[t](){return n}})),globalThis.ValidityState=e}const L=e=>(()=>{let t=e,n=[],r,i,a=[],c=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;r=[l()],i=[u()],o(this,null,r,{kind:`setter`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,set:(e,t)=>{e.name=t}},metadata:e},null,n),o(this,null,i,{kind:`accessor`,name:`formDisabled`,static:!1,private:!1,access:{has:e=>`formDisabled`in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},a,c),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.formAssociated=!0}get form(){return this.internals.form}set name(e){this.setAttribute(`name`,`${e}`),this.updateFormValue()}get name(){return this.getAttribute(`name`)??``}get type(){return this.localName}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}#e;get formDisabled(){return this.#e}set formDisabled(e){this.#e=e}constructor(...e){super(...e),this._validityStates=(s(this,n),/* @__PURE__ */ new Map),this.#e=s(this,a,!1),s(this,c),this.addEventListener?.(`invalid`,e=>e.preventDefault())}attributeChangedCallback(e,t,n){(e!==`name`||t!==n)&&super.attributeChangedCallback(e,t,n)}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}setCustomValidity(e){e?this.setValidityFlag(`customError`,e):this.removeValidityFlag(`customError`)}formDisabledCallback(e){this.formDisabled=this._hasDisabledAncestor()}_hasDisabledAncestor(){let e=this.parentElement;for(;e;){if(e.localName===`fieldset`&&e.hasAttribute(`disabled`))return!0;e=e.parentElement}return!1}requestUpdate(e,t,n){super.requestUpdate(e,t,n),e===`value`&&this.updateFormValue(),this.hasUpdated&&this.shouldValidate(e)&&this.validate()}firstUpdated(e){super.firstUpdated(e),this.validate()}updateFormValue(){let e,t=this.name??this.getAttribute(`name`);typeof this.value==`string`||this.value==null?e=this.value:Array.isArray(this.value)?(e=new FormData,this.value.forEach(n=>{e.append(t,typeof n==`string`?n:new Blob([JSON.stringify(n)],{type:`application/json`}))})):(e=new FormData,e.append(t,new Blob([JSON.stringify(this.value)],{type:`application/json`}))),this.internals.setFormValue(e,this.formState?.())}setValidityFlag(e,t,n){n??=!0;let r=this._validityStates.get(e);(!r||r.message!==t||r.flagValue!==n)&&(this._validityStates.set(e,{flagValue:n,message:t}),this._setInternalValidity())}removeValidityFlag(e){this._validityStates.has(e)&&(this._validityStates.delete(e),this._setInternalValidity())}validate(){}shouldValidate(e){return!e}_setInternalValidity(){let e=this._validityStates.get(`customError`)?.message,t={};this._validityStates.forEach(({flagValue:n,message:r},i)=>{t[i]=n,e||=r});let n=Object.keys(ValidityState.prototype).filter(e=>!(e in je)&&e!==`valid`);for(let e of n){let n=e in t&&t[e];Object.defineProperty(this.internals.validity,e,{value:n,configurable:!0}),n&&(t.customError=!0)}this.internals.setValidity(t,e),A&&Object.defineProperty(this.internals.validity,"customError",{value:this._validityStates.has(`customError`)||!!t.customError,configurable:!0}),this.dispatchEvent(new Event(`validity`))}}})();var Me=class extends L(F){static{this.role=`button`}constructor(){if(super(),this._preventScrollOnSpaceKeydown=e=>{e.key===` `&&(e.preventDefault(),this.internals.states.add(`active`))},this._removeActiveMarker=()=>{this.internals.states.delete(`active`)},this._dispatchClickEventOnSpaceKeyup=e=>{e.key===` `&&(this._removeActiveMarker(),this._dispatchClickEvent(e))},this._dispatchClickEvent=e=>{let{altKey:t,ctrlKey:n,metaKey:r,shiftKey:i}=e;e.target.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,pointerId:-1,pointerType:``,altKey:t,ctrlKey:n,metaKey:r,shiftKey:i}))},this.internals.states.add(`button`),!r){this.setupBaseEventHandlers();let e={passive:!0};this.addEventListener(`keydown`,this._preventScrollOnSpaceKeydown),this.addEventListener(`keyup`,this._dispatchClickEventOnSpaceKeyup,e),this.addEventListener(`blur`,this._removeActiveMarker,e),this.addEventListener(`keypress`,e=>{(e.key===`Enter`||e.key===`
19
19
  `)&&this._dispatchClickEvent(e)},e)}}connectedCallback(){super.connectedCallback(),this.tabIndex=0}attributeChangedCallback(e,t,n){(![`name`,`value`].includes(e)||t!==n)&&super.attributeChangedCallback(e,t,n)}};let Ne=(()=>{let e=Me,t=[],n,r=[],i=[],a,c;return class extends e{static{let s=typeof Symbol==`function`&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;n=[I(),l()],a=[l()],c=[l()],o(this,null,n,{kind:`accessor`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:s},r,i),o(this,null,a,{kind:`setter`,name:`type`,static:!1,private:!1,access:{has:e=>`type`in e,set:(e,t)=>{e.type=t}},metadata:s},null,t),o(this,null,c,{kind:`setter`,name:`form`,static:!1,private:!1,access:{has:e=>`form`in e,set:(e,t)=>{e.form=t}},metadata:s},null,t),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}#e;get value(){return this.#e}set value(e){this.#e=e}set type(e){this.setAttribute(`type`,`${e}`)}get type(){return this.getAttribute(`type`)??`button`}set form(e){this._formId=e,this.form?.addEventListener(`keydown`,this._formKeyDown,{capture:!0})}get form(){return this._formId?this.getRootNode?.()?.getElementById?.(this._formId)??null:this.internals.form}constructor(){super(),this._elementsOnWhichEnterPressTriggersSubmit=(s(this,t),[`input`,`sbb-date-input`,`sbb-time-input`]),this.#e=s(this,r,``),this._formId=(s(this,i),``),this._handleButtonClick=async e=>{if(this.type===`button`||await Ae(e))return;let t=this.form;if(t)this.type===`submit`?this._requestSubmit(t):this.type===`reset`&&t.reset();else return},this._formKeyDown=e=>{let t=this.form;this.type===`submit`&&t&&(e.key===`Enter`||e.key===`
20
- `)&&this._elementsOnWhichEnterPressTriggersSubmit.includes(e.target?.localName)&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault(),e.composedPath()[0].dispatchEvent(new KeyboardEvent(e.type,e))&&!this.matches(`:disabled`)&&this._requestSubmit(t))},this.addEventListener(`click`,this._handleButtonClick)}connectedCallback(){super.connectedCallback(),this.form?.addEventListener(`keydown`,this._formKeyDown,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener(`keydown`,this._formKeyDown,{capture:!0})}_requestSubmit(e){let t=document.createElement(`button`);t.inert=!0,t.hidden=!0,t.name=this.name,t.value=this.value??``,e.append(t),e.requestSubmit(t),t.remove()}formResetCallback(){}formStateRestoreCallback(e,t){}updateFormValue(){}}})();function R(){return`sbbConfig`in globalThis||(globalThis.sbbConfig={}),globalThis.sbbConfig}function Pe(e){let t=R();Object.assign(t,e)}var z=class e{static{this._defaultLanguage=`en`}static{this._supportedLocales=[`en`,`de`,`fr`,`it`]}static{this._listeners=new Set}static{this._observer=r?null:new MutationObserver(t=>{t[0].oldValue!==document.documentElement.getAttribute(`lang`)&&e._listeners.forEach(e=>e._callHandlers())})}static{this._observerConfig={attributeFilter:[`lang`],attributeOldValue:!0}}static get current(){let t=((R().language??(r?e._defaultLanguage:document.documentElement.getAttribute(`lang`)))||e._defaultLanguage).split(`-`)[0];return e._supportedLocales.includes(t)?t:e._defaultLanguage}get current(){return e.current}constructor(e){this._host=e,this._handlers=[],this._host.addController(this)}withHandler(e){return this._handlers.unshift(e),this}hostConnected(){r||(e._listeners.size||e._observer.observe(document.documentElement,e._observerConfig),e._listeners.add(this),this._previousLanguage!==this.current&&this._callHandlers(this._previousLanguage!==void 0))}hostDisconnected(){r||(this._previousLanguage=this.current,e._listeners.delete(this),e._listeners.size||e._observer.disconnect())}_callHandlers(e=!0){this._handlers.forEach(e=>e()),e&&this._host.requestUpdate()}};const B={toAttribute(e,n){return(n===String||n===void 0)&&e===``||n===Number&&isNaN(e)?null:t.toAttribute(e,n)}},Fe={de:`Richtung`,en:`Direction`,fr:`Direction`,it:`Direzione`},Ie={de:`Ankunft`,en:`Arrival`,fr:`Arrivée`,it:`Arrivo`},Le={de:`Sektor`,en:`Sector`,fr:`Secteur`,it:`Settore`},Re={de:`Skt.`,en:`Sec.`,fr:`Sect.`,it:`Set.`},ze={de:`und`,en:`and`,fr:`et`,it:`e`},Be={first:{de:`Erste Klasse`,en:`First Class`,fr:`Première classe`,it:`Prima classe`},second:{de:`Zweite Klasse`,en:`Second Class`,fr:`Deuxième classe`,it:`Seconda classe`}},Ve={de:`Zug`,en:`Train`,fr:`Train`,it:`Treno`},He={de:`Züge`,en:`Trains`,fr:`Trains`,it:`Treni`},Ue={de:`Wagen des Zuges`,en:`Coaches of the train`,fr:`Wagons du train`,it:`Carrozze del treno`},We={de:`Wagen`,en:`Train coach`,fr:`Wagon`,it:`Carrozza del treno`},Ge={de:`Nummer`,en:`Number`,fr:`Numéro`,it:`Numero`},Ke={de:`Geschlossener Zugwaggon`,en:`Closed train coach`,fr:`Wagon du train fermé`,it:`Carrozza del treno chiuso`},qe={de:`Lokomotive`,en:`Locomotive`,fr:`Locomotive`,it:`Locomotiva`},Je={de:`Schlafwagen`,en:`Sleeping car`,fr:`Voiture-lits`,it:`Carrozza letti`},Ye={de:`Liegewagen`,en:`Couchette car`,fr:`Voiture-couchettes`,it:`Carrozza cuccette`},Xe={de:`Speisewagen`,en:`Dining car`,fr:`Voiture-restaurant`,it:`Carrozza ristorante`},Ze={previous:{de:`Kein Durchgang zum vorherigen Wagen`,en:`No passage to the previous train coach`,fr:`Pas de passage au wagon du train précédent`,it:`Nessun passaggio alla carrozza del treno precedente`},next:{de:`Kein Durchgang zum nächsten Wagen`,en:`No passage to the next train coach`,fr:`Pas de passage au wagon du train suivant`,it:`Nessun passaggio alla carrozza del treno successivo`},both:{de:`Kein Durchgang zum nächsten und vorherigen Wagen`,en:`No passage to the next and previous train coach`,fr:`Pas de passage au wagon du train suivant et précédent`,it:`Nessun passaggio alla carrozza del treno successivo e precedente`}},Qe={de:`Zusätzliche Wageninformation`,en:`Additional wagon information`,fr:`Informations supplémentaires sur les wagons`,it:`Informazioni aggiuntive sulla carrozza del treno`},$e={de:`Abfahrt`,en:`Departure`,fr:`Départ`,it:`Partenza`},et={de:`nicht barrierefrei`,en:`not accessible`,fr:`non accessible`,it:`non accessibile`},tt={de:`herunterladen`,en:`download`,fr:`télécharger`,it:`scaricare`},nt={single:{long:{de:`Minute`,en:`Minute`,fr:`Minute`,it:`Minuto`},short:{de:`m`,en:`m`,fr:`m`,it:`m`}},multiple:{long:{de:`Minuten`,en:`Minutes`,fr:`Minutes`,it:`Minuti`},short:{de:`Min`,en:`min`,fr:`min.`,it:`mins`}}},rt={single:{long:{de:`Stunde`,en:`Hour`,fr:`Heure`,it:`Ora`},short:{de:`Std.`,en:`h`,fr:`ore`,it:`hrs`}},multiple:{long:{de:`Stunden`,en:`Hours`,fr:`Heures`,it:`Ore`},short:{de:`Std.`,en:`h`,fr:`ore`,it:`hrs`}}},it={single:{long:{de:`Tag`,en:`Day`,fr:`Jour`,it:`Giorno`}},multiple:{long:{de:`Tage`,en:`Days`,fr:`Jours`,it:`Giorni`}}},at={de:`Gleisänderung im Verlauf dieser Verbindung`,en:`Track change in the course of this connection`,fr:`Changement de voie sur le parcours de cette connexion`,it:`Cambiamento di binario nel corso di questa connessione`},ot={de:`Reisedauer`,en:`Travel time`,fr:`Durée du voyage`,it:`Durata del viaggio`},st={de:`Reisehinweise`,en:`Travelhints`,fr:`Indications sur le voyage`,it:`Indicazioni di viaggio`},ct={de:`Echtzeitinformationen`,en:`Real time information`,fr:`Informations en temps réel`,it:`Informazioni in tempo reale`},lt={de:`mal umsteigen`,en:`change`,fr:`changement de train`,it:`cambio`},ut={de:`mal umsteigen`,en:`changes`,fr:`changements de train`,it:`cambi`},dt={de:`neu`,en:`new`,fr:`nouveau`,it:`nuovo`},ft={de:`Auf`,en:`on`,fr:`sur`,it:`su`},pt={de:`Sparbillette`,en:`Supersaver tickets`,fr:`Billets dégriffés`,it:`Biglietti risparmio`},mt={none:{de:`Keine Belegungsprognose verfügbar`,en:`No occupancy forecast available`,fr:`Aucune prévision d'occupation disponible`,it:`Nessuna previsione di occupazione disponibile`},low:{de:`Tiefe bis mittlere Belegung erwartet`,en:`Low to average occupancy expected`,fr:`Taux d’occupation faible à moyen prévu`,it:`È prevista un’occupazione medio-bassa`},medium:{de:`Hohe Belegung erwartet`,en:`High occupancy expected`,fr:`Taux d’occupation élevé prévu`,it:`È prevista un’occupazione elevata`},high:{de:`Sehr hohe Belegung erwartet`,en:`Very high occupancy expected`,fr:`Taux d’occupation très élevé prévu`,it:`È prevista un’occupazione molto elevata`}},ht={funicular:{de:`Seilbahn/Zahnradbahn`,en:`Funicular/Cog railway`,fr:`Funiculaire/Chemin de fer à crémaillère`,it:`Funivia/Ferrovia a cremagliera`},ec_id:{de:`EC/IC`,en:`EC/IC`,fr:`EC/IC`,it:`EC/IC`},bus:{de:`Bus`,en:`Bus`,fr:`Bus`,it:`Bus`},re:{de:`RE`,en:`RE`,fr:`RE`,it:`RE`},arz_ext:{de:`ARZ/EXT`,en:`ARZ/EXT`,fr:`ARZ/EXT`,it:`ARZ/EXT`},ice_tgv_rjx:{de:`ICE/TGV/RJX`,en:`ICE/TGV/RJX`,fr:`ICE/TGV/RJX`,it:`ICE/TGV/RJX`},ir_pe:{de:`IR/PE`,en:`IR/PE`,fr:`IR/PE`,it:`IR/PE`},s_sn_r:{de:`S/SN/R`,en:`S/SN/R`,fr:`S/SN/R`,it:`S/SN/R`},tramway:{de:`Tram/Metro`,en:`Tramway/Underground`,fr:`Tram/Métro`,it:`Tram/Metro`},ship:{de:`Schiff`,en:`Ship`,fr:`Bateau`,it:`Battello`},train:{de:`Zug`,en:`Train`,fr:`Train`,it:`Treno`}},gt={de:`Linkziel öffnet in neuem Fenster.`,en:`Link target opens in a new window.`,fr:`Le lien s'ouvre dans une nouvelle fenêtre.`,it:`Il link si apre in una nuova finestra.`},_t={de:`Minuten Fussweg nach Ankunft:`,en:`minutes of walking time after arrival:`,fr:`minutes de trajet à pied après l’arrivée:`,it:`minuti a piedi all’arrivo:`},vt={de:`Minuten Fussweg vor Abfahrt:`,en:`minutes of walking time before departure:`,fr:`minutes de trajet à pied avant le départ:`,it:`minuti a piedi prima della partenza:`},yt={de:`Meldung schliessen`,en:`Close message`,fr:`Fermer le message`,it:`Chiudere il messaggio`},bt={de:`Nachricht schliessen`,en:`Close message`,fr:`Fermer le message`,it:`Chiudere il messaggio`},xt={de:`Dialog`,en:`Dialog`,fr:`Dialogue`,it:`Dialogo`},St={de:`Übergelagertes Fenster schliessen`,en:`Close secondary window`,fr:`Fermer la fenêtre superposée`,it:`Chiudere la finestra sovrapposta`},Ct={de:`Navigation schliessen`,en:`Close navigation`,fr:`Fermer la navigation`,it:`Chiudere la navigazione`},wt={de:`Seitenleiste schliessen`,en:`Close sidebar`,fr:`Fermer la barre latérale`,it:`Chiudere la barra laterale`},Tt={de:`Hinweis schliessen`,en:`Close note`,fr:`Fermer la note`,it:`Chiudere la nota`},Et={de:`Zurück`,en:`Go back`,fr:`Retourner`,it:`Indietro`},Dt={de:`Heute`,en:`Today`,fr:`Aujourd’hui`,it:`Oggi`},Ot={de:`Zum nächsten Monat wechseln`,en:`Change to the next month`,fr:`Passer au mois suivant`,it:`Passare al mese successivo`},kt={de:`Zum letzten Monat wechseln`,en:`Change to the previous month`,fr:`Passer au mois précédent`,it:`Passare al mese precedente`},At={de:`Nächster Tag`,en:`Next day`,fr:`Jour suivant`,it:`Giorno successivo`},jt={de:`Vorheriger Tag`,en:`Previous day`,fr:`Jour précédent`,it:`Giorno precedente`},Mt={de:`Jahr und Monat auswählen`,en:`Choose year and month`,fr:`Choisir l’année et le mois`,it:`Seleziona anno e mese`},Nt={de:`Wechsel zur Datumsauswahl`,en:`Change to date selection`,fr:`Passer à la sélection de date`,it:`Passare alla selezione della data`},Pt=e=>({de:`Wechsel zu den nächsten ${e} Jahren`,en:`Change to the next ${e} years`,fr:`Passer aux ${e} prochaines années`,it:`Passare ai successivi ${e} anni`}),Ft=e=>({de:`Wechsel zu den vorherigen ${e} Jahren`,en:`Change to the previous ${e} years`,fr:`Passage aux ${e} précédentes années`,it:`Passare ai precedenti ${e} anni`}),It={de:`Zum nächsten Jahr wechseln`,en:`Change to the next year`,fr:`Passer à l'année suivante`,it:`Passare all'anno successivo`},Lt={de:`Zum letzten Jahr wechseln`,en:`Change to the previous year`,fr:`Passer à l'année précédent`,it:`Passare all'anno precedente`},Rt=e=>({de:`Zum nächsten Tag wechseln, derzeit ausgewählt ${e}.`,en:`Change to the next day, currently selected ${e}.`,fr:`Passer au jour suivant, actuellement sélectionné ${e}.`,it:`Passare al giorno successivo, attualmente selezionato ${e}.`}),zt=e=>({de:`Zum vorherigen Tag wechseln, derzeit ausgewählt ${e}.`,en:`Change to the previous day, currently selected ${e}.`,fr:`Passer au jour précédent, actuellement sélectionné ${e}.`,it:`Passare al giorno precedente, attualmente selezionato ${e}.`}),Bt={de:`Kalender anzeigen`,en:`Show calendar`,fr:`Afficher le calendrier`,it:`Visualizza il calendario`},Vt={de:`TT.MM.JJJJ`,en:`DD.MM.YYYY`,fr:`JJ.MM.AAAA`,it:`GG.MM.AAAA`},Ht={de:`Datum geändert auf`,en:`Date changed to`,fr:`Date modifiée au`,it:`Data modificata in`},Ut={de:`Verbindung von`,en:`Connection from`,fr:`Liaison de`,it:`Collegamento da`},Wt={de:`nach`,en:`to`,fr:`à`,it:`a`},Gt=e=>({de:`und zurück nach ${e}.`,en:`and back to ${e}.`,fr:`et retour à ${e}.`,it:`e ritorno a ${e}.`}),Kt={de:`erweitert`,en:`expanded`,fr:`étendu`,it:`espanso`},qt={de:`reduziert`,en:`collapsed`,fr:`condensé`,it:`compresso`},Jt={de:`Karte zeigen`,en:`Show map`,fr:`Afficher la carte`,it:`Mostra la mappa`},Yt={de:`Mehr Breadcrumbs anzeigen`,en:`Show more breadcrumbs`,fr:`Afficher plus de fils d’Ariane`,it:`Mostra più breadcrumbs`},Xt={de:`Feldinhalt löschen`,en:`Clear input value`,fr:`Effacer la valeur d’entrée`,it:`Cancella il valore dell’input`},Zt={de:`Klicken Sie auf diese Karte für Details`,en:`Click on this card for details`,fr:`Cliquez sur cette carte pour plus de détails`,it:`Clicca su questa scheda per i dettagli`},Qt={de:`Klicken Sie auf diese Karte, um zurück zur Zusammenfassung zu gelangen`,en:`Click on this card to go back to the summary`,fr:`Cliquez sur cette carte pour revenir au résumé`,it:`Clicca su questa scheda per tornare al sommario`},$t={de:`Datei auswählen`,en:`Choose a file`,fr:`Choisissez un fichier`,it:`Scegli un file`},en={de:`Dateien auswählen`,en:`Choose files`,fr:`Choisissez des fichiers`,it:`Scegli file`},tn={de:`Ziehen Sie Ihre Datei hier hin (Drag & Drop)`,en:`Drag & Drop your file here`,fr:`Faites glisser et déposez votre fichier ici`,it:`Trascina e rilascia il file qui`},nn={de:`Ziehen Sie Ihre Dateien hier hin (Drag & Drop)`,en:`Drag & Drop your files here`,fr:`Faites glisser et déposez vos fichiers ici`,it:`Trascina e rilascia i file qui`},rn={de:`Datei entfernen`,en:`Remove file`,fr:`Effacer le fichier`,it:`Rimuovi il file`},an=e=>e&&e.length>0?{de:`Aktuell ausgewählte Datei: ${e.join(`, `)}.`,en:`Currently selected files: ${e.join(`, `)}.`,fr:`Fichier actuellement sélectionné: ${e.join(`, `)}.`,it:`File attualmente selezionato: ${e.join(`, `)}.`}:{de:`Keine Datei ausgewählt.`,en:`No files selected.`,fr:`Nessun fichier sélectionné.`,it:`Nessun file selezionato.`},on={de:`Nächste Seite`,en:`Next page`,fr:`Page suivante`,it:`Pagina successiva`},sn={de:`Vorherige Seite`,en:`Previous page`,fr:`Page précédente`,it:`Pagina precedente`},cn={de:`Seite`,en:`Page`,fr:`Page`,it:`Pagina`},ln={de:`Einträge pro Seite`,en:`Items per page`,fr:`Entrées par page`,it:`Elementi per pagina`},un={de:`ausgewählt`,en:`selected`,fr:`sélectionnée`,it:`selezionata`},dn={de:`von`,en:`of`,fr:`sur`,it:`di`},fn={de:`Muss gesetzt sein.`,en:`Must be checked.`,fr:`Doit être cochée.`,it:`Deve essere impostato.`},pn={de:`Auswahl erforderlich.`,en:`Selection required.`,fr:`Sélection requise.`,it:`Selezione necessaria.`},mn={de:`Eingabe erforderlich.`,en:`Input required.`,fr:`Entrée obligatoire.`,it:`Inserimento necessario.`},hn={de:`Bitte gültiges Datum eingeben.`,en:`Please provide a valid date.`,fr:`Veuillez saisir une date valide.`,it:`Inserire una data valida.`},gn=e=>({de:`Datum darf nicht vor ${e} sein.`,en:`Date must not be before ${e}.`,fr:`La date ne doit pas être antérieure au ${e}.`,it:`La data non deve essere anteriore al ${e}.`}),_n=e=>({de:`Datum darf nicht nach ${e} sein.`,en:`Date must not be after ${e}.`,fr:`La date ne doit pas être postérieure au ${e}.`,it:`La data non deve essere successiva al ${e}.`}),vn=e=>({de:`Zeit geändert zu ${e}.`,en:`Time changed to ${e}.`,fr:`Heure modifiée: ${e}.`,it:`Orario modificata alle ${e}.`}),yn={de:`Bitte gültige Zeit eingeben.`,en:`Please provide a valid time.`,fr:`Veuillez saisir une heure valide.`,it:`Inserisci un orario valido.`},bn={de:`Zeit darf nicht nach 23:59 sein.`,en:`Time must not be after 23:59.`,fr:`L’heure ne doit pas être postérieure à 23h59.`,it:`L’orario non può essere successivo alle 23.59.`},xn={de:`Die Zeiteingabe darf nicht mehr als fünf Zeichen haben.`,en:`The time input must not exceed five characters.`,fr:`La saisie de l’heure ne doit pas comporter plus de cinq caractères.`,it:`L’indicazione temporale non può contenere più di cinque caratteri.`},Sn={de:`Drücken Sie die Entfernen-Taste um den Chip zu löschen`,en:`Press the Delete button to remove the chip`,fr:`Appuyez sur la touche Del pour supprimer cette puce`,it:`Premi il tasto Canc per rimuovere questa chip`},Cn={de:`Ausgewählte Elemente:`,en:`Selected elements:`,fr:`Éléments sélectionnés:`,it:`Elementi selezionati:`},wn={de:`Woche`,en:`Week`,fr:`Semaine`,it:`Settimana`},Tn={de:`Von und Nach tauschen`,en:`Swap from and to`,fr:`Échanger de et à`,it:`Inverti Da e A`},En=(e,t)=>({de:`${e} von ${t}`,en:`${e} of ${t}`,fr:`${e} sur ${t}`,it:`${e} di ${t}`}),Dn={de:`Karussell – Benutzen Sie die Pfeiltasten im Interaktionsmodus, um durch die Folien zu navigieren`,en:`Carousel - Use the arrow keys in interaction mode to navigate through the slides`,fr:`Carrousel – Utilisez les touches fléchées en mode interaction pour naviguer dans les diapositives`,it:`Carosello – Utilizzare i tasti freccia in modalità interazione per navigare tra le slide`},On={de:`Nächste Folie`,en:`Next slide`,fr:`Diapositive suivante`,it:`Slide successiva`},kn={de:`Vorherige Folie`,en:`Previous slide`,fr:`Diapositive précédente`,it:`Slide precedente`},An={de:`Folie`,en:`Slide`,fr:`Diapositive`,it:`Slide`},jn={de:`Zeichen übrig`,en:`characters remaining`,fr:`caractères restants`,it:`caratteri rimanenti`};let Mn=(()=>{let e=F,t,a=[],c=[],u,d=[],f=[],p,m=[],h=[],g,_=[],v=[],y,b=[],x=[],S,C=[],w=[];return class extends e{static{let n=typeof Symbol==`function`&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[I(),l({reflect:!0,converter:B})],u=[I(),l({reflect:!0,converter:B})],p=[I(),l({reflect:!0,converter:B})],g=[I(),l({type:Boolean,reflect:!0})],y=[I(),l({attribute:`accessibility-label`})],S=[I(),l({attribute:`accessibility-current`})],o(this,null,t,{kind:`accessor`,name:`href`,static:!1,private:!1,access:{has:e=>`href`in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:n},a,c),o(this,null,u,{kind:`accessor`,name:`target`,static:!1,private:!1,access:{has:e=>`target`in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:n},d,f),o(this,null,p,{kind:`accessor`,name:`rel`,static:!1,private:!1,access:{has:e=>`rel`in e,get:e=>e.rel,set:(e,t)=>{e.rel=t}},metadata:n},m,h),o(this,null,g,{kind:`accessor`,name:`download`,static:!1,private:!1,access:{has:e=>`download`in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:n},_,v),o(this,null,y,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:n},b,x),o(this,null,S,{kind:`accessor`,name:`accessibilityCurrent`,static:!1,private:!1,access:{has:e=>`accessibilityCurrent`in e,get:e=>e.accessibilityCurrent,set:(e,t)=>{e.accessibilityCurrent=t}},metadata:n},C,w),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}#e;get href(){return this.#e}set href(e){this.#e=e}#t;get target(){return this.#t}set target(e){this.#t=e}#n;get rel(){return this.#n}set rel(e){this.#n=e}#r;get download(){return this.#r}set download(e){this.#r=e}#i;get accessibilityLabel(){return this.#i}set accessibilityLabel(e){this.#i=e}#a;get accessibilityCurrent(){return this.#a}set accessibilityCurrent(e){this.#a=e}constructor(){super(),this.#e=s(this,a,``),this.#t=(s(this,c),s(this,d,``)),this.#n=(s(this,f),s(this,m,``)),this.#r=(s(this,h),s(this,_,!1)),this.#i=(s(this,v),s(this,b,``)),this.#a=(s(this,x),s(this,C,``)),this.language=(s(this,w),new z(this)),this.anchorRole=null,this._evaluateRelAttribute=e=>this.rel?this.rel:e===`_blank`?`external noopener nofollow`:i,this.internals.states.add(`link`),r||this.setupBaseEventHandlers()}focus(e){this.shadowRoot.querySelector(`a`)?.focus(e)}blur(){this.shadowRoot.querySelector(`a`)?.blur()}click(){this.shadowRoot.querySelector(`a`)?.click()}resolveTarget(){return this.target}render(){return this.renderLink(this.renderTemplate())}renderLink(e){let t=this.resolveTarget(),r=!!this.href&&t===`_blank`;return n`
20
+ `)&&this._elementsOnWhichEnterPressTriggersSubmit.includes(e.target?.localName)&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault(),e.composedPath()[0].dispatchEvent(new KeyboardEvent(e.type,e))&&!this.matches(`:disabled`)&&this._requestSubmit(t))},this.addEventListener(`click`,this._handleButtonClick)}connectedCallback(){super.connectedCallback(),this.form?.addEventListener(`keydown`,this._formKeyDown,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener(`keydown`,this._formKeyDown,{capture:!0})}_requestSubmit(e){let t=document.createElement(`button`);t.inert=!0,t.hidden=!0,t.name=this.name,t.value=this.value??``,e.append(t),e.requestSubmit(t),t.remove()}formResetCallback(){}formStateRestoreCallback(e,t){}updateFormValue(){}}})();function R(){return`sbbConfig`in globalThis||(globalThis.sbbConfig={}),globalThis.sbbConfig}function Pe(e){let t=R();Object.assign(t,e)}var z=class e{static{this._defaultLanguage=`en`}static{this._supportedLocales=[`en`,`de`,`fr`,`it`]}static{this._listeners=/* @__PURE__ */ new Set}static{this._observer=r?null:new MutationObserver(t=>{t[0].oldValue!==document.documentElement.getAttribute(`lang`)&&e._listeners.forEach(e=>e._callHandlers())})}static{this._observerConfig={attributeFilter:[`lang`],attributeOldValue:!0}}static get current(){let t=((R().language??(r?e._defaultLanguage:document.documentElement.getAttribute(`lang`)))||e._defaultLanguage).split(`-`)[0];return e._supportedLocales.includes(t)?t:e._defaultLanguage}get current(){return e.current}constructor(e){this._host=e,this._handlers=[],this._host.addController(this)}withHandler(e){return this._handlers.unshift(e),this}hostConnected(){r||(e._listeners.size||e._observer.observe(document.documentElement,e._observerConfig),e._listeners.add(this),this._previousLanguage!==this.current&&this._callHandlers(this._previousLanguage!==void 0))}hostDisconnected(){r||(this._previousLanguage=this.current,e._listeners.delete(this),e._listeners.size||e._observer.disconnect())}_callHandlers(e=!0){this._handlers.forEach(e=>e()),e&&this._host.requestUpdate()}};const B={toAttribute(e,n){return(n===String||n===void 0)&&e===``||n===Number&&isNaN(e)?null:t.toAttribute(e,n)}},Fe={de:`Richtung`,en:`Direction`,fr:`Direction`,it:`Direzione`},Ie={de:`Ankunft`,en:`Arrival`,fr:`Arrivée`,it:`Arrivo`},Le={de:`Sektor`,en:`Sector`,fr:`Secteur`,it:`Settore`},Re={de:`Skt.`,en:`Sec.`,fr:`Sect.`,it:`Set.`},ze={de:`und`,en:`and`,fr:`et`,it:`e`},Be={first:{de:`Erste Klasse`,en:`First Class`,fr:`Première classe`,it:`Prima classe`},second:{de:`Zweite Klasse`,en:`Second Class`,fr:`Deuxième classe`,it:`Seconda classe`}},Ve={de:`Zug`,en:`Train`,fr:`Train`,it:`Treno`},He={de:`Züge`,en:`Trains`,fr:`Trains`,it:`Treni`},Ue={de:`Wagen des Zuges`,en:`Coaches of the train`,fr:`Wagons du train`,it:`Carrozze del treno`},We={de:`Wagen`,en:`Train coach`,fr:`Wagon`,it:`Carrozza del treno`},Ge={de:`Nummer`,en:`Number`,fr:`Numéro`,it:`Numero`},Ke={de:`Geschlossener Zugwaggon`,en:`Closed train coach`,fr:`Wagon du train fermé`,it:`Carrozza del treno chiuso`},qe={de:`Lokomotive`,en:`Locomotive`,fr:`Locomotive`,it:`Locomotiva`},Je={de:`Schlafwagen`,en:`Sleeping car`,fr:`Voiture-lits`,it:`Carrozza letti`},Ye={de:`Liegewagen`,en:`Couchette car`,fr:`Voiture-couchettes`,it:`Carrozza cuccette`},Xe={de:`Speisewagen`,en:`Dining car`,fr:`Voiture-restaurant`,it:`Carrozza ristorante`},Ze={previous:{de:`Kein Durchgang zum vorherigen Wagen`,en:`No passage to the previous train coach`,fr:`Pas de passage au wagon du train précédent`,it:`Nessun passaggio alla carrozza del treno precedente`},next:{de:`Kein Durchgang zum nächsten Wagen`,en:`No passage to the next train coach`,fr:`Pas de passage au wagon du train suivant`,it:`Nessun passaggio alla carrozza del treno successivo`},both:{de:`Kein Durchgang zum nächsten und vorherigen Wagen`,en:`No passage to the next and previous train coach`,fr:`Pas de passage au wagon du train suivant et précédent`,it:`Nessun passaggio alla carrozza del treno successivo e precedente`}},Qe={de:`Zusätzliche Wageninformation`,en:`Additional wagon information`,fr:`Informations supplémentaires sur les wagons`,it:`Informazioni aggiuntive sulla carrozza del treno`},$e={de:`Abfahrt`,en:`Departure`,fr:`Départ`,it:`Partenza`},et={de:`nicht barrierefrei`,en:`not accessible`,fr:`non accessible`,it:`non accessibile`},tt={de:`herunterladen`,en:`download`,fr:`télécharger`,it:`scaricare`},nt={single:{long:{de:`Minute`,en:`Minute`,fr:`Minute`,it:`Minuto`},short:{de:`m`,en:`m`,fr:`m`,it:`m`}},multiple:{long:{de:`Minuten`,en:`Minutes`,fr:`Minutes`,it:`Minuti`},short:{de:`Min`,en:`min`,fr:`min.`,it:`mins`}}},rt={single:{long:{de:`Stunde`,en:`Hour`,fr:`Heure`,it:`Ora`},short:{de:`Std.`,en:`h`,fr:`ore`,it:`hrs`}},multiple:{long:{de:`Stunden`,en:`Hours`,fr:`Heures`,it:`Ore`},short:{de:`Std.`,en:`h`,fr:`ore`,it:`hrs`}}},it={single:{long:{de:`Tag`,en:`Day`,fr:`Jour`,it:`Giorno`}},multiple:{long:{de:`Tage`,en:`Days`,fr:`Jours`,it:`Giorni`}}},at={de:`Gleisänderung im Verlauf dieser Verbindung`,en:`Track change in the course of this connection`,fr:`Changement de voie sur le parcours de cette connexion`,it:`Cambiamento di binario nel corso di questa connessione`},ot={de:`Reisedauer`,en:`Travel time`,fr:`Durée du voyage`,it:`Durata del viaggio`},st={de:`Reisehinweise`,en:`Travelhints`,fr:`Indications sur le voyage`,it:`Indicazioni di viaggio`},ct={de:`Echtzeitinformationen`,en:`Real time information`,fr:`Informations en temps réel`,it:`Informazioni in tempo reale`},lt={de:`mal umsteigen`,en:`change`,fr:`changement de train`,it:`cambio`},ut={de:`mal umsteigen`,en:`changes`,fr:`changements de train`,it:`cambi`},dt={de:`neu`,en:`new`,fr:`nouveau`,it:`nuovo`},ft={de:`Auf`,en:`on`,fr:`sur`,it:`su`},pt={de:`Sparbillette`,en:`Supersaver tickets`,fr:`Billets dégriffés`,it:`Biglietti risparmio`},mt={none:{de:`Keine Belegungsprognose verfügbar`,en:`No occupancy forecast available`,fr:`Aucune prévision d'occupation disponible`,it:`Nessuna previsione di occupazione disponibile`},low:{de:`Tiefe bis mittlere Belegung erwartet`,en:`Low to average occupancy expected`,fr:`Taux d’occupation faible à moyen prévu`,it:`È prevista un’occupazione medio-bassa`},medium:{de:`Hohe Belegung erwartet`,en:`High occupancy expected`,fr:`Taux d’occupation élevé prévu`,it:`È prevista un’occupazione elevata`},high:{de:`Sehr hohe Belegung erwartet`,en:`Very high occupancy expected`,fr:`Taux d’occupation très élevé prévu`,it:`È prevista un’occupazione molto elevata`}},ht={funicular:{de:`Seilbahn/Zahnradbahn`,en:`Funicular/Cog railway`,fr:`Funiculaire/Chemin de fer à crémaillère`,it:`Funivia/Ferrovia a cremagliera`},ec_id:{de:`EC/IC`,en:`EC/IC`,fr:`EC/IC`,it:`EC/IC`},bus:{de:`Bus`,en:`Bus`,fr:`Bus`,it:`Bus`},re:{de:`RE`,en:`RE`,fr:`RE`,it:`RE`},arz_ext:{de:`ARZ/EXT`,en:`ARZ/EXT`,fr:`ARZ/EXT`,it:`ARZ/EXT`},ice_tgv_rjx:{de:`ICE/TGV/RJX`,en:`ICE/TGV/RJX`,fr:`ICE/TGV/RJX`,it:`ICE/TGV/RJX`},ir_pe:{de:`IR/PE`,en:`IR/PE`,fr:`IR/PE`,it:`IR/PE`},s_sn_r:{de:`S/SN/R`,en:`S/SN/R`,fr:`S/SN/R`,it:`S/SN/R`},tramway:{de:`Tram/Metro`,en:`Tramway/Underground`,fr:`Tram/Métro`,it:`Tram/Metro`},ship:{de:`Schiff`,en:`Ship`,fr:`Bateau`,it:`Battello`},train:{de:`Zug`,en:`Train`,fr:`Train`,it:`Treno`}},gt={de:`Linkziel öffnet in neuem Fenster.`,en:`Link target opens in a new window.`,fr:`Le lien s'ouvre dans une nouvelle fenêtre.`,it:`Il link si apre in una nuova finestra.`},_t={de:`Minuten Fussweg nach Ankunft:`,en:`minutes of walking time after arrival:`,fr:`minutes de trajet à pied après l’arrivée:`,it:`minuti a piedi all’arrivo:`},vt={de:`Minuten Fussweg vor Abfahrt:`,en:`minutes of walking time before departure:`,fr:`minutes de trajet à pied avant le départ:`,it:`minuti a piedi prima della partenza:`},yt={de:`Meldung schliessen`,en:`Close message`,fr:`Fermer le message`,it:`Chiudere il messaggio`},bt={de:`Nachricht schliessen`,en:`Close message`,fr:`Fermer le message`,it:`Chiudere il messaggio`},xt={de:`Dialog`,en:`Dialog`,fr:`Dialogue`,it:`Dialogo`},St={de:`Übergelagertes Fenster schliessen`,en:`Close secondary window`,fr:`Fermer la fenêtre superposée`,it:`Chiudere la finestra sovrapposta`},Ct={de:`Navigation schliessen`,en:`Close navigation`,fr:`Fermer la navigation`,it:`Chiudere la navigazione`},wt={de:`Seitenleiste schliessen`,en:`Close sidebar`,fr:`Fermer la barre latérale`,it:`Chiudere la barra laterale`},Tt={de:`Hinweis schliessen`,en:`Close note`,fr:`Fermer la note`,it:`Chiudere la nota`},Et={de:`Zurück`,en:`Go back`,fr:`Retourner`,it:`Indietro`},Dt={de:`Heute`,en:`Today`,fr:`Aujourd’hui`,it:`Oggi`},Ot={de:`Zum nächsten Monat wechseln`,en:`Change to the next month`,fr:`Passer au mois suivant`,it:`Passare al mese successivo`},kt={de:`Zum letzten Monat wechseln`,en:`Change to the previous month`,fr:`Passer au mois précédent`,it:`Passare al mese precedente`},At={de:`Nächster Tag`,en:`Next day`,fr:`Jour suivant`,it:`Giorno successivo`},jt={de:`Vorheriger Tag`,en:`Previous day`,fr:`Jour précédent`,it:`Giorno precedente`},Mt={de:`Jahr und Monat auswählen`,en:`Choose year and month`,fr:`Choisir l’année et le mois`,it:`Seleziona anno e mese`},Nt={de:`Wechsel zur Datumsauswahl`,en:`Change to date selection`,fr:`Passer à la sélection de date`,it:`Passare alla selezione della data`},Pt=e=>({de:`Wechsel zu den nächsten ${e} Jahren`,en:`Change to the next ${e} years`,fr:`Passer aux ${e} prochaines années`,it:`Passare ai successivi ${e} anni`}),Ft=e=>({de:`Wechsel zu den vorherigen ${e} Jahren`,en:`Change to the previous ${e} years`,fr:`Passage aux ${e} précédentes années`,it:`Passare ai precedenti ${e} anni`}),It={de:`Zum nächsten Jahr wechseln`,en:`Change to the next year`,fr:`Passer à l'année suivante`,it:`Passare all'anno successivo`},Lt={de:`Zum letzten Jahr wechseln`,en:`Change to the previous year`,fr:`Passer à l'année précédent`,it:`Passare all'anno precedente`},Rt=e=>({de:`Zum nächsten Tag wechseln, derzeit ausgewählt ${e}.`,en:`Change to the next day, currently selected ${e}.`,fr:`Passer au jour suivant, actuellement sélectionné ${e}.`,it:`Passare al giorno successivo, attualmente selezionato ${e}.`}),zt=e=>({de:`Zum vorherigen Tag wechseln, derzeit ausgewählt ${e}.`,en:`Change to the previous day, currently selected ${e}.`,fr:`Passer au jour précédent, actuellement sélectionné ${e}.`,it:`Passare al giorno precedente, attualmente selezionato ${e}.`}),Bt={de:`Kalender anzeigen`,en:`Show calendar`,fr:`Afficher le calendrier`,it:`Visualizza il calendario`},Vt={de:`TT.MM.JJJJ`,en:`DD.MM.YYYY`,fr:`JJ.MM.AAAA`,it:`GG.MM.AAAA`},Ht={de:`Datum geändert auf`,en:`Date changed to`,fr:`Date modifiée au`,it:`Data modificata in`},Ut={de:`Verbindung von`,en:`Connection from`,fr:`Liaison de`,it:`Collegamento da`},Wt={de:`nach`,en:`to`,fr:`à`,it:`a`},Gt=e=>({de:`und zurück nach ${e}.`,en:`and back to ${e}.`,fr:`et retour à ${e}.`,it:`e ritorno a ${e}.`}),Kt={de:`erweitert`,en:`expanded`,fr:`étendu`,it:`espanso`},qt={de:`reduziert`,en:`collapsed`,fr:`condensé`,it:`compresso`},Jt={de:`Karte zeigen`,en:`Show map`,fr:`Afficher la carte`,it:`Mostra la mappa`},Yt={de:`Mehr Breadcrumbs anzeigen`,en:`Show more breadcrumbs`,fr:`Afficher plus de fils d’Ariane`,it:`Mostra più breadcrumbs`},Xt={de:`Feldinhalt löschen`,en:`Clear input value`,fr:`Effacer la valeur d’entrée`,it:`Cancella il valore dell’input`},Zt={de:`Klicken Sie auf diese Karte für Details`,en:`Click on this card for details`,fr:`Cliquez sur cette carte pour plus de détails`,it:`Clicca su questa scheda per i dettagli`},Qt={de:`Klicken Sie auf diese Karte, um zurück zur Zusammenfassung zu gelangen`,en:`Click on this card to go back to the summary`,fr:`Cliquez sur cette carte pour revenir au résumé`,it:`Clicca su questa scheda per tornare al sommario`},$t={de:`Datei auswählen`,en:`Choose a file`,fr:`Choisissez un fichier`,it:`Scegli un file`},en={de:`Dateien auswählen`,en:`Choose files`,fr:`Choisissez des fichiers`,it:`Scegli file`},tn={de:`Ziehen Sie Ihre Datei hier hin (Drag & Drop)`,en:`Drag & Drop your file here`,fr:`Faites glisser et déposez votre fichier ici`,it:`Trascina e rilascia il file qui`},nn={de:`Ziehen Sie Ihre Dateien hier hin (Drag & Drop)`,en:`Drag & Drop your files here`,fr:`Faites glisser et déposez vos fichiers ici`,it:`Trascina e rilascia i file qui`},rn={de:`Datei entfernen`,en:`Remove file`,fr:`Effacer le fichier`,it:`Rimuovi il file`},an=e=>e&&e.length>0?{de:`Aktuell ausgewählte Datei: ${e.join(`, `)}.`,en:`Currently selected files: ${e.join(`, `)}.`,fr:`Fichier actuellement sélectionné: ${e.join(`, `)}.`,it:`File attualmente selezionato: ${e.join(`, `)}.`}:{de:`Keine Datei ausgewählt.`,en:`No files selected.`,fr:`Nessun fichier sélectionné.`,it:`Nessun file selezionato.`},on={de:`Nächste Seite`,en:`Next page`,fr:`Page suivante`,it:`Pagina successiva`},sn={de:`Vorherige Seite`,en:`Previous page`,fr:`Page précédente`,it:`Pagina precedente`},cn={de:`Seite`,en:`Page`,fr:`Page`,it:`Pagina`},ln={de:`Einträge pro Seite`,en:`Items per page`,fr:`Entrées par page`,it:`Elementi per pagina`},un={de:`ausgewählt`,en:`selected`,fr:`sélectionnée`,it:`selezionata`},dn={de:`von`,en:`of`,fr:`sur`,it:`di`},fn={de:`Muss gesetzt sein.`,en:`Must be checked.`,fr:`Doit être cochée.`,it:`Deve essere impostato.`},pn={de:`Auswahl erforderlich.`,en:`Selection required.`,fr:`Sélection requise.`,it:`Selezione necessaria.`},mn={de:`Eingabe erforderlich.`,en:`Input required.`,fr:`Entrée obligatoire.`,it:`Inserimento necessario.`},hn={de:`Bitte gültiges Datum eingeben.`,en:`Please provide a valid date.`,fr:`Veuillez saisir une date valide.`,it:`Inserire una data valida.`},gn=e=>({de:`Datum darf nicht vor ${e} sein.`,en:`Date must not be before ${e}.`,fr:`La date ne doit pas être antérieure au ${e}.`,it:`La data non deve essere anteriore al ${e}.`}),_n=e=>({de:`Datum darf nicht nach ${e} sein.`,en:`Date must not be after ${e}.`,fr:`La date ne doit pas être postérieure au ${e}.`,it:`La data non deve essere successiva al ${e}.`}),vn=e=>({de:`Zeit geändert zu ${e}.`,en:`Time changed to ${e}.`,fr:`Heure modifiée: ${e}.`,it:`Orario modificata alle ${e}.`}),yn={de:`Bitte gültige Zeit eingeben.`,en:`Please provide a valid time.`,fr:`Veuillez saisir une heure valide.`,it:`Inserisci un orario valido.`},bn={de:`Zeit darf nicht nach 23:59 sein.`,en:`Time must not be after 23:59.`,fr:`L’heure ne doit pas être postérieure à 23h59.`,it:`L’orario non può essere successivo alle 23.59.`},xn={de:`Die Zeiteingabe darf nicht mehr als fünf Zeichen haben.`,en:`The time input must not exceed five characters.`,fr:`La saisie de l’heure ne doit pas comporter plus de cinq caractères.`,it:`L’indicazione temporale non può contenere più di cinque caratteri.`},Sn={de:`Drücken Sie die Entfernen-Taste um den Chip zu löschen`,en:`Press the Delete button to remove the chip`,fr:`Appuyez sur la touche Del pour supprimer cette puce`,it:`Premi il tasto Canc per rimuovere questa chip`},Cn={de:`Ausgewählte Elemente:`,en:`Selected elements:`,fr:`Éléments sélectionnés:`,it:`Elementi selezionati:`},wn={de:`Woche`,en:`Week`,fr:`Semaine`,it:`Settimana`},Tn={de:`Von und Nach tauschen`,en:`Swap from and to`,fr:`Échanger de et à`,it:`Inverti Da e A`},En=(e,t)=>({de:`${e} von ${t}`,en:`${e} of ${t}`,fr:`${e} sur ${t}`,it:`${e} di ${t}`}),Dn={de:`Karussell – Benutzen Sie die Pfeiltasten im Interaktionsmodus, um durch die Folien zu navigieren`,en:`Carousel - Use the arrow keys in interaction mode to navigate through the slides`,fr:`Carrousel – Utilisez les touches fléchées en mode interaction pour naviguer dans les diapositives`,it:`Carosello – Utilizzare i tasti freccia in modalità interazione per navigare tra le slide`},On={de:`Nächste Folie`,en:`Next slide`,fr:`Diapositive suivante`,it:`Slide successiva`},kn={de:`Vorherige Folie`,en:`Previous slide`,fr:`Diapositive précédente`,it:`Slide precedente`},An={de:`Folie`,en:`Slide`,fr:`Diapositive`,it:`Slide`},jn={de:`Zeichen übrig`,en:`characters remaining`,fr:`caractères restants`,it:`caratteri rimanenti`};let Mn=(()=>{let e=F,t,a=[],c=[],u,d=[],f=[],p,m=[],h=[],g,_=[],v=[],y,b=[],x=[],S,C=[],w=[];return class extends e{static{let n=typeof Symbol==`function`&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[I(),l({reflect:!0,converter:B})],u=[I(),l({reflect:!0,converter:B})],p=[I(),l({reflect:!0,converter:B})],g=[I(),l({type:Boolean,reflect:!0})],y=[I(),l({attribute:`accessibility-label`})],S=[I(),l({attribute:`accessibility-current`})],o(this,null,t,{kind:`accessor`,name:`href`,static:!1,private:!1,access:{has:e=>`href`in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:n},a,c),o(this,null,u,{kind:`accessor`,name:`target`,static:!1,private:!1,access:{has:e=>`target`in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:n},d,f),o(this,null,p,{kind:`accessor`,name:`rel`,static:!1,private:!1,access:{has:e=>`rel`in e,get:e=>e.rel,set:(e,t)=>{e.rel=t}},metadata:n},m,h),o(this,null,g,{kind:`accessor`,name:`download`,static:!1,private:!1,access:{has:e=>`download`in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:n},_,v),o(this,null,y,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:n},b,x),o(this,null,S,{kind:`accessor`,name:`accessibilityCurrent`,static:!1,private:!1,access:{has:e=>`accessibilityCurrent`in e,get:e=>e.accessibilityCurrent,set:(e,t)=>{e.accessibilityCurrent=t}},metadata:n},C,w),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}#e;get href(){return this.#e}set href(e){this.#e=e}#t;get target(){return this.#t}set target(e){this.#t=e}#n;get rel(){return this.#n}set rel(e){this.#n=e}#r;get download(){return this.#r}set download(e){this.#r=e}#i;get accessibilityLabel(){return this.#i}set accessibilityLabel(e){this.#i=e}#a;get accessibilityCurrent(){return this.#a}set accessibilityCurrent(e){this.#a=e}constructor(){super(),this.#e=s(this,a,``),this.#t=(s(this,c),s(this,d,``)),this.#n=(s(this,f),s(this,m,``)),this.#r=(s(this,h),s(this,_,!1)),this.#i=(s(this,v),s(this,b,``)),this.#a=(s(this,x),s(this,C,``)),this.language=(s(this,w),new z(this)),this.anchorRole=null,this._evaluateRelAttribute=e=>this.rel?this.rel:e===`_blank`?`external noopener nofollow`:i,this.internals.states.add(`link`),r||this.setupBaseEventHandlers()}focus(e){this.shadowRoot.querySelector(`a`)?.focus(e)}blur(){this.shadowRoot.querySelector(`a`)?.blur()}click(){this.shadowRoot.querySelector(`a`)?.click()}resolveTarget(){return this.target}render(){return this.renderLink(this.renderTemplate())}renderLink(e){let t=this.resolveTarget(),r=!!this.href&&t===`_blank`;return n`
21
21
  <a
22
22
  class="sbb-action-base ${this.localName}"
23
23
  href=${this.href||i}
@@ -40,9 +40,9 @@ let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._cr
40
40
  `;let Ln=(()=>{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(In)]}#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 Rn=class{get size(){return this._handlers.size}constructor(e,t){this._host=e,this._property=t,this._handlers=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=new WeakMap;var zn=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=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 Rn(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 Bn=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Bn.at(-1)?.escapeStrategy())});var Vn=class{constructor(e,t=Bn){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 Hn=new WeakMap;var Un=class{constructor(e,t,n=Hn){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=new Set([this]),t=new MutationObserver(t=>{let n=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);if(!e){this._rootNode=null;return}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 Wn=[`script`,`head`,`template`,`style`],W=`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`,Gn=new Set,Kn=new Set,qn=new Set;var Jn=class{constructor(e,t=Gn,n=qn,r=Kn){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(){if(this._currentOverlay()!==this._host){this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host);return}this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()}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();for(;e!==document.documentElement&&e!==null;)Array.from((e?.parentElement??e?.getRootNode())?.childNodes??[]).filter(t=>t!==e&&this._isHTMLElement(t)&&!Wn.includes(t.localName)).forEach(e=>this._addInertOrCarveIgnoredElements(e)),e=e?.parentElement??e?.getRootNode()?.host??null}_addInertOrCarveIgnoredElements(e){if(!e.matches?.(W)){if(!this._containsIgnoredElement(e)){this._addInertAttributes(e);return}[...e.childNodes,...e.shadowRoot?.childNodes??[]].filter(e=>this._isHTMLElement(e)).forEach(e=>this._addInertOrCarveIgnoredElements(e))}}_containsIgnoredElement(e){if(e.matches?.(W)||e.querySelector?.(W)||e.shadowRoot?.querySelector(W))return!0;for(let t of e.querySelectorAll(`*`))if(t.shadowRoot&&this._containsIgnoredElement(t))return!0;if(e.shadowRoot){for(let t of e.shadowRoot.querySelectorAll(`*`))if(t.shadowRoot&&this._containsIgnoredElement(t))return!0}return!1}_isHTMLElement(e){return e instanceof window.HTMLElement}_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 Yn=`(forced-colors: active)`,G=`(prefers-color-scheme: dark)`,Xn=`(any-hover: hover)`,Zn=`(pointer: coarse)`,Qn=`(min-width: 0rem)`,$n=`(min-width: 37.5rem)`,er=`(min-width: 64rem)`,tr=`(min-width: 90rem)`,nr=`(max-width: 63.9375rem)`,rr=`(max-width: 89.9375rem)`,K=new Map;var ir=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=K.get(e);if(n)n.handlers.add(t);else{let n=matchMedia(e),r=new Set([t]),i=e=>r.forEach(t=>t(e.matches));n.addEventListener(`change`,i),K.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=K.get(e);n&&(n.handlers.delete(t),n.handlers.size||K.delete(e))}}},ar=class e extends ir{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,{[G]: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=K.get(G);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(K.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(K.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 or=!r&&CSS.supports(`anchor-name`,`--test`),sr=[`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`],cr=[`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`],lr={"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`};[...sr,...cr];let ur=0;var dr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!or){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++ur}`,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&&cr.includes(r)?lr[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 fr=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,pr=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,mr=1,hr=2,gr=3,_r=4,vr=5,yr=6,br=0;var q=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(pr);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(fr);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=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 xr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Sr=class extends q{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(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(xr.test(e))return this.getValidDateOrNull(new Date(e.includes(`T`)?e:e+`T00:00:00`))}return super.deserialize(e)}invalid(){return 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 J=new Sr,Cr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var wr=class extends q{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(Cr.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 Tr=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}`)},Er=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}`)},Y=new WeakMap,X=new WeakMap,Dr=()=>(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)??X.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=Y.get(this.rootNode);if(e)e.controllers.add(this);else{let e=new Set([this]),t=new MutationObserver(t=>{let n=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}),Y.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=Y.get(this.rootNode);if(!e){this.rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),Y.delete(this.rootNode)),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)X.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&&=(X.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Or={toAttribute(e,t){let n=R().datetime?.dateAdapter??J;return n.isValid(e)?n.toIso8601(e):null}},kr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??J;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??J,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ar(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function Z(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function jr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Mr(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Q(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function Nr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Pr(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&Nr(t))return t}return null}var Fr=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=Pr(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(Q())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(){Q()&&(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 Ir(e){e.key===` `&&e.preventDefault()}function Lr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Rr=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},zr=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`,Ir),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`)}}})(),Br=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)}})(),Vr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Hr=e=>(()=>{let t=Br(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 Rn=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 zn=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 Rn(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 Bn=[];r||window.addEventListener(`keydown`,e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),Bn.at(-1)?.escapeStrategy())});var Vn=class{constructor(e,t=Bn){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 Hn=/* @__PURE__ */ new WeakMap;var Un=class{constructor(e,t,n=Hn){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);if(!e){this._rootNode=null;return}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 Wn=[`script`,`head`,`template`,`style`],W=`sbb-toast,.sbb-overlay-outlet,.sbb-live-announcer-element,.cdk-live-announcer-element,.cdk-overlay-container`,Gn=/* @__PURE__ */ new Set,Kn=/* @__PURE__ */ new Set,qn=/* @__PURE__ */ new Set;var Jn=class{constructor(e,t=Gn,n=qn,r=Kn){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(){if(this._currentOverlay()!==this._host){this._inertOverlays.has(this._host)&&this._inertOverlays.delete(this._host);return}this._removeAllInertAttributes(),this._inertOverlays.delete(this._host),this._inertOverlays.size&&this._addAllInertAttributes()}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();for(;e!==document.documentElement&&e!==null;)Array.from((e?.parentElement??e?.getRootNode())?.childNodes??[]).filter(t=>t!==e&&this._isHTMLElement(t)&&!Wn.includes(t.localName)).forEach(e=>this._addInertOrCarveIgnoredElements(e)),e=e?.parentElement??e?.getRootNode()?.host??null}_addInertOrCarveIgnoredElements(e){if(!e.matches?.(W)){if(!this._containsIgnoredElement(e)){this._addInertAttributes(e);return}[...e.childNodes,...e.shadowRoot?.childNodes??[]].filter(e=>this._isHTMLElement(e)).forEach(e=>this._addInertOrCarveIgnoredElements(e))}}_containsIgnoredElement(e){if(e.matches?.(W)||e.querySelector?.(W)||e.shadowRoot?.querySelector(W))return!0;for(let t of e.querySelectorAll(`*`))if(t.shadowRoot&&this._containsIgnoredElement(t))return!0;if(e.shadowRoot){for(let t of e.shadowRoot.querySelectorAll(`*`))if(t.shadowRoot&&this._containsIgnoredElement(t))return!0}return!1}_isHTMLElement(e){return e instanceof window.HTMLElement}_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 Yn=`(forced-colors: active)`,G=`(prefers-color-scheme: dark)`,Xn=`(any-hover: hover)`,Zn=`(pointer: coarse)`,Qn=`(min-width: 0rem)`,$n=`(min-width: 37.5rem)`,er=`(min-width: 64rem)`,tr=`(min-width: 90rem)`,nr=`(max-width: 63.9375rem)`,rr=`(max-width: 89.9375rem)`,K=/* @__PURE__ */ new Map;var ir=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=K.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),K.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=K.get(e);n&&(n.handlers.delete(t),n.handlers.size||K.delete(e))}}},ar=class e extends ir{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,{[G]: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=K.get(G);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(K.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(K.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 or=!r&&CSS.supports(`anchor-name`,`--test`),sr=[`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`],cr=[`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`],lr={"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`};[...sr,...cr];let ur=0;var dr=class{get currentPosition(){return this._usePolyfill?this._lastPosition??this._positions[0]??``:(this._overlayStyles??=getComputedStyle(this._overlay),this._overlayStyles.getPropertyValue(`position-area`))}constructor(e,t=!or){this._usePolyfill=t,this._resizeObserver=r?null:new ResizeObserver(()=>this._requestCalculatePosition()),this._anchorName=`--sbb-overlay-anchor-${++ur}`,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&&cr.includes(r)?lr[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 fr=/(0?[1-9]|[12][0-9]|3[01])[.,\\/\-\s](0?[1-9]|1[0-2])[.,\\/\-\s]([0-9]{1,4}$)?/,pr=/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-3][0-9])$/,mr=1,hr=2,gr=3,_r=4,vr=5,yr=6,br=0;var q=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(pr);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(fr);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 xr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var Sr=class extends q{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(xr.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 J=new Sr,Cr=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;var wr=class extends q{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(Cr.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 Tr=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}`)},Er=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}`)},Y=/* @__PURE__ */ new WeakMap,X=/* @__PURE__ */ new WeakMap,Dr=()=>(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)??X.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=Y.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}),Y.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=Y.get(this.rootNode);if(!e){this.rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),Y.delete(this.rootNode)),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)X.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&&=(X.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Or={toAttribute(e,t){let n=R().datetime?.dateAdapter??J;return n.isValid(e)?n.toIso8601(e):null}},kr=e=>(t,n)=>{let{kind:r}=n;if(r===`accessor`)return{set(e){let n=R().datetime?.dateAdapter??J;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??J,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ar(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function Z(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function jr(e,t,n){n?e.setAttribute(t,n):e.removeAttribute(t)}function Mr(e){let t=()=>queueMicrotask(e);document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,t):t()}function Q(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}function Nr(e){let t=getComputedStyle(e).overflowY;return(t===`auto`||t===`scroll`)&&e.scrollHeight>e.clientHeight}function Pr(e){for(let t of e){if(t===document.body||t===document.documentElement)break;if(t instanceof Element&&Nr(t))return t}return null}var Fr=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=Pr(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(Q())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(){Q()&&(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 Ir(e){e.key===` `&&e.preventDefault()}function Lr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Rr=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},zr=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`,Ir),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`)}}})(),Br=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)}})(),Vr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Hr=e=>(()=>{let t=Br(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
- `?(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`,mn[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`:Vr?`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>`}}})(),$=new WeakMap,Ur=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=$.get(e),this._radioButtonGroupsMap||(this._radioButtonGroupsMap=new Map,$.set(e,this._radioButtonGroupsMap)),this.associatedRadioButtons=this._radioButtonGroupsMap.get(this.name),this.associatedRadioButtons||(this.associatedRadioButtons=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 Wr=`: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)}
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`,mn[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`:Vr?`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>`}}})(),$=/* @__PURE__ */ new WeakMap,Ur=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=$.get(e),this._radioButtonGroupsMap||(this._radioButtonGroupsMap=/* @__PURE__ */ new Map,$.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 Wr=`: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
  `,Gr=`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}
47
47
  `,Kr=`:host{--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}:host::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color,transparent)}:host::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color,transparent)}:host::-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}:host::-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)))}:host::-webkit-scrollbar-button,:host::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){:host{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color,currentcolor) var(--sbb-scrollbar-track-color,transparent)}}
48
48
  `,qr=`ul,ol{font-size:inherit;margin:0;padding:0;list-style:none}
@@ -66,4 +66,4 @@ let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._cr
66
66
  <span><slot name=${r[0].name}></slot></span>
67
67
  </span>
68
68
  ${this.renderHiddenSlot()} `:this.renderHiddenSlot()}listSlotEntries(e){return(this.listChildren.length?this.listChildren:Array.from({length:+(this.getAttribute(ni)??0)})).map((t,n)=>({name:`li-${n}`,ariaHidden:e?.localNameVisualOnly?.includes(t.localName)??!1}))}renderHiddenSlot(){return n`<span hidden><slot></slot></span>`}}})(),ii=e=>(()=>{let t=e,n,r=[],i=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[I(),l({reflect:!0,type:Boolean})],o(this,null,n,{kind:`accessor`,name:`negative`,static:!1,private:!1,access:{has:e=>`negative`in e,get:e=>e.negative,set:(e,t)=>{e.negative=t}},metadata:e},r,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#e=s(this,r,!1);get negative(){return this.#e}set negative(e){this.#e=e}constructor(){super(...arguments),s(this,i)}}})();var ai=`:host{--sbb-selection-panel-background:var(--sbb-selection-panel-inner-background,var(--sbb-selection-panel-background-default));--sbb-selection-panel-border-width:var(--sbb-selection-panel-inner-border-width,var(--sbb-selection-panel-border-width-default));--sbb-selection-panel-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));display:block;outline:none!important}:host([size=xs]){--sbb-selection-panel-checkbox-dimension:var(--sbb-checkbox-dimension-xs);--sbb-selection-panel-input-padding:var(--sbb-selection-panel-input-padding-block-xs) var(--sbb-selection-panel-input-padding-inline-xs)}:host([size=s]){--sbb-selection-panel-checkbox-dimension:var(--sbb-checkbox-dimension-s);--sbb-selection-panel-input-padding:var(--sbb-selection-panel-input-padding-block-s) var(--sbb-selection-panel-input-padding-inline-s)}:host([size=m]){--sbb-selection-panel-checkbox-dimension:var(--sbb-checkbox-dimension-m);--sbb-selection-panel-input-padding:var(--sbb-selection-panel-input-padding-block-m) var(--sbb-selection-panel-input-padding-inline-m)}:host([color=milk]){--sbb-selection-panel-background:var(--sbb-selection-panel-inner-background,var(--sbb-selection-panel-background-milk))}:host([borderless]:not(:is(:state(checked),[state--checked]))){--sbb-selection-panel-border-color:var(--sbb-selection-panel-border-color-borderless)}:host(:is(:state(checked),[state--checked]):not(:disabled,[disabled])){--sbb-selection-panel-border-color:var(--sbb-selection-panel-border-color-checked);--sbb-selection-panel-border-width:var(--sbb-selection-panel-inner-border-width,var(--sbb-selection-panel-border-width-checked))}:host(:is(:disabled,[disabled])){--sbb-selection-panel-cursor:var(--sbb-cursor-default)}.sbb-selection-panel{cursor:var(--sbb-selection-panel-cursor);border-radius:var(--sbb-selection-panel-border-radius);box-shadow:inset 0 0 0 var(--sbb-selection-panel-border-width) var(--sbb-selection-panel-border-color);padding:var(--sbb-selection-panel-input-padding);background-color:var(--sbb-selection-panel-background);height:100%;transition-duration:var(--sbb-selection-panel-animation-duration);transition-timing-function:var(--sbb-animation-easing);transition-property:box-shadow;display:block;position:relative}@media (forced-colors:active){.sbb-selection-panel:after{content:"";pointer-events:none;border:var(--sbb-selection-panel-border-width) solid var(--sbb-selection-panel-border-color);border-radius:var(--sbb-selection-panel-border-radius);display:block;position:absolute;inset:0}}:host(:focus-visible) .sbb-selection-panel{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}.sbb-selection-panel__badge{user-select:none;pointer-events:none;border-radius:var(--sbb-selection-panel-border-radius);position:absolute;inset:0;overflow:hidden}slot[name=suffix]{color:var(--sbb-selection-panel-suffix-color)}slot[name=subtext]{color:var(--sbb-selection-panel-subtext-color);padding-inline-start:calc(var(--sbb-selection-panel-checkbox-dimension) + var(--sbb-spacing-fixed-2x));display:block}:host(:not(:is(:state(slotted-subtext),[state--slotted-subtext]))) slot[name=subtext]{display:none}
69
- `;const oi=e=>(()=>{let t=e,n,r=[],i=[],c,u=[],d=[],f,p=[],m=[],h,g=[],_=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[l({reflect:!0})],c=[I(),l({reflect:!0,type:Boolean})],f=[I(),l()],h=[l({reflect:!0}),Tr((e,t)=>e.group?.size??t)],o(this,null,n,{kind:`accessor`,name:`color`,static:!1,private:!1,access:{has:e=>`color`in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:e},r,i),o(this,null,c,{kind:`accessor`,name:`borderless`,static:!1,private:!1,access:{has:e=>`borderless`in e,get:e=>e.borderless,set:(e,t)=>{e.borderless=t}},metadata:e},u,d),o(this,null,f,{kind:`accessor`,name:`expansionState`,static:!1,private:!1,access:{has:e=>`expansionState`in e,get:e=>e.expansionState,set:(e,t)=>{e.expansionState=t}},metadata:e},p,m),o(this,null,h,{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:e},g,_),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.styles=[a(ai)]}#e=s(this,r,`white`);get color(){return this.#e}set color(e){this.#e=e}#t=(s(this,i),s(this,u,!1));get borderless(){return this.#t}set borderless(e){this.#t=e}#n=(s(this,d),s(this,p,``));get expansionState(){return this.#n}set expansionState(e){this.#n=e}#r=(s(this,m),s(this,g,null));get size(){return this.#r}set size(e){this.#r=e}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event(`panelconnected`,{bubbles:!0}))}constructor(){super(...arguments),s(this,_)}}})(),si=e=>{class t extends e{get group(){return this.closest?.(`sbb-radio-button-group, sbb-checkbox-group`)??null}get panel(){return this.querySelector?.(`sbb-radio-button-panel, sbb-checkbox-panel`)??null}constructor(...e){super(e),this._previousSize=null,this._propertyWatcher=new zn(this,()=>this.panel,{checked:e=>{this.toggleState(`checked`,e.checked),this.onInputStateChange?.()},disabled:e=>{this.toggleState(`disabled`,e.disabled),this.onInputStateChange?.()},size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)},borderless:e=>{this.toggleState(`borderless`,e.borderless)},color:e=>{this._previousColor&&this.internals.states.delete(`color-${this._previousColor}`),this._previousColor=e.color,this._previousColor&&this.internals.states.add(`color-${this._previousColor}`)}}),this.addEventListener?.(`panelconnected`,()=>this._propertyWatcher.connect())}onInputStateChange(){}}return t},ci=e=>{class t extends e{constructor(){super(...arguments),this._updatePromise=Promise.resolve(),this._updateResolve=()=>{}}startUpdate(){this._updatePromise=new Promise(e=>this._updateResolve=e)}completeUpdate(){this._updateResolve()}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this._updatePromise,e}}return t};function li(e){let t=window.getComputedStyle(e),n=t.display,r=parseInt(t.maxHeight,10).toString();if(n!==`none`&&r!==`0`)return{scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,offsetHeight:e.offsetHeight,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,offsetWidth:e.offsetWidth};e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.display=`block`;let i=e.scrollHeight,a=e.clientHeight,o=e.offsetHeight,s=e.scrollWidth,c=e.clientWidth,l=e.offsetWidth;return e.style.display=``,e.style.position=``,e.style.visibility=``,{scrollHeight:i,clientHeight:a,offsetHeight:o,scrollWidth:s,clientWidth:c,offsetWidth:l}}function ui(e,t){if(!e||!t)return!1;let n=e.getBoundingClientRect();return n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function di(e,t,n,r){let i=r?.verticalOffset||0,a=r?.horizontalOffset||0,o=r?.responsiveHeight||!1,s=t.getBoundingClientRect(),c=li(e),l=s.left,u=s.top,d=document.documentElement.clientWidth-(l+s.width),f=u-i,p=document.documentElement.clientHeight-(u+s.height+i),m=l,h=u+s.height+i,g=c.offsetWidth-s.width,_={horizontal:`start`,vertical:`below`},v=`${p-i}px`;r?.centered&&l-16+s.width/2>c.offsetWidth/2&&d-16>g/2&&(m-=g/=2,_.horizontal=`center`),d<g&&l>g&&(m-=g,_.horizontal=`end`),a&&_.horizontal!==`center`&&s.width/2<a&&(m+=a*(_.horizontal===`start`?-1:1)),(l<g&&d<g||document.documentElement.clientWidth<c.offsetWidth)&&(m=document.documentElement.clientWidth/2-c.offsetWidth/2);let y=p-i>=c.scrollHeight,b=f-i>=(o?c.clientHeight:c.scrollHeight),x=!y&&(b||f>p);!r?.forceBelow&&(r?.forceAbove||x)&&(h=f<c.scrollHeight?h-s.height-f-i:u-c.clientHeight-i,v=`${f-i}px`,_.vertical=`above`);let S=n.getBoundingClientRect();return S.left<0&&(m-=S.left),S.top<0&&(h-=S.top),{top:h,left:m,maxHeight:v,alignment:_}}function fi(e,t,n,r){let i=r?.verticalOffset||0,a=r?.horizontalOffset||0,o=t.getBoundingClientRect(),s=li(e),c=t.parentElement.shadowRoot.querySelector(r?.contentSelector??`.${e.className}`).getBoundingClientRect(),l=n.getBoundingClientRect(),u=document.documentElement.clientWidth-c.right,d=document.documentElement.clientHeight-(o.top-i),f=document.documentElement.clientHeight,p=`${f-32}px`,m={horizontal:`end`,vertical:`above`},h=s.offsetWidth+a,g=c.right,_=o.top+i;return u<h&&o.left>h&&(g=g-c.width-s.offsetWidth,m.horizontal=`start`),a&&m.horizontal!==`center`&&(g+=a*(m.horizontal===`start`?-1:1)),d<s.scrollHeight&&(_=f-s.clientHeight-16),l.left<0&&(g-=l.left),l.top<0&&(_-=l.top),{top:_,left:g,maxHeight:p,alignment:m}}function pi(e,t,n,r,i,a=`auto`){if(!e||!t)return;let o=t.getBoundingClientRect();i.style.setProperty(`--sbb-options-panel-width`,`${t.offsetWidth}px`),i.style.setProperty(`--sbb-options-panel-origin-height`,`${t.offsetHeight}px`),i.style.setProperty(`--sbb-options-panel-origin-position-x`,`${o.left}px`),i.style.setProperty(`--sbb-options-panel-origin-position-y`,`${o.top}px`);let s=di(n,t,r,{forceBelow:a===`below`,forceAbove:a===`above`});i.style.setProperty(`--sbb-options-panel-position-x`,`${s.left}px`),i.style.setProperty(`--sbb-options-panel-position-y`,`${s.top}px`),i.style.setProperty(`--sbb-options-panel-max-height-calculated`,s.maxHeight);let c=s.alignment.vertical===`above`;i.toggleState?.(`options-panel-position-above`,c),i.toggleState?.(`options-panel-position-below`,!c),t.setAttribute(`data-options-panel-position`,s.alignment.vertical)}var mi=class{constructor(){this._overlays=new Set,this._pointerDownListener=e=>{this._pointerDownEventTarget=e.composedPath()[0]},this._clickListener=e=>{let t=e.composedPath()[0],n=e.type===`click`&&this._pointerDownEventTarget?this._pointerDownEventTarget:t;this._pointerDownEventTarget=void 0;for(let e of Array.from(this._overlays).reverse()){if(Z(e,t)||Z(e,n))break;e.dispatchEvent(new Event(`overlayOutsidePointer`))}}}connect(e){this._overlays.size||(this._addGlobalEventListeners(),j&&(this._cursorOriginalValue=document.body.style.cursor,document.body.style.cursor=`pointer`)),this._overlays.add(e)}disconnect(e){this._overlays.delete(e),this._overlays.size||(this._abortController?.abort(),this._abortController=void 0,j&&(document.body.style.cursor=this._cursorOriginalValue))}_addGlobalEventListeners(){let e=document.body;this._abortController=new AbortController;let t={capture:!0,passive:!0,signal:this._abortController.signal};e.addEventListener(`click`,this._clickListener,t),!ie&&!j&&(e.addEventListener(`pointerdown`,this._pointerDownListener,t),e.addEventListener(`auxclick`,this._clickListener,t),e.addEventListener(`contextmenu`,this._clickListener,t))}};const hi=new mi;function gi(e,t,n,r){t&&(t.ariaHasPopup=n,t.ariaControlsElements=[e],t.ariaExpanded=`${r===`opening`||r===`opened`}`)}function _i(e){e&&(e.ariaHasPopup=null,e.ariaControlsElements=null,e.ariaExpanded=null)}function vi(e,t,n,r=`listbox`){e&&(e.setAttribute(`autocomplete`,`off`),e.setAttribute(`role`,`combobox`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,r),e.setAttribute(`aria-controls`,t),e.setAttribute(`aria-owns`,t),e.setAttribute(`aria-expanded`,`${n}`))}function yi(e){e&&(e.removeAttribute(`autocomplete`),e.removeAttribute(`role`),e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`),e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-owns`),e.removeAttribute(`aria-expanded`))}export{q as DateAdapter,fr as FORMAT_DATE,vr as FRIDAY,pr as ISO8601_FORMAT_DATE,te as IS_FOCUSABLE_QUERY,le as InteractivityChecker,ce as IsFocusableConfig,mr as MONDAY,Sr as NativeDateAdapter,yr as SATURDAY,br as SUNDAY,F as SbbActionBaseElement,Rr as SbbAnimationCompleteMixin,Ne as SbbButtonBaseElement,Me as SbbButtonLikeBaseElement,ar as SbbDarkModeController,Pn as SbbDisabledInteractiveMixin,V as SbbDisabledMixin,Fn as SbbDisabledTabIndexActionMixin,P as SbbElement,Vn as SbbEscapableOverlayController,be as SbbFocusTrapController,ee as SbbFocusVisibleWithinController,zr as SbbFormAssociatedCheckboxMixin,Hr as SbbFormAssociatedInputMixin,L as SbbFormAssociatedMixin,Ur as SbbFormAssociatedRadioButtonMixin,Un as SbbIdReferenceController,Jn as SbbInertController,z as SbbLanguageController,Mn as SbbLinkBaseElement,Se as SbbLiveAnnouncer,ir as SbbMediaMatcherController,er as SbbMediaQueryBreakpointLargeAndAbove,rr as SbbMediaQueryBreakpointLargeAndBelow,$n as SbbMediaQueryBreakpointSmallAndAbove,nr as SbbMediaQueryBreakpointSmallAndBelow,tr as SbbMediaQueryBreakpointUltraAndAbove,Qn as SbbMediaQueryBreakpointZeroAndAbove,G as SbbMediaQueryDarkMode,Yn as SbbMediaQueryForcedColors,Xn as SbbMediaQueryHover,Zn as SbbMediaQueryPointerCoarse,ri as SbbNamedSlotListMixin,ii as SbbNegativeMixin,Nn as SbbOpenCloseBaseElement,mi as SbbOverlayOutsidePointerEventListener,dr as SbbOverlayPositionController,oi as SbbPanelMixin,zn as SbbPropertyWatcherController,Br as SbbReadonlyMixin,H as SbbRequiredMixin,Fr as SbbScrollHandler,Ln as SbbSelectionGroupBaseElement,si as SbbSelectionPanelMixin,N as SbbSlottedChangeEvent,ci as SbbUpdateSchedulerMixin,_r as THURSDAY,hr as TUESDAY,wr as TemporalDateAdapter,gr as WEDNESDAY,Oe as appendAriaElements,Xr as buttonResetStyles,Z as containsPierceShadowDom,J as defaultDateAdapter,I as forceType,Lr as forwardEvent,di as getElementPosition,fi as getElementPositionHorizontal,li as getElementRectangle,S as getEventTarget,y as getNextElementIndex,Tr as getOverride,Er as handleDistinctChange,Zr as hostScrollbarStyles,Qe as i18nAdditionalWagonInformationHeading,ze as i18nAnd,Ie as i18nArrival,Ze as i18nBlockedPassage,Yt as i18nBreadcrumbEllipsisButtonLabel,Nt as i18nCalendarDateSelection,wn as i18nCalendarWeekNumber,Dn as i18nCarouselArrowsNavigationHint,En as i18nCarouselItemAriaLabel,fn as i18nCheckboxRequired,Sn as i18nChipDelete,Cn as i18nChipGroupInputDescription,Be as i18nClass,Xt as i18nClearInput,yt as i18nCloseAlert,St as i18nCloseDialog,Ct as i18nCloseNavigation,bt as i18nCloseNotification,Tt as i18nClosePopover,wt as i18nCloseSidebar,Ke as i18nClosedCompartmentLabel,qt as i18nCollapsed,Ut as i18nConnectionFrom,Gt as i18nConnectionRoundtrip,Wt as i18nConnectionTo,Ye as i18nCouchetteWagonLabel,Ht as i18nDateChangedTo,hn as i18nDateInvalid,_n as i18nDateMax,gn as i18nDateMin,Vt as i18nDatePickerPlaceholder,$e as i18nDeparture,xt as i18nDialog,Fe as i18nDirection,tt as i18nDownload,it as i18nDurationDay,rt as i18nDurationHour,nt as i18nDurationMinute,Kt as i18nExpanded,$t as i18nFileSelectorButtonLabel,en as i18nFileSelectorButtonLabelMultiple,an as i18nFileSelectorCurrentlySelected,rn as i18nFileSelectorDeleteFile,tn as i18nFileSelectorSubtitleLabel,nn as i18nFileSelectorSubtitleLabelMultiple,Zt as i18nFlipCard,ft as i18nFromPlatform,Et as i18nGoBack,mn as i18nInputRequired,ln as i18nItemsPerPage,qe as i18nLocomotiveLabel,Jt as i18nMapContainerButtonLabel,ht as i18nMeansOfTransport,dt as i18nNew,At as i18nNextDay,Ot as i18nNextMonth,on as i18nNextPage,On as i18nNextSlide,It as i18nNextYear,Pt as i18nNextYearRange,et as i18nNonAccessible,mt as i18nOccupancy,cn as i18nPage,dn as i18nPaginatorOf,un as i18nPaginatorSelected,jt as i18nPreviousDay,kt as i18nPreviousMonth,sn as i18nPreviousPage,kn as i18nPreviousSlide,Lt as i18nPreviousYear,Ft as i18nPreviousYearRange,ct as i18nRealTimeInfo,jn as i18nRemainingCharacters,Xe as i18nRestaurantWagonLabel,Qt as i18nReverseCard,Le as i18nSector,Re as i18nSectorShort,Rt as i18nSelectNextDay,zt as i18nSelectPreviousDay,pn as i18nSelectionRequired,Bt as i18nShowCalendar,Je as i18nSleepingWagonLabel,An as i18nSlide,pt as i18nSupersaver,gt as i18nTargetOpensInNewWindow,vn as i18nTimeInputChange,yn as i18nTimeInvalid,bn as i18nTimeMax,xn as i18nTimeMaxLength,Tn as i18nTimetableFormSwapButtonLabel,Dt as i18nToday,Ve as i18nTrain,He as i18nTrains,lt as i18nTransferProcedure,ut as i18nTransferProcedures,st as i18nTravelhints,ot as i18nTripDuration,at as i18nTripQuayChange,We as i18nWagonLabel,Ge as i18nWagonLabelNumber,Ue as i18nWagonsLabel,_t as i18nWalkingDistanceArrival,vt as i18nWalkingDistanceDeparture,Mt as i18nYearMonthSelection,Dr as idReference,M as interactivityChecker,ie as isAndroid,g as isArrowKeyOrPageKeysPressed,p as isArrowKeyPressed,k as isBlink,oe as isChromium,D as isEdge,ui as isEventOnElement,Ae as isEventPrevented,b as isFakeMousedownFromScreenReader,x as isFakeTouchstartFromScreenReader,re as isFirefox,j as isIOS,ne as isMacOS,h as isNextArrowKeyPressed,se as isNextjs,m as isPreviousArrowKeyPressed,ae as isSafari,O as isTrident,A as isWebkit,Ar as isZeroAnimationDuration,Qr as listResetStyles,Pe as mergeConfig,B as omitEmptyConverter,Q as pageScrollDisabled,kr as plainDate,Or as plainDateConverter,ei as popoverResetStyles,Ir as preventScrollOnSpacebarPress,Mr as queueDomContentLoaded,$ as radioButtonRegistry,R as readConfig,yi as removeAriaComboBoxAttributes,ke as removeAriaElements,_i as removeAriaOverlayTriggerProperties,T as sbbInputModalityDetector,Ce as sbbLiveAnnouncer,hi as sbbOverlayOutsidePointerEventListener,$r as screenReaderOnlyStyles,ti as scrollbarStyles,vi as setAriaComboBoxAttributes,gi as setAriaOverlayTriggerProperties,jr as setOrRemoveAttribute,pi as setOverlayPosition,De as ɵstateController};
69
+ `;const oi=e=>(()=>{let t=e,n,r=[],i=[],c,u=[],d=[],f,p=[],m=[],h,g=[],_=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[l({reflect:!0})],c=[I(),l({reflect:!0,type:Boolean})],f=[I(),l()],h=[l({reflect:!0}),Tr((e,t)=>e.group?.size??t)],o(this,null,n,{kind:`accessor`,name:`color`,static:!1,private:!1,access:{has:e=>`color`in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:e},r,i),o(this,null,c,{kind:`accessor`,name:`borderless`,static:!1,private:!1,access:{has:e=>`borderless`in e,get:e=>e.borderless,set:(e,t)=>{e.borderless=t}},metadata:e},u,d),o(this,null,f,{kind:`accessor`,name:`expansionState`,static:!1,private:!1,access:{has:e=>`expansionState`in e,get:e=>e.expansionState,set:(e,t)=>{e.expansionState=t}},metadata:e},p,m),o(this,null,h,{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:e},g,_),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.styles=[a(ai)]}#e=s(this,r,`white`);get color(){return this.#e}set color(e){this.#e=e}#t=(s(this,i),s(this,u,!1));get borderless(){return this.#t}set borderless(e){this.#t=e}#n=(s(this,d),s(this,p,``));get expansionState(){return this.#n}set expansionState(e){this.#n=e}#r=(s(this,m),s(this,g,null));get size(){return this.#r}set size(e){this.#r=e}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event(`panelconnected`,{bubbles:!0}))}constructor(){super(...arguments),s(this,_)}}})(),si=e=>{class t extends e{get group(){return this.closest?.(`sbb-radio-button-group, sbb-checkbox-group`)??null}get panel(){return this.querySelector?.(`sbb-radio-button-panel, sbb-checkbox-panel`)??null}constructor(...e){super(e),this._previousSize=null,this._propertyWatcher=new zn(this,()=>this.panel,{checked:e=>{this.toggleState(`checked`,e.checked),this.onInputStateChange?.()},disabled:e=>{this.toggleState(`disabled`,e.disabled),this.onInputStateChange?.()},size:e=>{this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e.size,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)},borderless:e=>{this.toggleState(`borderless`,e.borderless)},color:e=>{this._previousColor&&this.internals.states.delete(`color-${this._previousColor}`),this._previousColor=e.color,this._previousColor&&this.internals.states.add(`color-${this._previousColor}`)}}),this.addEventListener?.(`panelconnected`,()=>this._propertyWatcher.connect())}onInputStateChange(){}}return t},ci=e=>{class t extends e{constructor(){super(...arguments),this._updatePromise=Promise.resolve(),this._updateResolve=()=>{}}startUpdate(){this._updatePromise=new Promise(e=>this._updateResolve=e)}completeUpdate(){this._updateResolve()}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this._updatePromise,e}}return t};function li(e){let t=window.getComputedStyle(e),n=t.display,r=parseInt(t.maxHeight,10).toString();if(n!==`none`&&r!==`0`)return{scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,offsetHeight:e.offsetHeight,scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,offsetWidth:e.offsetWidth};e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.display=`block`;let i=e.scrollHeight,a=e.clientHeight,o=e.offsetHeight,s=e.scrollWidth,c=e.clientWidth,l=e.offsetWidth;return e.style.display=``,e.style.position=``,e.style.visibility=``,{scrollHeight:i,clientHeight:a,offsetHeight:o,scrollWidth:s,clientWidth:c,offsetWidth:l}}function ui(e,t){if(!e||!t)return!1;let n=e.getBoundingClientRect();return n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function di(e,t,n,r){let i=r?.verticalOffset||0,a=r?.horizontalOffset||0,o=r?.responsiveHeight||!1,s=t.getBoundingClientRect(),c=li(e),l=s.left,u=s.top,d=document.documentElement.clientWidth-(l+s.width),f=u-i,p=document.documentElement.clientHeight-(u+s.height+i),m=l,h=u+s.height+i,g=c.offsetWidth-s.width,_={horizontal:`start`,vertical:`below`},v=`${p-i}px`;r?.centered&&l-16+s.width/2>c.offsetWidth/2&&d-16>g/2&&(m-=g/=2,_.horizontal=`center`),d<g&&l>g&&(m-=g,_.horizontal=`end`),a&&_.horizontal!==`center`&&s.width/2<a&&(m+=a*(_.horizontal===`start`?-1:1)),(l<g&&d<g||document.documentElement.clientWidth<c.offsetWidth)&&(m=document.documentElement.clientWidth/2-c.offsetWidth/2);let y=p-i>=c.scrollHeight,b=f-i>=(o?c.clientHeight:c.scrollHeight),x=!y&&(b||f>p);!r?.forceBelow&&(r?.forceAbove||x)&&(h=f<c.scrollHeight?h-s.height-f-i:u-c.clientHeight-i,v=`${f-i}px`,_.vertical=`above`);let S=n.getBoundingClientRect();return S.left<0&&(m-=S.left),S.top<0&&(h-=S.top),{top:h,left:m,maxHeight:v,alignment:_}}function fi(e,t,n,r){let i=r?.verticalOffset||0,a=r?.horizontalOffset||0,o=t.getBoundingClientRect(),s=li(e),c=t.parentElement.shadowRoot.querySelector(r?.contentSelector??`.${e.className}`).getBoundingClientRect(),l=n.getBoundingClientRect(),u=document.documentElement.clientWidth-c.right,d=document.documentElement.clientHeight-(o.top-i),f=document.documentElement.clientHeight,p=`${f-32}px`,m={horizontal:`end`,vertical:`above`},h=s.offsetWidth+a,g=c.right,_=o.top+i;return u<h&&o.left>h&&(g=g-c.width-s.offsetWidth,m.horizontal=`start`),a&&m.horizontal!==`center`&&(g+=a*(m.horizontal===`start`?-1:1)),d<s.scrollHeight&&(_=f-s.clientHeight-16),l.left<0&&(g-=l.left),l.top<0&&(_-=l.top),{top:_,left:g,maxHeight:p,alignment:m}}function pi(e,t,n,r,i,a=`auto`){if(!e||!t)return;let o=t.getBoundingClientRect();i.style.setProperty(`--sbb-options-panel-width`,`${t.offsetWidth}px`),i.style.setProperty(`--sbb-options-panel-origin-height`,`${t.offsetHeight}px`),i.style.setProperty(`--sbb-options-panel-origin-position-x`,`${o.left}px`),i.style.setProperty(`--sbb-options-panel-origin-position-y`,`${o.top}px`);let s=di(n,t,r,{forceBelow:a===`below`,forceAbove:a===`above`});i.style.setProperty(`--sbb-options-panel-position-x`,`${s.left}px`),i.style.setProperty(`--sbb-options-panel-position-y`,`${s.top}px`),i.style.setProperty(`--sbb-options-panel-max-height-calculated`,s.maxHeight);let c=s.alignment.vertical===`above`;i.toggleState?.(`options-panel-position-above`,c),i.toggleState?.(`options-panel-position-below`,!c),t.setAttribute(`data-options-panel-position`,s.alignment.vertical)}var mi=class{constructor(){this._overlays=/* @__PURE__ */ new Set,this._pointerDownListener=e=>{this._pointerDownEventTarget=e.composedPath()[0]},this._clickListener=e=>{let t=e.composedPath()[0],n=e.type===`click`&&this._pointerDownEventTarget?this._pointerDownEventTarget:t;this._pointerDownEventTarget=void 0;for(let e of Array.from(this._overlays).reverse()){if(Z(e,t)||Z(e,n))break;e.dispatchEvent(new Event(`overlayOutsidePointer`))}}}connect(e){this._overlays.size||(this._addGlobalEventListeners(),j&&(this._cursorOriginalValue=document.body.style.cursor,document.body.style.cursor=`pointer`)),this._overlays.add(e)}disconnect(e){this._overlays.delete(e),this._overlays.size||(this._abortController?.abort(),this._abortController=void 0,j&&(document.body.style.cursor=this._cursorOriginalValue))}_addGlobalEventListeners(){let e=document.body;this._abortController=new AbortController;let t={capture:!0,passive:!0,signal:this._abortController.signal};e.addEventListener(`click`,this._clickListener,t),!ie&&!j&&(e.addEventListener(`pointerdown`,this._pointerDownListener,t),e.addEventListener(`auxclick`,this._clickListener,t),e.addEventListener(`contextmenu`,this._clickListener,t))}};const hi=new mi;function gi(e,t,n,r){t&&(t.ariaHasPopup=n,t.ariaControlsElements=[e],t.ariaExpanded=`${r===`opening`||r===`opened`}`)}function _i(e){e&&(e.ariaHasPopup=null,e.ariaControlsElements=null,e.ariaExpanded=null)}function vi(e,t,n,r=`listbox`){e&&(e.setAttribute(`autocomplete`,`off`),e.setAttribute(`role`,`combobox`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,r),e.setAttribute(`aria-controls`,t),e.setAttribute(`aria-owns`,t),e.setAttribute(`aria-expanded`,`${n}`))}function yi(e){e&&(e.removeAttribute(`autocomplete`),e.removeAttribute(`role`),e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`),e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-owns`),e.removeAttribute(`aria-expanded`))}export{q as DateAdapter,fr as FORMAT_DATE,vr as FRIDAY,pr as ISO8601_FORMAT_DATE,te as IS_FOCUSABLE_QUERY,le as InteractivityChecker,ce as IsFocusableConfig,mr as MONDAY,Sr as NativeDateAdapter,yr as SATURDAY,br as SUNDAY,F as SbbActionBaseElement,Rr as SbbAnimationCompleteMixin,Ne as SbbButtonBaseElement,Me as SbbButtonLikeBaseElement,ar as SbbDarkModeController,Pn as SbbDisabledInteractiveMixin,V as SbbDisabledMixin,Fn as SbbDisabledTabIndexActionMixin,P as SbbElement,Vn as SbbEscapableOverlayController,be as SbbFocusTrapController,ee as SbbFocusVisibleWithinController,zr as SbbFormAssociatedCheckboxMixin,Hr as SbbFormAssociatedInputMixin,L as SbbFormAssociatedMixin,Ur as SbbFormAssociatedRadioButtonMixin,Un as SbbIdReferenceController,Jn as SbbInertController,z as SbbLanguageController,Mn as SbbLinkBaseElement,Se as SbbLiveAnnouncer,ir as SbbMediaMatcherController,er as SbbMediaQueryBreakpointLargeAndAbove,rr as SbbMediaQueryBreakpointLargeAndBelow,$n as SbbMediaQueryBreakpointSmallAndAbove,nr as SbbMediaQueryBreakpointSmallAndBelow,tr as SbbMediaQueryBreakpointUltraAndAbove,Qn as SbbMediaQueryBreakpointZeroAndAbove,G as SbbMediaQueryDarkMode,Yn as SbbMediaQueryForcedColors,Xn as SbbMediaQueryHover,Zn as SbbMediaQueryPointerCoarse,ri as SbbNamedSlotListMixin,ii as SbbNegativeMixin,Nn as SbbOpenCloseBaseElement,mi as SbbOverlayOutsidePointerEventListener,dr as SbbOverlayPositionController,oi as SbbPanelMixin,zn as SbbPropertyWatcherController,Br as SbbReadonlyMixin,H as SbbRequiredMixin,Fr as SbbScrollHandler,Ln as SbbSelectionGroupBaseElement,si as SbbSelectionPanelMixin,N as SbbSlottedChangeEvent,ci as SbbUpdateSchedulerMixin,_r as THURSDAY,hr as TUESDAY,wr as TemporalDateAdapter,gr as WEDNESDAY,Oe as appendAriaElements,Xr as buttonResetStyles,Z as containsPierceShadowDom,J as defaultDateAdapter,I as forceType,Lr as forwardEvent,di as getElementPosition,fi as getElementPositionHorizontal,li as getElementRectangle,S as getEventTarget,y as getNextElementIndex,Tr as getOverride,Er as handleDistinctChange,Zr as hostScrollbarStyles,Qe as i18nAdditionalWagonInformationHeading,ze as i18nAnd,Ie as i18nArrival,Ze as i18nBlockedPassage,Yt as i18nBreadcrumbEllipsisButtonLabel,Nt as i18nCalendarDateSelection,wn as i18nCalendarWeekNumber,Dn as i18nCarouselArrowsNavigationHint,En as i18nCarouselItemAriaLabel,fn as i18nCheckboxRequired,Sn as i18nChipDelete,Cn as i18nChipGroupInputDescription,Be as i18nClass,Xt as i18nClearInput,yt as i18nCloseAlert,St as i18nCloseDialog,Ct as i18nCloseNavigation,bt as i18nCloseNotification,Tt as i18nClosePopover,wt as i18nCloseSidebar,Ke as i18nClosedCompartmentLabel,qt as i18nCollapsed,Ut as i18nConnectionFrom,Gt as i18nConnectionRoundtrip,Wt as i18nConnectionTo,Ye as i18nCouchetteWagonLabel,Ht as i18nDateChangedTo,hn as i18nDateInvalid,_n as i18nDateMax,gn as i18nDateMin,Vt as i18nDatePickerPlaceholder,$e as i18nDeparture,xt as i18nDialog,Fe as i18nDirection,tt as i18nDownload,it as i18nDurationDay,rt as i18nDurationHour,nt as i18nDurationMinute,Kt as i18nExpanded,$t as i18nFileSelectorButtonLabel,en as i18nFileSelectorButtonLabelMultiple,an as i18nFileSelectorCurrentlySelected,rn as i18nFileSelectorDeleteFile,tn as i18nFileSelectorSubtitleLabel,nn as i18nFileSelectorSubtitleLabelMultiple,Zt as i18nFlipCard,ft as i18nFromPlatform,Et as i18nGoBack,mn as i18nInputRequired,ln as i18nItemsPerPage,qe as i18nLocomotiveLabel,Jt as i18nMapContainerButtonLabel,ht as i18nMeansOfTransport,dt as i18nNew,At as i18nNextDay,Ot as i18nNextMonth,on as i18nNextPage,On as i18nNextSlide,It as i18nNextYear,Pt as i18nNextYearRange,et as i18nNonAccessible,mt as i18nOccupancy,cn as i18nPage,dn as i18nPaginatorOf,un as i18nPaginatorSelected,jt as i18nPreviousDay,kt as i18nPreviousMonth,sn as i18nPreviousPage,kn as i18nPreviousSlide,Lt as i18nPreviousYear,Ft as i18nPreviousYearRange,ct as i18nRealTimeInfo,jn as i18nRemainingCharacters,Xe as i18nRestaurantWagonLabel,Qt as i18nReverseCard,Le as i18nSector,Re as i18nSectorShort,Rt as i18nSelectNextDay,zt as i18nSelectPreviousDay,pn as i18nSelectionRequired,Bt as i18nShowCalendar,Je as i18nSleepingWagonLabel,An as i18nSlide,pt as i18nSupersaver,gt as i18nTargetOpensInNewWindow,vn as i18nTimeInputChange,yn as i18nTimeInvalid,bn as i18nTimeMax,xn as i18nTimeMaxLength,Tn as i18nTimetableFormSwapButtonLabel,Dt as i18nToday,Ve as i18nTrain,He as i18nTrains,lt as i18nTransferProcedure,ut as i18nTransferProcedures,st as i18nTravelhints,ot as i18nTripDuration,at as i18nTripQuayChange,We as i18nWagonLabel,Ge as i18nWagonLabelNumber,Ue as i18nWagonsLabel,_t as i18nWalkingDistanceArrival,vt as i18nWalkingDistanceDeparture,Mt as i18nYearMonthSelection,Dr as idReference,M as interactivityChecker,ie as isAndroid,g as isArrowKeyOrPageKeysPressed,p as isArrowKeyPressed,k as isBlink,oe as isChromium,D as isEdge,ui as isEventOnElement,Ae as isEventPrevented,b as isFakeMousedownFromScreenReader,x as isFakeTouchstartFromScreenReader,re as isFirefox,j as isIOS,ne as isMacOS,h as isNextArrowKeyPressed,se as isNextjs,m as isPreviousArrowKeyPressed,ae as isSafari,O as isTrident,A as isWebkit,Ar as isZeroAnimationDuration,Qr as listResetStyles,Pe as mergeConfig,B as omitEmptyConverter,Q as pageScrollDisabled,kr as plainDate,Or as plainDateConverter,ei as popoverResetStyles,Ir as preventScrollOnSpacebarPress,Mr as queueDomContentLoaded,$ as radioButtonRegistry,R as readConfig,yi as removeAriaComboBoxAttributes,ke as removeAriaElements,_i as removeAriaOverlayTriggerProperties,T as sbbInputModalityDetector,Ce as sbbLiveAnnouncer,hi as sbbOverlayOutsidePointerEventListener,$r as screenReaderOnlyStyles,ti as scrollbarStyles,vi as setAriaComboBoxAttributes,gi as setAriaOverlayTriggerProperties,jr as setOrRemoveAttribute,pi as setOverlayPosition,De as ɵstateController};
package/download.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,nothing as r,unsafeCSS as i}from"lit";import{property as a}from"lit/decorators.js";import{SbbSecondaryButtonStaticElement as o}from"./button.pure.js";import{SbbElement as s,SbbLanguageController as c,SbbLinkBaseElement as l,SbbPropertyWatcherController as u,defaultDateAdapter as d,forceType as f,i18nDownload as p,i18nNonAccessible as m,omitEmptyConverter as h,readConfig as g,screenReaderOnlyStyles as _}from"./core.js";import{SbbDividerElement as v}from"./divider.pure.js";import{SbbIconNameMixin as y}from"./icon.pure.js";var b=`:host{--sbb-card-background-color:var(--sbb-background-color-1);--sbb-card-border-color:transparent;--sbb-card-border-radius:var(--sbb-border-radius-4x);--sbb-card-animation-easing:var(--sbb-animation-easing);--sbb-card-border-style:solid;--sbb-card-padding-inline-default:var(--sbb-spacing-responsive-s);--sbb-card-padding-block-default:var(--sbb-spacing-responsive-xxxs);--sbb-card-with-badge-padding-block-default:var(--sbb-spacing-fixed-6x) var(--sbb-spacing-responsive-xxxs);--sbb-card-padding-block:var(--sbb-card-padding-block-default);--sbb-card-with-badge-padding-block:var(--sbb-card-with-badge-padding-block-default);--sbb-card-padding-inline:var(--sbb-card-padding-inline-default);display:block}:host(:where([color=white])){--sbb-card-background-color:var(--sbb-background-color-1);--sbb-card-border-color:transparent}:host(:where([color=milk])){--sbb-card-background-color:var(--sbb-background-color-3);--sbb-card-border-color:transparent}.sbb-download{--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));--sbb-card-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-1x));padding-inline:var(--sbb-card-padding-inline);padding-block:var(--sbb-card-padding-block);border-radius:var(--sbb-card-border-radius);background-color:var(--sbb-card-background-color);box-shadow:none;transition:box-shadow var(--sbb-card-animation-duration) var(--sbb-card-animation-easing);color:var(--sbb-card-color);display:block;position:relative}.sbb-download:after{content:"";border:var(--sbb-card-border-width) var(--sbb-card-border-style) var(--sbb-card-border-color);border-radius:var(--sbb-card-border-radius);pointer-events:none;background-color:#0000;position:absolute;inset:0}@media (forced-colors:active){.sbb-download{--sbb-title-color:var(--sbb-card-color)}}.sbb-download{translate:0 var(--sbb-card-hover-shift,0);transition:box-shadow var(--sbb-card-animation-duration) var(--sbb-card-animation-easing), translate var(--sbb-card-animation-duration) var(--sbb-card-animation-easing);align-items:center;text-decoration:none;display:flex}.sbb-download:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}@media (any-hover:hover){:host(:hover) .sbb-download{--sbb-card-hover-shift:-.125rem;box-shadow:var(--sbb-box-shadow-level-9-hard)}}@media (any-hover:hover) and (forced-colors:active){:host(:hover) .sbb-download{--sbb-card-border-color:Highlight}}.sbb-download__icon{flex:none}.sbb-download__divider{height:auto;margin-block:var(--sbb-download-divider-margin-block);margin-inline:var(--sbb-download-gap) var(--sbb-download-content-gap);align-self:stretch}:host(:not(:is(:state(slotted-icon),[state--slotted-icon]),:is(:state(has-icon-name),[state--has-icon-name]))) .sbb-download__divider{display:none}.sbb-download__content{flex-direction:column;flex:auto;min-width:0;display:flex}.sbb-download__label{overflow-wrap:break-word;font-size:var(--sbb-download-label-font-size);line-height:var(--sbb-typo-line-height-heading);letter-spacing:var(--sbb-letter-spacing-heading);color:var(--sbb-download-label-color);font-weight:700}.sbb-download__custom-content,.sbb-download__info{line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-letter-spacing-text);font-size:var(--sbb-text-font-size-xxs);color:var(--sbb-download-info-color)}.sbb-download__button{flex:none;margin-inline-start:var(--sbb-download-content-gap)}
2
- `;const x=new Map([[`pdf`,`document-pdf-small`],[`xls`,`document-xls-small`],[`xlsx`,`document-xls-small`],[`ppt`,`document-ppt-small`],[`pptx`,`document-ppt-small`],[`doc`,`document-doc-small`],[`docx`,`document-doc-small`],[`zip`,`document-zip-small`],[`jpg`,`document-image-small`],[`jpeg`,`document-image-small`],[`png`,`document-image-small`],[`gif`,`document-image-small`],[`svg`,`document-image-small`],[`webp`,`document-image-small`]]);let S=(()=>{let s=y(l),u,d=[],m=[],g,S=[],C=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,d,`white`),this.#t=(t(this,m),t(this,S,``)),this._languageController=(t(this,C),new c(this))}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;u=[a({reflect:!0})],g=[f(),a({converter:h})],e(this,null,u,{kind:`accessor`,name:`color`,static:!1,private:!1,access:{has:e=>`color`in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:t},d,m),e(this,null,g,{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},S,C),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-download`}static{this.elementDependencies=[v,o]}static{this.styles=[_,i(b)]}#e;get color(){return this.#e}set color(e){this.#e=e}#t;get label(){return this.#t}set label(e){this.#t=e}get fileName(){return this.href.split(/[?#]/)[0].split(`/`).filter(Boolean).at(-1)??``}get fileExtension(){let e=this.fileName;return e.includes(`.`)?e.split(`.`).at(-1)?.toLowerCase()??``:``}renderIconName(){if(this.iconName)return this.iconName;if(!this.href)return``;let e=this.fileExtension;return e&&x.get(e)||`document-standard-small`}resolveTarget(){return this.target||this.hasAttribute(`target`)?this.target:this.download?``:`_blank`}updated(e){super.updated(e),this._updateDescribedByElements()}_updateDescribedByElements(){let e=this.shadowRoot?.querySelector?.(`a`);if(e){let t=this.shadowRoot?.querySelector?.(`.sbb-download__custom-content`),n=this.shadowRoot?.querySelector?.(`#sbb-link-new-window`);e.ariaDescribedByElements=[...t?[t]:[],...this._downloadInfoElements(),...n?[n]:[]]}}_downloadInfoElements(){return this.querySelectorAll?.(`sbb-download-info`)??[]}renderTemplate(){return n`
2
+ `;const x=/* @__PURE__ */ new Map([[`pdf`,`document-pdf-small`],[`xls`,`document-xls-small`],[`xlsx`,`document-xls-small`],[`ppt`,`document-ppt-small`],[`pptx`,`document-ppt-small`],[`doc`,`document-doc-small`],[`docx`,`document-doc-small`],[`zip`,`document-zip-small`],[`jpg`,`document-image-small`],[`jpeg`,`document-image-small`],[`png`,`document-image-small`],[`gif`,`document-image-small`],[`svg`,`document-image-small`],[`webp`,`document-image-small`]]);let S=(()=>{let s=y(l),u,d=[],m=[],g,S=[],C=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,d,`white`),this.#t=(t(this,m),t(this,S,``)),this._languageController=(t(this,C),new c(this))}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;u=[a({reflect:!0})],g=[f(),a({converter:h})],e(this,null,u,{kind:`accessor`,name:`color`,static:!1,private:!1,access:{has:e=>`color`in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:t},d,m),e(this,null,g,{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},S,C),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-download`}static{this.elementDependencies=[v,o]}static{this.styles=[_,i(b)]}#e;get color(){return this.#e}set color(e){this.#e=e}#t;get label(){return this.#t}set label(e){this.#t=e}get fileName(){return this.href.split(/[?#]/)[0].split(`/`).filter(Boolean).at(-1)??``}get fileExtension(){let e=this.fileName;return e.includes(`.`)?e.split(`.`).at(-1)?.toLowerCase()??``:``}renderIconName(){if(this.iconName)return this.iconName;if(!this.href)return``;let e=this.fileExtension;return e&&x.get(e)||`document-standard-small`}resolveTarget(){return this.target||this.hasAttribute(`target`)?this.target:this.download?``:`_blank`}updated(e){super.updated(e),this._updateDescribedByElements()}_updateDescribedByElements(){let e=this.shadowRoot?.querySelector?.(`a`);if(e){let t=this.shadowRoot?.querySelector?.(`.sbb-download__custom-content`),n=this.shadowRoot?.querySelector?.(`#sbb-link-new-window`);e.ariaDescribedByElements=[...t?[t]:[],...this._downloadInfoElements(),...n?[n]:[]]}}_downloadInfoElements(){return this.querySelectorAll?.(`sbb-download-info`)??[]}renderTemplate(){return n`
3
3
  ${this.renderIconSlot(`sbb-download__icon`)}
4
4
  <sbb-divider
5
5
  class="sbb-download__divider"
@@ -21,7 +21,7 @@ import{html as e,isServer as t,unsafeCSS as n}from"lit";import{SbbButtonBaseElem
21
21
  <slot></slot>
22
22
  </span>
23
23
  `}},S=`:host{--sbb-form-field-hint-divider-width:var(--sbb-spacing-fixed-1x);--sbb-form-field-hint-padding-block-start:var(--sbb-form-field-hint-divider-width);--sbb-form-field-select-inline-padding-end:calc(var(--sbb-icon-svg-width) + var(--sbb-form-field-gap));--sbb-form-field-label-size:calc(var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-text));--sbb-form-field-text-line-height:calc(var(--sbb-form-field-input-text-size) * var(--sbb-typo-line-height-text));--sbb-form-field-margin-block-start:calc(( var(--sbb-form-field-min-height) - var(--sbb-form-field-label-size) - var(--sbb-form-field-text-line-height) + var(--_sbb-form-field-label-to-input-overlapping) ) / 2);--sbb-icon-svg-width:var(--sbb-form-field-icon-size);--sbb-icon-svg-height:var(--sbb-form-field-icon-size);--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));color:var(--sbb-form-field-color);font-weight:400;line-height:var(--sbb-typo-line-height-text);display:inline-block}:host(:where(:not([width=collapse]))){width:min(18.75rem,100%);min-width:9.375rem}:host([negative]){color:var(--sbb-color-3-negative);--sbb-form-field-background-color:var(--sbb-background-color-1-negative);--sbb-form-field-border-color:var(--sbb-border-color-5);--sbb-form-field-label-color:var(--sbb-color-5);--sbb-form-field-prefix-color:var(--sbb-color-5);--sbb-form-field-text-color:var(--sbb-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark);--sbb-form-field-arrow-color:var(--sbb-color-3-negative)}@media (forced-colors:active){:host([negative]){--sbb-form-field-border-color:ButtonBorder}}:host([size=s]){--sbb-form-field-min-height:var(--sbb-size-element-xs);--sbb-form-field-padding-inline:var(--sbb-spacing-fixed-2x);--sbb-form-field-input-text-size:var(--sbb-text-font-size-s);--sbb-form-field-label-text-size:var(--sbb-text-font-size-xxs);--_sbb-form-field-input-margin-block-end:-.125rem;--_sbb-form-field-label-to-input-overlapping:.625rem;--_sbb-form-field-floating-label-transform:.34375rem;--_sbb-form-field-spacer-margin-block-end:-.53125rem}@media (width>=64rem){:host([size=s]){--_sbb-form-field-label-to-input-overlapping:.6875rem;--_sbb-form-field-floating-label-transform:.3125rem;--_sbb-form-field-spacer-margin-block-end:-.5rem}}:host([size=s]:where(:is(:state(input-element-textarea),[state--input-element-textarea]))){--_sbb-form-field-spacer-margin-block-end-textarea:var(--sbb-form-field-textarea-s-spacer)}:host([size=m]){--sbb-form-field-min-height:var(--sbb-size-element-m);--sbb-form-field-padding-inline:var(--sbb-spacing-fixed-3x)}:host([size=l]){--sbb-form-field-min-height:var(--sbb-size-element-l);--sbb-form-field-padding-inline:var(--sbb-spacing-responsive-xxxs)}:host(:is([size=m],[size=l])){--sbb-form-field-input-text-size:var(--sbb-text-font-size-m);--sbb-form-field-label-text-size:var(--sbb-text-font-size-xs);--_sbb-form-field-input-margin-block-end:0;--_sbb-form-field-label-to-input-overlapping:var(--sbb-spacing-fixed-1x);--_sbb-form-field-floating-label-transform:.53125rem;--_sbb-form-field-spacer-margin-block-end:calc(-1 * var(--_sbb-form-field-label-to-input-overlapping))}@media (width>=64rem){:host(:is([size=m],[size=l])){--_sbb-form-field-floating-label-transform:.65625rem}}:host([error-space=reserve]){--sbb-form-field-hint-min-height:calc(var(--sbb-typo-line-height-text) * var(--sbb-text-font-size-xs));--sbb-form-field-hint-padding-block-start-override:var(--sbb-form-field-hint-divider-width)}:host(:where(:is(:state(readonly),[state--readonly]),:is(:state(disabled),[state--disabled]))){--sbb-form-field-background-color:var(--sbb-background-color-3);--sbb-form-field-border-color:light-dark(var(--sbb-color-graphite),var(--sbb-color-smoke));--sbb-form-field-arrow-color:light-dark(var(--sbb-color-granite),var(--sbb-color-storm))}@media (forced-colors:active){:host(:where(:is(:state(readonly),[state--readonly]),:is(:state(disabled),[state--disabled]))){--sbb-form-field-border-color:ButtonBorder}}:host(:where(:is(:state(readonly),[state--readonly]),:is(:state(disabled),[state--disabled]))[negative]){--sbb-form-field-background-color:var(--sbb-background-color-3-negative);--sbb-form-field-border-color:var(--sbb-border-color-5);--sbb-form-field-arrow-color:var(--sbb-border-color-5)}:host(:where(:is(:state(disabled),[state--disabled]))){--sbb-form-field-label-color:light-dark(var(--sbb-color-granite),var(--sbb-color-smoke));--sbb-form-field-prefix-color:light-dark(var(--sbb-color-granite),var(--sbb-color-storm));--sbb-form-field-border-style:dashed}@media (forced-colors:active){:host(:where(:is(:state(disabled),[state--disabled]))){--sbb-form-field-label-color:GrayText!important;--sbb-form-field-prefix-color:GrayText!important;--sbb-form-field-text-color:GrayText!important;--sbb-form-field-border-color:GrayText!important}}:host(:where(:is(:state(disabled),[state--disabled]))[negative]){--sbb-form-field-text-color:var(--sbb-color-5);--sbb-form-field-label-color:var(--sbb-color-5);--sbb-form-field-prefix-color:var(--sbb-color-5)}:host(:where(:is(:state(readonly),[state--readonly])):not([negative])){--sbb-form-field-label-color:light-dark(var(--sbb-color-granite),var(--sbb-color-smoke));--sbb-form-field-prefix-color:light-dark(var(--sbb-color-granite),var(--sbb-color-storm))}:host(:where(:is(:state(focus),[state--focus]))){--sbb-form-field-border-color:var(--sbb-border-color-3);--sbb-form-field-prefix-color:var(--sbb-color-3);--sbb-form-field-border-width:var(--sbb-border-width-2x)}:host(:where(:is(:state(focus),[state--focus]))[negative]){--sbb-form-field-border-color:var(--sbb-border-color-3-negative);--sbb-form-field-prefix-color:var(--sbb-color-3-negative)}@media (forced-colors:active){:host(:is(:state(focus),[state--focus])){--sbb-form-field-border-color:Highlight;--sbb-form-field-prefix-color:Highlight}}:host(:not(:where(:is(:state(has-error),[state--has-error]),:is(:state(has-hint),[state--has-hint])))){--sbb-form-field-hint-padding-block-start:0}:host([floating-label]){--sbb-select-placeholder-color:transparent}@media (forced-colors:active){:host([floating-label]){--sbb-select-placeholder-color:Canvas}}:host(:is(:not(:is(:state(slotted-label),[state--slotted-label])),[hidden-label])){--sbb-form-field-label-size:0rem;--_sbb-form-field-label-to-input-overlapping:0rem}:host(:where(:is(:state(input-element-sbb-slider),[state--input-element-sbb-slider]))){--sbb-form-field-overflow:visible}.sbb-form-field__space-wrapper{flex-direction:column;height:100%;display:flex}.sbb-form-field__space-wrapper:before{content:"​";user-select:none;width:0;height:0}.sbb-form-field__wrapper{gap:var(--sbb-form-field-gap);padding-inline:var(--sbb-form-field-padding-inline);border-radius:var(--sbb-form-field-border-radius);min-height:var(--sbb-form-field-min-height);max-height:var(--sbb-form-field-max-height);background-color:var(--sbb-form-field-background-color);flex:1;display:flex;position:relative}.sbb-form-field__wrapper:before{content:"";border:var(--sbb-form-field-border-width) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);border-radius:var(--sbb-form-field-border-radius);pointer-events:none;display:block;position:absolute;inset:0}:host(:where(:is(:state(focus),[state--focus]):is(:state(focus-origin-keyboard),[state--focus-origin-keyboard]))) .sbb-form-field__wrapper{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width);outline-offset:var(--sbb-form-field-outline-offset,var(--sbb-focus-outline-offset))}@media (forced-colors:none){:host(:is([borderless],:is(:state(input-element-sbb-slider),[state--input-element-sbb-slider]))) .sbb-form-field__wrapper:before{border-color:#0000}.sbb-form-field__wrapper:after{border-block-end:var(--sbb-border-width-1x) var(--sbb-form-field-border-style) var(--sbb-form-field-border-color);inset-inline:var(--sbb-form-field-border-block-end-inset-inline,var(--sbb-form-field-padding-inline));z-index:var(--sbb-form-field-focus-underline-z-index,initial);position:absolute;inset-block-end:0}:host(:where(:is(:state(focus),[state--focus]),:is(:state(disabled),[state--disabled]))[borderless]) .sbb-form-field__wrapper:after{content:""}}::slotted([slot=prefix]){color:var(--sbb-form-field-prefix-color)}::slotted([slot=prefix]),::slotted([slot=suffix]){min-width:var(--sbb-icon-svg-width);margin-block-start:calc((var(--sbb-form-field-min-height) - var(--sbb-size-icon-ui-small)) / 2);display:flex}:host(:where(:is(:state(empty),[state--empty]),:is(:state(disabled),[state--disabled]),:is(:state(readonly),[state--readonly]))) ::slotted(sbb-form-field-clear),:host(:is(:state(has-error),[state--has-error])) slot[name=hint],:host(:where(:is(:state(disabled),[state--disabled]),:is(:state(readonly),[state--readonly]))) ::slotted(sbb-form-field-text-counter){display:none}::slotted(sbb-datepicker-toggle){padding-block-end:calc((var(--sbb-form-field-min-height) - var(--sbb-size-icon-ui-small)) / 2)}@media (forced-colors:active){::slotted([slot=suffix]){color:var(--sbb-form-field-prefix-color)}}.sbb-form-field__select-input-icon{top:50%;pointer-events:none;color:var(--sbb-form-field-arrow-color);margin-block-start:calc(-1 * var(--sbb-form-field-margin-block-start) / 2);display:none;position:absolute;inset-inline-end:0;translate:0 -50%}:host(:is(:is(:state(input-element-select),[state--input-element-select]),:is(:state(input-element-sbb-select),[state--input-element-sbb-select]),:is(:state(explicit-input-element-select),[state--explicit-input-element-select]))) .sbb-form-field__select-input-icon{display:inline-block}.sbb-form-field__input-container{flex-direction:column;flex:auto;min-width:0;margin-block-start:var(--sbb-form-field-margin-block-start);display:flex;position:relative}.sbb-form-field__label-spacer{height:calc(var(--sbb-form-field-label-text-size) * var(--sbb-typo-line-height-text));margin-block-end:calc(var(--_sbb-form-field-spacer-margin-block-end) + var(--_sbb-form-field-spacer-margin-block-end-textarea,0px));display:flex}:host(:not(:is(:state(slotted-label),[state--slotted-label]))) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){display:none}:host([hidden-label]) :is(.sbb-form-field__label,.sbb-form-field__label-spacer){clip-path:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.sbb-form-field__label{max-width:100%;cursor:var(--sbb-cursor-default);color:var(--sbb-form-field-label-color);font-size:var(--sbb-form-field-label-text-size);letter-spacing:var(--sbb-letter-spacing-text);display:flex;position:absolute;inset-block-start:0}:host(:where(:is(:state(input-element-select),[state--input-element-select]),:is(:state(input-element-sbb-select),[state--input-element-sbb-select]))) .sbb-form-field__label{padding-inline-end:var(--sbb-form-field-select-inline-padding-end)}:host([floating-label]) .sbb-form-field__label{transform-origin:0 0;pointer-events:none;backface-visibility:hidden;will-change:transform, font-size;transition-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));transition-timing-function:var(--sbb-animation-easing);transition-property:transform,font-size}:host([floating-label]:is(:not(:where(:is(:state(focus),[state--focus])):not(:where(:is(:state(input-element-sbb-select),[state--input-element-sbb-select]))),:where(:is(:state(has-popup-open),[state--has-popup-open]))),:where(:is(:state(readonly),[state--readonly]))):where(:is(:state(empty),[state--empty]))) .sbb-form-field__label{font-size:var(--sbb-form-field-input-text-size);transform:translateY(var(--_sbb-form-field-floating-label-transform))}@media (forced-colors:active){:host(:where(:is(:state(input-element-textarea),[state--input-element-textarea]))) .sbb-form-field__label{z-index:1}}.sbb-form-field__label-ellipsis{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sbb-form-field__input{flex:1;align-items:start;display:flex}:host(:is(:is(:state(input-element-input),[state--input-element-input]),:is(:state(input-element-select),[state--input-element-select]),:is(:state(input-element-sbb-select),[state--input-element-sbb-select]),:is(:state(input-element-sbb-date-input),[state--input-element-sbb-date-input]),:is(:state(input-element-sbb-time-input),[state--input-element-sbb-time-input]))) .sbb-form-field__input{margin-block-end:var(--_sbb-form-field-input-margin-block-end)}.sbb-form-field__hint{min-height:var(--sbb-form-field-hint-min-height);flex-direction:column;margin-block-start:var(--sbb-form-field-hint-padding-block-start-override,var(--sbb-form-field-hint-padding-block-start));margin-inline-start:var(--sbb-form-field-padding-inline);display:flex}
24
- `;let C=0;const w=new WeakMap,T=[`input`,`textarea`,`select`];var E=class extends Event{get control(){return this._control}constructor(e){super(`formfieldcontrol`),this._control=e}};let D=(()=>{let r=o(i),a,l=[],u=[],p,y=[],b=[],x,E=[],D=[],O,k=[],A=[],j,M=[],N=[],P,F=[],I=[],L,R=[],z=[],B,V=[],H=[],U,W=[],G=[],K,q=[],J=[];return class extends r{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[g({attribute:`error-space`,reflect:!0})],p=[g({reflect:!0})],x=[c(),g({reflect:!0,type:Boolean})],O=[g({reflect:!0})],j=[c(),g({attribute:`hidden-label`,reflect:!0,type:Boolean})],P=[c(),g({attribute:`floating-label`,reflect:!0,type:Boolean})],L=[_()],B=[_()],U=[_()],K=[_()],m(this,null,a,{kind:`accessor`,name:`errorSpace`,static:!1,private:!1,access:{has:e=>`errorSpace`in e,get:e=>e.errorSpace,set:(e,t)=>{e.errorSpace=t}},metadata:e},l,u),m(this,null,p,{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:e},y,b),m(this,null,x,{kind:`accessor`,name:`borderless`,static:!1,private:!1,access:{has:e=>`borderless`in e,get:e=>e.borderless,set:(e,t)=>{e.borderless=t}},metadata:e},E,D),m(this,null,O,{kind:`accessor`,name:`width`,static:!1,private:!1,access:{has:e=>`width`in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:e},k,A),m(this,null,j,{kind:`accessor`,name:`hiddenLabel`,static:!1,private:!1,access:{has:e=>`hiddenLabel`in e,get:e=>e.hiddenLabel,set:(e,t)=>{e.hiddenLabel=t}},metadata:e},M,N),m(this,null,P,{kind:`accessor`,name:`floatingLabel`,static:!1,private:!1,access:{has:e=>`floatingLabel`in e,get:e=>e.floatingLabel,set:(e,t)=>{e.floatingLabel=t}},metadata:e},F,I),m(this,null,L,{kind:`accessor`,name:`_errorElements`,static:!1,private:!1,access:{has:e=>`_errorElements`in e,get:e=>e._errorElements,set:(e,t)=>{e._errorElements=t}},metadata:e},R,z),m(this,null,B,{kind:`accessor`,name:`_hintElements`,static:!1,private:!1,access:{has:e=>`_hintElements`in e,get:e=>e._hintElements,set:(e,t)=>{e._hintElements=t}},metadata:e},V,H),m(this,null,U,{kind:`accessor`,name:`_input`,static:!1,private:!1,access:{has:e=>`_input`in e,get:e=>e._input,set:(e,t)=>{e._input=t}},metadata:e},W,G),m(this,null,K,{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:e},q,J),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.elementName=`sbb-form-field`}static{this.elementDependencies=[v]}static{this.styles=[n(S)]}#e;get errorSpace(){return this.#e}set errorSpace(e){this.#e=e}#t;get size(){return this.#t}set size(e){this.#t=e}#n;get borderless(){return this.#n}set borderless(e){this.#n=e}#r;get width(){return this.#r}set width(e){this.#r=e}#i;get hiddenLabel(){return this.#i}set hiddenLabel(e){this.#i=e}#a;get floatingLabel(){return this.#a}set floatingLabel(e){this.#a=e}#o;get _errorElements(){return this.#o}set _errorElements(e){this.#o=e}#s;get _hintElements(){return this.#s}set _hintElements(e){this.#s=e}#c;get _input(){return this.#c}set _input(e){this.#c=e}#l;get _label(){return this.#l}set _label(e){this.#l=e}get inputElement(){return this._input}get label(){return this._label}constructor(){super(),this._excludedFocusElements=[`button`,`sbb-popover`,`sbb-option`,`sbb-chip`],this._floatingLabelSupportedInputElements=[`input`,`select`,`textarea`,`sbb-select`],this._floatingLabelSupportedInputTypes=[`email`,`number`,`password`,`search`,`tel`,`text`,`url`],this.#e=h(this,l,`none`),this.#t=(h(this,u),h(this,y,null)),this.#n=(h(this,b),h(this,E,!1)),this.#r=(h(this,D),h(this,k,`default`)),this.#i=(h(this,A),h(this,M,!1)),this.#a=(h(this,N),h(this,F,!1)),this.#o=(h(this,I),h(this,R,[])),this.#s=(h(this,z),h(this,V,[])),this.#c=(h(this,H),h(this,W,null)),this.#l=(h(this,G),h(this,q,void 0)),this._formFieldAttributeObserver=(h(this,J),t?null:new MutationObserver(e=>{e.some(e=>e.type===`attributes`)&&this._input&&(this._readInputState(),this._registerInputFormListener(),this._checkAndUpdateInputEmpty(),this.dispatchEvent(new Event(`ɵinputattributechange`)))})),this._inputFormAbortController=new AbortController,this._control=null,this._previousType=null,this.addEventListener?.(`focusin`,e=>{(e.target===this.inputElement||e.target===this.inputElement?.inputElement)&&(this.internals.states.add(`focus`),this.internals.states.add(`focus-origin-${f.mostRecentModality}`))},{passive:!0}),this.addEventListener?.(`focusout`,e=>{if(e.target===this.inputElement||e.target===this.inputElement?.inputElement){this._checkAndUpdateInputEmpty(),this.internals.states.delete(`focus`);for(let e of this.internals.states)e.startsWith(`focus-origin-`)&&this.internals.states.delete(e)}},{passive:!0}),this.addEventListener(`input`,()=>this._checkAndUpdateInputEmpty()),this.addEventListener(`displayvaluechange`,()=>this._checkAndUpdateInputEmpty()),this.addEventListener(`invalid`,e=>e.preventDefault(),{capture:!0}),this.addEventListener(`formfieldcontrol`,e=>{this._control=e.control,this._connectInputElement()===`unchanged`&&(this._assignAriaDescribedByElements(),this._readInputState(),this._checkAndUpdateInputEmpty())})}connectedCallback(){super.connectedCallback(),this._assignSlots(),this._connectInputElement(),this._syncNegative(),this._syncSize()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this._syncNegative(),e.has(`size`)&&this._syncSize()}disconnectedCallback(){super.disconnectedCallback(),this._formFieldAttributeObserver?.disconnect(),this._inputFormAbortController.abort(),(this._input?.localName===`input`||this._input?.localName===`textarea`)&&this._unpatchInputValue()}_handleWrapperClick(e){this._isElementFocusExcluded(e)||(this._control?.onContainerClick?this._control?.onContainerClick(e):e.target.localName!==`label`&&(this._input?.localName===`sbb-select`&&e.target.localName!==`sbb-select`&&this._input.click(),this._input?.focus()))}_isElementFocusExcluded(e){return e.composedPath().some(e=>e instanceof window.HTMLElement&&(e.getAttribute(`tabindex`)===`0`||e.hasAttribute(`contenteditable`))||this._excludedFocusElements.includes(e.localName))}_onSlotLabelChange(){let e=Array.from(this.querySelectorAll(`label`));this._label=e[0],this._syncLabelInputReferences()}_onSlotInputChange(){this._assignSlots(),this._connectInputElement()}_assignSlots(){this.querySelectorAll(`label:not([slot])`).forEach(e=>e.setAttribute(`slot`,`label`)),this.querySelectorAll(`sbb-error:not([slot])`).forEach(e=>e.setAttribute(`slot`,`error`))}_connectInputElement(){let e;if(this._control?.element)e=this._control.element;else if(this._control?.id)e=this.getRootNode().getElementById(this._control.id);else{let t=Array.from(this.querySelectorAll(`*:not([slot],sbb-chip-group)`));e=(t.find(e=>this._isInputElement(e))||t[0])??null}return e===this._input?`unchanged`:(this._input&&(this.internals.states.delete(`input-element-${this._input.localName}`),(this._input.localName===`input`||this._input.localName===`textarea`)&&this._unpatchInputValue()),e?(this._input=e,this._registerInputFormListener(),this._assignAriaDescribedByElements(),this._readInputState(),this._checkAndUpdateInputEmpty(),this._input.localName===`textarea`?(this._input.setAttribute(`rows`,this._input.getAttribute(`rows`)||`3`),this._patchInputValue()):this._input.localName===`input`?this._patchInputValue():(this._input.localName===`select`||this._input.localName===`sbb-select`)&&!this.hasUpdated&&this.hydrationComplete.then(()=>this.requestUpdate()),this._formFieldAttributeObserver?.disconnect(),this._formFieldAttributeObserver?.observe(this._input,{attributes:!0,attributeFilter:[`readonly`,`disabled`,`form`,`class`,`data-expanded`,`maxlength`]}),this.internals.states.add(`input-element-${this._input.localName}`),this._syncLabelInputReferences(),`changed`):(this._input=null,`no-input`))}_syncLabelInputReferences(){if(this._input&&this._label){if(T.includes(this._input.localName)||customElements.get(this._input.localName)?.formAssociated)this._input.id||=`sbb-form-field-input-${C++}`,this._label.htmlFor=this._input.id;else{this._label.id||=`sbb-form-field-label-${C++}`;let e=this._input.getAttribute(`aria-labelledby`)?.split(` `).filter(e=>!!e&&e!==this._label.id)??[];this._input.setAttribute(`aria-labelledby`,[...e,this._label.id].join(` `))}}}_isInputElement(e){return T.includes(e.localName)||!!customElements.get(e.localName)?.formAssociated}_readInputState(){this.toggleState(`readonly`,this._control?.readOnly??this._input.hasAttribute(`readonly`)),this.toggleState(`disabled`,this._control?.disabled??this._input.hasAttribute(`disabled`)),this.toggleState(`has-popup-open`,this._input.hasAttribute(`data-expanded`)),this.toggleState(`interacted`,!!this._control?.interacted),this.toggleState(`invalid`,!!this._control?.invalid),this._previousType&&this.internals.states.delete(`input-type-${this._previousType}`),this._previousType=this._control?.type??this._input.type??`text`,this.internals.states.add(`input-type-${this._previousType}`)}_registerInputFormListener(){this._inputFormAbortController.abort();let{signal:e}=this._inputFormAbortController=new AbortController;(this._input?.form??this._input?.closest(`form`))?.addEventListener(`reset`,()=>setTimeout(()=>this.reset()),{signal:e})}_patchInputValue(){let e=this._input;if(!e||w.has(e))return;let t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);if(!t||!t.set||!t.get)return;w.set(e,t);let{get:n,set:r}=t,i=()=>{this._checkAndUpdateInputEmpty(),this.dispatchEvent(new Event(`ɵinput`))};Object.defineProperty(e,"value",{...t,get(){return n.call(this)},set(e){r.call(this,e),i()}})}_unpatchInputValue(){let e=this._input,t=w.get(e);t&&(Object.defineProperty(e,"value",t),w.delete(e))}_checkAndUpdateInputEmpty(){this.toggleState(`empty`,this._control?.empty??(((this._floatingLabelSupportedInputElements.includes(this._input?.localName)||this._input?.constructor?.formFieldAssociated)??!1)&&this._isInputEmpty()))}_isInputEmpty(){let e=this.querySelector(`sbb-chip-group`);return e?this._isInputValueEmpty()&&(Array.isArray(e.value)?e.value.length===0:!e.querySelector(`sbb-chip`)):this._input instanceof HTMLInputElement?this._floatingLabelSupportedInputTypes.includes(this._input.type)&&this._isInputValueEmpty():this._input instanceof HTMLSelectElement?this._input.selectedOptions?.item(0)?.label?.trim()===``:this._input?.localName===`sbb-select`?this._input.getDisplayValue?.()?.trim()===``:this._isInputValueEmpty()}_isInputValueEmpty(){let e=this._input.value;return[``,void 0,null].includes(e)||Array.isArray(e)&&e.length===0}_onSlotErrorChange(e){let t=e.target.assignedElements();this._input&&this._input.ariaDescribedByElements?.length&&(this._input.ariaDescribedByElements=d(this._input.ariaDescribedByElements,...this._errorElements??[],...this._hintElements??[])),this._errorElements=t;for(let e of this._errorElements)e.role||=`status`;this._assignAriaDescribedByElements(),this.toggleState(`has-error`,!!this._errorElements.length),this._syncNegative()}_onSlotHintChange(e){let t=e.target.assignedElements();this._input?.ariaDescribedByElements?.length&&this._hintElements?.length&&(this._input.ariaDescribedByElements=d(this._input.ariaDescribedByElements,...this._hintElements)),this._hintElements=t,this._assignAriaDescribedByElements(),this.toggleState(`has-hint`,!!this._hintElements.length),this._syncNegative()}_assignAriaDescribedByElements(){if(this._input){let e=this._errorElements.length?this._errorElements:this._hintElements;this._input.ariaDescribedByElements=s(this._input.ariaDescribedByElements,...e)}}reset(){this._checkAndUpdateInputEmpty()}clear(){this._input?.localName===`input`&&(this._input.value=``,this._checkAndUpdateInputEmpty())}_syncNegative(){this.querySelectorAll?.(`sbb-error,sbb-mini-button,sbb-mini-button-link,sbb-form-field-clear,sbb-datepicker-next-day,sbb-datepicker-previous-day,sbb-datepicker-toggle,sbb-select,sbb-autocomplete,sbb-autocomplete-grid,sbb-chip-group,sbb-hint,sbb-form-field-text-counter`).forEach(e=>e.toggleAttribute(`negative`,this.negative))}_syncSize(){this.querySelectorAll?.(`sbb-autocomplete,sbb-autocomplete-grid,sbb-select`).forEach(e=>e.size=this.size===`l`?`m`:this.size)}render(){return e`
24
+ `;let C=0;const w=/* @__PURE__ */ new WeakMap,T=[`input`,`textarea`,`select`];var E=class extends Event{get control(){return this._control}constructor(e){super(`formfieldcontrol`),this._control=e}};let D=(()=>{let r=o(i),a,l=[],u=[],p,y=[],b=[],x,E=[],D=[],O,k=[],A=[],j,M=[],N=[],P,F=[],I=[],L,R=[],z=[],B,V=[],H=[],U,W=[],G=[],K,q=[],J=[];return class extends r{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[g({attribute:`error-space`,reflect:!0})],p=[g({reflect:!0})],x=[c(),g({reflect:!0,type:Boolean})],O=[g({reflect:!0})],j=[c(),g({attribute:`hidden-label`,reflect:!0,type:Boolean})],P=[c(),g({attribute:`floating-label`,reflect:!0,type:Boolean})],L=[_()],B=[_()],U=[_()],K=[_()],m(this,null,a,{kind:`accessor`,name:`errorSpace`,static:!1,private:!1,access:{has:e=>`errorSpace`in e,get:e=>e.errorSpace,set:(e,t)=>{e.errorSpace=t}},metadata:e},l,u),m(this,null,p,{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:e},y,b),m(this,null,x,{kind:`accessor`,name:`borderless`,static:!1,private:!1,access:{has:e=>`borderless`in e,get:e=>e.borderless,set:(e,t)=>{e.borderless=t}},metadata:e},E,D),m(this,null,O,{kind:`accessor`,name:`width`,static:!1,private:!1,access:{has:e=>`width`in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:e},k,A),m(this,null,j,{kind:`accessor`,name:`hiddenLabel`,static:!1,private:!1,access:{has:e=>`hiddenLabel`in e,get:e=>e.hiddenLabel,set:(e,t)=>{e.hiddenLabel=t}},metadata:e},M,N),m(this,null,P,{kind:`accessor`,name:`floatingLabel`,static:!1,private:!1,access:{has:e=>`floatingLabel`in e,get:e=>e.floatingLabel,set:(e,t)=>{e.floatingLabel=t}},metadata:e},F,I),m(this,null,L,{kind:`accessor`,name:`_errorElements`,static:!1,private:!1,access:{has:e=>`_errorElements`in e,get:e=>e._errorElements,set:(e,t)=>{e._errorElements=t}},metadata:e},R,z),m(this,null,B,{kind:`accessor`,name:`_hintElements`,static:!1,private:!1,access:{has:e=>`_hintElements`in e,get:e=>e._hintElements,set:(e,t)=>{e._hintElements=t}},metadata:e},V,H),m(this,null,U,{kind:`accessor`,name:`_input`,static:!1,private:!1,access:{has:e=>`_input`in e,get:e=>e._input,set:(e,t)=>{e._input=t}},metadata:e},W,G),m(this,null,K,{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:e},q,J),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.elementName=`sbb-form-field`}static{this.elementDependencies=[v]}static{this.styles=[n(S)]}#e;get errorSpace(){return this.#e}set errorSpace(e){this.#e=e}#t;get size(){return this.#t}set size(e){this.#t=e}#n;get borderless(){return this.#n}set borderless(e){this.#n=e}#r;get width(){return this.#r}set width(e){this.#r=e}#i;get hiddenLabel(){return this.#i}set hiddenLabel(e){this.#i=e}#a;get floatingLabel(){return this.#a}set floatingLabel(e){this.#a=e}#o;get _errorElements(){return this.#o}set _errorElements(e){this.#o=e}#s;get _hintElements(){return this.#s}set _hintElements(e){this.#s=e}#c;get _input(){return this.#c}set _input(e){this.#c=e}#l;get _label(){return this.#l}set _label(e){this.#l=e}get inputElement(){return this._input}get label(){return this._label}constructor(){super(),this._excludedFocusElements=[`button`,`sbb-popover`,`sbb-option`,`sbb-chip`],this._floatingLabelSupportedInputElements=[`input`,`select`,`textarea`,`sbb-select`],this._floatingLabelSupportedInputTypes=[`email`,`number`,`password`,`search`,`tel`,`text`,`url`],this.#e=h(this,l,`none`),this.#t=(h(this,u),h(this,y,null)),this.#n=(h(this,b),h(this,E,!1)),this.#r=(h(this,D),h(this,k,`default`)),this.#i=(h(this,A),h(this,M,!1)),this.#a=(h(this,N),h(this,F,!1)),this.#o=(h(this,I),h(this,R,[])),this.#s=(h(this,z),h(this,V,[])),this.#c=(h(this,H),h(this,W,null)),this.#l=(h(this,G),h(this,q,void 0)),this._formFieldAttributeObserver=(h(this,J),t?null:new MutationObserver(e=>{e.some(e=>e.type===`attributes`)&&this._input&&(this._readInputState(),this._registerInputFormListener(),this._checkAndUpdateInputEmpty(),this.dispatchEvent(new Event(`ɵinputattributechange`)))})),this._inputFormAbortController=new AbortController,this._control=null,this._previousType=null,this.addEventListener?.(`focusin`,e=>{(e.target===this.inputElement||e.target===this.inputElement?.inputElement)&&(this.internals.states.add(`focus`),this.internals.states.add(`focus-origin-${f.mostRecentModality}`))},{passive:!0}),this.addEventListener?.(`focusout`,e=>{if(e.target===this.inputElement||e.target===this.inputElement?.inputElement){this._checkAndUpdateInputEmpty(),this.internals.states.delete(`focus`);for(let e of this.internals.states)e.startsWith(`focus-origin-`)&&this.internals.states.delete(e)}},{passive:!0}),this.addEventListener(`input`,()=>this._checkAndUpdateInputEmpty()),this.addEventListener(`displayvaluechange`,()=>this._checkAndUpdateInputEmpty()),this.addEventListener(`invalid`,e=>e.preventDefault(),{capture:!0}),this.addEventListener(`formfieldcontrol`,e=>{this._control=e.control,this._connectInputElement()===`unchanged`&&(this._assignAriaDescribedByElements(),this._readInputState(),this._checkAndUpdateInputEmpty())})}connectedCallback(){super.connectedCallback(),this._assignSlots(),this._connectInputElement(),this._syncNegative(),this._syncSize()}willUpdate(e){super.willUpdate(e),e.has(`negative`)&&this._syncNegative(),e.has(`size`)&&this._syncSize()}disconnectedCallback(){super.disconnectedCallback(),this._formFieldAttributeObserver?.disconnect(),this._inputFormAbortController.abort(),(this._input?.localName===`input`||this._input?.localName===`textarea`)&&this._unpatchInputValue()}_handleWrapperClick(e){this._isElementFocusExcluded(e)||(this._control?.onContainerClick?this._control?.onContainerClick(e):e.target.localName!==`label`&&(this._input?.localName===`sbb-select`&&e.target.localName!==`sbb-select`&&this._input.click(),this._input?.focus()))}_isElementFocusExcluded(e){return e.composedPath().some(e=>e instanceof window.HTMLElement&&(e.getAttribute(`tabindex`)===`0`||e.hasAttribute(`contenteditable`))||this._excludedFocusElements.includes(e.localName))}_onSlotLabelChange(){let e=Array.from(this.querySelectorAll(`label`));this._label=e[0],this._syncLabelInputReferences()}_onSlotInputChange(){this._assignSlots(),this._connectInputElement()}_assignSlots(){this.querySelectorAll(`label:not([slot])`).forEach(e=>e.setAttribute(`slot`,`label`)),this.querySelectorAll(`sbb-error:not([slot])`).forEach(e=>e.setAttribute(`slot`,`error`))}_connectInputElement(){let e;if(this._control?.element)e=this._control.element;else if(this._control?.id)e=this.getRootNode().getElementById(this._control.id);else{let t=Array.from(this.querySelectorAll(`*:not([slot],sbb-chip-group)`));e=(t.find(e=>this._isInputElement(e))||t[0])??null}return e===this._input?`unchanged`:(this._input&&(this.internals.states.delete(`input-element-${this._input.localName}`),(this._input.localName===`input`||this._input.localName===`textarea`)&&this._unpatchInputValue()),e?(this._input=e,this._registerInputFormListener(),this._assignAriaDescribedByElements(),this._readInputState(),this._checkAndUpdateInputEmpty(),this._input.localName===`textarea`?(this._input.setAttribute(`rows`,this._input.getAttribute(`rows`)||`3`),this._patchInputValue()):this._input.localName===`input`?this._patchInputValue():(this._input.localName===`select`||this._input.localName===`sbb-select`)&&!this.hasUpdated&&this.hydrationComplete.then(()=>this.requestUpdate()),this._formFieldAttributeObserver?.disconnect(),this._formFieldAttributeObserver?.observe(this._input,{attributes:!0,attributeFilter:[`readonly`,`disabled`,`form`,`class`,`data-expanded`,`maxlength`]}),this.internals.states.add(`input-element-${this._input.localName}`),this._syncLabelInputReferences(),`changed`):(this._input=null,`no-input`))}_syncLabelInputReferences(){if(this._input&&this._label){if(T.includes(this._input.localName)||customElements.get(this._input.localName)?.formAssociated)this._input.id||=`sbb-form-field-input-${C++}`,this._label.htmlFor=this._input.id;else{this._label.id||=`sbb-form-field-label-${C++}`;let e=this._input.getAttribute(`aria-labelledby`)?.split(` `).filter(e=>!!e&&e!==this._label.id)??[];this._input.setAttribute(`aria-labelledby`,[...e,this._label.id].join(` `))}}}_isInputElement(e){return T.includes(e.localName)||!!customElements.get(e.localName)?.formAssociated}_readInputState(){this.toggleState(`readonly`,this._control?.readOnly??this._input.hasAttribute(`readonly`)),this.toggleState(`disabled`,this._control?.disabled??this._input.hasAttribute(`disabled`)),this.toggleState(`has-popup-open`,this._input.hasAttribute(`data-expanded`)),this.toggleState(`interacted`,!!this._control?.interacted),this.toggleState(`invalid`,!!this._control?.invalid),this._previousType&&this.internals.states.delete(`input-type-${this._previousType}`),this._previousType=this._control?.type??this._input.type??`text`,this.internals.states.add(`input-type-${this._previousType}`)}_registerInputFormListener(){this._inputFormAbortController.abort();let{signal:e}=this._inputFormAbortController=new AbortController;(this._input?.form??this._input?.closest(`form`))?.addEventListener(`reset`,()=>setTimeout(()=>this.reset()),{signal:e})}_patchInputValue(){let e=this._input;if(!e||w.has(e))return;let t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);if(!t||!t.set||!t.get)return;w.set(e,t);let{get:n,set:r}=t,i=()=>{this._checkAndUpdateInputEmpty(),this.dispatchEvent(new Event(`ɵinput`))};Object.defineProperty(e,"value",{...t,get(){return n.call(this)},set(e){r.call(this,e),i()}})}_unpatchInputValue(){let e=this._input,t=w.get(e);t&&(Object.defineProperty(e,"value",t),w.delete(e))}_checkAndUpdateInputEmpty(){this.toggleState(`empty`,this._control?.empty??(((this._floatingLabelSupportedInputElements.includes(this._input?.localName)||this._input?.constructor?.formFieldAssociated)??!1)&&this._isInputEmpty()))}_isInputEmpty(){let e=this.querySelector(`sbb-chip-group`);return e?this._isInputValueEmpty()&&(Array.isArray(e.value)?e.value.length===0:!e.querySelector(`sbb-chip`)):this._input instanceof HTMLInputElement?this._floatingLabelSupportedInputTypes.includes(this._input.type)&&this._isInputValueEmpty():this._input instanceof HTMLSelectElement?this._input.selectedOptions?.item(0)?.label?.trim()===``:this._input?.localName===`sbb-select`?this._input.getDisplayValue?.()?.trim()===``:this._isInputValueEmpty()}_isInputValueEmpty(){let e=this._input.value;return[``,void 0,null].includes(e)||Array.isArray(e)&&e.length===0}_onSlotErrorChange(e){let t=e.target.assignedElements();this._input&&this._input.ariaDescribedByElements?.length&&(this._input.ariaDescribedByElements=d(this._input.ariaDescribedByElements,...this._errorElements??[],...this._hintElements??[])),this._errorElements=t;for(let e of this._errorElements)e.role||=`status`;this._assignAriaDescribedByElements(),this.toggleState(`has-error`,!!this._errorElements.length),this._syncNegative()}_onSlotHintChange(e){let t=e.target.assignedElements();this._input?.ariaDescribedByElements?.length&&this._hintElements?.length&&(this._input.ariaDescribedByElements=d(this._input.ariaDescribedByElements,...this._hintElements)),this._hintElements=t,this._assignAriaDescribedByElements(),this.toggleState(`has-hint`,!!this._hintElements.length),this._syncNegative()}_assignAriaDescribedByElements(){if(this._input){let e=this._errorElements.length?this._errorElements:this._hintElements;this._input.ariaDescribedByElements=s(this._input.ariaDescribedByElements,...e)}}reset(){this._checkAndUpdateInputEmpty()}clear(){this._input?.localName===`input`&&(this._input.value=``,this._checkAndUpdateInputEmpty())}_syncNegative(){this.querySelectorAll?.(`sbb-error,sbb-mini-button,sbb-mini-button-link,sbb-form-field-clear,sbb-datepicker-next-day,sbb-datepicker-previous-day,sbb-datepicker-toggle,sbb-select,sbb-autocomplete,sbb-autocomplete-grid,sbb-chip-group,sbb-hint,sbb-form-field-text-counter`).forEach(e=>e.toggleAttribute(`negative`,this.negative))}_syncSize(){this.querySelectorAll?.(`sbb-autocomplete,sbb-autocomplete-grid,sbb-select`).forEach(e=>e.size=this.size===`l`?`m`:this.size)}render(){return e`
25
25
  <div class="sbb-form-field__space-wrapper">
26
26
  ${``}
27
27
  <div @click=${this._handleWrapperClick} class="sbb-form-field__wrapper" id="overlay-anchor">
package/header.pure.js CHANGED
@@ -12,7 +12,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
12
12
  <slot></slot>
13
13
  </span>
14
14
  `}},C=class extends y(d){static{this.elementName=`sbb-header-link`}},w=`:host{--sbb-logo-height:1rem;--sbb-signet-height:1rem;--sbb-header-transition-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-6x))}@media (width>=64rem){:host{--sbb-logo-height:1.25rem;--sbb-signet-height:1.25rem}}:host{height:var(--sbb-header-height);line-height:var(--sbb-typo-line-height-text);padding-block-start:calc(var(--sbb-header-height) + var(--sbb-header-padding-block-start));display:block}:host([size=s]){--sbb-header-height:var(--sbb-header-height-s)}:host([size=m]){--sbb-header-height:var(--sbb-header-height-m)}:host([hide-on-scroll]){--sbb-header-position:absolute}:host([hide-on-scroll]:is(:state(fixed),[state--fixed])){--sbb-header-position:fixed;--sbb-header-animation-name:hide;--sbb-header-transform:translate3d(0, -100%, 0);--sbb-header-inset-inline-end:var(--sbb-scrollbar-reserved-space,0)}:host([hide-on-scroll]:is(:state(fixed),[state--fixed]):is(:state(animated),[state--animated])){--sbb-header-transition-timing:cubic-bezier(.4, 0, 1, 1)}:host([hide-on-scroll]:is(:state(fixed),[state--fixed]):is(:state(visible),[state--visible])){--sbb-header-animation-name:show;--sbb-header-transform:translate3d(0, 0, 0);--sbb-header-transition-timing:cubic-bezier(0, 0, .2, 1)}:host([hide-on-scroll]:is(:state(fixed),[state--fixed]):is(:state(has-visible-focus-within),[state--has-visible-focus-within])){--sbb-header-transition-duration:0;--sbb-header-transform:translate3d(0, 0, 0)}.sbb-header{position:var(--sbb-header-position);inset:0 var(--sbb-header-inset-inline-end) auto 0;background:var(--sbb-header-background);z-index:var(--sbb-header-z-index,10);transform:var(--sbb-header-transform);transition-property:box-shadow;transition-duration:var(--sbb-header-transition-duration);transition-timing-function:var(--sbb-header-transition-timing);animation-name:var(--sbb-header-animation-name);animation-duration:var(--sbb-header-transition-duration);animation-timing-function:var(--sbb-header-transition-timing);padding-block-start:var(--sbb-header-padding-block-start)}:host(:is(:is(:state(shadow),[state--shadow]),:is(:state(has-visible-focus-within),[state--has-visible-focus-within]):is(:state(fixed),[state--fixed]))) .sbb-header{box-shadow:var(--sbb-header-box-shadow)}@media (forced-colors:active){.sbb-header{border-block-end:var(--sbb-border-width-1x) solid CanvasText}}.sbb-header__wrapper{height:var(--sbb-header-height);justify-content:flex-start;align-items:center;display:flex}:host(:not([expanded])) .sbb-header__wrapper{padding-inline:var(--sbb-page-spacing-padding,var(--sbb-layout-base-offset-responsive));width:100%;margin-inline:auto}@media (width>=90rem){:host(:not([expanded])) .sbb-header__wrapper{max-width:var(--sbb-spacing-max-width,calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive)))}}:host([expanded]) .sbb-header__wrapper{padding-inline:var(--sbb-page-spacing-padding,var(--sbb-spacing-responsive-xxs))}::slotted(:is(sbb-header-button,sbb-header-link):first-child){margin-inline-start:var(--sbb-header-first-item-margin-inline-start)}::slotted(*){flex:none}::slotted(.sbb-header-shrinkable){flex-shrink:1;min-width:0}::slotted(.sbb-header-spacer){flex-grow:1}::slotted(.sbb-header-logo){margin-inline-start:var(--sbb-spacing-responsive-s)}::slotted(a.sbb-header-logo){padding-block:var(--sbb-spacing-fixed-3x);flex-basis:0;display:block;position:relative;outline:none!important}::slotted(a.sbb-header-logo):before{content:"";inset:var(--sbb-spacing-fixed-3x) 0;display:block;position:absolute}::slotted(a.sbb-header-logo:focus-visible):before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width);outline-offset:var(--sbb-spacing-fixed-3x);border-radius:1px}@keyframes show{0%{transform:translateY(-100%)}to{transform:translate(0,0)}}@keyframes hide{0%{transform:translate(0,0)}to{transform:translateY(-100%)}}
15
- `;let T=(()=>{let s=l,c,d=[],f=[],g,_=[],v=[],y,b=[],x=[],S,C=[],T=[],E,D=[],O=[];return class l extends s{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;c=[p(),a({reflect:!0,type:Boolean})],g=[m(),a({attribute:`scroll-origin`})],y=[p(),a({attribute:`hide-on-scroll`,reflect:!0,type:Boolean})],S=[a({reflect:!0})],E=[o()],e(this,null,c,{kind:`accessor`,name:`expanded`,static:!1,private:!1,access:{has:e=>`expanded`in e,get:e=>e.expanded,set:(e,t)=>{e.expanded=t}},metadata:t},d,f),e(this,null,g,{kind:`accessor`,name:`scrollOrigin`,static:!1,private:!1,access:{has:e=>`scrollOrigin`in e,get:e=>e.scrollOrigin,set:(e,t)=>{e.scrollOrigin=t}},metadata:t},_,v),e(this,null,y,{kind:`accessor`,name:`hideOnScroll`,static:!1,private:!1,access:{has:e=>`hideOnScroll`in e,get:e=>e.hideOnScroll,set:(e,t)=>{e.hideOnScroll=t}},metadata:t},b,x),e(this,null,S,{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},C,T),e(this,null,E,{kind:`accessor`,name:`_headerOnTop`,static:!1,private:!1,access:{has:e=>`_headerOnTop`in e,get:e=>e._headerOnTop,set:(e,t)=>{e._headerOnTop=t}},metadata:t},D,O),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-header`}static{this.styles=[i(w)]}static{this._headerScrollOrigins=new Set}static{this._headerElements=new Set}static{r||h(()=>this._initializeScrollOriginObserver())}#e;get expanded(){return this.#e}set expanded(e){this.#e=e}#t;get scrollOrigin(){return this.#t}set scrollOrigin(e){this.#t=e}#n;get hideOnScroll(){return this.#n}set hideOnScroll(e){this.#n=e}#r;get size(){return this.#r}set size(e){this.#r=e}#i;get _headerOnTop(){return this.#i}set _headerOnTop(e){this.#i=e}constructor(){super(),this.#e=t(this,d,!1),this.#t=(t(this,f),t(this,_,null)),this.#n=(t(this,v),t(this,b,!1)),this.#r=(t(this,x),t(this,C,null)),this.#i=(t(this,T),t(this,D,!0)),this._scrollElement=t(this,O),this._lastScroll=0,this._scrollOriginFromObserver=null,this.addController(new u(this))}static _initializeScrollOriginObserver(){new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`)this._handleScrollOriginElement(t.target);else if(t.type===`childList`)for(let e of[...t.addedNodes,...t.removedNodes].filter(e=>e.nodeType===e.ELEMENT_NODE))this._handleScrollOriginElement(e),this._findAndHandleScrollOrigins(e);this._updateHeaderElements()}).observe(document.documentElement,{attributeFilter:[`sbb-header-scroll-origin`],childList:!0,subtree:!0}),this._findAndHandleScrollOrigins(document.body),this._updateHeaderElements()}static _findAndHandleScrollOrigins(e){e.querySelectorAll(`[sbb-header-scroll-origin]`).forEach(e=>this._handleScrollOriginElement(e))}static _handleScrollOriginElement(e){e.isConnected&&e.hasAttribute(`sbb-header-scroll-origin`)?this._headerScrollOrigins.add(e):this._headerScrollOrigins.delete(e)}static _updateHeaderElements(){for(let e of this._headerElements)e._scrollOriginFromObserver=this._headerScrollOrigins.size===0?null:this._headerScrollOrigins.size===1?this._headerScrollOrigins.values().next().value??null:Array.from(this._headerScrollOrigins).sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINS).at(-1)??null,e._updateScrollListener()}connectedCallback(){super.connectedCallback(),l._headerElements.add(this),this.hasUpdated&&this._updateScrollListener()}disconnectedCallback(){super.disconnectedCallback(),this._scrollElement=null,this._scrollEventsController?.abort(),l._headerElements.delete(this)}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!r&&(!e||e===`scrollOrigin`)&&this.hasUpdated&&this._updateScrollListener()}firstUpdated(e){super.firstUpdated(e),this._updateScrollListener()}_updateScrollListener(){let e=this.scrollOrigin??this._scrollOriginFromObserver??document;if(e===this._scrollElement||(this._scrollEventsController?.abort(),this._scrollElement=e,!this._scrollElement))return;this._scrollEventsController=new AbortController,this._scrollFunction=this._getScrollFunction.bind(this),this._scrollElement.addEventListener(`scroll`,this._scrollFunction,{passive:!0,signal:this._scrollEventsController.signal});let t=this._getCurrentScrollProperty(`scrollTop`);this._lastScroll=t<=0?0:t}_getScrollFunction(){return this.hideOnScroll?this._scrollListener():this._scrollShadowListener()}_getCurrentScrollProperty(e){return this._scrollElement instanceof Document?this._scrollElement.documentElement[e]||this._scrollElement.body[e]:this._scrollElement?.[e]||0}_scrollListener(){let e=this._getCurrentScrollProperty(`scrollTop`);this._getCurrentScrollProperty(`scrollHeight`)-window.innerHeight-e<=0||(this.toggleState(`shadow`,e!==0),e>this.offsetHeight&&e>0&&this._lastScroll<e&&this._closeOpenOverlays(),e>this.offsetHeight*2?(this._headerOnTop=!1,e>0&&this._lastScroll<e?[`shadow`,`visible`].forEach(e=>this.internals.states.delete(e)):[`fixed`,`shadow`,`animated`,`visible`].forEach(e=>this.internals.states.add(e))):(e===0&&(this._headerOnTop=!0),this._headerOnTop&&[`shadow`,`animated`,`fixed`,`visible`].forEach(e=>this.internals.states.delete(e))),this._lastScroll=e<=0?0:e)}_scrollShadowListener(){this.toggleState(`shadow`,this._getCurrentScrollProperty(`scrollTop`)!==0)}_closeOpenOverlays(){if(this.matches(`:is(:state(has-visible-focus-within),[state--has-visible-focus-within])`))return;let e=Array.from(this.querySelectorAll(`[aria-controls][aria-expanded='true']`));for(let t of e){let e=t.ariaControlsElements[0];typeof e?.close==`function`&&e.close()}}render(){return n`
15
+ `;let T=(()=>{let s=l,c,d=[],f=[],g,_=[],v=[],y,b=[],x=[],S,C=[],T=[],E,D=[],O=[];return class l extends s{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;c=[p(),a({reflect:!0,type:Boolean})],g=[m(),a({attribute:`scroll-origin`})],y=[p(),a({attribute:`hide-on-scroll`,reflect:!0,type:Boolean})],S=[a({reflect:!0})],E=[o()],e(this,null,c,{kind:`accessor`,name:`expanded`,static:!1,private:!1,access:{has:e=>`expanded`in e,get:e=>e.expanded,set:(e,t)=>{e.expanded=t}},metadata:t},d,f),e(this,null,g,{kind:`accessor`,name:`scrollOrigin`,static:!1,private:!1,access:{has:e=>`scrollOrigin`in e,get:e=>e.scrollOrigin,set:(e,t)=>{e.scrollOrigin=t}},metadata:t},_,v),e(this,null,y,{kind:`accessor`,name:`hideOnScroll`,static:!1,private:!1,access:{has:e=>`hideOnScroll`in e,get:e=>e.hideOnScroll,set:(e,t)=>{e.hideOnScroll=t}},metadata:t},b,x),e(this,null,S,{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},C,T),e(this,null,E,{kind:`accessor`,name:`_headerOnTop`,static:!1,private:!1,access:{has:e=>`_headerOnTop`in e,get:e=>e._headerOnTop,set:(e,t)=>{e._headerOnTop=t}},metadata:t},D,O),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-header`}static{this.styles=[i(w)]}static{this._headerScrollOrigins=/* @__PURE__ */ new Set}static{this._headerElements=/* @__PURE__ */ new Set}static{r||h(()=>this._initializeScrollOriginObserver())}#e;get expanded(){return this.#e}set expanded(e){this.#e=e}#t;get scrollOrigin(){return this.#t}set scrollOrigin(e){this.#t=e}#n;get hideOnScroll(){return this.#n}set hideOnScroll(e){this.#n=e}#r;get size(){return this.#r}set size(e){this.#r=e}#i;get _headerOnTop(){return this.#i}set _headerOnTop(e){this.#i=e}constructor(){super(),this.#e=t(this,d,!1),this.#t=(t(this,f),t(this,_,null)),this.#n=(t(this,v),t(this,b,!1)),this.#r=(t(this,x),t(this,C,null)),this.#i=(t(this,T),t(this,D,!0)),this._scrollElement=t(this,O),this._lastScroll=0,this._scrollOriginFromObserver=null,this.addController(new u(this))}static _initializeScrollOriginObserver(){new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`)this._handleScrollOriginElement(t.target);else if(t.type===`childList`)for(let e of[...t.addedNodes,...t.removedNodes].filter(e=>e.nodeType===e.ELEMENT_NODE))this._handleScrollOriginElement(e),this._findAndHandleScrollOrigins(e);this._updateHeaderElements()}).observe(document.documentElement,{attributeFilter:[`sbb-header-scroll-origin`],childList:!0,subtree:!0}),this._findAndHandleScrollOrigins(document.body),this._updateHeaderElements()}static _findAndHandleScrollOrigins(e){e.querySelectorAll(`[sbb-header-scroll-origin]`).forEach(e=>this._handleScrollOriginElement(e))}static _handleScrollOriginElement(e){e.isConnected&&e.hasAttribute(`sbb-header-scroll-origin`)?this._headerScrollOrigins.add(e):this._headerScrollOrigins.delete(e)}static _updateHeaderElements(){for(let e of this._headerElements)e._scrollOriginFromObserver=this._headerScrollOrigins.size===0?null:this._headerScrollOrigins.size===1?this._headerScrollOrigins.values().next().value??null:Array.from(this._headerScrollOrigins).sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINS).at(-1)??null,e._updateScrollListener()}connectedCallback(){super.connectedCallback(),l._headerElements.add(this),this.hasUpdated&&this._updateScrollListener()}disconnectedCallback(){super.disconnectedCallback(),this._scrollElement=null,this._scrollEventsController?.abort(),l._headerElements.delete(this)}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!r&&(!e||e===`scrollOrigin`)&&this.hasUpdated&&this._updateScrollListener()}firstUpdated(e){super.firstUpdated(e),this._updateScrollListener()}_updateScrollListener(){let e=this.scrollOrigin??this._scrollOriginFromObserver??document;if(e===this._scrollElement||(this._scrollEventsController?.abort(),this._scrollElement=e,!this._scrollElement))return;this._scrollEventsController=new AbortController,this._scrollFunction=this._getScrollFunction.bind(this),this._scrollElement.addEventListener(`scroll`,this._scrollFunction,{passive:!0,signal:this._scrollEventsController.signal});let t=this._getCurrentScrollProperty(`scrollTop`);this._lastScroll=t<=0?0:t}_getScrollFunction(){return this.hideOnScroll?this._scrollListener():this._scrollShadowListener()}_getCurrentScrollProperty(e){return this._scrollElement instanceof Document?this._scrollElement.documentElement[e]||this._scrollElement.body[e]:this._scrollElement?.[e]||0}_scrollListener(){let e=this._getCurrentScrollProperty(`scrollTop`);this._getCurrentScrollProperty(`scrollHeight`)-window.innerHeight-e<=0||(this.toggleState(`shadow`,e!==0),e>this.offsetHeight&&e>0&&this._lastScroll<e&&this._closeOpenOverlays(),e>this.offsetHeight*2?(this._headerOnTop=!1,e>0&&this._lastScroll<e?[`shadow`,`visible`].forEach(e=>this.internals.states.delete(e)):[`fixed`,`shadow`,`animated`,`visible`].forEach(e=>this.internals.states.add(e))):(e===0&&(this._headerOnTop=!0),this._headerOnTop&&[`shadow`,`animated`,`fixed`,`visible`].forEach(e=>this.internals.states.delete(e))),this._lastScroll=e<=0?0:e)}_scrollShadowListener(){this.toggleState(`shadow`,this._getCurrentScrollProperty(`scrollTop`)!==0)}_closeOpenOverlays(){if(this.matches(`:is(:state(has-visible-focus-within),[state--has-visible-focus-within])`))return;let e=Array.from(this.querySelectorAll(`[aria-controls][aria-expanded='true']`));for(let t of e){let e=t.ariaControlsElements[0];typeof e?.close==`function`&&e.close()}}render(){return n`
16
16
  <header class="sbb-header">
17
17
  <div class="sbb-header__wrapper">
18
18
  <slot></slot>
package/icon.pure.js CHANGED
@@ -1,4 +1,4 @@
1
- import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{property as o,state as s}from"lit/decorators.js";import{unsafeHTML as c}from"lit/directives/unsafe-html.js";import{until as l}from"lit/directives/until.js";import{SbbElement as u,forceType as d,omitEmptyConverter as f,readConfig as p}from"./core.js";const m=e=>typeof e==`string`,h=e=>{if(e.nodeType===1){if(e.nodeName.toLowerCase()===`script`)return!1;for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t].name;if(m(n)&&n.toLowerCase().indexOf(`on`)===0)return!1}for(let t=0;t<e.childNodes.length;t++)if(!h(e.childNodes[t]))return!1}return!0},g=(e,t=!0,n=!1)=>{let r=document.createElement(`div`);r.innerHTML=e;for(let e=r.childNodes.length-1;e>=0;e--)r.childNodes[e].nodeName.toLowerCase()!==`svg`&&r.removeChild(r.childNodes[e]);let i=r.firstElementChild;return i&&i.nodeName.toLowerCase()===`svg`&&(n&&!i.classList.contains(`color-immutable`)&&i.classList.add(`color-immutable`),!t||h(i))?r.innerHTML:``},_=`https://icons.app.sbb.ch/`,v=new Map().set(`default`,`${_}icons/`).set(`picto`,`${_}picto/`),y=new Map,b=(e,t,n)=>{let i=p().icon??{},a=i.namespaces?.get(e)??v.get(e);if(a==null)throw Error(`Unable to find the namespace "${e}". Please register your custom namespace.`);let o=`${a}${t}.svg`,s=y.get(o);if(!s){if(typeof fetch<`u`&&!r){let r=i.interceptor??(e=>e.request()),a;try{a=Promise.resolve(r({namespace:e,name:t,url:o,request:()=>fetch(o).then(async r=>{if(!r.ok)throw Error(`Failed to load icon ${e}:${t}`);return g(await r.text(),n)})}))}catch(e){a=Promise.reject(e)}s=a.then(e=>(!e&&y.get(o)===s&&y.delete(o),e),e=>(y.get(o)===s&&y.delete(o),console.warn(e),``)),y.set(o,s)}else return Promise.resolve(``)}return s};var x=`:host{-webkit-tap-highlight-color:transparent;line-height:0;display:inline-block}:host(:is(:state(empty),[state--empty])){--sbb-icon-default-dimension:0}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-extra-small]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-extra-small)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-small]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-small)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-medium]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-medium)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-large]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-large)}svg{display:var(--sbb-icon-svg-display);width:var(--sbb-icon-svg-width,var(--sbb-icon-default-dimension));height:var(--sbb-icon-svg-height,var(--sbb-icon-default-dimension));stroke:var(--sbb-icon-svg-stroke-color);stroke-width:var(--sbb-icon-svg-stroke-width)}svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentColor}svg:not(.color-immutable) [stroke]:not([stroke=none]){stroke:currentColor}svg:not(.color-immutable)>:where(path,polygon,polyline):where(:not([stroke]):not([fill])),svg:not(.color-immutable) :where(:not([stroke]):not([fill])) :where(path,polygon,polyline):where(:not([stroke]):not([fill])){fill:currentColor}
1
+ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isServer as r,nothing as i,unsafeCSS as a}from"lit";import{property as o,state as s}from"lit/decorators.js";import{unsafeHTML as c}from"lit/directives/unsafe-html.js";import{until as l}from"lit/directives/until.js";import{SbbElement as u,forceType as d,omitEmptyConverter as f,readConfig as p}from"./core.js";const m=e=>typeof e==`string`,h=e=>{if(e.nodeType===1){if(e.nodeName.toLowerCase()===`script`)return!1;for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t].name;if(m(n)&&n.toLowerCase().indexOf(`on`)===0)return!1}for(let t=0;t<e.childNodes.length;t++)if(!h(e.childNodes[t]))return!1}return!0},g=(e,t=!0,n=!1)=>{let r=document.createElement(`div`);r.innerHTML=e;for(let e=r.childNodes.length-1;e>=0;e--)r.childNodes[e].nodeName.toLowerCase()!==`svg`&&r.removeChild(r.childNodes[e]);let i=r.firstElementChild;return i&&i.nodeName.toLowerCase()===`svg`&&(n&&!i.classList.contains(`color-immutable`)&&i.classList.add(`color-immutable`),!t||h(i))?r.innerHTML:``},_=`https://icons.app.sbb.ch/`,v=(/* @__PURE__ */ new Map()).set(`default`,`${_}icons/`).set(`picto`,`${_}picto/`),y=/* @__PURE__ */ new Map,b=(e,t,n)=>{let i=p().icon??{},a=i.namespaces?.get(e)??v.get(e);if(a==null)throw Error(`Unable to find the namespace "${e}". Please register your custom namespace.`);let o=`${a}${t}.svg`,s=y.get(o);if(!s){if(typeof fetch<`u`&&!r){let r=i.interceptor??(e=>e.request()),a;try{a=Promise.resolve(r({namespace:e,name:t,url:o,request:()=>fetch(o).then(async r=>{if(!r.ok)throw Error(`Failed to load icon ${e}:${t}`);return g(await r.text(),n)})}))}catch(e){a=Promise.reject(e)}s=a.then(e=>(!e&&y.get(o)===s&&y.delete(o),e),e=>(y.get(o)===s&&y.delete(o),console.warn(e),``)),y.set(o,s)}else return Promise.resolve(``)}return s};var x=`:host{-webkit-tap-highlight-color:transparent;line-height:0;display:inline-block}:host(:is(:state(empty),[state--empty])){--sbb-icon-default-dimension:0}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-extra-small]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-extra-small)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-small]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-small)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-medium]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-medium)}:host(:is(:state(empty),[state--empty]):is(:state(namespace-default),[state--namespace-default])[name$=-large]){--sbb-icon-default-dimension:var(--sbb-size-icon-ui-large)}svg{display:var(--sbb-icon-svg-display);width:var(--sbb-icon-svg-width,var(--sbb-icon-default-dimension));height:var(--sbb-icon-svg-height,var(--sbb-icon-default-dimension));stroke:var(--sbb-icon-svg-stroke-color);stroke-width:var(--sbb-icon-svg-stroke-width)}svg:not(.color-immutable) [fill]:not([fill=none]){fill:currentColor}svg:not(.color-immutable) [stroke]:not([stroke=none]){stroke:currentColor}svg:not(.color-immutable)>:where(path,polygon,polyline):where(:not([stroke]):not([fill])),svg:not(.color-immutable) :where(:not([stroke]):not([fill])) :where(path,polygon,polyline):where(:not([stroke]):not([fill])){fill:currentColor}
2
2
  `;const S=`default`;let C=(()=>{let r=u,i,f=[],p=[],m,h=[],g=[],_,v=[],y=[];return class extends r{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;i=[s()],m=[s()],_=[d(),o({attribute:`no-sanitize`,type:Boolean})],e(this,null,i,{kind:`accessor`,name:`_svgNamespace`,static:!1,private:!1,access:{has:e=>`_svgNamespace`in e,get:e=>e._svgNamespace,set:(e,t)=>{e._svgNamespace=t}},metadata:t},f,p),e(this,null,m,{kind:`accessor`,name:`_svgIcon`,static:!1,private:!1,access:{has:e=>`_svgIcon`in e,get:e=>e._svgIcon,set:(e,t)=>{e._svgIcon=t}},metadata:t},h,g),e(this,null,_,{kind:`accessor`,name:`noSanitize`,static:!1,private:!1,access:{has:e=>`noSanitize`in e,get:e=>e.noSanitize,set:(e,t)=>{e.noSanitize=t}},metadata:t},v,y),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[a(x)]}static{this.role=`img`}#e=t(this,f,S);get _svgNamespace(){return this.#e}set _svgNamespace(e){this.#e=e}#t=(t(this,p),t(this,h,null));get _svgIcon(){return this.#t}set _svgIcon(e){this.#t=e}#n=(t(this,g),t(this,v,!1));get noSanitize(){return this.#n}set noSanitize(e){this.#n=e}constructor(){super(),t(this,y),this.internals.states.add(`empty`)}async loadSvgIcon(e){if(!e)return;let[t,n]=this._splitIconName(e);this._svgNamespace&&this.internals.states.delete(`namespace-${this._svgNamespace}`),this._svgNamespace=t,this._svgNamespace&&this.internals.states.add(`namespace-${this._svgNamespace}`);let r=this.fetchSvgIcon(this._svgNamespace,n);this.toggleState(`empty`,!0),this._svgIcon=r.then(e=>c(e));try{this.toggleState(`empty`,!await r)}catch{this.internals.states.add(`empty`)}}async fetchSvgIcon(e,t){return await b(e,t,!this.noSanitize)}_splitIconName(e){if(!e)return[``,``];let t=e.split(`:`);switch(t.length){case 1:return[S,t[0]];case 2:return t;default:throw Error(`Invalid icon name: "${e}"`)}}render(){return n`<span class="sbb-icon-inner"
3
3
  >${l(this._svgIcon,n`<svg width="0" height="0"></svg>`)}</span
4
4
  >`}}})(),w=(()=>{let r=C,i,a=[],c=[],l,u=[],p=[];return class extends r{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;i=[d(),o({reflect:!0,converter:f})],l=[s()],e(this,null,i,{kind:`accessor`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:t},a,c),e(this,null,l,{kind:`accessor`,name:`_sbbAngularCompatibility`,static:!1,private:!1,access:{has:e=>`_sbbAngularCompatibility`in e,get:e=>e._sbbAngularCompatibility,set:(e,t)=>{e._sbbAngularCompatibility=t}},metadata:t},u,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-icon`}static get observedAttributes(){return super.observedAttributes.concat(`svgicon`)}#e=t(this,a,``);get name(){return this.#e}set name(e){this.#e=e}#t=(t(this,c),t(this,u,!1));get _sbbAngularCompatibility(){return this.#t}set _sbbAngularCompatibility(e){this.#t=e}constructor(){super(),t(this,p),this.internals.ariaHidden=`true`}async fetchSvgIcon(e,t){return this.internals.ariaLabel=`Icon ${t.replace(/-/g,` `)}`,super.fetchSvgIcon(e,t)}willUpdate(e){super.willUpdate(e),e.has(`name`)&&this.name&&this.loadSvgIcon(this.name)}attributeChangedCallback(e,t,n){e===`svgicon`?this._sbbAngularCompatibility=!!n:super.attributeChangedCallback(e,t,n)}render(){return this._sbbAngularCompatibility?n`<slot></slot>`:super.render()}}})();const T=r=>(()=>{let a=r,s,c=[],l=[];return class extends a{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;s=[d(),o({attribute:`icon-name`,converter:f})],e(this,null,s,{kind:`accessor`,name:`iconName`,static:!1,private:!1,access:{has:e=>`iconName`in e,get:e=>e.iconName,set:(e,t)=>{e.iconName=t}},metadata:t},c,l),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementDependencies=[w]}#e=t(this,c,``);get iconName(){return this.#e}set iconName(e){this.#e=e}renderIconSlot(e){let t=this._renderIconName();return n`
package/logo.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{LitElement as e,html as t,isServer as n,unsafeCSS as r}from"lit";import{SbbElement as i}from"./core.js";import{__esDecorate as a,__runInitializers as o}from"tslib";import{property as s}from"lit/decorators.js";var c=`*,:before,:after{box-sizing:border-box}
2
- `;const l=n||!CSS.supports(`selector(:state(loading))`)?class extends Set{constructor(e){super(),this._host=e,this._applied=n,this._host.addController(this),n||Promise.resolve().then(()=>this._applyStates())}add(e){return this._applied&&this._toggleState(e,!0),super.add(e)}delete(e){return this._toggleState(e,!1),super.delete(e)}clear(){this.forEach(e=>this.delete(e))}hostConnected(){this._applyStates()}_toggleState(e,t){this._host.toggleAttribute(`state--${e}`,t)}_applyStates(){this._applied||(this._applied=!0,this.forEach(e=>this._toggleState(e,!0)))}}:null;if(!n){let e=0,t=e=>e.shadowRoot?.host??(e instanceof Element?e:(()=>{throw Error(`Unable to resolve related element! This should never happen.`)})()),n={attributes:!0,attributeFilter:[`id`]},r=(t,n,r)=>{let i=r[Element.name]??r[ElementInternals.name];t.setAttribute(n,i.id||=`aria-ref-${e++}`)},i=(t,n,r)=>{t.setAttribute(n,Object.values(r).reduce((e,t)=>e.concat(t)).filter((e,t,n)=>n.indexOf(e)===t).map(t=>t.id||=`aria-ref-${e++}`).join(` `))};for(let e of[ElementInternals,Element]){let a=e.prototype;if(!(`ariaActiveDescendantElement`in a)){let i=`aria-activedescendant`,o=new WeakMap;Object.defineProperty(a,"ariaActiveDescendantElement",{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(i)?.split(/\s+/)[0]??null;return n?e.getRootNode().getElementById?.(n)??null:null},set(a){if(a!==null&&!(a instanceof Element))throw TypeError(`Failed to set the 'ariaActiveDescendantElement' property on '${e.name}': Failed to convert value to 'Element'.`);let s=t(this),c=o.get(s);if(c?.observer?.disconnect(),a===null)c&&(delete c.elements[e.name],Object.keys(c).length?c.observer.observe(Object.values(c.elements)[0],n):(o.delete(s),s.removeAttribute(i)));else if(c)c.elements[e.name]=a,r(s,i,c.elements),Object.values(c.elements).forEach(e=>c.observer.observe(e,n));else{let t={[e.name]:a};r(s,i,t);let c=new MutationObserver(()=>r(s,i,t));c.observe(a,n),o.set(s,{elements:t,observer:c})}}})}for(let r of[`ariaControlsElements`,`ariaDescribedByElements`,`ariaDetailsElements`,`ariaErrorMessageElements`,`ariaLabelledByElements`,`ariaOwnsElements`])if(!(r in a)){let o=new WeakMap,s=`aria-${r.slice(4,-8).toLowerCase()}`;Object.defineProperty(a,r,{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(s)?.split(/\s+/).filter((e,t,n)=>n.indexOf(e)===t).map(t=>e.getRootNode().getElementById?.(t)).filter(e=>e instanceof Element);return n?.length?Object.freeze(n):null},set(a){if(a!==null&&(!Array.isArray(a)||a.some(e=>!(e instanceof Element))))throw TypeError(`Failed to set the '${r}' property on '${e.name}': Failed to convert value to 'Element'.`);let c=t(this);a=a?.filter((e,t,n)=>n.indexOf(e)===t)??null;let l=o.get(c);if(l?.observer?.disconnect(),a===null)l&&(delete l.elements[e.name],Object.keys(l.elements).length?Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n)):o.delete(c));else if(l)l.elements[e.name]=a,i(c,s,l.elements),Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n));else{let t={[e.name]:a};i(c,s,t);let r=new MutationObserver(()=>i(c,s,t));a.forEach(e=>r.observe(e,n)),o.set(c,{elements:t,observer:r})}}})}}}const u=new WeakMap;var d=class extends Event{constructor(e){super(`slottedchange`,{composed:!0}),this.slot=e}};(class extends e{static{this._$sbbElement$=!0}static{this.styles=[r(c)]}get hydrationComplete(){return this._hydrationComplete}get hydrationRequired(){return this._hydrationRequired}constructor(){if(super(),this.internals=this.attachInternals(),this._hydrationComplete=new Promise(e=>this._resolveHydration=e),u.set(this,this.internals),l)Object.defineProperty(this.internals,"states",{value:new l(this),writable:!1,configurable:!1,enumerable:!1});else for(let e of this.getAttributeNames().filter(e=>e.startsWith(`state--`)))this.internals.states.add(e.slice(7)),this.removeAttribute(e);let e=this.constructor.role;if(e&&(this.internals.role=e),this._hydrationRequired=!!this.shadowRoot,!this._hydrationRequired)this._resolveHydration(!1);else{let e=e=>{this._hydrationRequired&&e.stopImmediatePropagation()},t={capture:!0},n=this.shadowRoot?.querySelectorAll(`slot`);n?.length&&(n.forEach(n=>n.addEventListener(`slotchange`,e,t)),this.hydrationComplete.then(()=>n.forEach(n=>{n.removeEventListener(`slotchange`,e,t),n.assignedNodes().length&&n.dispatchEvent(new Event(`slotchange`,{bubbles:!0}))})))}}static define(){if(!this.elementName)throw Error(`The static property "elementName" is not defined on ${this.name}. Please define it to register the custom element.`);if(!customElements.get(this.elementName)){customElements.define(this.elementName,this);let e=[],t=this;for(;t._$sbbElement$;)Array.isArray(t.elementDependencies)&&e.push(...t.elementDependencies),t=Object.getPrototypeOf(t);new Set(e).forEach(e=>e.define())}}static finalizeStyles(t){let n=[],r=this;for(;r&&r!==e;)Object.hasOwn(r,`styles`)&&r.styles&&n.unshift(r.styles),r=Object.getPrototypeOf(r);return super.finalizeStyles(n)}createRenderRoot(){let e=super.createRenderRoot();return this.shadowRoot?.addEventListener(`slotchange`,e=>this._slotchangeHandler(e,e.target)),this.shadowRoot?.addEventListener(`slottedchange`,e=>this._slotchangeHandler(e,e.slot),{capture:!0}),this.shadowRoot?.querySelectorAll?.(`slot`).forEach(e=>this._handleSlotChangeForSlottedState(e)),e}addController(e){super.addController(e),(this._controllers??=new Set).add(e)}removeController(e){super.removeController(e),this._controllers?.delete(e)}requestUpdate(e,t,n,r,i){if(super.requestUpdate(e,t,n,r,i),e){let a={oldValue:t,value:r?i:this[e]};this._controllers?.forEach(t=>t.hostPropertyUpdate?.(e,a,n))}}update(e){super.update(e),this._hydrationRequired&&(this._hydrationRequired=!1,this._resolveHydration(!0))}toggleState(e,t){t||t!==!1&&!this.internals.states.has(e)?this.internals.states.add(e):this.internals.states.delete(e)}_slotchangeHandler(e,t){let n=this.shadowRoot.contains(t)?t:e.composedPath().find(e=>e instanceof HTMLSlotElement&&this.shadowRoot.contains(e));n&&this._handleSlotChangeForSlottedState(n)}_handleSlotChangeForSlottedState(e){this._updateSlottedState(e),e.name||this._observeTextNodesInSlot(e)}_updateSlottedState(e){let t=e.name?`slotted-${e.name}`:`slotted`,n=this._hasSlottedContent(e);n&&!this.internals.states.has(t)?(this.internals.states.add(t),this.dispatchEvent(new d(e))):!n&&this.internals.states.has(t)&&(this.internals.states.delete(t),this.dispatchEvent(new d(e)))}_observeTextNodesInSlot(e){this._textObserver?.disconnect(),this._textObserver??=new MutationObserver(()=>{let e=this.shadowRoot.querySelector(`slot:not([name])`);e?this._updateSlottedState(e):this._textObserver.disconnect()}),e.assignedNodes().filter(e=>e.nodeType===e.TEXT_NODE).forEach(e=>this._textObserver.observe(e,{characterData:!0}))}_hasSlottedContent(e){return e.name?e.assignedElements().some(e=>!(e instanceof HTMLSlotElement)||this._hasSlottedContent(e)):e.assignedNodes().some(e=>e instanceof HTMLSlotElement?this._hasSlottedContent(e):e.nodeType!==e.TEXT_NODE||!!e.textContent?.trim())}});const f=e=>(t,n)=>{let{kind:r,metadata:i,name:a}=n,o=globalThis.litPropertyMetadata.get(i)?.get(a)?.type??String;if(e??=o,e===String?e=e=>e==null?``:String(e):e===Number&&(e=e=>e==null?NaN:Number(e)),r===`accessor`)return{set(n){t.set.call(this,e(n))}};if(r===`setter`)return function(n){t.call(this,e(n))};throw Error(`Unsupported decorator location: ${r}`)},p=e=>(()=>{let t=e,n,r=[],i=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[f(),s({reflect:!0,type:Boolean})],a(this,null,n,{kind:`accessor`,name:`negative`,static:!1,private:!1,access:{has:e=>`negative`in e,get:e=>e.negative,set:(e,t)=>{e.negative=t}},metadata:e},r,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#e=o(this,r,!1);get negative(){return this.#e}set negative(e){this.#e=e}constructor(){super(...arguments),o(this,i)}}})();var m=`:host{height:var(--sbb-logo-height);justify-content:center;align-items:center;display:flex}@media (forced-colors:active){:host{--sbb-logo-word-mark-color:ButtonText!important}}:host([negative]){--sbb-logo-word-mark-color:var(--sbb-color-white)}.sbb-logo__svg-container{height:var(--sbb-logo-svg-container-height,100%);width:100%;display:flex}svg{width:100%;height:100%}#sbb-logo__word-mark{fill:var(--sbb-logo-word-mark-color)}#sbb-logo__panel{fill:var(--sbb-logo-panel-color);stroke:var(--sbb-logo-panel-color)}#sbb-logo__signet{fill:var(--sbb-logo-signet-color)}
2
+ `;const l=n||!CSS.supports(`selector(:state(loading))`)?class extends Set{constructor(e){super(),this._host=e,this._applied=n,this._host.addController(this),n||Promise.resolve().then(()=>this._applyStates())}add(e){return this._applied&&this._toggleState(e,!0),super.add(e)}delete(e){return this._toggleState(e,!1),super.delete(e)}clear(){this.forEach(e=>this.delete(e))}hostConnected(){this._applyStates()}_toggleState(e,t){this._host.toggleAttribute(`state--${e}`,t)}_applyStates(){this._applied||(this._applied=!0,this.forEach(e=>this._toggleState(e,!0)))}}:null;if(!n){let e=0,t=e=>e.shadowRoot?.host??(e instanceof Element?e:(()=>{throw Error(`Unable to resolve related element! This should never happen.`)})()),n={attributes:!0,attributeFilter:[`id`]},r=(t,n,r)=>{let i=r[Element.name]??r[ElementInternals.name];t.setAttribute(n,i.id||=`aria-ref-${e++}`)},i=(t,n,r)=>{t.setAttribute(n,Object.values(r).reduce((e,t)=>e.concat(t)).filter((e,t,n)=>n.indexOf(e)===t).map(t=>t.id||=`aria-ref-${e++}`).join(` `))};for(let e of[ElementInternals,Element]){let a=e.prototype;if(!(`ariaActiveDescendantElement`in a)){let i=`aria-activedescendant`,o=/* @__PURE__ */ new WeakMap;Object.defineProperty(a,"ariaActiveDescendantElement",{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(i)?.split(/\s+/)[0]??null;return n?e.getRootNode().getElementById?.(n)??null:null},set(a){if(a!==null&&!(a instanceof Element))throw TypeError(`Failed to set the 'ariaActiveDescendantElement' property on '${e.name}': Failed to convert value to 'Element'.`);let s=t(this),c=o.get(s);if(c?.observer?.disconnect(),a===null)c&&(delete c.elements[e.name],Object.keys(c).length?c.observer.observe(Object.values(c.elements)[0],n):(o.delete(s),s.removeAttribute(i)));else if(c)c.elements[e.name]=a,r(s,i,c.elements),Object.values(c.elements).forEach(e=>c.observer.observe(e,n));else{let t={[e.name]:a};r(s,i,t);let c=new MutationObserver(()=>r(s,i,t));c.observe(a,n),o.set(s,{elements:t,observer:c})}}})}for(let r of[`ariaControlsElements`,`ariaDescribedByElements`,`ariaDetailsElements`,`ariaErrorMessageElements`,`ariaLabelledByElements`,`ariaOwnsElements`])if(!(r in a)){let o=/* @__PURE__ */ new WeakMap,s=`aria-${r.slice(4,-8).toLowerCase()}`;Object.defineProperty(a,r,{enumerable:!0,configurable:!0,get(){let e=t(this),n=e.getAttribute(s)?.split(/\s+/).filter((e,t,n)=>n.indexOf(e)===t).map(t=>e.getRootNode().getElementById?.(t)).filter(e=>e instanceof Element);return n?.length?Object.freeze(n):null},set(a){if(a!==null&&(!Array.isArray(a)||a.some(e=>!(e instanceof Element))))throw TypeError(`Failed to set the '${r}' property on '${e.name}': Failed to convert value to 'Element'.`);let c=t(this);a=a?.filter((e,t,n)=>n.indexOf(e)===t)??null;let l=o.get(c);if(l?.observer?.disconnect(),a===null)l&&(delete l.elements[e.name],Object.keys(l.elements).length?Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n)):o.delete(c));else if(l)l.elements[e.name]=a,i(c,s,l.elements),Object.values(l.elements).reduce((e,t)=>e.concat(t)).forEach(e=>l.observer.observe(e,n));else{let t={[e.name]:a};i(c,s,t);let r=new MutationObserver(()=>i(c,s,t));a.forEach(e=>r.observe(e,n)),o.set(c,{elements:t,observer:r})}}})}}}const u=/* @__PURE__ */ new WeakMap;var d=class extends Event{constructor(e){super(`slottedchange`,{composed:!0}),this.slot=e}};(class extends e{static{this._$sbbElement$=!0}static{this.styles=[r(c)]}get hydrationComplete(){return this._hydrationComplete}get hydrationRequired(){return this._hydrationRequired}constructor(){if(super(),this.internals=this.attachInternals(),this._hydrationComplete=new Promise(e=>this._resolveHydration=e),u.set(this,this.internals),l)Object.defineProperty(this.internals,"states",{value:new l(this),writable:!1,configurable:!1,enumerable:!1});else for(let e of this.getAttributeNames().filter(e=>e.startsWith(`state--`)))this.internals.states.add(e.slice(7)),this.removeAttribute(e);let e=this.constructor.role;if(e&&(this.internals.role=e),this._hydrationRequired=!!this.shadowRoot,!this._hydrationRequired)this._resolveHydration(!1);else{let e=e=>{this._hydrationRequired&&e.stopImmediatePropagation()},t={capture:!0},n=this.shadowRoot?.querySelectorAll(`slot`);n?.length&&(n.forEach(n=>n.addEventListener(`slotchange`,e,t)),this.hydrationComplete.then(()=>n.forEach(n=>{n.removeEventListener(`slotchange`,e,t),n.assignedNodes().length&&n.dispatchEvent(new Event(`slotchange`,{bubbles:!0}))})))}}static define(){if(!this.elementName)throw Error(`The static property "elementName" is not defined on ${this.name}. Please define it to register the custom element.`);if(!customElements.get(this.elementName)){customElements.define(this.elementName,this);let e=[],t=this;for(;t._$sbbElement$;)Array.isArray(t.elementDependencies)&&e.push(...t.elementDependencies),t=Object.getPrototypeOf(t);new Set(e).forEach(e=>e.define())}}static finalizeStyles(t){let n=[],r=this;for(;r&&r!==e;)Object.hasOwn(r,`styles`)&&r.styles&&n.unshift(r.styles),r=Object.getPrototypeOf(r);return super.finalizeStyles(n)}createRenderRoot(){let e=super.createRenderRoot();return this.shadowRoot?.addEventListener(`slotchange`,e=>this._slotchangeHandler(e,e.target)),this.shadowRoot?.addEventListener(`slottedchange`,e=>this._slotchangeHandler(e,e.slot),{capture:!0}),this.shadowRoot?.querySelectorAll?.(`slot`).forEach(e=>this._handleSlotChangeForSlottedState(e)),e}addController(e){super.addController(e),(this._controllers??=/* @__PURE__ */ new Set).add(e)}removeController(e){super.removeController(e),this._controllers?.delete(e)}requestUpdate(e,t,n,r,i){if(super.requestUpdate(e,t,n,r,i),e){let a={oldValue:t,value:r?i:this[e]};this._controllers?.forEach(t=>t.hostPropertyUpdate?.(e,a,n))}}update(e){super.update(e),this._hydrationRequired&&(this._hydrationRequired=!1,this._resolveHydration(!0))}toggleState(e,t){t||t!==!1&&!this.internals.states.has(e)?this.internals.states.add(e):this.internals.states.delete(e)}_slotchangeHandler(e,t){let n=this.shadowRoot.contains(t)?t:e.composedPath().find(e=>e instanceof HTMLSlotElement&&this.shadowRoot.contains(e));n&&this._handleSlotChangeForSlottedState(n)}_handleSlotChangeForSlottedState(e){this._updateSlottedState(e),e.name||this._observeTextNodesInSlot(e)}_updateSlottedState(e){let t=e.name?`slotted-${e.name}`:`slotted`,n=this._hasSlottedContent(e);n&&!this.internals.states.has(t)?(this.internals.states.add(t),this.dispatchEvent(new d(e))):!n&&this.internals.states.has(t)&&(this.internals.states.delete(t),this.dispatchEvent(new d(e)))}_observeTextNodesInSlot(e){this._textObserver?.disconnect(),this._textObserver??=new MutationObserver(()=>{let e=this.shadowRoot.querySelector(`slot:not([name])`);e?this._updateSlottedState(e):this._textObserver.disconnect()}),e.assignedNodes().filter(e=>e.nodeType===e.TEXT_NODE).forEach(e=>this._textObserver.observe(e,{characterData:!0}))}_hasSlottedContent(e){return e.name?e.assignedElements().some(e=>!(e instanceof HTMLSlotElement)||this._hasSlottedContent(e)):e.assignedNodes().some(e=>e instanceof HTMLSlotElement?this._hasSlottedContent(e):e.nodeType!==e.TEXT_NODE||!!e.textContent?.trim())}});const f=e=>(t,n)=>{let{kind:r,metadata:i,name:a}=n,o=globalThis.litPropertyMetadata.get(i)?.get(a)?.type??String;if(e??=o,e===String?e=e=>e==null?``:String(e):e===Number&&(e=e=>e==null?NaN:Number(e)),r===`accessor`)return{set(n){t.set.call(this,e(n))}};if(r===`setter`)return function(n){t.call(this,e(n))};throw Error(`Unsupported decorator location: ${r}`)},p=e=>(()=>{let t=e,n,r=[],i=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[f(),s({reflect:!0,type:Boolean})],a(this,null,n,{kind:`accessor`,name:`negative`,static:!1,private:!1,access:{has:e=>`negative`in e,get:e=>e.negative,set:(e,t)=>{e.negative=t}},metadata:e},r,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}#e=o(this,r,!1);get negative(){return this.#e}set negative(e){this.#e=e}constructor(){super(...arguments),o(this,i)}}})();var m=`:host{height:var(--sbb-logo-height);justify-content:center;align-items:center;display:flex}@media (forced-colors:active){:host{--sbb-logo-word-mark-color:ButtonText!important}}:host([negative]){--sbb-logo-word-mark-color:var(--sbb-color-white)}.sbb-logo__svg-container{height:var(--sbb-logo-svg-container-height,100%);width:100%;display:flex}svg{width:100%;height:100%}#sbb-logo__word-mark{fill:var(--sbb-logo-word-mark-color)}#sbb-logo__panel{fill:var(--sbb-logo-panel-color);stroke:var(--sbb-logo-panel-color)}#sbb-logo__signet{fill:var(--sbb-logo-signet-color)}
3
3
  `;const h=e=>(()=>{let t=p(e),n,i=[],c=[],l,u=[],d=[];return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;n=[s({attribute:`protective-room`,reflect:!0})],l=[f(),s({attribute:`accessibility-label`})],a(this,null,n,{kind:`accessor`,name:`protectiveRoom`,static:!1,private:!1,access:{has:e=>`protectiveRoom`in e,get:e=>e.protectiveRoom,set:(e,t)=>{e.protectiveRoom=t}},metadata:e},i,c),a(this,null,l,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:e},u,d),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.styles=[r(m)]}#e=o(this,i,`ideal`);get protectiveRoom(){return this.#e}set protectiveRoom(e){this.#e=e}#t=(o(this,c),o(this,u,``));get accessibilityLabel(){return this.#t}set accessibilityLabel(e){this.#t=e}constructor(){super(...arguments),o(this,d)}}})();var g=`:host{aspect-ratio:var(--sbb-logo-aspect-ratio)}:host([protective-room=minimal]){--sbb-logo-aspect-ratio:502 / 96;--sbb-logo-svg-container-height:50%}:host([protective-room=ideal]){--sbb-logo-aspect-ratio:550 / 144;--sbb-logo-svg-container-height:calc(48 / 144 * 100%)}
4
4
  `,_=class extends h(i){static{this.elementName=`sbb-logo`}static{this.styles=[r(g)]}constructor(){super(),this.accessibilityLabel||=`Logo`}render(){return t`
5
5
  <span class="sbb-logo__svg-container">
@@ -1,5 +1,5 @@
1
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,nothing as i,unsafeCSS as a}from"lit";import{property as o}from"lit/decorators.js";import{SbbSecondaryButtonElement as s}from"./button.pure.js";import{SbbElement as c,SbbLanguageController as l,SbbReadonlyMixin as u,i18nCloseNotification as d,isZeroAnimationDuration as f}from"./core.js";import{SbbDividerElement as p}from"./divider.pure.js";import{SbbIconNameMixin as m}from"./icon.pure.js";var h=`:host{--sbb-notification-border:var(--sbb-notification-border-width) solid var(--sbb-notification-type-color);--sbb-notification-background-color:light-dark(color-mix(in srgb, var(--sbb-notification-type-color) 5%, white),color-mix(in srgb, var(--sbb-notification-type-color) 35%, white));--sbb-notification-icon-color:var(--sbb-notification-type-color);--sbb-notification-border-radius-start:calc(var(--sbb-notification-base-border-radius) / 2);--sbb-notification-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--_sbb-notification-icon-authoritative-font-size:1em;--_sbb-notification-icon-authoritative-line-height:var(--sbb-typo-line-height-text);--_sbb-notification-inset-inline-start:calc(var(--sbb-notification-base-border-radius) - var(--sbb-notification-border-width));--sbb-focus-outline-color:var(--sbb-focus-outline-color-default);font-size:var(--sbb-notification-font-size);letter-spacing:var(--sbb-letter-spacing-text);line-height:var(--sbb-typo-line-height-text);display:block}:host(:is(:state(state-opening),[state--state-opening]):not([animation=open],[animation=all])),:host(:is(:state(state-closing),[state--state-closing]):not([animation=close],[animation=all])),:host(:is(:state(resize-disable-animation),[state--resize-disable-animation])){--sbb-disable-animation-duration:0s}:host(:where(:is(:state(slotted-title),[state--slotted-title]),:is(:state(slotted-title),[state--slotted-title])[size=m])){--_sbb-notification-icon-authoritative-font-size:var(--sbb-heading-font-size-5);--_sbb-notification-icon-authoritative-line-height:var(--sbb-typo-line-height-heading)}:host(:is(:state(slotted-title),[state--slotted-title])[size=s]){--_sbb-notification-icon-authoritative-font-size:var(--sbb-heading-font-size-6);--_sbb-notification-icon-authoritative-line-height:var(--sbb-typo-line-height-text)}:host([size=s]){--sbb-notification-font-size:var(--sbb-text-font-size-xs);--sbb-notification-padding-block:var(--sbb-spacing-responsive-xxxs);--sbb-notification-padding-inline:var(--sbb-spacing-responsive-xxs);--sbb-notification-content-padding-inline:var(--sbb-spacing-responsive-xxxs) var(--sbb-spacing-responsive-xxs);--sbb-notification-close-button-size:var(--sbb-button-min-height-size-s)}:host([size=m]){--sbb-notification-font-size:var(--sbb-text-font-size-s);--sbb-notification-padding-block:var(--sbb-spacing-responsive-xxs);--sbb-notification-padding-inline:var(--sbb-spacing-responsive-xs);--sbb-notification-content-padding-inline:var(--sbb-spacing-responsive-xxxs) var(--sbb-spacing-responsive-xs);--sbb-notification-close-button-size:var(--sbb-button-min-height-size-m)}:host(:is(:not([type]),[type=info])){--sbb-notification-type-color:var(--sbb-color-smoke);--sbb-notification-icon-color:var(--sbb-notification-color);--sbb-notification-divider-opacity-light:20%;--sbb-notification-divider-opacity-dark:20%}:host([type=note]){--sbb-notification-type-color:var(--sbb-color-sky);--sbb-notification-divider-opacity-light:20%;--sbb-notification-divider-opacity-dark:20%}:host([type=success]){--sbb-notification-type-color:var(--sbb-color-success);--sbb-notification-divider-opacity-light:15%;--sbb-notification-divider-opacity-dark:30%}:host([type=warn]){--sbb-notification-type-color:var(--sbb-color-warning);--sbb-notification-icon-color:var(--sbb-notification-color);--sbb-notification-divider-opacity-light:25%;--sbb-notification-divider-opacity-dark:40%}:host([type=error]){--sbb-notification-type-color:var(--sbb-color-error);--sbb-notification-divider-opacity-light:10%;--sbb-notification-divider-opacity-dark:25%}.sbb-notification__wrapper{width:calc(100% - var(--_sbb-notification-inset-inline-start));border:var(--sbb-notification-border);border-radius:var(--sbb-notification-border-radius-start) var(--sbb-notification-base-border-radius) var(--sbb-notification-base-border-radius) var(--sbb-notification-border-radius-start);opacity:0;max-height:0;margin:0;position:relative;inset-inline-start:var(--_sbb-notification-inset-inline-start)}.sbb-notification__wrapper:before{content:"";inset:calc(var(--sbb-notification-border-width) * -1) var(--sbb-notification-base-border-radius) calc(var(--sbb-notification-border-width) * -1) calc(var(--sbb-notification-base-border-radius) * -1);background-color:var(--sbb-notification-type-color);border:var(--sbb-notification-border);border-radius:var(--sbb-notification-base-border-radius);position:absolute}:host(:is(:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-notification__wrapper{opacity:1;max-height:calc(var(--sbb-notification-height) + var(--sbb-notification-border-width) * 2);margin:var(--sbb-notification-margin,0)}:host(:is(:state(state-opening),[state--state-opening])) .sbb-notification__wrapper{animation-name:open;animation-fill-mode:forwards;animation-duration:var(--sbb-notification-animation-duration);animation-timing-function:var(--sbb-notification-timing-function)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-notification__wrapper{animation-name:close,close-height;animation-fill-mode:forwards;animation-duration:var(--sbb-notification-animation-duration);animation-timing-function:var(--sbb-notification-timing-function);animation-delay:0s, var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x))}.sbb-notification{padding-block:var(--sbb-notification-padding-block);padding-inline:var(--sbb-notification-padding-inline);color:var(--sbb-notification-color);border-radius:var(--sbb-notification-border-radius-start) calc(var(--sbb-notification-base-border-radius) - var(--sbb-notification-border-width)) calc(var(--sbb-notification-base-border-radius) - var(--sbb-notification-border-width)) var(--sbb-notification-border-radius-start);background-color:var(--sbb-notification-background-color);grid-template-columns:auto 1fr auto auto;align-items:center;display:grid;position:relative;overflow:hidden}.sbb-notification__icon,::slotted(sbb-icon){color:var(--sbb-notification-icon-color);height:calc(1em * var(--_sbb-notification-icon-authoritative-line-height));--sbb-icon-svg-width:var(--sbb-notification-icon-size);align-self:flex-start;margin-block-start:calc((var(--_sbb-notification-icon-authoritative-font-size) * var(--_sbb-notification-icon-authoritative-line-height) - var(--sbb-size-icon-ui-small)) / 2)}.sbb-notification__content{color-scheme:light only;padding-inline:var(--sbb-notification-content-padding-inline);align-content:center;align-self:flex-start}.sbb-notification__text{margin:0;padding:0;display:inline}.sbb-notification__divider{--sbb-divider-color:light-dark(color-mix(in srgb, var(--sbb-notification-type-color) var(--sbb-notification-divider-opacity-light), var(--sbb-notification-background-color)),color-mix(in srgb, var(--sbb-notification-type-color) var(--sbb-notification-divider-opacity-dark), var(--sbb-notification-background-color)));height:calc(100% - var(--sbb-spacing-fixed-1x) * 2);margin-inline-end:calc(var(--sbb-notification-close-wrapper-gap) + var(--sbb-notification-close-button-size) - var(--sbb-divider-border-width));display:block;inset-inline-start:var(--sbb-border-width-1x)}.sbb-notification__close{position:absolute;inset-inline-end:var(--sbb-notification-padding-inline)}@keyframes open{0%{opacity:0;max-height:0;margin:0}to{opacity:1;max-height:calc(var(--sbb-notification-height) + var(--sbb-notification-border-width) * 2);margin:var(--sbb-notification-margin,0)}}@keyframes close{0%{opacity:1;margin:var(--sbb-notification-margin,0)}to{opacity:0;margin:0}}@keyframes close-height{0%{max-height:calc(var(--sbb-notification-height) + var(--sbb-notification-border-width) * 2)}to{max-height:0}}::slotted(sbb-title){font-size:var(--_sbb-notification-icon-authoritative-font-size);line-height:var(--_sbb-notification-icon-authoritative-line-height);margin:0}
2
- `;const g=new Map([[`info`,`circle-information-small`],[`note`,`circle-information-small`],[`success`,`circle-tick-small`],[`warn`,`circle-exclamation-point-small`],[`error`,`circle-cross-small`]]);let _=(()=>{let _=m(u(c)),v,y=[],b=[],x,S=[],C=[],w,T=[],E=[];return class extends _{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(_[Symbol.metadata]??null):void 0;v=[o({reflect:!0})],x=[o({reflect:!0})],w=[o({reflect:!0})],e(this,null,v,{kind:`accessor`,name:`type`,static:!1,private:!1,access:{has:e=>`type`in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},y,b),e(this,null,x,{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},S,C),e(this,null,w,{kind:`accessor`,name:`animation`,static:!1,private:!1,access:{has:e=>`animation`in e,get:e=>e.animation,set:(e,t)=>{e.animation=t}},metadata:t},T,E),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-notification`}static{this.elementDependencies=[s,p]}static{this.styles=[a(h)]}static{this.events={beforeopen:`beforeopen`,open:`open`,beforeclose:`beforeclose`,close:`close`}}#e;get type(){return this.#e}set type(e){this.#e=e}#t;get size(){return this.#t}set size(e){this.#t=e}#n;get animation(){return this.#n}set animation(e){this.#n=e}set _state(e){this._stateInternal&&this.internals.states.delete(`state-${this._stateInternal}`),this._stateInternal=e,this._stateInternal&&this.internals.states.add(`state-${this._stateInternal}`)}get _state(){return this._stateInternal}constructor(){super(),this.#e=t(this,y,`info`),this.#t=(t(this,b),t(this,S,null)),this.#n=(t(this,C),t(this,T,`all`)),this._stateInternal=t(this,E),this._resizeObserverTimeout=null,this._language=new l(this),this._notificationResizeObserver=new n(this,{target:null,skipInitial:!0,callback:()=>this._onNotificationResize()}),this._state=`closed`}_open(){this._state===`closed`&&(this._state=`opening`,this.dispatchEvent(new Event(`beforeopen`)),this._isZeroAnimationDuration()&&this._handleOpening())}close(){this._state===`opened`&&this._dispatchBeforeCloseEvent()&&(this._state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_dispatchBeforeCloseEvent(){return this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0}))}firstUpdated(e){super.firstUpdated(e),this._notificationElement=this.shadowRoot?.querySelector(`.sbb-notification__wrapper`),this.updateComplete.then(()=>{this._setNotificationHeight(),this._open()})}_isZeroAnimationDuration(){return f(this,`--sbb-notification-animation-duration`)}_setNotificationHeight(){if(!this._notificationElement?.scrollHeight)return;let e=`${this._notificationElement.scrollHeight}px`;this.style.setProperty(`--sbb-notification-height`,e)}_onNotificationResize(){this._state===`opened`&&(this._resizeObserverTimeout&&clearTimeout(this._resizeObserverTimeout),this.internals.states.add(`resize-disable-animation`),this._resizeObserverTimeout=setTimeout(()=>this.internals.states.delete(`resize-disable-animation`),150),setTimeout(()=>this._setNotificationHeight()))}_onNotificationAnimationEnd(e){this._state===`opening`&&e.animationName===`open`&&this._handleOpening(),this._state===`closing`&&e.animationName===`close-height`&&this._handleClosing()}_handleOpening(){this._state=`opened`,this._notificationResizeObserver.observe(this._notificationElement),this.dispatchEvent(new Event(`open`))}_handleClosing(){this._state=`closed`,this.dispatchEvent(new Event(`close`)),this._notificationResizeObserver.unobserve(this._notificationElement),setTimeout(()=>this.remove())}_handleSlotchange(){let e=Array.from(this.children).find(e=>e.localName===`sbb-title`);e&&(e.slot=`title`)}renderIconName(){return super.renderIconName()||g.get(this.type)}render(){return r`
2
+ `;const g=/* @__PURE__ */ new Map([[`info`,`circle-information-small`],[`note`,`circle-information-small`],[`success`,`circle-tick-small`],[`warn`,`circle-exclamation-point-small`],[`error`,`circle-cross-small`]]);let _=(()=>{let _=m(u(c)),v,y=[],b=[],x,S=[],C=[],w,T=[],E=[];return class extends _{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(_[Symbol.metadata]??null):void 0;v=[o({reflect:!0})],x=[o({reflect:!0})],w=[o({reflect:!0})],e(this,null,v,{kind:`accessor`,name:`type`,static:!1,private:!1,access:{has:e=>`type`in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:t},y,b),e(this,null,x,{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},S,C),e(this,null,w,{kind:`accessor`,name:`animation`,static:!1,private:!1,access:{has:e=>`animation`in e,get:e=>e.animation,set:(e,t)=>{e.animation=t}},metadata:t},T,E),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-notification`}static{this.elementDependencies=[s,p]}static{this.styles=[a(h)]}static{this.events={beforeopen:`beforeopen`,open:`open`,beforeclose:`beforeclose`,close:`close`}}#e;get type(){return this.#e}set type(e){this.#e=e}#t;get size(){return this.#t}set size(e){this.#t=e}#n;get animation(){return this.#n}set animation(e){this.#n=e}set _state(e){this._stateInternal&&this.internals.states.delete(`state-${this._stateInternal}`),this._stateInternal=e,this._stateInternal&&this.internals.states.add(`state-${this._stateInternal}`)}get _state(){return this._stateInternal}constructor(){super(),this.#e=t(this,y,`info`),this.#t=(t(this,b),t(this,S,null)),this.#n=(t(this,C),t(this,T,`all`)),this._stateInternal=t(this,E),this._resizeObserverTimeout=null,this._language=new l(this),this._notificationResizeObserver=new n(this,{target:null,skipInitial:!0,callback:()=>this._onNotificationResize()}),this._state=`closed`}_open(){this._state===`closed`&&(this._state=`opening`,this.dispatchEvent(new Event(`beforeopen`)),this._isZeroAnimationDuration()&&this._handleOpening())}close(){this._state===`opened`&&this._dispatchBeforeCloseEvent()&&(this._state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_dispatchBeforeCloseEvent(){return this.dispatchEvent(new Event(`beforeclose`,{cancelable:!0}))}firstUpdated(e){super.firstUpdated(e),this._notificationElement=this.shadowRoot?.querySelector(`.sbb-notification__wrapper`),this.updateComplete.then(()=>{this._setNotificationHeight(),this._open()})}_isZeroAnimationDuration(){return f(this,`--sbb-notification-animation-duration`)}_setNotificationHeight(){if(!this._notificationElement?.scrollHeight)return;let e=`${this._notificationElement.scrollHeight}px`;this.style.setProperty(`--sbb-notification-height`,e)}_onNotificationResize(){this._state===`opened`&&(this._resizeObserverTimeout&&clearTimeout(this._resizeObserverTimeout),this.internals.states.add(`resize-disable-animation`),this._resizeObserverTimeout=setTimeout(()=>this.internals.states.delete(`resize-disable-animation`),150),setTimeout(()=>this._setNotificationHeight()))}_onNotificationAnimationEnd(e){this._state===`opening`&&e.animationName===`open`&&this._handleOpening(),this._state===`closing`&&e.animationName===`close-height`&&this._handleClosing()}_handleOpening(){this._state=`opened`,this._notificationResizeObserver.observe(this._notificationElement),this.dispatchEvent(new Event(`open`))}_handleClosing(){this._state=`closed`,this.dispatchEvent(new Event(`close`)),this._notificationResizeObserver.unobserve(this._notificationElement),setTimeout(()=>this.remove())}_handleSlotchange(){let e=Array.from(this.children).find(e=>e.localName===`sbb-title`);e&&(e.slot=`title`)}renderIconName(){return super.renderIconName()||g.get(this.type)}render(){return r`
3
3
  <div class="sbb-notification__wrapper" @animationend=${this._onNotificationAnimationEnd}>
4
4
  <div class="sbb-notification">
5
5
  ${this.renderIconSlot(`sbb-notification__icon`)}
package/overlay.pure.js CHANGED
@@ -1,4 +1,4 @@
1
- import{__esDecorate as e,__runInitializers as t}from"tslib";import{isServer as n,unsafeCSS as r}from"lit";import{property as i}from"lit/decorators.js";import{SbbEscapableOverlayController as a,SbbFocusTrapController as o,SbbInertController as s,SbbLanguageController as c,SbbNegativeMixin as l,SbbOpenCloseBaseElement as u,SbbScrollHandler as d,forceType as f,forwardEvent as p,i18nCloseDialog as m,i18nDialog as h,idReference as g,isZeroAnimationDuration as _,popoverResetStyles as v,removeAriaOverlayTriggerProperties as y,screenReaderOnlyStyles as b,scrollbarStyles as x,setAriaOverlayTriggerProperties as S}from"./core.js";import{ref as C}from"lit/directives/ref.js";import{html as w}from"lit/static-html.js";import{SbbSecondaryButtonElement as T}from"./button.pure.js";import{SbbContainerElement as E}from"./container.pure.js";const D=new WeakMap;var O=class extends Event{constructor(e,{cancelable:t,closeAttribute:n,closeTarget:r,result:i}){super(e,{cancelable:t}),this.result=i??(r?D.get(r)??(r.getAttribute(n)?.trim()||null):null),this.closeTarget=r??null}};function k(e,t){D.set(e,t)}const A=[];let j=(()=>{let r=l(u),p,m=[],_=[],x,C=[],w=[],T,E=[],D=[];return class extends r{constructor(){super(...arguments),this.#e=t(this,m,null),this.#t=(t(this,_),t(this,C,``)),this.#n=(t(this,w),t(this,E,!1)),this.lastFocusedElement=t(this,D),this.focusTrapController=new o(this),this.scrollHandler=new d,this.language=new c(this),this.inertController=new s(this),this.escapableOverlayController=new a(this),this._ariaLiveRefToggle=!1,this._triggerElement=null}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;p=[g(),i()],x=[f(),i({attribute:`accessibility-label`})],T=[f(),i({type:Boolean})],e(this,null,p,{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},m,_),e(this,null,x,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`skipFocusRestoration`,static:!1,private:!1,access:{has:e=>`skipFocusRestoration`in e,get:e=>e.skipFocusRestoration,set:(e,t)=>{e.skipFocusRestoration=t}},metadata:t},E,D),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[v,b]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}#t;get accessibilityLabel(){return this.#t}set accessibilityLabel(e){this.#t=e}#n;get skipFocusRestoration(){return this.#n}set skipFocusRestoration(e){this.#n=e}open(){this.state!==`opening`&&this.state!==`opened`&&!this._hasClosedParent()&&this.dispatchBeforeOpenEvent()&&(this.lastFocusedElement=document.activeElement,this.showPopover?.(),this.state=`opening`,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),A.push(this),this.scrollHandler.disableScroll(),this.escapableOverlayController.connect(),this.attachOpenOverlayEvents(),this.isZeroAnimationDuration()&&this.handleOpening())}close(e){this._close(e,void 0)}_close(e,t){this.state!==`closing`&&this.state!==`closed`&&(this.lastResult=e??null,this.lastClosedTarget=t,this.dispatchBeforeCloseEvent()&&(this.state=`closing`,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this.removeAriaLiveRefContent(),this.isZeroAnimationDuration()&&this.handleClosing()))}_hasClosedParent(){let e=this.parentElement?.closest(`sbb-dialog, sbb-overlay`);return e?.state===`closed`||e?.state===`closing`}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.hasUpdated&&this._configureTrigger()}_configureTrigger(){this.trigger!==this._triggerElement&&(this._triggerAbortController?.abort(),y(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(S(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal})))}firstUpdated(e){super.firstUpdated(e),this._ariaLiveRef=this.shadowRoot.querySelector(`.sbb-screen-reader-only`),this._configureTrigger(),this.isOpen&&setTimeout(()=>{this.focusTrapController.focusInitialElement()},0)}disconnectedCallback(){super.disconnectedCallback(),this.openOverlayController?.abort(),this.removeInstanceFromGlobalCollection(),this.scrollHandler.enableScroll(),this._triggerElement=null,this._triggerAbortController?.abort()}requestUpdate(e,t,r){super.requestUpdate(e,t,r),!n&&(!e||e===`trigger`)&&this.hasUpdated&&this._configureTrigger()}attachOpenOverlayEvents(){this.openOverlayController=new AbortController,window.addEventListener(`keydown`,()=>{this.removeAriaLiveRefContent()},{signal:this.openOverlayController.signal}),window.addEventListener(`click`,()=>this.removeAriaLiveRefContent(),{signal:this.openOverlayController.signal})}removeInstanceFromGlobalCollection(){let e=A.indexOf(this);e>-1&&A.splice(e,1)}closeOnSbbOverlayCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(this.closeAttribute)||e.localName===this.closeTag)&&!e.hasAttribute(`disabled`)&&(e.closest(this.localName)===this||(this.shadowRoot?.contains(e)??!1)));t&&A.length&&A[A.length-1]._close(null,t)}removeAriaLiveRefContent(){this._ariaLiveRef&&(this._ariaLiveRef.textContent=``)}setAriaLiveRefContent(e){this._ariaLiveRef&&(this._ariaLiveRefToggle=!this._ariaLiveRefToggle,this._ariaLiveRef.textContent=`${h[this.language.current]}${e?`, ${e}`:``}${this._ariaLiveRefToggle?`\xA0`:``}`)}onOverlayAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this.handleOpening():e.animationName===`close`&&this.state===`closing`&&this.handleClosing()}}})();var M=`:host{--sbb-overlay-display:none;--sbb-overlay-inset:0 auto auto 0;--sbb-overlay-pointer-events:none;--sbb-overlay-container-display:none;--_sbb-overlay-padding-block:calc(var(--sbb-spacing-fixed-14x) + var(--sbb-spacing-responsive-l));--sbb-overlay-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-6x));display:var(--sbb-overlay-display);inset:var(--sbb-overlay-inset);z-index:var(--sbb-overlay-z-index,var(--sbb-overlay-default-z-index));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-overlay-display:block;--sbb-overlay-container-display:flex}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]))){--sbb-overlay-pointer-events:all}:host(:not([negative])){--sbb-overlay-color:var(--sbb-color-1);--sbb-overlay-background-color:var(--sbb-background-color-3)}:host([negative]){--sbb-overlay-color:var(--sbb-color-1-negative);--sbb-overlay-background-color:var(--sbb-background-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}:host(:not(:is(:state(state-closed),[state--state-closed]))){--sbb-overlay-inset:0}.sbb-overlay__container{background-color:var(--sbb-overlay-background-color);pointer-events:var(--sbb-overlay-pointer-events);display:var(--sbb-overlay-container-display);inset:var(--sbb-overlay-inset);align-items:center;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-overlay__container{animation-name:open;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-overlay__container{pointer-events:none;animation-name:close}.sbb-overlay{height:var(--sbb-overlay-height);color:var(--sbb-overlay-color);border:none;margin:auto;padding:0;position:absolute;inset-inline:0}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-overlay{animation-name:open-move-in;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-overlay{animation-name:close-move-out}.sbb-overlay__wrapper{width:100%;height:var(--sbb-overlay-height);outline:none;flex-direction:column;display:flex;position:fixed}@media (width>=64rem){.sbb-overlay__wrapper{height:auto;position:sticky;inset-block-start:0}}.sbb-overlay__header{pointer-events:none;width:100%;padding:var(--sbb-spacing-responsive-xs);z-index:1;justify-content:space-between;align-items:start;padding-block-end:0;display:flex;position:absolute;inset-inline-start:0}.sbb-overlay__header *{pointer-events:all}.sbb-overlay__close{margin-inline-start:auto}.sbb-overlay__content{-webkit-overflow-scrolling:touch;height:100vh;overflow:auto}.sbb-overlay__content-container{padding-block:var(--_sbb-overlay-padding-block)}@keyframes open{0%{opacity:0}to{opacity:1}}@keyframes open-move-in{0%{transform:translateY(var(--sbb-spacing-fixed-4x))}to{transform:translateY(0%)}}@keyframes close{0%{opacity:1}to{opacity:0}}@keyframes close-move-out{0%{transform:translateY(0%)}to{transform:translateY(var(--sbb-spacing-fixed-4x))}}
1
+ import{__esDecorate as e,__runInitializers as t}from"tslib";import{isServer as n,unsafeCSS as r}from"lit";import{property as i}from"lit/decorators.js";import{SbbEscapableOverlayController as a,SbbFocusTrapController as o,SbbInertController as s,SbbLanguageController as c,SbbNegativeMixin as l,SbbOpenCloseBaseElement as u,SbbScrollHandler as d,forceType as f,forwardEvent as p,i18nCloseDialog as m,i18nDialog as h,idReference as g,isZeroAnimationDuration as _,popoverResetStyles as v,removeAriaOverlayTriggerProperties as y,screenReaderOnlyStyles as b,scrollbarStyles as x,setAriaOverlayTriggerProperties as S}from"./core.js";import{ref as C}from"lit/directives/ref.js";import{html as w}from"lit/static-html.js";import{SbbSecondaryButtonElement as T}from"./button.pure.js";import{SbbContainerElement as E}from"./container.pure.js";const D=/* @__PURE__ */ new WeakMap;var O=class extends Event{constructor(e,{cancelable:t,closeAttribute:n,closeTarget:r,result:i}){super(e,{cancelable:t}),this.result=i??(r?D.get(r)??(r.getAttribute(n)?.trim()||null):null),this.closeTarget=r??null}};function k(e,t){D.set(e,t)}const A=[];let j=(()=>{let r=l(u),p,m=[],_=[],x,C=[],w=[],T,E=[],D=[];return class extends r{constructor(){super(...arguments),this.#e=t(this,m,null),this.#t=(t(this,_),t(this,C,``)),this.#n=(t(this,w),t(this,E,!1)),this.lastFocusedElement=t(this,D),this.focusTrapController=new o(this),this.scrollHandler=new d,this.language=new c(this),this.inertController=new s(this),this.escapableOverlayController=new a(this),this._ariaLiveRefToggle=!1,this._triggerElement=null}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;p=[g(),i()],x=[f(),i({attribute:`accessibility-label`})],T=[f(),i({type:Boolean})],e(this,null,p,{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},m,_),e(this,null,x,{kind:`accessor`,name:`accessibilityLabel`,static:!1,private:!1,access:{has:e=>`accessibilityLabel`in e,get:e=>e.accessibilityLabel,set:(e,t)=>{e.accessibilityLabel=t}},metadata:t},C,w),e(this,null,T,{kind:`accessor`,name:`skipFocusRestoration`,static:!1,private:!1,access:{has:e=>`skipFocusRestoration`in e,get:e=>e.skipFocusRestoration,set:(e,t)=>{e.skipFocusRestoration=t}},metadata:t},E,D),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[v,b]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}#t;get accessibilityLabel(){return this.#t}set accessibilityLabel(e){this.#t=e}#n;get skipFocusRestoration(){return this.#n}set skipFocusRestoration(e){this.#n=e}open(){this.state!==`opening`&&this.state!==`opened`&&!this._hasClosedParent()&&this.dispatchBeforeOpenEvent()&&(this.lastFocusedElement=document.activeElement,this.showPopover?.(),this.state=`opening`,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),A.push(this),this.scrollHandler.disableScroll(),this.escapableOverlayController.connect(),this.attachOpenOverlayEvents(),this.isZeroAnimationDuration()&&this.handleOpening())}close(e){this._close(e,void 0)}_close(e,t){this.state!==`closing`&&this.state!==`closed`&&(this.lastResult=e??null,this.lastClosedTarget=t,this.dispatchBeforeCloseEvent()&&(this.state=`closing`,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this.removeAriaLiveRefContent(),this.isZeroAnimationDuration()&&this.handleClosing()))}_hasClosedParent(){let e=this.parentElement?.closest(`sbb-dialog, sbb-overlay`);return e?.state===`closed`||e?.state===`closing`}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.hasUpdated&&this._configureTrigger()}_configureTrigger(){this.trigger!==this._triggerElement&&(this._triggerAbortController?.abort(),y(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(S(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:this._triggerAbortController.signal})))}firstUpdated(e){super.firstUpdated(e),this._ariaLiveRef=this.shadowRoot.querySelector(`.sbb-screen-reader-only`),this._configureTrigger(),this.isOpen&&setTimeout(()=>{this.focusTrapController.focusInitialElement()},0)}disconnectedCallback(){super.disconnectedCallback(),this.openOverlayController?.abort(),this.removeInstanceFromGlobalCollection(),this.scrollHandler.enableScroll(),this._triggerElement=null,this._triggerAbortController?.abort()}requestUpdate(e,t,r){super.requestUpdate(e,t,r),!n&&(!e||e===`trigger`)&&this.hasUpdated&&this._configureTrigger()}attachOpenOverlayEvents(){this.openOverlayController=new AbortController,window.addEventListener(`keydown`,()=>{this.removeAriaLiveRefContent()},{signal:this.openOverlayController.signal}),window.addEventListener(`click`,()=>this.removeAriaLiveRefContent(),{signal:this.openOverlayController.signal})}removeInstanceFromGlobalCollection(){let e=A.indexOf(this);e>-1&&A.splice(e,1)}closeOnSbbOverlayCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(this.closeAttribute)||e.localName===this.closeTag)&&!e.hasAttribute(`disabled`)&&(e.closest(this.localName)===this||(this.shadowRoot?.contains(e)??!1)));t&&A.length&&A[A.length-1]._close(null,t)}removeAriaLiveRefContent(){this._ariaLiveRef&&(this._ariaLiveRef.textContent=``)}setAriaLiveRefContent(e){this._ariaLiveRef&&(this._ariaLiveRefToggle=!this._ariaLiveRefToggle,this._ariaLiveRef.textContent=`${h[this.language.current]}${e?`, ${e}`:``}${this._ariaLiveRefToggle?`\xA0`:``}`)}onOverlayAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this.handleOpening():e.animationName===`close`&&this.state===`closing`&&this.handleClosing()}}})();var M=`:host{--sbb-overlay-display:none;--sbb-overlay-inset:0 auto auto 0;--sbb-overlay-pointer-events:none;--sbb-overlay-container-display:none;--_sbb-overlay-padding-block:calc(var(--sbb-spacing-fixed-14x) + var(--sbb-spacing-responsive-l));--sbb-overlay-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-6x));display:var(--sbb-overlay-display);inset:var(--sbb-overlay-inset);z-index:var(--sbb-overlay-z-index,var(--sbb-overlay-default-z-index));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-overlay-display:block;--sbb-overlay-container-display:flex}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]))){--sbb-overlay-pointer-events:all}:host(:not([negative])){--sbb-overlay-color:var(--sbb-color-1);--sbb-overlay-background-color:var(--sbb-background-color-3)}:host([negative]){--sbb-overlay-color:var(--sbb-color-1-negative);--sbb-overlay-background-color:var(--sbb-background-color-3-negative);--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark)}:host(:not(:is(:state(state-closed),[state--state-closed]))){--sbb-overlay-inset:0}.sbb-overlay__container{background-color:var(--sbb-overlay-background-color);pointer-events:var(--sbb-overlay-pointer-events);display:var(--sbb-overlay-container-display);inset:var(--sbb-overlay-inset);align-items:center;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-overlay__container{animation-name:open;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-overlay__container{pointer-events:none;animation-name:close}.sbb-overlay{height:var(--sbb-overlay-height);color:var(--sbb-overlay-color);border:none;margin:auto;padding:0;position:absolute;inset-inline:0}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-overlay{animation-name:open-move-in;animation-duration:var(--sbb-overlay-animation-duration);animation-timing-function:var(--sbb-overlay-animation-easing)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-overlay{animation-name:close-move-out}.sbb-overlay__wrapper{width:100%;height:var(--sbb-overlay-height);outline:none;flex-direction:column;display:flex;position:fixed}@media (width>=64rem){.sbb-overlay__wrapper{height:auto;position:sticky;inset-block-start:0}}.sbb-overlay__header{pointer-events:none;width:100%;padding:var(--sbb-spacing-responsive-xs);z-index:1;justify-content:space-between;align-items:start;padding-block-end:0;display:flex;position:absolute;inset-inline-start:0}.sbb-overlay__header *{pointer-events:all}.sbb-overlay__close{margin-inline-start:auto}.sbb-overlay__content{-webkit-overflow-scrolling:touch;height:100vh;overflow:auto}.sbb-overlay__content-container{padding-block:var(--_sbb-overlay-padding-block)}@keyframes open{0%{opacity:0}to{opacity:1}}@keyframes open-move-in{0%{transform:translateY(var(--sbb-spacing-fixed-4x))}to{transform:translateY(0%)}}@keyframes close{0%{opacity:1}to{opacity:0}}@keyframes close-move-out{0%{transform:translateY(0%)}to{transform:translateY(var(--sbb-spacing-fixed-4x))}}
2
2
  `;let N=(()=>{let n=j,a,o=[],s=[],c,l=[],u=[];return class extends n{constructor(){super(...arguments),this.#e=t(this,o,!1),this.#t=(t(this,s),t(this,l,``)),this.closeAttribute=(t(this,u),`sbb-overlay-close`),this._overlayContentElement=null}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;a=[f(),i({reflect:!0,type:Boolean})],c=[f(),i({attribute:`accessibility-close-label`})],e(this,null,a,{kind:`accessor`,name:`expanded`,static:!1,private:!1,access:{has:e=>`expanded`in e,get:e=>e.expanded,set:(e,t)=>{e.expanded=t}},metadata:t},o,s),e(this,null,c,{kind:`accessor`,name:`accessibilityCloseLabel`,static:!1,private:!1,access:{has:e=>`accessibilityCloseLabel`in e,get:e=>e.accessibilityCloseLabel,set:(e,t)=>{e.accessibilityCloseLabel=t}},metadata:t},l,u),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-overlay`}static{this.elementDependencies=[T,E]}static{this.styles=[x,r(M)]}static{this.events={beforeopen:`beforeopen`,open:`open`,beforeclose:`beforeclose`,close:`close`}}#e;get expanded(){return this.#e}set expanded(e){this.#e=e}#t;get accessibilityCloseLabel(){return this.#t}set accessibilityCloseLabel(e){this.#t=e}firstUpdated(e){super.firstUpdated(e),this.isOpen&&this.setAriaLiveRefContent()}isZeroAnimationDuration(){return _(this,`--sbb-overlay-animation-duration`)}handleOpening(){this.state=`opened`,this.inertController.activate(),this.focusTrapController.focusInitialElement(),setTimeout(()=>this.setAriaLiveRefContent(this.accessibilityLabel)),this.focusTrapController.enabled=!0,this.dispatchOpenEvent()}handleClosing(){this._overlayContentElement?.scrollTo(0,0),this.state=`closed`,this.hidePopover?.(),this.inertController.deactivate(),this.skipFocusRestoration||this.lastFocusedElement?.focus(),this.openOverlayController?.abort(),this.focusTrapController.enabled=!1,this.removeInstanceFromGlobalCollection(),A.length||this.scrollHandler.enableScroll(),this.escapableOverlayController.disconnect(),this.dispatchCloseEvent()}dispatchBeforeCloseEvent(){return this.dispatchEvent(new O(`beforeclose`,{cancelable:!0,closeAttribute:this.closeAttribute,closeTarget:this.lastClosedTarget,result:this.lastResult}))}dispatchCloseEvent(){return this.dispatchEvent(new O(`close`,{closeAttribute:this.closeAttribute,closeTarget:this.lastClosedTarget,result:this.lastResult}))}render(){return w`
3
3
  <div class="sbb-overlay__container" @animationend=${this.onOverlayAnimationEnd}>
4
4
  <div class="sbb-overlay">
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-dev",
3
- "version": "5.9.0-dev.1789969822",
3
+ "version": "5.9.0-dev.1789969922",
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/52152ec13a3fad4c412de45f28e499b95af4dfce"
9
+ "https://github.com/sbb-design-systems/lyne-components/commit/e7936551baf2df99099bc9002c0c4c17fb474ae5"
10
10
  ],
11
11
  "type": "module",
12
12
  "exports": {
package/popover.pure.js CHANGED
@@ -1,5 +1,5 @@
1
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,unsafeCSS as a}from"lit";import{property as o,state as s}from"lit/decorators.js";import{ref as c}from"lit/directives/ref.js";import{IS_FOCUSABLE_QUERY as l,SbbEscapableOverlayController as u,SbbFocusTrapController as d,SbbLanguageController as f,SbbMediaQueryPointerCoarse as p,SbbNegativeMixin as m,SbbOpenCloseBaseElement as h,SbbPropertyWatcherController as g,forceType as _,getElementPosition as v,i18nClosePopover as y,idReference as b,isEventOnElement as x,isFakeMousedownFromScreenReader as S,isZeroAnimationDuration as C,popoverResetStyles as w,readConfig as T,removeAriaOverlayTriggerProperties as E,sbbInputModalityDetector as D,scrollbarStyles as O,setAriaOverlayTriggerProperties as k,ɵstateController as A}from"./core.js";import{SbbSecondaryButtonElement as j}from"./button.pure.js";var M=`:host{--sbb-focus-outline-color:light-dark(var(--sbb-focus-outline-color-default),var(--sbb-focus-outline-color-dark));--sbb-popover-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--_sbb-popover-inset:0 auto auto 0;--_sbb-popover-translate:0 var(--sbb-spacing-fixed-2x);--_sbb-popover-box-shadow:var(--sbb-box-shadow-level-9-hard);display:none;outline:none!important}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){--_sbb-popover-inset:0;display:block}:host(:is(:state(position-above),[state--position-above])){--_sbb-popover-translate:0 calc(var(--sbb-spacing-fixed-2x) * -1)}.sbb-popover:after,.sbb-popover__content:before{content:"";width:var(--sbb-popover-arrow-size);height:var(--sbb-popover-arrow-size);left:var(--_sbb-popover-arrow-position-x,0);bottom:calc(100% - var(--sbb-popover-arrow-size) / 2);background-color:var(--sbb-popover-background);border-radius:var(--sbb-border-radius-2x) 0;display:block;position:absolute;rotate:45deg}.sbb-popover__container{inset:var(--_sbb-popover-inset);pointer-events:none;z-index:var(--sbb-popover-z-index,var(--sbb-overlay-default-z-index));position:fixed}.sbb-popover{top:var(--_sbb-popover-position-y,0);bottom:unset;left:var(--_sbb-popover-position-x,0);right:unset;background-color:var(--sbb-popover-background);max-width:var(--sbb-popover-max-width);width:max-content;box-shadow:var(--_sbb-popover-box-shadow);border-radius:var(--sbb-popover-border-radius);pointer-events:all;border:none;outline:none;padding:0;display:none;position:absolute}:host(:focus-visible) .sbb-popover{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style,solid) var(--sbb-focus-outline-width)}:host(:is(:is(:state(state-opening),[state--state-opening]),:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))) .sbb-popover{animation-name:open;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing);display:block}:host(:is(:state(state-closing),[state--state-closing])) .sbb-popover{pointer-events:none;animation-name:close;animation-duration:var(--sbb-popover-animation-duration);animation-timing-function:var(--sbb-popover-animation-easing)}.sbb-popover:after{z-index:-1;box-shadow:var(--_sbb-popover-box-shadow)}@media (forced-colors:active){.sbb-popover:after{outline:var(--sbb-border-width-1x) solid CanvasText}}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:after{top:calc(100% - var(--sbb-popover-arrow-size) / 2)}@media (forced-colors:active){.sbb-popover{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-popover:before{content:"";z-index:-1;background-color:#0000;display:block;position:absolute;inset:0}:host(:is(:state(position-below),[state--position-below])) .sbb-popover:before{inset-block-start:calc(-1 * var(--sbb-spacing-fixed-6x))}:host(:is(:state(position-above),[state--position-above])) .sbb-popover:before{inset-block-end:calc(-1 * var(--sbb-spacing-fixed-6x))}.sbb-popover__content{border-radius:var(--sbb-popover-border-radius);padding:var(--sbb-popover-padding);background-color:var(--sbb-popover-background);outline:none}.sbb-popover__content:before{clip-path:polygon(100% 0,0% 0%,0% 100%)}:host(:is(:state(position-above),[state--position-above])) .sbb-popover__content:before{top:calc(100% - var(--sbb-popover-arrow-size) / 2);clip-path:polygon(100% 0,100% 100%,0% 100%)}@keyframes open{0%{opacity:0;translate:var(--_sbb-popover-translate)}to{opacity:1;translate:0}}@keyframes close{0%{opacity:1;translate:0}to{opacity:0;translate:var(--_sbb-popover-translate)}}
2
- `;const N=new Set;var P=class extends Event{get closeTarget(){return this._closeTarget}constructor(e,{closeTarget:t,cancelable:n}){super(e,{cancelable:n}),this._closeTarget=t}};let F=(()=>{let s=h,f,p=[],m=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,p,null),this._nextFocusedElement=t(this,m),this._skipCloseFocus=!1,this._resizeController=new n(this,{target:null,callback:()=>this._setPopoverPosition()}),this._escapableOverlayController=new u(this),this._focusTrapController=new d(this),this._blurTimeout=null,this._pointerDownListener=e=>{this._isPointerDownEventOnPopover=x(this.overlay,e)},this._closeOnBackdropClick=e=>{let t=e.composedPath();!this._isPointerDownEventOnPopover&&!x(this.overlay,e)&&(!this.trigger||!t.includes(this.trigger))&&(this._nextFocusedElement=t.filter(e=>e instanceof window.HTMLElement).find(e=>e.matches(l)),clearTimeout(this.closeTimeout),this.close())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;f=[b(),o()],e(this,null,f,{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},p,m),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[w,a(M)]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}open(){if((this.state===`closed`||this.state===`closing`)&&this.overlay&&this.dispatchBeforeOpenEvent()){for(let e of N)(e.state===`opened`||e.state===`opening`)&&e.close();this.showPopover?.(),this.state=`opening`,this.inert=!0,this._setPopoverPosition(),this._attachWindowEvents(),this._escapableOverlayController.connect(),this._nextFocusedElement=void 0,this._skipCloseFocus=!1,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),this._isZeroAnimationDuration()&&this._handleOpening()}}close(e){(this.state===`opened`||this.state===`opening`)&&(this._popoverCloseElement=e,this.dispatchBeforeCloseEvent({closeTarget:e??null})&&(this.state=`closing`,this.inert=!0,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this._isZeroAnimationDuration()&&this._handleClosing()))}_isZeroAnimationDuration(){return C(this,`--sbb-popover-animation-duration`)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.overlay&&(this._resizeController.unobserve(this.overlay),this.overlay.firstElementChild?.scrollTo(0,0)),this.removeAttribute(`tabindex`),this._skipCloseFocus||(this._nextFocusedElement||this._triggerElement)?.focus(),this._escapableOverlayController.disconnect(),this._openStateController?.abort(),this._focusTrapController.enabled=!1,this.dispatchCloseEvent({closeTarget:this._popoverCloseElement??null})}_handleOpening(){this.state=`opened`,this.inert=!1,this._setPopoverFocus(),this._focusTrapController.enabled=!0,this.overlay&&this._resizeController.observe(this.overlay),this.dispatchOpenEvent()}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.state=`closed`,N.add(this),this.hasUpdated&&this._configureTrigger()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&(!e||e===`trigger`||e===`hoverTrigger`)&&this.hasUpdated&&this._configureTrigger()}firstUpdated(e){super.firstUpdated(e),this._configureTrigger()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openStateController?.abort(),N.delete(this),this._blurTimeout&&clearTimeout(this._blurTimeout)}_configureTrigger(){if(!i){if(this.hydrationRequired){this.hydrationComplete.then(()=>this._configureTrigger());return}this.configureTrigger(this._triggerElement??null)}}configureTrigger(e){this._triggerAbortController?.abort(),E(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(k(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this.registerTriggerListeners(this._triggerAbortController.signal))}registerTriggerListeners(e){this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:e})}_attachWindowEvents(){this._openStateController=new AbortController,document.addEventListener(`scroll`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal}),window.addEventListener(`pointerdown`,this._pointerDownListener,{signal:this._openStateController.signal}),window.addEventListener(`pointerup`,this._closeOnBackdropClick,{signal:this._openStateController.signal})}_closeOnSbbPopoverCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(`sbb-popover-close`)||e.localName===`sbb-popover-close-button`)&&!e.hasAttribute(`disabled`));t&&(clearTimeout(this.closeTimeout),this.close(t))}_onPopoverAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_setPopoverFocus(){!this._focusTrapController.focusInitialElement()&&this._openStateController&&(this.setAttribute(`tabindex`,`0`),this.focus({preventScroll:!0}),this.addEventListener(`blur`,e=>{this._blurTimeout=setTimeout(()=>{if(document.visibilityState!==`hidden`){if(this.removeAttribute(`tabindex`),this.contains(e.relatedTarget)||e.relatedTarget===this.trigger)return;(this.state===`opened`||this.state===`opening`)&&(this._skipCloseFocus=!0),this.close()}})},{signal:this._openStateController.signal}))}_setPopoverPosition(){if(!this.overlay||!this._triggerElement)return;let e=v(this.overlay,this._triggerElement,this.shadowRoot.querySelector(`.sbb-popover__container`),{verticalOffset:16,horizontalOffset:32,centered:!0,responsiveHeight:!0}),t=e.alignment.vertical;for(let e of[`above`,`below`])this.toggleState(`position-${e}`,e===t);let n=this.overlay.offsetWidth,r=document.documentElement.clientWidth,i=Math.max(2,Math.min(e.left,r-n-2)),a=this._triggerElement.getBoundingClientRect(),o=parseFloat(getComputedStyle(this.overlay).borderTopLeftRadius)||0,s=a.left-i+a.width/2-8,c=Math.max(o,Math.min(s,n-o-16));this.style.setProperty(`--_sbb-popover-position-x`,`${i}px`),this.style.setProperty(`--_sbb-popover-position-y`,`${e.top}px`),this.style.setProperty(`--_sbb-popover-arrow-position-x`,`${c}px`),this.style.setProperty(`--_sbb-popover-max-height`,e.maxHeight)}dispatchBeforeCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`beforeclose`,{closeTarget:t,cancelable:!0}))}dispatchCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`close`,{closeTarget:t,cancelable:!1}))}render(){return r`
2
+ `;const N=/* @__PURE__ */ new Set;var P=class extends Event{get closeTarget(){return this._closeTarget}constructor(e,{closeTarget:t,cancelable:n}){super(e,{cancelable:n}),this._closeTarget=t}};let F=(()=>{let s=h,f,p=[],m=[];return class extends s{constructor(){super(...arguments),this.#e=t(this,p,null),this._nextFocusedElement=t(this,m),this._skipCloseFocus=!1,this._resizeController=new n(this,{target:null,callback:()=>this._setPopoverPosition()}),this._escapableOverlayController=new u(this),this._focusTrapController=new d(this),this._blurTimeout=null,this._pointerDownListener=e=>{this._isPointerDownEventOnPopover=x(this.overlay,e)},this._closeOnBackdropClick=e=>{let t=e.composedPath();!this._isPointerDownEventOnPopover&&!x(this.overlay,e)&&(!this.trigger||!t.includes(this.trigger))&&(this._nextFocusedElement=t.filter(e=>e instanceof window.HTMLElement).find(e=>e.matches(l)),clearTimeout(this.closeTimeout),this.close())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;f=[b(),o()],e(this,null,f,{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},p,m),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.styles=[w,a(M)]}#e;get trigger(){return this.#e}set trigger(e){this.#e=e}open(){if((this.state===`closed`||this.state===`closing`)&&this.overlay&&this.dispatchBeforeOpenEvent()){for(let e of N)(e.state===`opened`||e.state===`opening`)&&e.close();this.showPopover?.(),this.state=`opening`,this.inert=!0,this._setPopoverPosition(),this._attachWindowEvents(),this._escapableOverlayController.connect(),this._nextFocusedElement=void 0,this._skipCloseFocus=!1,this._triggerElement&&(this._triggerElement.ariaExpanded=`true`),this._isZeroAnimationDuration()&&this._handleOpening()}}close(e){(this.state===`opened`||this.state===`opening`)&&(this._popoverCloseElement=e,this.dispatchBeforeCloseEvent({closeTarget:e??null})&&(this.state=`closing`,this.inert=!0,this._triggerElement&&(this._triggerElement.ariaExpanded=`false`),this._isZeroAnimationDuration()&&this._handleClosing()))}_isZeroAnimationDuration(){return C(this,`--sbb-popover-animation-duration`)}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.overlay&&(this._resizeController.unobserve(this.overlay),this.overlay.firstElementChild?.scrollTo(0,0)),this.removeAttribute(`tabindex`),this._skipCloseFocus||(this._nextFocusedElement||this._triggerElement)?.focus(),this._escapableOverlayController.disconnect(),this._openStateController?.abort(),this._focusTrapController.enabled=!1,this.dispatchCloseEvent({closeTarget:this._popoverCloseElement??null})}_handleOpening(){this.state=`opened`,this.inert=!1,this._setPopoverFocus(),this._focusTrapController.enabled=!0,this.overlay&&this._resizeController.observe(this.overlay),this.dispatchOpenEvent()}connectedCallback(){this.popover=`manual`,super.connectedCallback(),this.state=`closed`,N.add(this),this.hasUpdated&&this._configureTrigger()}requestUpdate(e,t,n){super.requestUpdate(e,t,n),!i&&(!e||e===`trigger`||e===`hoverTrigger`)&&this.hasUpdated&&this._configureTrigger()}firstUpdated(e){super.firstUpdated(e),this._configureTrigger()}disconnectedCallback(){super.disconnectedCallback(),this._triggerElement=null,this._triggerAbortController?.abort(),this._openStateController?.abort(),N.delete(this),this._blurTimeout&&clearTimeout(this._blurTimeout)}_configureTrigger(){if(!i){if(this.hydrationRequired){this.hydrationComplete.then(()=>this._configureTrigger());return}this.configureTrigger(this._triggerElement??null)}}configureTrigger(e){this._triggerAbortController?.abort(),E(this._triggerElement),this._triggerElement=this.trigger,this._triggerElement&&(k(this,this._triggerElement,`dialog`,this.state),this._triggerAbortController=new AbortController,this.registerTriggerListeners(this._triggerAbortController.signal))}registerTriggerListeners(e){this._triggerElement.addEventListener(`click`,()=>this.open(),{signal:e})}_attachWindowEvents(){this._openStateController=new AbortController,document.addEventListener(`scroll`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal,capture:!0}),window.addEventListener(`resize`,()=>this._setPopoverPosition(),{passive:!0,signal:this._openStateController.signal}),window.addEventListener(`pointerdown`,this._pointerDownListener,{signal:this._openStateController.signal}),window.addEventListener(`pointerup`,this._closeOnBackdropClick,{signal:this._openStateController.signal})}_closeOnSbbPopoverCloseClick(e){let t=e.composedPath().find((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&(e.hasAttribute(`sbb-popover-close`)||e.localName===`sbb-popover-close-button`)&&!e.hasAttribute(`disabled`));t&&(clearTimeout(this.closeTimeout),this.close(t))}_onPopoverAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_setPopoverFocus(){!this._focusTrapController.focusInitialElement()&&this._openStateController&&(this.setAttribute(`tabindex`,`0`),this.focus({preventScroll:!0}),this.addEventListener(`blur`,e=>{this._blurTimeout=setTimeout(()=>{if(document.visibilityState!==`hidden`){if(this.removeAttribute(`tabindex`),this.contains(e.relatedTarget)||e.relatedTarget===this.trigger)return;(this.state===`opened`||this.state===`opening`)&&(this._skipCloseFocus=!0),this.close()}})},{signal:this._openStateController.signal}))}_setPopoverPosition(){if(!this.overlay||!this._triggerElement)return;let e=v(this.overlay,this._triggerElement,this.shadowRoot.querySelector(`.sbb-popover__container`),{verticalOffset:16,horizontalOffset:32,centered:!0,responsiveHeight:!0}),t=e.alignment.vertical;for(let e of[`above`,`below`])this.toggleState(`position-${e}`,e===t);let n=this.overlay.offsetWidth,r=document.documentElement.clientWidth,i=Math.max(2,Math.min(e.left,r-n-2)),a=this._triggerElement.getBoundingClientRect(),o=parseFloat(getComputedStyle(this.overlay).borderTopLeftRadius)||0,s=a.left-i+a.width/2-8,c=Math.max(o,Math.min(s,n-o-16));this.style.setProperty(`--_sbb-popover-position-x`,`${i}px`),this.style.setProperty(`--_sbb-popover-position-y`,`${e.top}px`),this.style.setProperty(`--_sbb-popover-arrow-position-x`,`${c}px`),this.style.setProperty(`--_sbb-popover-max-height`,e.maxHeight)}dispatchBeforeCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`beforeclose`,{closeTarget:t,cancelable:!0}))}dispatchCloseEvent(e){let t=e?.closeTarget??null;return this.dispatchEvent(new P(`close`,{closeTarget:t,cancelable:!1}))}render(){return r`
3
3
  <div class="sbb-popover__container">
4
4
  <div
5
5
  @animationend=${this._onPopoverAnimationEnd}
package/sidebar.pure.js CHANGED
@@ -3,7 +3,7 @@ import{html as e,isServer as t,unsafeCSS as n}from"lit";import{SbbSecondaryButto
3
3
  `,E=`:host{position:absolute;inset:0}
4
4
  `,D=`:host{outline-color:var(--sbb-focus-outline-color);height:100%;display:block;position:relative;overflow:auto}
5
5
  `;const O=n(E),k=n(D);n(T);var A=`:host{--sbb-sidebar-container-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-4x));--sbb-sidebar-container-animation-easing:var(--sbb-animation-easing);--sbb-sidebar-container-backdrop-opacity:0;--sbb-sidebar-container__backdrop-visibility:hidden;--sbb-sidebar-container-backdrop-animation-duration:var(--sbb-sidebar-container-animation-duration);display:block;overflow:hidden}@media (forced-colors:active){:host{--sbb-sidebar-container-backdrop-opacity:.5}}.sbb-sidebar-container-backdrop{visibility:var(--sbb-sidebar-container__backdrop-visibility);opacity:var(--sbb-sidebar-container-backdrop-opacity);background-color:var(--sbb-color-black);z-index:3;transition-duration:var(--sbb-sidebar-container-backdrop-animation-duration);transition-timing-function:var(--sbb-sidebar-container-animation-easing);transition-property:opacity,visibility;position:absolute;inset:0}
6
- `;const j=new Set;let M;var N=class extends a{constructor(){super(...arguments),this._forcedClosedSidebars=new WeakSet}static{this.elementName=`sbb-sidebar-container`}static{this.styles=[O,n(A)]}get sidebars(){return Array.from(this.querySelectorAll?.(`:scope > sbb-sidebar`)??[])}get start(){return this.querySelector?.(`:scope > sbb-sidebar:not([position='end'])`)}get end(){return this.querySelector?.(`:scope > sbb-sidebar[position='end']`)}connectedCallback(){super.connectedCallback(),M??=!t&&new ResizeObserver(()=>this._handleWidthChange()),!t&&j.size===0&&M.observe(document?.documentElement),j.add(this),this._handleWidthChange()}disconnectedCallback(){super.disconnectedCallback(),j.delete(this),j.size===0&&M?.disconnect()}firstUpdated(e){super.firstUpdated(e),this._handleWidthChange()}_handleWidthChange(){Array.from(j).sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING).forEach(e=>e._calculateSpaceState())}async _calculateSpaceState(){if(t)return;let e=this.parentElement?.closest?.(`sbb-sidebar-container`)?.sidebars??[];for(let t of e)await t.updateComplete.then(()=>t.animationComplete);let n=this.offsetWidth??0;if(n===0)return;let r=this.sidebars,i=e.some(e=>e.matches(`:is(:state(mode-over-forced),[state--mode-over-forced])`))??!1,a=n-r.filter(e=>e.mode===`side`).reduce((e,t)=>e+(t.offsetWidth??0),0)<320;for(let e of r){let t=e.matches(`:is(:state(mode-over-forced),[state--mode-over-forced])`),n=g(e);n.toggle(`mode-over-forced`,a),e.mode===`side`&&((a||i)&&e.opened&&!t?(e.isOpen&&!e.matches(`:is(:state(skip-animation),[state--skip-animation])`)&&n.add(`mode-over-forced-closing`),e.opened=!1,this._forcedClosedSidebars.add(e),e.matches(`:is(:state(mode-over-forced-closing),[state--mode-over-forced-closing])`)&&e.updateComplete.then(()=>e.animationComplete).then(()=>n.delete(`mode-over-forced-closing`))):!a&&!i&&this._forcedClosedSidebars.has(e)&&(e.cedeFocus(),e.opened=!0,this._forcedClosedSidebars.delete(e)))}}render(){return e`<div
6
+ `;const j=/* @__PURE__ */ new Set;let M;var N=class extends a{constructor(){super(...arguments),this._forcedClosedSidebars=/* @__PURE__ */ new WeakSet}static{this.elementName=`sbb-sidebar-container`}static{this.styles=[O,n(A)]}get sidebars(){return Array.from(this.querySelectorAll?.(`:scope > sbb-sidebar`)??[])}get start(){return this.querySelector?.(`:scope > sbb-sidebar:not([position='end'])`)}get end(){return this.querySelector?.(`:scope > sbb-sidebar[position='end']`)}connectedCallback(){super.connectedCallback(),M??=!t&&new ResizeObserver(()=>this._handleWidthChange()),!t&&j.size===0&&M.observe(document?.documentElement),j.add(this),this._handleWidthChange()}disconnectedCallback(){super.disconnectedCallback(),j.delete(this),j.size===0&&M?.disconnect()}firstUpdated(e){super.firstUpdated(e),this._handleWidthChange()}_handleWidthChange(){Array.from(j).sort((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING).forEach(e=>e._calculateSpaceState())}async _calculateSpaceState(){if(t)return;let e=this.parentElement?.closest?.(`sbb-sidebar-container`)?.sidebars??[];for(let t of e)await t.updateComplete.then(()=>t.animationComplete);let n=this.offsetWidth??0;if(n===0)return;let r=this.sidebars,i=e.some(e=>e.matches(`:is(:state(mode-over-forced),[state--mode-over-forced])`))??!1,a=n-r.filter(e=>e.mode===`side`).reduce((e,t)=>e+(t.offsetWidth??0),0)<320;for(let e of r){let t=e.matches(`:is(:state(mode-over-forced),[state--mode-over-forced])`),n=g(e);n.toggle(`mode-over-forced`,a),e.mode===`side`&&((a||i)&&e.opened&&!t?(e.isOpen&&!e.matches(`:is(:state(skip-animation),[state--skip-animation])`)&&n.add(`mode-over-forced-closing`),e.opened=!1,this._forcedClosedSidebars.add(e),e.matches(`:is(:state(mode-over-forced-closing),[state--mode-over-forced-closing])`)&&e.updateComplete.then(()=>e.animationComplete).then(()=>n.delete(`mode-over-forced-closing`))):!a&&!i&&this._forcedClosedSidebars.has(e)&&(e.cedeFocus(),e.opened=!0,this._forcedClosedSidebars.delete(e)))}}render(){return e`<div
7
7
  class="sbb-sidebar-container-backdrop"
8
8
  @click=${()=>this.sidebars.forEach(e=>e.close())}
9
9
  ></div>
package/status.pure.js CHANGED
@@ -7,4 +7,4 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,uns
7
7
  <slot></slot>
8
8
  </p>
9
9
  </span>
10
- `}constructor(){super(...arguments),this._statusTypes=new Map([[`info`,`circle-information-small`],[`success`,`circle-tick-small`],[`warning`,`circle-exclamation-point-small`],[`error`,`circle-cross-small`],[`pending`,`circle-three-dots-small`],[`incomplete`,`circle-dotted-part-x-small`],[`not-started`,`circle-dotted-small`],[`in-progress`,`circle-dotted-part-small`]]),this.#e=t(this,u,`info`),t(this,d)}}})();export{c as SbbStatusElement};
10
+ `}constructor(){super(...arguments),this._statusTypes=/* @__PURE__ */ new Map([[`info`,`circle-information-small`],[`success`,`circle-tick-small`],[`warning`,`circle-exclamation-point-small`],[`error`,`circle-cross-small`],[`pending`,`circle-three-dots-small`],[`incomplete`,`circle-dotted-part-x-small`],[`not-started`,`circle-dotted-small`],[`in-progress`,`circle-dotted-part-small`]]),this.#e=t(this,u,`info`),t(this,d)}}})();export{c as SbbStatusElement};
@@ -1,2 +1,2 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{isServer as n,unsafeCSS as r}from"lit";import{property as i}from"lit/decorators.js";import{SbbElement as a,SbbFormAssociatedInputMixin as o,SbbLanguageController as s,i18nTimeInputChange as c,i18nTimeInvalid as l,i18nTimeMax as u,i18nTimeMaxLength as d,sbbLiveAnnouncer as f}from"./core.js";var p=`:host{min-width:var(--sbb-time-input-max-width);max-width:var(--sbb-time-input-max-width);cursor:text;align-items:center;font-weight:400;display:inline-flex}@media (forced-colors:active){:host{color:fieldtext}}:host(:disabled){cursor:var(--sbb-cursor-default)}:host(:focus){text-overflow:initial!important}:host(:empty):after{content:attr(placeholder);color:var(--sbb-color-5);-webkit-text-fill-color:var(--sbb-color-5);opacity:1}@media (forced-colors:active){:host(:empty):after{color:graytext}}
2
- `;const m=/[0-9.:,\-;_hH]/,h=/[^0-9.:,\-;_hH]/g,g=/^([0-9]{1,2})([0-9]{2})$/,_=/^([0-9]{1,2})?[.:,\-;_hH]?([0-9]{1,2})?$/;let v=(()=>{let v=o(a),y=[],b;return class extends v{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;b=[i({attribute:!1})],e(this,null,b,{kind:`setter`,name:`valueAsDate`,static:!1,private:!1,access:{has:e=>`valueAsDate`in e,set:(e,t)=>{e.valueAsDate=t}},metadata:t},null,y),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-time-input`}static{this.styles=[r(p)]}set value(e){e=typeof e==`string`?e.replace(h,``).substring(0,5):``,this._tryParseValue(e),!n&&!this.isSelected()&&this.valueAsDate!==null&&(e=this._formatTime()),super.value=e}get value(){return super.value??``}set valueAsDate(e){let t=this._toTime(e);if(!this.isSelected()||t!==null&&!this._isSameTime(t,this._parseValue(this.value))){if(t){this._valueAsTime=t;let e=this._formatTime();this.value!==e&&(this.value=e)}else this._valueAsTime=null,this.value=``}}get valueAsDate(){if(this._valueAsTime&&this._isTimeValid(this._valueAsTime)){let e=new Date(0);return e.setHours(this._valueAsTime.hours),e.setMinutes(this._valueAsTime.minutes),e}return null}constructor(){super(),this._valueAsTime=t(this,y),this._language=new s(this),this.addEventListener?.(`change`,()=>this._updateValueDateFormat(),{capture:!0}),this.addEventListener?.(`change`,()=>f.announce(c(this.value)[this._language.current])),this.addEventListener?.(`keydown`,e=>this._preventCharInsert(e))}connectedCallback(){super.connectedCallback(),this.inputMode||=`numeric`,this.placeholder||=`HH:MM`}disconnectedCallback(){super.disconnectedCallback()}updateFormValue(){this._tryParseValue();let e=this.valueAsDate===null?null:this._formatTime();this.internals.setFormValue(e,this.value)}_tryParseValue(e=this.value){this._valueCache?.[0]!==e&&(this._valueAsTime=this._parseValue(e),this._valueCache=[e,this._valueAsTime??null])}_parseValue(e){let t=e?.trim();if(!t)return null;let n=t.match(g)??t.match(_);return n?{hours:+n[1]||0,minutes:+n[2]||0}:null}_toTime(e){return e instanceof Date&&!isNaN(e.valueOf())?{hours:e.getHours(),minutes:e.getMinutes()}:null}_isSameTime(e,t){return!!(e==t||e&&t&&e.hours===t.hours&&e.minutes===t.minutes)}_updateValueDateFormat(){if(this.valueAsDate){let e=this._formatTime();this.value!==e&&(super.value=e)}}_formatTime(){let e=this.valueAsDate;return e?`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`:``}preparePastedText(e){return e.replace(h,``).substring(0,5-(this.textContent?.length??0))}shouldValidate(e){return super.shouldValidate(e)||[`valueAsDate`,`min`,`max`,`dateFilter`].includes(e)}validate(){super.validate(),this.value?this._valueAsTime?this._isTimeValid(this._valueAsTime)?this._removeValidityErrors():(this._removeValidityErrors(`rangeOverflow`),this.setValidityFlag(`rangeOverflow`,u[this.language.current])):(this._removeValidityErrors(`badInput`),this.setValidityFlag(`badInput`,l[this.language.current])):this._removeValidityErrors()}_removeValidityErrors(e){[`badInput`,`rangeOverflow`].filter(t=>t!==e).forEach(e=>this.removeValidityFlag(e))}_isTimeValid(e){return e.hours<24&&e.minutes<60}_preventCharInsert(e){e.ctrlKey||e.altKey||e.metaKey||[`Backspace`,`Tab`,`Enter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Delete`].includes(e.key)||m.test(e.key)&&(this.value.length<5||this._hasSelection())||(e.preventDefault(),this.value.length>=5&&f.announce(d[this._language.current]))}_hasSelection(){let e=window.getSelection()?.getRangeAt(0);return!!e&&e.startOffset!==e.endOffset}}})();export{v as SbbTimeInputElement};
2
+ `;const m=/[0-9.:,\-;_hH]/,h=/[^0-9.:,\-;_hH]/g,g=/^([0-9]{1,2})([0-9]{2})$/,_=/^([0-9]{1,2})?[.:,\-;_hH]?([0-9]{1,2})?$/;let v=(()=>{let v=o(a),y=[],b;return class extends v{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;b=[i({attribute:!1})],e(this,null,b,{kind:`setter`,name:`valueAsDate`,static:!1,private:!1,access:{has:e=>`valueAsDate`in e,set:(e,t)=>{e.valueAsDate=t}},metadata:t},null,y),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-time-input`}static{this.styles=[r(p)]}set value(e){e=typeof e==`string`?e.replace(h,``).substring(0,5):``,this._tryParseValue(e),!n&&!this.isSelected()&&this.valueAsDate!==null&&(e=this._formatTime()),super.value=e}get value(){return super.value??``}set valueAsDate(e){let t=this._toTime(e);if(!this.isSelected()||t!==null&&!this._isSameTime(t,this._parseValue(this.value))){if(t){this._valueAsTime=t;let e=this._formatTime();this.value!==e&&(this.value=e)}else this._valueAsTime=null,this.value=``}}get valueAsDate(){if(this._valueAsTime&&this._isTimeValid(this._valueAsTime)){let e=/* @__PURE__ */ new Date(0);return e.setHours(this._valueAsTime.hours),e.setMinutes(this._valueAsTime.minutes),e}return null}constructor(){super(),this._valueAsTime=t(this,y),this._language=new s(this),this.addEventListener?.(`change`,()=>this._updateValueDateFormat(),{capture:!0}),this.addEventListener?.(`change`,()=>f.announce(c(this.value)[this._language.current])),this.addEventListener?.(`keydown`,e=>this._preventCharInsert(e))}connectedCallback(){super.connectedCallback(),this.inputMode||=`numeric`,this.placeholder||=`HH:MM`}disconnectedCallback(){super.disconnectedCallback()}updateFormValue(){this._tryParseValue();let e=this.valueAsDate===null?null:this._formatTime();this.internals.setFormValue(e,this.value)}_tryParseValue(e=this.value){this._valueCache?.[0]!==e&&(this._valueAsTime=this._parseValue(e),this._valueCache=[e,this._valueAsTime??null])}_parseValue(e){let t=e?.trim();if(!t)return null;let n=t.match(g)??t.match(_);return n?{hours:+n[1]||0,minutes:+n[2]||0}:null}_toTime(e){return e instanceof Date&&!isNaN(e.valueOf())?{hours:e.getHours(),minutes:e.getMinutes()}:null}_isSameTime(e,t){return!!(e==t||e&&t&&e.hours===t.hours&&e.minutes===t.minutes)}_updateValueDateFormat(){if(this.valueAsDate){let e=this._formatTime();this.value!==e&&(super.value=e)}}_formatTime(){let e=this.valueAsDate;return e?`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`:``}preparePastedText(e){return e.replace(h,``).substring(0,5-(this.textContent?.length??0))}shouldValidate(e){return super.shouldValidate(e)||[`valueAsDate`,`min`,`max`,`dateFilter`].includes(e)}validate(){super.validate(),this.value?this._valueAsTime?this._isTimeValid(this._valueAsTime)?this._removeValidityErrors():(this._removeValidityErrors(`rangeOverflow`),this.setValidityFlag(`rangeOverflow`,u[this.language.current])):(this._removeValidityErrors(`badInput`),this.setValidityFlag(`badInput`,l[this.language.current])):this._removeValidityErrors()}_removeValidityErrors(e){[`badInput`,`rangeOverflow`].filter(t=>t!==e).forEach(e=>this.removeValidityFlag(e))}_isTimeValid(e){return e.hours<24&&e.minutes<60}_preventCharInsert(e){e.ctrlKey||e.altKey||e.metaKey||[`Backspace`,`Tab`,`Enter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Delete`].includes(e.key)||m.test(e.key)&&(this.value.length<5||this._hasSelection())||(e.preventDefault(),this.value.length>=5&&f.announce(d[this._language.current]))}_hasSelection(){let e=window.getSelection()?.getRangeAt(0);return!!e&&e.startOffset!==e.endOffset}}})();export{v as SbbTimeInputElement};
package/toast.pure.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,nothing as r,unsafeCSS as i}from"lit";import{property as a}from"lit/decorators.js";import{SbbTransparentButtonElement as o}from"./button.pure.js";import{SbbDarkModeController as s,SbbLanguageController as c,SbbOpenCloseBaseElement as l,SbbReadonlyMixin as u,forceType as d,i18nCloseAlert as f,isZeroAnimationDuration as p,popoverResetStyles as m}from"./core.js";import{SbbDividerElement as h}from"./divider.pure.js";import{SbbIconNameMixin as g}from"./icon.pure.js";var _=`:host{--sbb-toast-animation-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-6x));--sbb-focus-outline-color:var(--sbb-focus-outline-color-dark);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]))){--sbb-toast-container-display:flex;display:block}:host([position=bottom-left]),:host([position=bottom-start]){--sbb-toast-horizontal-position:flex-start;--sbb-toast-vertical-position:flex-end}:host([position=bottom-center]){--sbb-toast-horizontal-position:center;--sbb-toast-vertical-position:flex-end}:host([position=bottom-right]),:host([position=bottom-end]){--sbb-toast-horizontal-position:flex-end;--sbb-toast-vertical-position:flex-end}:host([position=top-left]),:host([position=top-start]){--sbb-toast-horizontal-position:flex-start;--sbb-toast-vertical-position:flex-start}:host([position=top-center]){--sbb-toast-horizontal-position:center;--sbb-toast-vertical-position:flex-start}:host([position=top-right]),:host([position=top-end]){--sbb-toast-horizontal-position:flex-end;--sbb-toast-vertical-position:flex-start}:host(:is(:state(dark),[state--dark])){--sbb-focus-outline-color:var(--sbb-focus-outline-color-default)}.sbb-toast__overlay-container{position:var(--sbb-toast-container-position);pointer-events:none;display:var(--sbb-toast-container-display,none);justify-content:var(--sbb-toast-horizontal-position);align-items:var(--sbb-toast-vertical-position);inset:0}.sbb-toast{z-index:var(--sbb-toast-z-index,var(--sbb-overlay-default-z-index));pointer-events:auto;margin:var(--sbb-toast-margin);border-radius:var(--sbb-toast-border-radius);max-width:var(--sbb-toast-max-width);color:var(--sbb-toast-text-color);background-color:var(--sbb-toast-background-color);display:flex}:host(:is(:state(state-opening),[state--state-opening])) .sbb-toast{animation-name:open;animation-duration:var(--sbb-toast-animation-duration);animation-timing-function:var(--sbb-toast-animation-timing-function)}:host(:is(:state(state-closing),[state--state-closing])) .sbb-toast{animation-name:close;animation-duration:var(--sbb-toast-animation-duration);animation-timing-function:var(--sbb-toast-animation-timing-function)}.sbb-toast-wrapper{align-items:center;gap:var(--sbb-toast-gap);padding-block:var(--sbb-toast-padding-block);padding-inline:var(--sbb-toast-padding-inline);display:flex}slot:not([name=icon]),.sbb-toast__close{color-scheme:light only}.sbb-toast__content{font-weight:700;font-size:var(--sbb-heading-font-size-6);letter-spacing:var(--sbb-letter-spacing-heading);flex:1 1 0}.sbb-toast__close{align-items:center;display:flex}.sbb-toast__close-divider{padding-block:var(--sbb-toast-padding-block)}.sbb-toast__close-button{margin-inline:var(--sbb-spacing-responsive-xxxs)}@keyframes open{0%{visibility:hidden;opacity:0;translate:0 var(--sbb-spacing-fixed-2x)}to{visibility:visible;opacity:1;translate:0}}@keyframes close{0%{visibility:visible;opacity:1;translate:0}to{visibility:hidden;opacity:0;translate:0 var(--sbb-spacing-fixed-2x)}}
2
- `;const v=new Set;let y=(()=>{let y=g(u(l)),b,x=[],S=[],C,w=[],T=[],E,D=[],O=[];return class extends y{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;b=[d(),a({type:Number})],C=[a({reflect:!0})],E=[a()],e(this,null,b,{kind:`accessor`,name:`timeout`,static:!1,private:!1,access:{has:e=>`timeout`in e,get:e=>e.timeout,set:(e,t)=>{e.timeout=t}},metadata:t},x,S),e(this,null,C,{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},w,T),e(this,null,E,{kind:`accessor`,name:`politeness`,static:!1,private:!1,access:{has:e=>`politeness`in e,get:e=>e.politeness,set:(e,t)=>{e.politeness=t}},metadata:t},D,O),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-toast`}static{this.elementDependencies=[o,h]}static{this.styles=[m,i(_)]}#e;get timeout(){return this.#e}set timeout(e){this.#e=e}#t;get position(){return this.#t}set position(e){this.#t=e}#n;get politeness(){return this.#n}set politeness(e){this.#n=e}constructor(){super(),this.#e=t(this,x,0),this.#t=(t(this,S),t(this,w,`bottom-center`)),this.#n=(t(this,T),t(this,D,`polite`)),this._closeTimeout=t(this,O),this._language=new c(this),this._darkModeController=new s(this,()=>{this._syncSlottedElements(),this.requestUpdate()}),this.addEventListener?.(`click`,e=>this._onClick(e))}connectedCallback(){this.popover=`manual`,super.connectedCallback(),v.add(this)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._closeTimeout),v.delete(this)}willUpdate(e){super.willUpdate(e),e.has(`politeness`)&&(this.internals.ariaLive=this.politeness)}open(){this.state!==`opened`&&this.state!==`opening`&&this.dispatchBeforeOpenEvent()&&(this._closeOtherToasts(),this.showPopover?.(),this.state=`opening`,this._isZeroAnimationDuration()&&this._handleOpening())}close(){this.state!==`closed`&&this.state!==`closing`&&this.dispatchBeforeCloseEvent()&&(clearTimeout(this._closeTimeout),this.state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.dispatchCloseEvent()}_handleOpening(){if(this.state=`opened`,this.dispatchOpenEvent(),this.timeout){let e=globalThis,t=e[e.Zone?.__symbol__?.(`setTimeout`)]??e.setTimeout;this._closeTimeout=t(()=>this.close(),this.timeout)}}_onClick(e){e.composedPath().some((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&e.hasAttribute(`sbb-toast-close`)&&!e.hasAttribute(`disabled`))&&this.close()}_isZeroAnimationDuration(){return p(this,`--sbb-toast-animation-duration`)}_onContentSlotChange(e){let t=e.target.assignedNodes();if(t.some(e=>e.nodeType===Node.TEXT_NODE)){let e=document.createElement(`span`);this.prepend(e),e.append(...t)}this._syncSlottedElements()}_syncSlottedElements(){this.querySelectorAll(`sbb-transparent-button, sbb-transparent-button-link`).forEach(e=>{e.negative=this._isLightMode()}),this.querySelectorAll(`sbb-link, sbb-link-button, sbb-link-static`).forEach(e=>{e.negative=this._isLightMode()})}_onToastAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_closeOtherToasts(){v.forEach(e=>{(e.state===`opened`||e.state===`opening`)&&e.close()})}_isLightMode(){return!this._darkModeController.matches()}render(){return n`
2
+ `;const v=/* @__PURE__ */ new Set;let y=(()=>{let y=g(u(l)),b,x=[],S=[],C,w=[],T=[],E,D=[],O=[];return class extends y{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;b=[d(),a({type:Number})],C=[a({reflect:!0})],E=[a()],e(this,null,b,{kind:`accessor`,name:`timeout`,static:!1,private:!1,access:{has:e=>`timeout`in e,get:e=>e.timeout,set:(e,t)=>{e.timeout=t}},metadata:t},x,S),e(this,null,C,{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},w,T),e(this,null,E,{kind:`accessor`,name:`politeness`,static:!1,private:!1,access:{has:e=>`politeness`in e,get:e=>e.politeness,set:(e,t)=>{e.politeness=t}},metadata:t},D,O),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-toast`}static{this.elementDependencies=[o,h]}static{this.styles=[m,i(_)]}#e;get timeout(){return this.#e}set timeout(e){this.#e=e}#t;get position(){return this.#t}set position(e){this.#t=e}#n;get politeness(){return this.#n}set politeness(e){this.#n=e}constructor(){super(),this.#e=t(this,x,0),this.#t=(t(this,S),t(this,w,`bottom-center`)),this.#n=(t(this,T),t(this,D,`polite`)),this._closeTimeout=t(this,O),this._language=new c(this),this._darkModeController=new s(this,()=>{this._syncSlottedElements(),this.requestUpdate()}),this.addEventListener?.(`click`,e=>this._onClick(e))}connectedCallback(){this.popover=`manual`,super.connectedCallback(),v.add(this)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this._closeTimeout),v.delete(this)}willUpdate(e){super.willUpdate(e),e.has(`politeness`)&&(this.internals.ariaLive=this.politeness)}open(){this.state!==`opened`&&this.state!==`opening`&&this.dispatchBeforeOpenEvent()&&(this._closeOtherToasts(),this.showPopover?.(),this.state=`opening`,this._isZeroAnimationDuration()&&this._handleOpening())}close(){this.state!==`closed`&&this.state!==`closing`&&this.dispatchBeforeCloseEvent()&&(clearTimeout(this._closeTimeout),this.state=`closing`,this._isZeroAnimationDuration()&&this._handleClosing())}_handleClosing(){this.state=`closed`,this.hidePopover?.(),this.dispatchCloseEvent()}_handleOpening(){if(this.state=`opened`,this.dispatchOpenEvent(),this.timeout){let e=globalThis,t=e[e.Zone?.__symbol__?.(`setTimeout`)]??e.setTimeout;this._closeTimeout=t(()=>this.close(),this.timeout)}}_onClick(e){e.composedPath().some((e,t,n)=>e instanceof HTMLElement&&t<n.indexOf(this)&&e.hasAttribute(`sbb-toast-close`)&&!e.hasAttribute(`disabled`))&&this.close()}_isZeroAnimationDuration(){return p(this,`--sbb-toast-animation-duration`)}_onContentSlotChange(e){let t=e.target.assignedNodes();if(t.some(e=>e.nodeType===Node.TEXT_NODE)){let e=document.createElement(`span`);this.prepend(e),e.append(...t)}this._syncSlottedElements()}_syncSlottedElements(){this.querySelectorAll(`sbb-transparent-button, sbb-transparent-button-link`).forEach(e=>{e.negative=this._isLightMode()}),this.querySelectorAll(`sbb-link, sbb-link-button, sbb-link-static`).forEach(e=>{e.negative=this._isLightMode()})}_onToastAnimationEnd(e){e.animationName===`open`&&this.state===`opening`?this._handleOpening():e.animationName===`close`&&this.state===`closing`&&this._handleClosing()}_closeOtherToasts(){v.forEach(e=>{(e.state===`opened`||e.state===`opening`)&&e.close()})}_isLightMode(){return!this._darkModeController.matches()}render(){return n`
3
3
  <div class="sbb-toast__overlay-container">
4
4
  <div class="sbb-toast" @animationend=${this._onToastAnimationEnd}>
5
5
  <div class="sbb-toast-wrapper">
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=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>