@sbb-esta/lyne-elements-dev 5.4.1-dev.1785836006 → 5.4.1-dev.1785915890
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/calendar/_calendar.global.scss +8 -1
- package/calendar.pure.js +4 -4
- package/chip.pure.js +1 -1
- package/core.js +1 -1
- package/development/calendar.pure.js +4 -4
- package/development/chip.pure.js +5 -1
- package/development/core.js +4 -1
- package/lean-off-brand-theme.css +10 -2
- package/lean-safety-theme.css +10 -2
- package/lean-theme.css +10 -2
- package/off-brand-theme.css +10 -2
- package/package.json +2 -2
- package/safety-theme.css +10 -2
- package/standard-theme.css +10 -2
|
@@ -10,7 +10,14 @@ $theme: 'standard' !default;
|
|
|
10
10
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
11
11
|
--sbb-calendar-cell-disabled-height: #{sbb.px-to-rem-build(1.5)};
|
|
12
12
|
--sbb-calendar-cell-disabled-width: #{sbb.px-to-rem-build(25.5)};
|
|
13
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
13
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
14
|
+
var(--sbb-color-granite),
|
|
15
|
+
var(--sbb-color-smoke)
|
|
16
|
+
);
|
|
17
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
18
|
+
var(--sbb-color-graphite),
|
|
19
|
+
var(--sbb-color-anthracite)
|
|
20
|
+
);
|
|
14
21
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
15
22
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
16
23
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/calendar.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{MONDAY as c,SbbButtonLikeBaseElement as l,SbbDisabledMixin as u,SbbElement as ee,SbbFormAssociatedMixin as te,SbbLanguageController as d,SbbPropertyWatcherController as f,THURSDAY as ne,TUESDAY as re,WEDNESDAY as ie,buttonResetStyles as ae,defaultDateAdapter as p,forceType as m,handleDistinctChange as oe,i18nCalendarDateSelection as h,i18nCalendarWeekNumber as g,i18nNextMonth as se,i18nNextYear as ce,i18nNextYearRange as le,i18nPreviousMonth as ue,i18nPreviousYear as de,i18nPreviousYearRange as fe,i18nYearMonthSelection as pe,isArrowKeyOrPageKeysPressed as me,plainDate as _,readConfig as v,screenReaderOnlyStyles as he}from"./core.js";import{SbbSecondaryButtonElement as ge}from"./button.pure.js";import{SbbIconElement as _e}from"./icon.pure.js";var y=`:host{--sbb-focus-outline-offset:.125rem;--sbb-calendar-cell-transition-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));font-size:var(--sbb-calendar-cell-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);cursor:var(--sbb-calendar-cell-cursor);color:var(--sbb-calendar-cell-color);border-radius:calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));margin:var(--sbb-calendar-cell-margin);padding:var(--sbb-calendar-cell-border-width);transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);background-clip:content-box;transition-property:background-color;display:block}:host(:is(sbb-calendar-weekday,sbb-calendar-weeknumber)){--sbb-calendar-cell-font-size:var(--sbb-text-font-size-xs);--sbb-calendar-day-height:var(--sbb-calendar-day-size);color:var(--sbb-calendar-header-color)}:host(:is(sbb-calendar-day,sbb-calendar-weekday,sbb-calendar-weeknumber)){height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width)}:host(:is(:state(current),[state--current])){font-weight:700}:host(:is(:state(selected),[state--selected])){border:var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);padding:0}:host(:disabled){--sbb-calendar-cell-color:var(--sbb-calendar-cell-disabled-color);--sbb-calendar-cell-cursor:
|
|
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{MONDAY as c,SbbButtonLikeBaseElement as l,SbbDisabledMixin as u,SbbElement as ee,SbbFormAssociatedMixin as te,SbbLanguageController as d,SbbPropertyWatcherController as f,THURSDAY as ne,TUESDAY as re,WEDNESDAY as ie,buttonResetStyles as ae,defaultDateAdapter as p,forceType as m,handleDistinctChange as oe,i18nCalendarDateSelection as h,i18nCalendarWeekNumber as g,i18nNextMonth as se,i18nNextYear as ce,i18nNextYearRange as le,i18nPreviousMonth as ue,i18nPreviousYear as de,i18nPreviousYearRange as fe,i18nYearMonthSelection as pe,isArrowKeyOrPageKeysPressed as me,plainDate as _,readConfig as v,screenReaderOnlyStyles as he}from"./core.js";import{SbbSecondaryButtonElement as ge}from"./button.pure.js";import{SbbIconElement as _e}from"./icon.pure.js";var y=`:host{--sbb-focus-outline-offset:.125rem;--sbb-calendar-cell-transition-duration:var(--sbb-disable-animation-duration,var(--sbb-animation-duration-2x));font-size:var(--sbb-calendar-cell-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);cursor:var(--sbb-calendar-cell-cursor);color:var(--sbb-calendar-cell-color);border-radius:calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));margin:var(--sbb-calendar-cell-margin);padding:var(--sbb-calendar-cell-border-width);transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);background-clip:content-box;transition-property:background-color;display:block}:host(:is(sbb-calendar-weekday,sbb-calendar-weeknumber)){--sbb-calendar-cell-font-size:var(--sbb-text-font-size-xs);--sbb-calendar-day-height:var(--sbb-calendar-day-size);color:var(--sbb-calendar-header-color)}:host(:is(sbb-calendar-day,sbb-calendar-weekday,sbb-calendar-weeknumber)){height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width)}:host(:is(:state(current),[state--current])){font-weight:700}:host(:is(:state(selected),[state--selected])){border:var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);padding:0}:host(:disabled){--sbb-calendar-cell-color:var(--sbb-calendar-cell-disabled-color);--sbb-calendar-cell-cursor:default}:host(:disabled:is(:state(crossed-out),[state--crossed-out])){--sbb-calendar-cell-color:var(--sbb-calendar-cell-disabled-crossed-out-color)}:host(: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(:not(:disabled,:where(:is(:state(active),[state--active]),:active)):hover){background-color:var(--sbb-calendar-cell-background-color-hover)}}@media (any-hover:hover) and (forced-colors:active){:host(:not(:disabled):hover){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-focus-outline-style:initial}}:host(:not(:disabled):where(:is(:state(active),[state--active]),:active)){background-color:var(--sbb-calendar-cell-background-color-active)}.sbb-action-base{flex-direction:column;justify-content:center;width:100%;height:100%;display:flex}.sbb-calendar-year,.sbb-calendar-month{height:var(--sbb-calendar-cell-year-month-height);width:var(--sbb-calendar-cell-year-month-width)}:host(:is(:state(crossed-out),[state--crossed-out])) :is(.sbb-calendar-year,.sbb-calendar-month,.sbb-calendar-day__value):after{content:"";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);background-color:var(--sbb-calendar-cell-disabled-crossed-out-color);position:absolute;top:50%;left:50%;translate:-50% -50%;rotate:-45deg}
|
|
2
2
|
`,b=class extends u(l){static{this.styles=[a(y)]}constructor(){super(),this.dateAdapter=v().datetime?.dateAdapter??p,this.addController(new f(this,()=>this.getParent(),{dateFilter:e=>this.setDisabledFilteredState(e),min:e=>this.setDisabledFilteredState(e),max:e=>this.setDisabledFilteredState(e),value:e=>this.setSelectedState(e)}))}getParent(){return this.getRootNode?.()?.host?.closest(`sbb-calendar`)}formResetCallback(){}formStateRestoreCallback(e,t){}},x=`.sbb-calendar-day{justify-content:var(--sbb-calendar-day-justify-content)}.sbb-calendar-day__value{height:var(--sbb-calendar-day-value-height);justify-content:center;align-items:center;display:flex;position:relative}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height)}::slotted(*){height:var(--sbb-calendar-day-extra-height)}
|
|
3
3
|
`;let S=(()=>{let r=b,i=[],c,l;return class extends r{constructor(){super(...arguments),this._value=(t(this,i),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;c=[o()],l=[s()],e(this,null,c,{kind:`setter`,name:`slot`,static:!1,private:!1,access:{has:e=>`slot`in e,set:(e,t)=>{e.slot=t}},metadata:t},null,i),e(this,null,l,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-day`}static{this.styles=[a(x)]}set slot(e){super.slot=e,this.value=this.dateAdapter.deserialize(e)}get slot(){return super.slot}set value(e){let t=this.dateAdapter.getValidDateOrNull(this.dateAdapter.deserialize(e));if(t){this._value=t;let e=this.dateAdapter.sameDate(t,this.dateAdapter.today());this.toggleState(`current`,e),this.internals.ariaCurrent=e?`date`:null,this.internals.ariaLabel=this.dateAdapter.getAccessibilityFormatDate(t);let n=this.getParent();n&&(this.setDisabledFilteredState(n),this.setSelectedState(n))}}get value(){return this._value}connectedCallback(){super.connectedCallback(),this.tabIndex=-1}getParent(){return this.closest?.(`sbb-calendar`)??this.getRootNode?.()?.host?.closest(`sbb-calendar`)}setSelectedState(e){let t=!!this.value&&(e.multiple?e.value.some(e=>this.dateAdapter.sameDate(this.value,e)):!!e.value&&this.dateAdapter.compareDate(this.value,e.value)===0);this.toggleState(`selected`,t),this.internals.ariaPressed=String(t)}setDisabledFilteredState(e){let t=!this._isActiveDate(e.dateFilter),n=!this._isDayInRange(e.min,e.max);this.disabled=t||n,this.internals.ariaDisabled=String(this.disabled),this.toggleState(`crossed-out`,t&&!n)}_isActiveDate(e){return e&&this.value?e(this.value):!0}_isDayInRange(e,t){return!this.value||!e&&!t||this.dateAdapter.sameDate(this.value,this.dateAdapter.clampDate(this.value,e,t))}_handleSlotchange(e){this.internals.ariaDescribedByElements=e.target.assignedElements()}renderTemplate(){return n` <span class="sbb-calendar-day__value" aria-hidden="true">
|
|
4
4
|
${this.value?this.dateAdapter.getDate(this.value):``}
|
|
@@ -6,7 +6,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
|
|
|
6
6
|
<span class="sbb-calendar-day__extra">
|
|
7
7
|
<slot @slotchange=${e=>this._handleSlotchange(e)}></slot>
|
|
8
8
|
</span>`}}})(),C=(()=>{let r=b,i=[],a;return class o extends r{constructor(){super(...arguments),this._monthShortNames=(t(this,i),this.dateAdapter.getMonthNames(`short`)),this._monthLongNames=this.dateAdapter.getMonthNames(`long`),this._monthValue=null,this._yearValue=null,this._value=null}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[s()],e(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-month`}static{this._monthFormatRegex=/^\d{4}-(0[1-9]|1[0-2])$/}set value(e){if(!e||!o._monthFormatRegex.test(e))return;this._value=e;let t=e.split(`-`);this._yearValue=Number(t[0]),this._monthValue=Number(t[1]);let n=this._yearValue===this.dateAdapter.getYear(this.dateAdapter.today())&&this._monthValue===this.dateAdapter.getMonth(this.dateAdapter.today());this.toggleState(`current`,n),this.internals.ariaLabel=`${this._monthLongNames[this._monthValue-1]} ${this._yearValue}`;let r=this.getParent();r&&(this.setDisabledFilteredState(r),this.setSelectedState(r))}get value(){return this._value}connectedCallback(){super.connectedCallback(),this.tabIndex=-1}setSelectedState(e){let t=!!this.value&&(e.multiple?e.value?.some(e=>this._yearValue===this.dateAdapter.getYear(e)&&this._monthValue===this.dateAdapter.getMonth(e))??!1:!!e.value&&this.dateAdapter.getYear(e.value)===this._yearValue&&this.dateAdapter.getMonth(e.value)===this._monthValue);this.toggleState(`selected`,t),this.internals.ariaPressed=String(t)}setDisabledFilteredState(e){let t=!this._isActiveMonth(e),n=!this._isMonthInRange(e.min,e.max);this.disabled=t||n,this.internals.ariaDisabled=String(this.disabled),this.toggleState(`crossed-out`,t&&!n)}_isActiveMonth(e){if(!e.dateFilter||!this._yearValue||!this._monthValue)return!0;let t=this.dateAdapter.createDate(this._yearValue,this._monthValue,1);for(let n=t;this.dateAdapter.getMonth(n)==this._monthValue;n=this.dateAdapter.addCalendarDays(n,1))if(e.dateFilter(n))return!0;return!1}_isMonthInRange(e,t){if(!e&&!t||!this._yearValue||!this._monthValue)return!0;let n=this.dateAdapter.isValid(e)&&(this._yearValue<this.dateAdapter.getYear(e)||this._yearValue===this.dateAdapter.getYear(e)&&this._monthValue<this.dateAdapter.getMonth(e)),r=this.dateAdapter.isValid(t)&&(this._yearValue>this.dateAdapter.getYear(t)||this._yearValue===this.dateAdapter.getYear(t)&&this._monthValue>this.dateAdapter.getMonth(t));return!(n||r)}renderTemplate(){return n`${this._monthShortNames[this._monthValue-1]}`}}})(),w=(()=>{let r=b,i=[],a;return class extends r{constructor(){super(...arguments),this._value=(t(this,i),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[s()],e(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-year`}set value(e){let t=Number(e);if(isNaN(t))return;this._value=e;let n=this.dateAdapter.getYear(this.dateAdapter.today())===t;this.toggleState(`current`,n),this.internals.ariaLabel=String(t);let r=this.getParent();r&&(this.setDisabledFilteredState(r),this.setSelectedState(r))}get value(){return this._value}connectedCallback(){super.connectedCallback(),this.tabIndex=-1}setSelectedState(e){let t=!!this.value&&(e.multiple?e.value?.some(e=>Number(this.value)===this.dateAdapter.getYear(e))??!1:!!e.value&&this.dateAdapter.getYear(e.value)===Number(this.value));this.toggleState(`selected`,t),this.internals.ariaPressed=String(t)}setDisabledFilteredState(e){let t=!this._isActiveYear(e),n=!this._isYearInRange(e.min,e.max);this.disabled=t||n,this.internals.ariaDisabled=String(this.disabled),this.toggleState(`crossed-out`,t&&!n)}_isActiveYear(e){if(!e.dateFilter||!this.value)return!0;let t=this.dateAdapter.createDate(Number(this.value),1,1);for(let n=t;this.dateAdapter.getYear(n)==Number(this.value);n=this.dateAdapter.addCalendarDays(n,1))if(e.dateFilter(n))return!0;return!1}_isYearInRange(e,t){if(!e&&!t||!this.value)return!0;let n=this.dateAdapter.isValid(e)&&this.dateAdapter.getYear(e)>Number(this.value),r=this.dateAdapter.isValid(t)&&this.dateAdapter.getYear(t)<Number(this.value);return!(n||r)}renderTemplate(){return n`${this.value}`}}})(),T=(()=>{let r=b,i=[],a;return class extends r{constructor(){super(...arguments),this._value=(t(this,i),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[s()],e(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-weekday`}set value(e){e&&(this._value=e,this.internals.ariaLabel=e.long)}get value(){return this._value}setSelectedState(){}setDisabledFilteredState(){}renderTemplate(){return n`${this.value?.narrow}`}}})(),E=(()=>{let r=b,i=[],a;return class extends r{constructor(){super(...arguments),this._language=(t(this,i),new d(this)),this._value=null}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[s()],e(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,i),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar-weeknumber`}set value(e){e&&(this._value=String(e),this.internals.ariaLabel=`${g[this._language.current]} ${e}`)}get value(){return this._value}setSelectedState(){}setDisabledFilteredState(){}renderTemplate(){return n`${this.value}`}}})();var ve=`:host{width:max-content;max-width:100%;line-height:var(--sbb-typo-line-height-text);display:block}:host(:is(:state(enhanced),[state--enhanced])){--sbb-calendar-cell-padding-block-end:var(--sbb-spacing-fixed-3x)}.sbb-calendar__wrapper{gap:var(--sbb-calendar-tables-gap);flex-wrap:wrap;width:100%;display:flex;position:relative}:is(.sbb-calendar__year-view,.sbb-calendar__month-view){position:absolute;inset-block-start:0;inset-inline-start:0}:host(:not(:is(:state(view-day),[state--view-day]))) .sbb-calendar__day-view{visibility:hidden}.sbb-calendar__table-header{align-items:center;gap:var(--sbb-calendar-control-gap);height:var(--sbb-size-element-xs);margin-block-end:var(--sbb-spacing-fixed-4x);display:flex}.sbb-calendar__table-header span{color:var(--sbb-calendar-control-view-change-color);flex:auto;padding-inline-start:var(--sbb-spacing-fixed-3x)}.sbb-calendar__control{-webkit-tap-highlight-color:transparent}.sbb-calendar__table{border-collapse:collapse;flex:0 0;width:100%;height:max-content}.sbb-calendar__table :is(thead,tbody){text-align:center}.sbb-calendar__table-header-cell,.sbb-calendar__table-header-cell-vertical{width:var(--sbb-calendar-cell-size);min-width:var(--sbb-calendar-cell-size);color:var(--sbb-calendar-header-color);font-size:var(--sbb-text-font-size-xs);letter-spacing:var(--sbb-typo-letter-spacing-text);padding:0;font-weight:400}:host(:not([multiple])) .sbb-calendar__table-header-cell,:host(:not([multiple])) .sbb-calendar__table-header-cell-vertical{height:var(--sbb-calendar-cell-size)}.sbb-calendar__table-header-cell-vertical{padding-block-end:var(--sbb-calendar-cell-padding-block-end)}.sbb-calendar__table-data{text-align:center;padding:0;position:relative}.sbb-calendar__day-cell{padding-block-end:var(--sbb-calendar-cell-padding-block-end)}:host(:not(:is(:state(enhanced),[state--enhanced]))) sbb-calendar-day{--sbb-calendar-day-justify-content:center;--sbb-calendar-day-height:var(--sbb-calendar-day-size);--sbb-calendar-day-extra-display:none;--sbb-calendar-day-value-height:unset}
|
|
9
|
-
`,D=class extends Event{get range(){return this._range}constructor(e){super(`monthchange`,{bubbles:!0,composed:!0}),this._range=Object.freeze(e||[])}},ye=class extends Event{get dateSelected(){return this._dateSelected}constructor(e){super(`dateselected`,{bubbles:!0,composed:!0}),this._dateSelected=Object.freeze(e)}};let O=(()=>{let l=te(ee),u=[],f,y=[],b=[],x,O=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B,V=[],H=[],U,W=[],G=[],K,q,J=[],Y=[],X,Z=[],be=[],xe,Q=[],Se=[],Ce,we=[],Te=[],Ee,De=[],$=[];return class extends l{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;f=[m(),o({type:Number})],x=[o()],A=[_(),o()],N=[_(),o()],I=[m(),oe((e,t)=>e._onMultipleChanged(t)),o({type:Boolean})],z=[o()],B=[s()],U=[o({attribute:`date-filter`})],K=[m(),o({attribute:`fixed-month`})],q=[o({reflect:!0})],X=[m(),o({attribute:`week-numbers`,type:Boolean})],xe=[s()],Ce=[s()],Ee=[s()],e(this,null,f,{kind:`accessor`,name:`amount`,static:!1,private:!1,access:{has:e=>`amount`in e,get:e=>e.amount,set:(e,t)=>{e.amount=t}},metadata:t},y,b),e(this,null,x,{kind:`accessor`,name:`view`,static:!1,private:!1,access:{has:e=>`view`in e,get:e=>e.view,set:(e,t)=>{e.view=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`min`,static:!1,private:!1,access:{has:e=>`min`in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`max`,static:!1,private:!1,access:{has:e=>`max`in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`multiple`,static:!1,private:!1,access:{has:e=>`multiple`in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:t},L,R),e(this,null,z,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,u),e(this,null,B,{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:t},V,H),e(this,null,U,{kind:`accessor`,name:`dateFilter`,static:!1,private:!1,access:{has:e=>`dateFilter`in e,get:e=>e.dateFilter,set:(e,t)=>{e.dateFilter=t}},metadata:t},W,G),e(this,null,K,{kind:`setter`,name:`fixedMonth`,static:!1,private:!1,access:{has:e=>`fixedMonth`in e,set:(e,t)=>{e.fixedMonth=t}},metadata:t},null,u),e(this,null,q,{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:t},J,Y),e(this,null,X,{kind:`accessor`,name:`weekNumbers`,static:!1,private:!1,access:{has:e=>`weekNumbers`in e,get:e=>e.weekNumbers,set:(e,t)=>{e.weekNumbers=t}},metadata:t},Z,be),e(this,null,xe,{kind:`accessor`,name:`_activeDate`,static:!1,private:!1,access:{has:e=>`_activeDate`in e,get:e=>e._activeDate,set:(e,t)=>{e._activeDate=t}},metadata:t},Q,Se),e(this,null,Ce,{kind:`accessor`,name:`_calendarView`,static:!1,private:!1,access:{has:e=>`_calendarView`in e,get:e=>e._calendarView,set:(e,t)=>{e._calendarView=t}},metadata:t},we,Te),e(this,null,Ee,{kind:`accessor`,name:`_initialized`,static:!1,private:!1,access:{has:e=>`_initialized`in e,get:e=>e._initialized,set:(e,t)=>{e._initialized=t}},metadata:t},De,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar`}static{this.elementDependencies=[S,C,T,E,w,_e,ge]}static{this.styles=[ae,he,a(ve)]}static{this.events={dateselected:`dateselected`,monthchange:`monthchange`}}#e;get amount(){return this.#e}set amount(e){this.#e=e}#t;get view(){return this.#t}set view(e){this.#t=e}#n;get min(){return this.#n}set min(e){this.#n=e}#r;get max(){return this.#r}set max(e){this.#r=e}#i;get multiple(){return this.#i}set multiple(e){this.#i=e}set value(e){if(Array.isArray(e))this._value=e.map(e=>this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))).filter(e=>e!==null).filter(e=>!this._isDayInRange(this._dateAdapter.toIso8601(e))||this._dateFilter(e)).sort(this._sortDate);else{let t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._value=t&&(!this._isDayInRange(this._dateAdapter.toIso8601(t))||this._dateFilter(t))?t:null}}get value(){return this._value}#a;get _value(){return this.#a}set _value(e){this.#a=e}#o;get dateFilter(){return this.#o}set dateFilter(e){this.#o=e}set fixedMonth(e){let t=e?e.match(/^(\d{4})-(\d{2})$/):null;this._fixedMonth=t?this._dateAdapter.createDate(Number(t[1]),Number(t[2]),1):null}get fixedMonth(){return this._fixedMonth?this._dateAdapter.toIso8601(this._fixedMonth).split(`-`).slice(0,2).join(`-`):``}#s;get orientation(){return this.#s}set orientation(e){this.#s=e}#c;get weekNumbers(){return this.#c}set weekNumbers(e){this.#c=e}#l;get _activeDate(){return this.#l}set _activeDate(e){this.#l=e}#u;get _calendarView(){return this.#u}set _calendarView(e){this.#u=e}get _cells(){return Array.from((this._calendarView===`day`?Array.from(this.shadowRoot.querySelectorAll(`slot`)).flatMap(e=>e.assignedElements({flatten:!0})):this.shadowRoot?.querySelectorAll(`sbb-calendar-${this._calendarView}`))??[])}#d;get _initialized(){return this.#d}set _initialized(e){this.#d=e}constructor(){super(),this.#e=(t(this,u),t(this,y,1)),this.#t=(t(this,b),t(this,O,`day`)),this.#n=(t(this,k),t(this,j,null)),this.#r=(t(this,M),t(this,P,null)),this.#i=(t(this,F),t(this,L,!1)),this.#a=(t(this,R),t(this,V,null)),this.#o=(t(this,H),t(this,W,null)),this._fixedMonth=(t(this,G),null),this.#s=t(this,J,`horizontal`),this.#c=(t(this,Y),t(this,Z,!1)),this._dateAdapter=(t(this,be),v().datetime?.dateAdapter??p),this.#l=t(this,Q,this._dateAdapter.today()),this.#u=(t(this,Se),t(this,we,`day`)),this._weekdays=t(this,Te),this._weeks=[],this._firstVisibleDay=``,this._lastVisibleDay=``,this._monthNames=this._dateAdapter.getMonthNames(`long`),this._enhancedVariant=!1,this._resetFocus=!1,this._containingFocus=!1,this._lastSelection=null,this.#d=t(this,De,!1),this._language=(t(this,$),new d(this).withHandler(()=>{this._monthNames=this._dateAdapter.getMonthNames(`long`),this._createMonthRows()})),this._sortDate=(e,t)=>this._dateAdapter.compareDate(e,t),this._onSlotChange=()=>{this._enhancedVariant=Array.from(this.children).some(e=>e.localName===`sbb-calendar-day`),this.toggleState(`enhanced`,this._enhancedVariant),this._setTabIndex()},this._createMonthRows(),this._setWeekdays(),this.addEventListener(`focusin`,()=>this._containingFocus=!0),this.addEventListener(`focusout`,()=>this._containingFocus=!1);let e=e=>e.target.closest(`sbb-calendar-day`)??e.composedPath().find(e=>e.localName===`sbb-calendar-day`)??null;this.addEventListener(`click`,t=>{let n=e(t);n&&this._selectDate(n.value,t)}),this.addEventListener(`keydown`,t=>{let n=e(t);n&&this._handleKeyboardEvent(t,n)}),this.addEventListener(`blur`,()=>this._lastSelection=null)}_dateFilter(e){return this.dateFilter?.(e)??!0}resetPosition(){this._resetCalendarView(),this._init()}connectedCallback(){super.connectedCallback(),this.resetPosition(),this.shadowRoot?.addEventListener(`slotchange`,this._onSlotChange,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot?.removeEventListener(`slotchange`,this._onSlotChange,{capture:!0})}visibleDays(){return this._weeks.flat(2).sort((e,t)=>e.value.localeCompare(t.value))}formResetCallback(){}formStateRestoreCallback(e,t){if(t===`autocomplete`||e==null)return;let n=e=>this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));if(typeof e==`string`)this.value=n(e);else if(e instanceof FormData){if(this.multiple){this._readFormData(e).then(e=>this.value=e.map(n).filter(e=>e!=null));return}let t=e.get(this.name);t instanceof Blob?t.text().then(e=>this.value=n(JSON.parse(e))):this.value=n(t)}}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}focus(){this._resetFocus=!0,this._focusCell()}willUpdate(e){super.willUpdate(e),this._initialized&&((e.has(`amount`)||e.has(`orientation`)||e.has(`fixedMonth`))&&this.resetPosition(),e.has(`view`)&&(this._setChosenYear(),this._chosenMonth=void 0,this._calendarView=this.view))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),e===`_calendarView`&&(this.internals.states.delete(`view-${t}`),this.internals.states.add(`view-${this._calendarView}`),this._containingFocus&&(this._resetFocus=!0))}updated(e){super.updated(e),this._setTabIndex(),this._focusCell()}firstUpdated(e){super.firstUpdated(e),this._emitMonthChange()}_onMultipleChanged(e){e&&!Array.isArray(this._value)&&(this._value=this._value?[this._value]:[]),!e&&Array.isArray(this._value)&&(this._value=this._value.length?this._value[0]:null)}_init(e){if(r)return;if(this.hydrationRequired){this.hydrationComplete.then(()=>this._init());return}e&&this._assignActiveDate(e);let t=this._fixedMonth??this._activeDate,n=this.amount<1?1:this.amount;this._weeks=Array.from({length:n},(e,n)=>this._createWeekRows(this._dateAdapter.addCalendarMonths(t,n)));let i=this._weeks[0][0][0].dateValue;this._firstVisibleDay=this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(i),this._dateAdapter.getMonth(i),1));let a=this._weeks[n-1][0][0].dateValue;this._lastVisibleDay=this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(a),this._dateAdapter.getMonth(a),this._dateAdapter.getNumDaysInMonth(a))),this._years=this._createYearRows(),this._weekNumbers=this._weeks.map(e=>e.flat().sort((e,t)=>e.value.localeCompare(t.value)).map(e=>e.weekValue).filter((e,t,n)=>n.indexOf(e)===t)),this._initialized=!0}_focusCell(){this._resetFocus&&=(this._getFirstFocusable()?.focus(),!1)}_setWeekdays(){let e=this._dateAdapter.getDayOfWeekNames(`narrow`),t=this._dateAdapter.getDayOfWeekNames(`long`).map((t,n)=>({long:t,narrow:e[n]})),n=this._dateAdapter.getFirstDayOfWeek();this._weekdays=t.slice(n).concat(t.slice(0,n))}_createWeekRows(e){let t=this._dateAdapter.getNumDaysInMonth(e),n=this._dateAdapter.getFirstWeekOffset(e);return this.orientation===`horizontal`?this._createWeekRowsHorizontal(e,t,n):this._createWeekRowsVertical(e,t,n)}_createWeekRowsHorizontal(e,t,n){let r=[[]];for(let i=0,a=n;i<t;i++,a++){a===7&&(r.push([]),a=0);let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),i+1);r[r.length-1].push(this._mapDateToDay(t))}return r}_createWeekRowsVertical(e,t,n){let r=Array.from({length:7},()=>[]);for(let i=0,a=n;i<t;i++,a++){a===7&&(a=0);let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),i+1);r[a].push(this._mapDateToDay(t))}return r}_mapDateToDay(e){return{value:this._dateAdapter.toIso8601(e),dateValue:e,dayValue:String(this._dateAdapter.getDate(e)),monthValue:String(this._dateAdapter.getMonth(e)),yearValue:String(this._dateAdapter.getYear(e)),weekValue:this._getWeek(e),weekDayValue:this._dateAdapter.getDayOfWeek(e)}}_getWeek(e){let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),1,1),n=this._dateAdapter.getDayOfWeek(t),r=+!![c,re,ie,ne].includes(n),i=this._dateAdapter.addCalendarDays(t,this._dateAdapter.getFirstWeekOffset(t)*-1);for(;this._dateAdapter.compareDate(i,e)<=0;){let n=this._dateAdapter.addCalendarDays(i,6);if(this._dateAdapter.compareDate(e,n)<=0)return r>0?r:this._getWeek(this._dateAdapter.addCalendarDays(t,-1));i=this._dateAdapter.addCalendarDays(i,7),r++}throw Error(`The provided date is invalid`)}_mapValueToISODate(e){return typeof e==`string`?e:this._dateAdapter.toIso8601(e)}_createMonthRows(){let e=Array(12).fill(null).map((e,t)=>({value:String(t+1).padStart(2,`0`),monthValue:t+1})),t=[];for(let n=0;n<3;n++)t.push(e.slice(4*n,4*(n+1)));this._months=t}_createYearRows(){let e=this._getStartValueYearView(),t=Array(24).fill(0).map((t,n)=>e+n),n=[];for(let e=0;e<6;e++)n.push(t.slice(4*e,4*(e+1)));return n}_getStartValueYearView(){let e=0;this.max?e=this._dateAdapter.getYear(this.max)-24+1:this.min&&(e=this._dateAdapter.getYear(this.min));let t=this._dateAdapter.getYear(this._activeDate);return t-((t-e)%24+24)%24}_isDayInRange(e){if(!this.min&&!this.max)return!0;let t=this._dateAdapter.deserialize(e);return this._dateAdapter.sameDate(t,this._dateAdapter.clampDate(t,this.min,this.max))}_selectDate(e,t){if(this._chosenMonth=void 0,this._setChosenYear(),this.multiple){window.getSelection()?.removeAllRanges();let n=this._value?Array.isArray(this._value)?this._value:[this._value]:[],r=n.map(e=>this._dateAdapter.toIso8601(e));if(t.shiftKey&&this._lastSelection&&r.includes(this._dateAdapter.toIso8601(this._lastSelection))&&!r.includes(this._dateAdapter.toIso8601(e))){let t=this._dateAdapter.compareDate(this._lastSelection,e)<0?1:-1,i=[],a=this._lastSelection;for(;!this._dateAdapter.sameDate(a,e);){a=this._dateAdapter.addCalendarDays(a,t);let e=this._dateAdapter.toIso8601(a);r.includes(e)||i.push(e)}n=this._mergeDates(i,r)}else n=n.some(t=>this._dateAdapter.sameDate(t,e))?n.filter(t=>!this._dateAdapter.sameDate(t,e)):[...n,e].sort(this._sortDate);this._lastSelection=e,this._value=n,this._emitDateSelectedEvent(this._value.map(e=>this._dateAdapter.deserialize(e)))}else(!this._value||this._dateAdapter.compareDate(this._value,e)!==0)&&(this._value=e,this._emitDateSelectedEvent(this._dateAdapter.deserialize(e)))}_selectMultipleDates(e){this._value=this._mergeDates(e.map(e=>e.value)),this._emitDateSelectedEvent(this._value.map(e=>this._dateAdapter.deserialize(e)))}_mergeDates(e,t){t??=this._value.map(e=>this._dateAdapter.toIso8601(e));let n=this._cells.filter(e=>!e.disabled).map(e=>this._mapValueToISODate(e.value)),r=e.filter(e=>n.includes(e));return t=r.every(e=>t.includes(e))?t.filter(e=>!r.includes(e)):[...t,...r].filter((e,t,n)=>n.indexOf(e)===t),t.map(e=>this._dateAdapter.deserialize(e)).sort(this._sortDate)}_emitDateSelectedEvent(e){this.dispatchEvent(new ye(e)),this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_emitMonthChange(){let e=this.visibleDays();this.dispatchEvent(new D(e))}_setChosenYear(){if(this.view===`month`){let e;e=this.multiple?this.value.at(-1):this.value,this._chosenYear=this._dateAdapter.getYear(e??this._dateAdapter.today())}else this._chosenYear=void 0}_assignActiveDate(e){this._activeDate=this._dateAdapter.clampDate(e,this.min,this.max)}_goToDifferentMonth(e){this._init(this._dateAdapter.addCalendarMonths(this._activeDate,e)),this._emitMonthChange()}_goToDifferentYear(e){this._chosenYear+=e,this._activeDate=this._dateAdapter.createDate(this._chosenYear,this._dateAdapter.getMonth(this._activeDate),this._dateAdapter.getDate(this._activeDate)),this._init()}_goToDifferentYearRange(e){this._init(this._dateAdapter.addCalendarYears(this._activeDate,e))}_prevDisabled(e){return this.min?this._dateAdapter.compareDate(e,this.min)<0:!1}_nextDisabled(e){return this.max?this._dateAdapter.compareDate(e,this.max)>0:!1}_previousMonthDisabled(){let e=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getDate(this._activeDate)*-1);return this._prevDisabled(e)}_nextMonthDisabled(){let e=this._dateAdapter.addCalendarMonths(this._activeDate,this.amount<1?1:this.amount);return e=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),1),this._nextDisabled(e)}_previousYearDisabled(){let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this._activeDate)-1,12,31);return this._prevDisabled(e)}_nextYearDisabled(){let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this._activeDate)+(this.amount<1?1:this.amount),1,1);return this._nextDisabled(e)}_previousYearRangeDisabled(){let e=this._dateAdapter.createDate(this._years[0][0]-1,12,31);return this._prevDisabled(e)}_nextYearRangeDisabled(){let e=this._years.flat(2).at(-1),t=this._dateAdapter.createDate(e+1,1,1);return this._nextDisabled(t)}_handleTableBlur(e){e?.localName!==`sbb-calendar-day`&&this._setTabIndex()}_setTabIndex(){Array.from(this._cells.filter(e=>e.tabIndex===0)??[]).forEach(e=>e.tabIndex=-1);let e=this._getFirstFocusable();e&&(e.tabIndex=0)}_getFirstFocusable(){if(this._calendarView===`day`){let e=this._cells.find(e=>e.matches(`:is(:state(selected),[state--selected])`))??this._cells.find(e=>e.matches(`:is(:state(current),[state--current])`));return e&&!e.disabled?e:this._getFirstFocusableDay()}{let e=this.shadowRoot?.querySelector(`sbb-calendar-${this._calendarView}:is(:state(selected),[state--selected])`)??this.shadowRoot?.querySelector(`sbb-calendar-${this._calendarView}:is(:state(current),[state--current])`);return e&&!e.disabled?e:this.shadowRoot.querySelector(`sbb-calendar-${this._calendarView}:not([disabled])`)}}_getFirstFocusableDay(){let e=this._cells,t=e.filter(e=>!e.disabled);if(!t||t.length===0)return null;{let n=t.map(e=>this._dateAdapter.toIso8601(e.value)).sort()[0];return e.find(e=>e.matches(`[slot="${n}"]`))??null}}_handleKeyboardEvent(e,t){me(e)&&e.preventDefault();let n=t??e.target,r=this._cells,i=r.indexOf(n),a;a=t?this._navigateByKeyboardDayView(e,i,r,this._mapDateToDay(t.value)):this._navigateByKeyboard(e,i,r);let o=(this._enhancedVariant?document:this.shadowRoot).activeElement;a!==o&&(a.tabIndex=0,a.focus(),r.includes(o)&&(o.tabIndex=-1))}_navigateByKeyboardDayView(e,t,n,r){let i=this.orientation===`horizontal`?{leftRight:1,upDown:7}:{leftRight:7,upDown:1};switch(e.key){case`ArrowUp`:return this._findDayArrows(n,t,r.dateValue,-i.upDown);case`ArrowDown`:return this._findDayArrows(n,t,r.dateValue,i.upDown);case`ArrowLeft`:return this._findDayArrows(n,t,r.dateValue,-i.leftRight);case`ArrowRight`:return this._findDayArrows(n,t,r.dateValue,i.leftRight);case`PageUp`:if(this.orientation===`horizontal`){let e=(r.dayValue%7||7)-r.dayValue;return this._findDayPageUpDown(n,t,r,e,i.upDown)}{let e=this._dateAdapter.getFirstWeekOffset(r.dateValue),a=(Math.ceil((+r.dayValue+e)/7)-1)*7-e+1-r.dayValue;return this._findDayPageUpDown(n,t,r,a,i.upDown)}case`PageDown`:if(this.orientation===`horizontal`){let e=+r.monthValue+1>12?1:+r.monthValue+1,a=+r.monthValue+1>12?+r.yearValue+1:+r.yearValue,o=this._dateAdapter.createDate(a,e,1),s=this._dateAdapter.getDate(this._dateAdapter.addCalendarDays(o,-1)),c=Math.trunc((s-+r.dayValue)/7)*7;return this._findDayPageUpDown(n,t,r,c,-i.upDown)}{let e=this._dateAdapter.getFirstWeekOffset(r.dateValue),a=Math.ceil((+r.dayValue+e)/7)*7-e-r.dayValue;return this._findDayPageUpDown(n,t,r,a,-i.upDown)}case`Home`:return this._findDayFirst(n,t,r,1);case`End`:{let e=+r.monthValue+1>12?1:+r.monthValue+1,i=+r.monthValue+1>12?+r.yearValue+1:+r.yearValue,a=this._dateAdapter.createDate(i,e,1);return this._findDayLast(n,t,a)}default:return n[t]}}_isDayOutOfView(e){return e<this._firstVisibleDay||e>this._lastVisibleDay}_findDayArrows(e,t,n,r){let i=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n,r));if(this._isDayOutOfView(i))return e[t];let a=e.find(e=>this._mapValueToISODate(e.value)===i);return!a||a.disabled?this._findDayArrows(e,t,this._dateAdapter.deserialize(i),r):a}_findDayPageUpDown(e,t,n,r,i){let a=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n.dateValue,r));if(this._isDayOutOfView(a))return e[t];let o=e.find(e=>this._mapValueToISODate(e.value)===a);return!o||o.disabled?this._findDayPageUpDown(e,t,n,r+i,i):o}_findDayFirst(e,t,n,r){let i=this._dateAdapter.toIso8601(this._dateAdapter.createDate(+n.yearValue,+n.monthValue,r));if(this._isDayOutOfView(i))return e[t];let a=e.find(e=>this._mapValueToISODate(e.value)===i);return!a||a.disabled?this._findDayFirst(e,t,n,r+1):a}_findDayLast(e,t,n){let r=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n,-1));if(this._isDayOutOfView(r))return e[t];let i=e.find(e=>this._mapValueToISODate(e.value)===r);return!i||i.disabled?this._findDayLast(e,t,this._dateAdapter.deserialize(r)):i}_navigateByKeyboard(e,t,n){let{elementIndexForWideMode:r,offsetForWideMode:i,lastElementIndexForWideMode:a,verticalOffset:o}=this._calculateParametersForKeyboardNavigation(t,this._calendarView===`year`);switch(e.key){case`ArrowUp`:return this._findNext(n,t,-o);case`ArrowDown`:return this._findNext(n,t,o);case`ArrowLeft`:return this._findNext(n,t,-1);case`ArrowRight`:return this._findNext(n,t,1);case`Home`:return this._findFirst(n,i);case`PageUp`:return this._findFirstOnColumn(n,r,i,o);case`PageDown`:return this._findLastOnColumn(n,t,a,o);case`End`:return this._findLast(n,a-1);default:return n[t]}}_calculateParametersForKeyboardNavigation(e,t){let n=t?24:12,r=Math.trunc(e/n)*n,i=r===0?e:e-n;return{verticalOffset:4,elementIndexForWideMode:i,offsetForWideMode:e-i,lastElementIndexForWideMode:r===0?n:n*2}}_findNext(e,t,n){let r=t+n;for(;r<e.length&&e[r]?.disabled;)r+=n;return e[r]??e[t]}_findFirst(e,t){return e[t].disabled?this._findNext(e,t,1):e[t]}_findLast(e,t){return e[t].disabled?this._findNext(e,t,-1):e[t]}_findFirstOnColumn(e,t,n,r){let i=t%r+n;return e[i].disabled?this._findNext(e,i,r):e[i]}_findLastOnColumn(e,t,n,r){let i=t+Math.trunc((n-t-1)/r)*r;return e[i].disabled?this._findNext(e,i,-r):e[i]}_resetCalendarViewAndEmitMonthChange(){this._resetCalendarView(),this._emitMonthChange()}_resetCalendarView(){this._containingFocus&&(this._resetFocus=!0),this._activeDate=(this.multiple?this._value.at(-1):this._value)??this._dateAdapter.today(),this._setChosenYear(),this._chosenMonth=void 0,this._init(),this._calendarView=this.view}_createDayTable(e,t,r){let a=e[0][0].dateValue,o=`${this._monthNames[this._dateAdapter.getMonth(a)-1]} ${this._dateAdapter.getYear(a)}`,s=e.flat(),c=e.flat();return n`
|
|
9
|
+
`,D=class extends Event{get range(){return this._range}constructor(e){super(`monthchange`,{bubbles:!0,composed:!0}),this._range=Object.freeze(e||[])}},ye=class extends Event{get dateSelected(){return this._dateSelected}constructor(e){super(`dateselected`,{bubbles:!0,composed:!0}),this._dateSelected=Object.freeze(e)}};let O=(()=>{let l=te(ee),u=[],f,y=[],b=[],x,O=[],k=[],A,j=[],M=[],N,P=[],F=[],I,L=[],R=[],z,B,V=[],H=[],U,W=[],G=[],K,q,J=[],Y=[],X,Z=[],be=[],xe,Q=[],Se=[],Ce,we=[],Te=[],Ee,De=[],$=[];return class extends l{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;f=[m(),o({type:Number})],x=[o()],A=[_(),o()],N=[_(),o()],I=[m(),oe((e,t)=>e._onMultipleChanged(t)),o({type:Boolean})],z=[o()],B=[s()],U=[o({attribute:`date-filter`})],K=[m(),o({attribute:`fixed-month`})],q=[o({reflect:!0})],X=[m(),o({attribute:`week-numbers`,type:Boolean})],xe=[s()],Ce=[s()],Ee=[s()],e(this,null,f,{kind:`accessor`,name:`amount`,static:!1,private:!1,access:{has:e=>`amount`in e,get:e=>e.amount,set:(e,t)=>{e.amount=t}},metadata:t},y,b),e(this,null,x,{kind:`accessor`,name:`view`,static:!1,private:!1,access:{has:e=>`view`in e,get:e=>e.view,set:(e,t)=>{e.view=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`min`,static:!1,private:!1,access:{has:e=>`min`in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`max`,static:!1,private:!1,access:{has:e=>`max`in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:t},P,F),e(this,null,I,{kind:`accessor`,name:`multiple`,static:!1,private:!1,access:{has:e=>`multiple`in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:t},L,R),e(this,null,z,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,u),e(this,null,B,{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:t},V,H),e(this,null,U,{kind:`accessor`,name:`dateFilter`,static:!1,private:!1,access:{has:e=>`dateFilter`in e,get:e=>e.dateFilter,set:(e,t)=>{e.dateFilter=t}},metadata:t},W,G),e(this,null,K,{kind:`setter`,name:`fixedMonth`,static:!1,private:!1,access:{has:e=>`fixedMonth`in e,set:(e,t)=>{e.fixedMonth=t}},metadata:t},null,u),e(this,null,q,{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:t},J,Y),e(this,null,X,{kind:`accessor`,name:`weekNumbers`,static:!1,private:!1,access:{has:e=>`weekNumbers`in e,get:e=>e.weekNumbers,set:(e,t)=>{e.weekNumbers=t}},metadata:t},Z,be),e(this,null,xe,{kind:`accessor`,name:`_activeDate`,static:!1,private:!1,access:{has:e=>`_activeDate`in e,get:e=>e._activeDate,set:(e,t)=>{e._activeDate=t}},metadata:t},Q,Se),e(this,null,Ce,{kind:`accessor`,name:`_calendarView`,static:!1,private:!1,access:{has:e=>`_calendarView`in e,get:e=>e._calendarView,set:(e,t)=>{e._calendarView=t}},metadata:t},we,Te),e(this,null,Ee,{kind:`accessor`,name:`_initialized`,static:!1,private:!1,access:{has:e=>`_initialized`in e,get:e=>e._initialized,set:(e,t)=>{e._initialized=t}},metadata:t},De,$),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-calendar`}static{this.elementDependencies=[S,C,T,E,w,_e,ge]}static{this.styles=[ae,he,a(ve)]}static{this.events={dateselected:`dateselected`,monthchange:`monthchange`}}#e;get amount(){return this.#e}set amount(e){this.#e=e}#t;get view(){return this.#t}set view(e){this.#t=e}#n;get min(){return this.#n}set min(e){this.#n=e}#r;get max(){return this.#r}set max(e){this.#r=e}#i;get multiple(){return this.#i}set multiple(e){this.#i=e}set value(e){if(Array.isArray(e))this._value=e.map(e=>this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))).filter(e=>e!==null).filter(e=>!this._isDayInRange(this._dateAdapter.toIso8601(e))||this._dateFilter(e)).sort(this._sortDate);else{let t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._value=t&&(!this._isDayInRange(this._dateAdapter.toIso8601(t))||this._dateFilter(t))?t:null}}get value(){return this._value}#a;get _value(){return this.#a}set _value(e){this.#a=e}#o;get dateFilter(){return this.#o}set dateFilter(e){this.#o=e}set fixedMonth(e){let t=e?e.match(/^(\d{4})-(\d{2})$/):null;this._fixedMonth=t?this._dateAdapter.createDate(Number(t[1]),Number(t[2]),1):null}get fixedMonth(){return this._fixedMonth?this._dateAdapter.toIso8601(this._fixedMonth).split(`-`).slice(0,2).join(`-`):``}#s;get orientation(){return this.#s}set orientation(e){this.#s=e}#c;get weekNumbers(){return this.#c}set weekNumbers(e){this.#c=e}#l;get _activeDate(){return this.#l}set _activeDate(e){this.#l=e}#u;get _calendarView(){return this.#u}set _calendarView(e){this.#u=e}get _cells(){return Array.from((this._calendarView===`day`?Array.from(this.shadowRoot.querySelectorAll(`slot`)).flatMap(e=>e.assignedElements({flatten:!0})):this.shadowRoot?.querySelectorAll(`sbb-calendar-${this._calendarView}`))??[])}#d;get _initialized(){return this.#d}set _initialized(e){this.#d=e}constructor(){super(),this.#e=(t(this,u),t(this,y,1)),this.#t=(t(this,b),t(this,O,`day`)),this.#n=(t(this,k),t(this,j,null)),this.#r=(t(this,M),t(this,P,null)),this.#i=(t(this,F),t(this,L,!1)),this.#a=(t(this,R),t(this,V,null)),this.#o=(t(this,H),t(this,W,null)),this._fixedMonth=(t(this,G),null),this.#s=t(this,J,`horizontal`),this.#c=(t(this,Y),t(this,Z,!1)),this._dateAdapter=(t(this,be),v().datetime?.dateAdapter??p),this.#l=t(this,Q,this._dateAdapter.today()),this.#u=(t(this,Se),t(this,we,`day`)),this._weekdays=t(this,Te),this._weeks=[],this._firstVisibleDay=``,this._lastVisibleDay=``,this._monthNames=this._dateAdapter.getMonthNames(`long`),this._enhancedVariant=!1,this._resetFocus=!1,this._containingFocus=!1,this._lastSelection=null,this.#d=t(this,De,!1),this._language=(t(this,$),new d(this).withHandler(()=>{this._monthNames=this._dateAdapter.getMonthNames(`long`),this._createMonthRows()})),this._sortDate=(e,t)=>this._dateAdapter.compareDate(e,t),this._onSlotChange=()=>{this._enhancedVariant=Array.from(this.children).some(e=>e.localName===`sbb-calendar-day`),this.toggleState(`enhanced`,this._enhancedVariant),this._setTabIndex()},this._createMonthRows(),this._setWeekdays(),this.addEventListener(`focusin`,()=>this._containingFocus=!0),this.addEventListener(`focusout`,()=>this._containingFocus=!1);let e=e=>e.target.closest(`sbb-calendar-day`)??e.composedPath().find(e=>e.localName===`sbb-calendar-day`)??null;this.addEventListener(`click`,t=>{let n=e(t);n&&this._selectDate(n.value,t)}),this.addEventListener(`keydown`,t=>{let n=e(t);n&&this._handleKeyboardEvent(t,n)}),this.addEventListener(`blur`,()=>this._lastSelection=null)}_dateFilter(e){return this.dateFilter?.(e)??!0}resetPosition(){this._resetCalendarView(),this._init()}connectedCallback(){super.connectedCallback(),this.resetPosition(),this.shadowRoot?.addEventListener(`slotchange`,this._onSlotChange,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.shadowRoot?.removeEventListener(`slotchange`,this._onSlotChange,{capture:!0})}visibleDays(){return this._weeks.flat(2).sort((e,t)=>e.value.localeCompare(t.value))}formResetCallback(){}formStateRestoreCallback(e,t){if(t===`autocomplete`||e==null)return;let n=e=>this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));if(typeof e==`string`)this.value=n(e);else if(e instanceof FormData){if(this.multiple){this._readFormData(e).then(e=>this.value=e.map(n).filter(e=>e!=null));return}let t=e.get(this.name);t instanceof Blob?t.text().then(e=>this.value=n(JSON.parse(e))):this.value=n(t)}}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}focus(){this._resetFocus=!0,this._focusCell()}willUpdate(e){super.willUpdate(e),this._initialized&&((e.has(`amount`)||e.has(`orientation`)||e.has(`fixedMonth`))&&this.resetPosition(),e.has(`view`)&&(this._setChosenYear(),this._chosenMonth=void 0,this._calendarView=this.view))}requestUpdate(e,t,n){super.requestUpdate(e,t,n),e===`_calendarView`&&(this.internals.states.delete(`view-${t}`),this.internals.states.add(`view-${this._calendarView}`),this._containingFocus&&(this._resetFocus=!0))}updated(e){super.updated(e),this._setTabIndex(),this._focusCell()}firstUpdated(e){super.firstUpdated(e),this._emitMonthChange()}_onMultipleChanged(e){e&&!Array.isArray(this._value)&&(this._value=this._value?[this._value]:[]),!e&&Array.isArray(this._value)&&(this._value=this._value.length?this._value[0]:null)}_init(e){if(r)return;if(this.hydrationRequired){this.hydrationComplete.then(()=>this._init());return}e&&this._assignActiveDate(e);let t=this._fixedMonth??this._activeDate,n=this.amount<1?1:this.amount;this._weeks=Array.from({length:n},(e,n)=>this._createWeekRows(this._dateAdapter.addCalendarMonths(t,n)));let i=this._weeks[0][0][0].dateValue;this._firstVisibleDay=this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(i),this._dateAdapter.getMonth(i),1));let a=this._weeks[n-1][0][0].dateValue;this._lastVisibleDay=this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(a),this._dateAdapter.getMonth(a),this._dateAdapter.getNumDaysInMonth(a))),this._years=this._createYearRows(),this._weekNumbers=this._weeks.map(e=>e.flat().sort((e,t)=>e.value.localeCompare(t.value)).map(e=>e.weekValue).filter((e,t,n)=>n.indexOf(e)===t)),this._initialized=!0}_focusCell(){this._resetFocus&&=(this._getFirstFocusable()?.focus(),!1)}_setWeekdays(){let e=this._dateAdapter.getDayOfWeekNames(`narrow`),t=this._dateAdapter.getDayOfWeekNames(`long`).map((t,n)=>({long:t,narrow:e[n]})),n=this._dateAdapter.getFirstDayOfWeek();this._weekdays=t.slice(n).concat(t.slice(0,n))}_createWeekRows(e){let t=this._dateAdapter.getNumDaysInMonth(e),n=this._dateAdapter.getFirstWeekOffset(e);return this.orientation===`horizontal`?this._createWeekRowsHorizontal(e,t,n):this._createWeekRowsVertical(e,t,n)}_createWeekRowsHorizontal(e,t,n){let r=[[]];for(let i=0,a=n;i<t;i++,a++){a===7&&(r.push([]),a=0);let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),i+1);r[r.length-1].push(this._mapDateToDay(t))}return r}_createWeekRowsVertical(e,t,n){let r=Array.from({length:7},()=>[]);for(let i=0,a=n;i<t;i++,a++){a===7&&(a=0);let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),i+1);r[a].push(this._mapDateToDay(t))}return r}_mapDateToDay(e){return{value:this._dateAdapter.toIso8601(e),dateValue:e,dayValue:String(this._dateAdapter.getDate(e)),monthValue:String(this._dateAdapter.getMonth(e)),yearValue:String(this._dateAdapter.getYear(e)),weekValue:this._getWeek(e),weekDayValue:this._dateAdapter.getDayOfWeek(e)}}_getWeek(e){let t=this._dateAdapter.createDate(this._dateAdapter.getYear(e),1,1),n=this._dateAdapter.getDayOfWeek(t),r=+!![c,re,ie,ne].includes(n),i=this._dateAdapter.addCalendarDays(t,this._dateAdapter.getFirstWeekOffset(t)*-1);for(;this._dateAdapter.compareDate(i,e)<=0;){let n=this._dateAdapter.addCalendarDays(i,6);if(this._dateAdapter.compareDate(e,n)<=0)return r>0?r:this._getWeek(this._dateAdapter.addCalendarDays(t,-1));i=this._dateAdapter.addCalendarDays(i,7),r++}throw Error(`The provided date is invalid`)}_mapValueToISODate(e){return typeof e==`string`?e:this._dateAdapter.toIso8601(e)}_createMonthRows(){let e=Array(12).fill(null).map((e,t)=>({value:String(t+1).padStart(2,`0`),monthValue:t+1})),t=[];for(let n=0;n<3;n++)t.push(e.slice(4*n,4*(n+1)));this._months=t}_createYearRows(){let e=this._getStartValueYearView(),t=Array(24).fill(0).map((t,n)=>e+n),n=[];for(let e=0;e<6;e++)n.push(t.slice(4*e,4*(e+1)));return n}_getStartValueYearView(){let e=0;this.max?e=this._dateAdapter.getYear(this.max)-24+1:this.min&&(e=this._dateAdapter.getYear(this.min));let t=this._dateAdapter.getYear(this._activeDate);return t-((t-e)%24+24)%24}_isDayInRange(e){if(!this.min&&!this.max)return!0;let t=this._dateAdapter.deserialize(e);return this._dateAdapter.sameDate(t,this._dateAdapter.clampDate(t,this.min,this.max))}_selectDate(e,t){if(this._chosenMonth=void 0,this._setChosenYear(),this.multiple){window.getSelection()?.removeAllRanges();let n=this._value?Array.isArray(this._value)?this._value:[this._value]:[],r=n.map(e=>this._dateAdapter.toIso8601(e));if(t.shiftKey&&this._lastSelection&&r.includes(this._dateAdapter.toIso8601(this._lastSelection))&&!r.includes(this._dateAdapter.toIso8601(e))){let t=this._dateAdapter.compareDate(this._lastSelection,e)<0?1:-1,i=[],a=this._lastSelection;for(;!this._dateAdapter.sameDate(a,e);){a=this._dateAdapter.addCalendarDays(a,t);let e=this._dateAdapter.toIso8601(a);r.includes(e)||i.push(e)}n=this._mergeDates(i,r)}else n=n.some(t=>this._dateAdapter.sameDate(t,e))?n.filter(t=>!this._dateAdapter.sameDate(t,e)):[...n,e].sort(this._sortDate);this._lastSelection=e,this._value=n,this._emitDateSelectedEvent(this._value.map(e=>this._dateAdapter.deserialize(e)))}else(!this._value||this._dateAdapter.compareDate(this._value,e)!==0)&&(this._value=e,this._emitDateSelectedEvent(this._dateAdapter.deserialize(e)))}_selectMultipleDates(e){this._value=this._mergeDates(e.map(e=>e.value)),this._emitDateSelectedEvent(this._value.map(e=>this._dateAdapter.deserialize(e)))}_mergeDates(e,t){t??=this._value.map(e=>this._dateAdapter.toIso8601(e));let n=this._cells.filter(e=>!e.disabled).map(e=>this._mapValueToISODate(e.value)),r=e.filter(e=>n.includes(e));return t=r.every(e=>t.includes(e))?t.filter(e=>!r.includes(e)):[...t,...r].filter((e,t,n)=>n.indexOf(e)===t),t.map(e=>this._dateAdapter.deserialize(e)).sort(this._sortDate)}_emitDateSelectedEvent(e){this.dispatchEvent(new ye(e)),this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_emitMonthChange(){let e=this.visibleDays();this.dispatchEvent(new D(e))}_setChosenYear(){if(this.view===`month`){let e;e=this.multiple?this.value.at(-1):this.value,this._chosenYear=this._dateAdapter.getYear(e??this._dateAdapter.today())}else this._chosenYear=void 0}_assignActiveDate(e){this._activeDate=this._dateAdapter.clampDate(e,this.min,this.max)}_goToDifferentMonth(e){this._init(this._dateAdapter.addCalendarMonths(this._activeDate,e)),this._emitMonthChange()}_goToDifferentYear(e){this._chosenYear+=e,this._activeDate=this._dateAdapter.createDate(this._chosenYear,this._dateAdapter.getMonth(this._activeDate),1),this._init()}_goToDifferentYearRange(e){this._init(this._dateAdapter.addCalendarYears(this._activeDate,e))}_prevDisabled(e){return this.min?this._dateAdapter.compareDate(e,this.min)<0:!1}_nextDisabled(e){return this.max?this._dateAdapter.compareDate(e,this.max)>0:!1}_previousMonthDisabled(){let e=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getDate(this._activeDate)*-1);return this._prevDisabled(e)}_nextMonthDisabled(){let e=this._dateAdapter.addCalendarMonths(this._activeDate,this.amount<1?1:this.amount);return e=this._dateAdapter.createDate(this._dateAdapter.getYear(e),this._dateAdapter.getMonth(e),1),this._nextDisabled(e)}_previousYearDisabled(){let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this._activeDate)-1,12,31);return this._prevDisabled(e)}_nextYearDisabled(){let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this._activeDate)+(this.amount<1?1:this.amount),1,1);return this._nextDisabled(e)}_previousYearRangeDisabled(){let e=this._dateAdapter.createDate(this._years[0][0]-1,12,31);return this._prevDisabled(e)}_nextYearRangeDisabled(){let e=this._years.flat(2).at(-1),t=this._dateAdapter.createDate(e+1,1,1);return this._nextDisabled(t)}_handleTableBlur(e){e?.localName!==`sbb-calendar-day`&&this._setTabIndex()}_setTabIndex(){Array.from(this._cells.filter(e=>e.tabIndex===0)??[]).forEach(e=>e.tabIndex=-1);let e=this._getFirstFocusable();e&&(e.tabIndex=0)}_getFirstFocusable(){if(this._calendarView===`day`){let e=this._cells.find(e=>e.matches(`:is(:state(selected),[state--selected])`))??this._cells.find(e=>e.matches(`:is(:state(current),[state--current])`));return e&&!e.disabled?e:this._getFirstFocusableDay()}{let e=this.shadowRoot?.querySelector(`sbb-calendar-${this._calendarView}:is(:state(selected),[state--selected])`)??this.shadowRoot?.querySelector(`sbb-calendar-${this._calendarView}:is(:state(current),[state--current])`);return e&&!e.disabled?e:this.shadowRoot.querySelector(`sbb-calendar-${this._calendarView}:not([disabled])`)}}_getFirstFocusableDay(){let e=this._cells,t=e.filter(e=>!e.disabled);if(!t||t.length===0)return null;{let n=t.map(e=>this._dateAdapter.toIso8601(e.value)).sort()[0];return e.find(e=>e.matches(`[slot="${n}"]`))??null}}_handleKeyboardEvent(e,t){me(e)&&e.preventDefault();let n=t??e.target,r=this._cells,i=r.indexOf(n),a;a=t?this._navigateByKeyboardDayView(e,i,r,this._mapDateToDay(t.value)):this._navigateByKeyboard(e,i,r);let o=(this._enhancedVariant?document:this.shadowRoot).activeElement;a!==o&&(a.tabIndex=0,a.focus(),r.includes(o)&&(o.tabIndex=-1))}_navigateByKeyboardDayView(e,t,n,r){let i=this.orientation===`horizontal`?{leftRight:1,upDown:7}:{leftRight:7,upDown:1};switch(e.key){case`ArrowUp`:return this._findDayArrows(n,t,r.dateValue,-i.upDown);case`ArrowDown`:return this._findDayArrows(n,t,r.dateValue,i.upDown);case`ArrowLeft`:return this._findDayArrows(n,t,r.dateValue,-i.leftRight);case`ArrowRight`:return this._findDayArrows(n,t,r.dateValue,i.leftRight);case`PageUp`:if(this.orientation===`horizontal`){let e=(r.dayValue%7||7)-r.dayValue;return this._findDayPageUpDown(n,t,r,e,i.upDown)}{let e=this._dateAdapter.getFirstWeekOffset(r.dateValue),a=(Math.ceil((+r.dayValue+e)/7)-1)*7-e+1-r.dayValue;return this._findDayPageUpDown(n,t,r,a,i.upDown)}case`PageDown`:if(this.orientation===`horizontal`){let e=+r.monthValue+1>12?1:+r.monthValue+1,a=+r.monthValue+1>12?+r.yearValue+1:+r.yearValue,o=this._dateAdapter.createDate(a,e,1),s=this._dateAdapter.getDate(this._dateAdapter.addCalendarDays(o,-1)),c=Math.trunc((s-+r.dayValue)/7)*7;return this._findDayPageUpDown(n,t,r,c,-i.upDown)}{let e=this._dateAdapter.getFirstWeekOffset(r.dateValue),a=Math.ceil((+r.dayValue+e)/7)*7-e-r.dayValue;return this._findDayPageUpDown(n,t,r,a,-i.upDown)}case`Home`:return this._findDayFirst(n,t,r,1);case`End`:{let e=+r.monthValue+1>12?1:+r.monthValue+1,i=+r.monthValue+1>12?+r.yearValue+1:+r.yearValue,a=this._dateAdapter.createDate(i,e,1);return this._findDayLast(n,t,a)}default:return n[t]}}_isDayOutOfView(e){return e<this._firstVisibleDay||e>this._lastVisibleDay}_findDayArrows(e,t,n,r){let i=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n,r));if(this._isDayOutOfView(i))return e[t];let a=e.find(e=>this._mapValueToISODate(e.value)===i);return!a||a.disabled?this._findDayArrows(e,t,this._dateAdapter.deserialize(i),r):a}_findDayPageUpDown(e,t,n,r,i){let a=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n.dateValue,r));if(this._isDayOutOfView(a))return e[t];let o=e.find(e=>this._mapValueToISODate(e.value)===a);return!o||o.disabled?this._findDayPageUpDown(e,t,n,r+i,i):o}_findDayFirst(e,t,n,r){let i=this._dateAdapter.toIso8601(this._dateAdapter.createDate(+n.yearValue,+n.monthValue,r));if(this._isDayOutOfView(i))return e[t];let a=e.find(e=>this._mapValueToISODate(e.value)===i);return!a||a.disabled?this._findDayFirst(e,t,n,r+1):a}_findDayLast(e,t,n){let r=this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(n,-1));if(this._isDayOutOfView(r))return e[t];let i=e.find(e=>this._mapValueToISODate(e.value)===r);return!i||i.disabled?this._findDayLast(e,t,this._dateAdapter.deserialize(r)):i}_navigateByKeyboard(e,t,n){let{elementIndexForWideMode:r,offsetForWideMode:i,lastElementIndexForWideMode:a,verticalOffset:o}=this._calculateParametersForKeyboardNavigation(t,this._calendarView===`year`);switch(e.key){case`ArrowUp`:return this._findNext(n,t,-o);case`ArrowDown`:return this._findNext(n,t,o);case`ArrowLeft`:return this._findNext(n,t,-1);case`ArrowRight`:return this._findNext(n,t,1);case`Home`:return this._findFirst(n,i);case`PageUp`:return this._findFirstOnColumn(n,r,i,o);case`PageDown`:return this._findLastOnColumn(n,t,a,o);case`End`:return this._findLast(n,a-1);default:return n[t]}}_calculateParametersForKeyboardNavigation(e,t){let n=t?24:12,r=Math.trunc(e/n)*n,i=r===0?e:e-n;return{verticalOffset:4,elementIndexForWideMode:i,offsetForWideMode:e-i,lastElementIndexForWideMode:r===0?n:n*2}}_findNext(e,t,n){let r=t+n;for(;r<e.length&&e[r]?.disabled;)r+=n;return e[r]??e[t]}_findFirst(e,t){return e[t].disabled?this._findNext(e,t,1):e[t]}_findLast(e,t){return e[t].disabled?this._findNext(e,t,-1):e[t]}_findFirstOnColumn(e,t,n,r){let i=t%r+n;return e[i].disabled?this._findNext(e,i,r):e[i]}_findLastOnColumn(e,t,n,r){let i=t+Math.trunc((n-t-1)/r)*r;return e[i].disabled?this._findNext(e,i,-r):e[i]}_resetCalendarViewAndEmitMonthChange(){this._resetCalendarView(),this._emitMonthChange()}_resetCalendarView(){this._containingFocus&&(this._resetFocus=!0),this._activeDate=(this.multiple?this._value.at(-1):this._value)??this._dateAdapter.today(),this._setChosenYear(),this._chosenMonth=void 0,this._init(),this._calendarView=this.view}_createDayTable(e,t,r){let a=e[0][0].dateValue,o=`${this._monthNames[this._dateAdapter.getMonth(a)-1]} ${this._dateAdapter.getYear(a)}`,s=e.flat(),c=e.flat();return n`
|
|
10
10
|
<div class="sbb-calendar__table-wrapper sbb-calendar__day-view">
|
|
11
11
|
<div class="sbb-calendar__table-header">
|
|
12
12
|
<span>${o}</span> ${r?this._createDayTableControls(o):i}
|
|
@@ -163,7 +163,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
|
|
|
163
163
|
</tbody>
|
|
164
164
|
</table>
|
|
165
165
|
</div>
|
|
166
|
-
`}_onMonthSelection(e,t){this._chosenMonth=e,this._calendarView=`day`,this._init(this._dateAdapter.createDate(t,this._chosenMonth,
|
|
166
|
+
`}_onMonthSelection(e,t){this._chosenMonth=e,this._calendarView=`day`,this._init(this._dateAdapter.createDate(t,this._chosenMonth,1)),this._emitMonthChange()}_renderYearView(){let e=this._years.flat(2)[0],t=this._years.at(-1).flat(),r=`${e} - ${t[t.length-1]}`;return n`
|
|
167
167
|
<div class="sbb-calendar__table-wrapper sbb-calendar__year-view">
|
|
168
168
|
<div class="sbb-calendar__table-header">
|
|
169
169
|
<span>${r}</span>
|
|
@@ -187,7 +187,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
|
|
|
187
187
|
</tbody>
|
|
188
188
|
</table>
|
|
189
189
|
</div>
|
|
190
|
-
`}_onYearSelection(e){this._chosenYear=e,this._calendarView=`month`,this._assignActiveDate(this._dateAdapter.createDate(
|
|
190
|
+
`}_onYearSelection(e){this._chosenYear=e,this._calendarView=`month`,this._assignActiveDate(this._dateAdapter.createDate(e,this._dateAdapter.getMonth(this._activeDate),1))}_getArrow(e,t,r,i=!1){return n`<sbb-secondary-button
|
|
191
191
|
class="sbb-calendar__control"
|
|
192
192
|
size="s"
|
|
193
193
|
icon-name="chevron-small-${e}-small"
|
package/chip.pure.js
CHANGED
|
@@ -14,4 +14,4 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
|
|
|
14
14
|
</sbb-mini-button>
|
|
15
15
|
<span class="sbb-screen-reader-only">, ${g[this._language.current]}</span>
|
|
16
16
|
`}}})();var w=`:host{gap:var(--sbb-chip-group-gap);width:100%;margin-block:var(--sbb-chip-group-margin-block);line-height:var(--sbb-typo-line-height-text);flex-wrap:wrap;align-items:center;display:flex}:host(:is(:is(:state(size-s),[state--size-s]),:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:0}:host(:is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-s)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-s)}:host(:is(:is(:state(size-l),[state--size-l]),:is(:state(size-m),[state--size-m]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-base-lm)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-m)}:host(:is(:state(without-label),[state--without-label]):not(:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-no-label-not-empty)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-m)}:host(:not(:is(:state(without-label),[state--without-label]),:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block:var(--sbb-chip-group-margin-block-with-label-not-empty)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-without-label-l)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block:var(--_sbb-chip-group-margin-block-with-label-l)}::slotted(input){flex:1 1 var(--sbb-chip-group-input-min-width);max-height:1.5rem}::slotted(sbb-chip){max-width:100%}
|
|
17
|
-
`,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.elementDependencies=[C]}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips()}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){if(!e){this.value=null;return}this._readFormData(e).then(e=>this.value=e)}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus();return}switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t))}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault()}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();if(e!==void 0&&t[e]){t[e].focus();return}if(t.length>0){t[t.length-1].focus();return}this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){
|
|
17
|
+
`,T=class extends Event{constructor(e){super(`chipinputtokenend`,{cancelable:!0,bubbles:!0,composed:!0}),this.origin=e.origin,this.value=e.value,this.label=e.label}setValue(e){this.value=e}setLabel(e){this.label=e}};let E=(()=>{let f=p(o(u(c(s)))),g=[],b,x,S=[],E=[],D,O=[],k=[],A,j=[],M=[];return class extends f{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;b=[a({type:Array})],x=[a({attribute:!1})],D=[a({attribute:`separator-keys`,type:Array})],A=[m(),a({attribute:`add-on-blur`,type:Boolean})],e(this,null,b,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:t},null,g),e(this,null,x,{kind:`accessor`,name:`displayWith`,static:!1,private:!1,access:{has:e=>`displayWith`in e,get:e=>e.displayWith,set:(e,t)=>{e.displayWith=t}},metadata:t},S,E),e(this,null,D,{kind:`accessor`,name:`separatorKeys`,static:!1,private:!1,access:{has:e=>`separatorKeys`in e,get:e=>e.separatorKeys,set:(e,t)=>{e.separatorKeys=t}},metadata:t},O,k),e(this,null,A,{kind:`accessor`,name:`addOnBlur`,static:!1,private:!1,access:{has:e=>`addOnBlur`in e,get:e=>e.addOnBlur,set:(e,t)=>{e.addOnBlur=t}},metadata:t},j,M),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-chip-group`}static{this.elementDependencies=[C]}static{this.role=`listbox`}static{this.styles=[i(w)]}static{this.events={input:`input`,change:`change`,chipinputtokenend:`chipinputtokenend`}}set value(e){e??=[];let t=this.value,n=[...t];for(let t of e)n.includes(t)&&n.splice(n.indexOf(t),1);n.forEach(e=>this._chipElements().find(t=>t.value===e)?.remove());let r=[...e];for(let e of t)r.includes(e)&&r.splice(r.indexOf(e),1);r.forEach(e=>this._createChipElement(e))}get value(){return this._chipElements().map(e=>e.value)}#e;get displayWith(){return this.#e}set displayWith(e){this.#e=e}#t;get separatorKeys(){return this.#t}set separatorKeys(e){this.#t=e}#n;get addOnBlur(){return this.#n}set addOnBlur(e){this.#n=e}constructor(){super(),this.#e=(t(this,g),t(this,S,null)),this.#t=(t(this,E),t(this,O,[`Enter`])),this.#n=(t(this,k),t(this,j,!1)),this._inputAttributeObserver=(t(this,M),r?null:new MutationObserver(()=>this._reactToInputChanges())),this._language=new l(this),this._previousSize=null,this.addEventListener?.(C.events.requestdelete,e=>this._deleteChip(e.target)),this.addEventListener?.(`keydown`,e=>this._onChipKeyDown(e)),this.addController(new d(this,()=>this.closest(`sbb-form-field`),{size:e=>this._updateSize(e.size),label:e=>this._updateLabelState(e),hiddenLabel:e=>this._updateLabelState(e)}))}_updateLabelState(e){this.toggleState(`without-label`,!e.label||e.hiddenLabel)}connectedCallback(){super.connectedCallback(),this._setupComponent()}willUpdate(e){super.willUpdate(e),(e.has(`disabled`)||e.has(`formDisabled`)||e.has(`negative`))&&this._proxyStateToChips(),e.has(`disabled`)&&this._inputElement&&this._inputElement.disabled!==this.disabled&&(this._inputElement.disabled=this.disabled)}formResetCallback(){this.value=null}formStateRestoreCallback(e,t){if(!e){this.value=null;return}this._readFormData(e).then(e=>this.value=e)}async _readFormData(e){return Promise.all(e.getAll(this.name).map(async e=>e instanceof Blob?JSON.parse(await e.text()):e))}shouldValidate(e){return super.shouldValidate(e)||e===`required`||e===`value`}validate(){super.validate(),this.required&&this.value.length===0?this.setValidityFlag(`valueMissing`,v[this._language.current]):this.removeValidityFlag(`valueMissing`)}_chipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip`)??[])}_enabledChipElements(){return Array.from(this.querySelectorAll?.(`sbb-chip:not([disabled])`)??[])}_setupComponent(){let e=this.querySelector(`input`);e&&e!==this._inputElement&&(this._inputAbortController?.abort(),this._inputAttributeObserver?.disconnect(),this._inputElement=e,this._inputAbortController=new AbortController,this._inputElement.addEventListener(`keydown`,e=>this._onInputKeyDown(e),{signal:this._inputAbortController.signal}),this._inputElement.addEventListener(`blur`,()=>this._onInputBlur(),{signal:this._inputAbortController.signal,capture:!0}),this._inputElement.addEventListener(`inputAutocomplete`,e=>this._createChipFromInput(`autocomplete`,e.option.value),{signal:this._inputAbortController.signal}),this._inputAttributeObserver?.observe(this._inputElement,{attributes:!0,attributeFilter:[`readonly`,`disabled`]})),this.closest(`sbb-form-field`)||this._updateSize(null),this.toggleState(`empty`,this.value.length===0),this._reactToInputChanges(),this._updateInputDescription(),this.updateFormValue()}_onChipKeyDown(e){let t=e.target;if(t.localName===`sbb-chip`){if(y(e)){let n=this._enabledChipElements();n[h(e,n.indexOf(t),n.length)].focus();return}switch(e.key){case`Backspace`:case`Delete`:!t.readOnly&&!t.disabled&&(e.preventDefault(),this._deleteChip(t))}}}_onInputKeyDown(e){switch(e.key){case`Backspace`:case`ArrowLeft`:this._inputElement.value||this._focusChip();break;case`Enter`:e.preventDefault()}this.separatorKeys.includes(e.key)&&(e.preventDefault(),this._createChipFromInput(`input`))}_onInputBlur(){this.addOnBlur&&this._createChipFromInput(`input`)}_createChipFromInput(e=`input`,t){let n=t??this._inputElement.value.trim();if(!n)return;let r=new T({origin:e,value:n,label:(t?this.displayWith?.(t):null)??void 0});this.dispatchEvent(r)&&(this._createChipElement(r.value,r.label),this._inputElement.value=``,this._emitInputEvents())}_deleteChip(e){let t=this._enabledChipElements();e.remove(),this._emitInputEvents(),this._focusChip(t.indexOf(e))}_focusChip(e){let t=this._enabledChipElements();if(e!==void 0&&t[e]){t[e].focus();return}if(t.length>0){t[t.length-1].focus();return}this._inputElement?.focus()}_emitInputEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_createChipElement(e,t){if(r)return;let n=document.createElement(`sbb-chip`);n.value=e,n.innerText=t??(e?this.displayWith?.(e):null)??``,this.insertBefore(n,this._inputElement??this.querySelector(`input`))}_reactToInputChanges(){let e=this._inputElement?.disabled??!1;this.disabled!==e&&(this.disabled=e),this._proxyStateToChips()}_proxyStateToChips(){this._chipElements().forEach(e=>{e.disabled=this.disabled||this.formDisabled,e.readOnly=this._inputElement?.hasAttribute(`readonly`)??!1,e.negative=this.negative})}_updateSize(e){this._previousSize&&this.internals.states.delete(`size-${this._previousSize}`),this._previousSize=e,this._previousSize&&this.internals.states.add(`size-${this._previousSize}`)}_updateInputDescription(){this._inputElement&&this._inputElement.setAttribute(`aria-description`,`${_[this._language.current]} ${this.value.length}`)}render(){return n`<slot @slotchange=${this._setupComponent}></slot>`}}})();export{C as SbbChipElement,E as SbbChipGroupElement,T as SbbChipInputTokenEndEvent};
|
package/core.js
CHANGED
|
@@ -40,7 +40,7 @@ let xe=0;var Se=class{constructor(){r||(document.body?this._liveElement=this._cr
|
|
|
40
40
|
`;let 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`],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&&t instanceof window.HTMLElement&&!Wn.includes(t.localName)&&!t.classList.contains(`sbb-live-announcer-element`)).forEach(e=>{this._addInertAttributes(e)}),e=e?.parentElement??e?.getRootNode()?.host??null}_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)`,W=`(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)`,G=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=G.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),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},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,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const 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 K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(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);if(!r||r.index!==0||r.length<=2||r.some(e=>e===void 0)||!this.isValid(this.createDate(+r[3],+r[2],+r[1])))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 K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date(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 q=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 K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(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}`)},J=new WeakMap,Y=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)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=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}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);if(!e){this.rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode)),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Or={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;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??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ar(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function 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 Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}var Nr=class{disableScroll(){if(Z())return;this._height=document.body.style.height,this._position=document.body.style.position,this._overflow=document.body.style.overflow,this._marginInlineEnd=document.body.style.marginInlineEnd;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow=`hidden`,document.body.style.height=`100dvh`,document.body.style.position=`relative`,document.body.style.marginInlineEnd=`${e}px`,document.body.style.setProperty(`--sbb-scrollbar-width`,`${e}px`),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.height=this._height||``,document.body.style.position=this._position||``,document.body.style.overflow=this._overflow||``,document.body.style.marginInlineEnd=this._marginInlineEnd||``,document.body.style.setProperty(`--sbb-scrollbar-width`,`0`),document.body.removeAttribute(`data-sbb-scroll-disabled`))}};function Pr(e){e.key===` `&&e.preventDefault()}function Fr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Ir=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},Lr=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`,Pr),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`)}}})(),Rr=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)}})(),zr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Br=e=>(()=>{let t=Rr(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=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`],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&&t instanceof window.HTMLElement&&!Wn.includes(t.localName)&&!t.classList.contains(`sbb-live-announcer-element`)).forEach(e=>{this._addInertAttributes(e)}),e=e?.parentElement??e?.getRootNode()?.host??null}_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)`,W=`(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)`,G=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=G.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),G.set(e,{mediaQueryList:n,handlers:r,eventHandler:i})}}}hostDisconnected(){for(let[e,t]of Object.entries(this._queries)){let n=G.get(e);n&&(n.handlers.delete(t),n.handlers.size||G.delete(e))}}},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,{[W]:n}),this._host=e,this._onChangeWithStateUpdater=n}static _readLightDarkClass(){if(r)return null;let e=document.documentElement.classList;return[`sbb-light-dark`,`sbb-dark`,`sbb-light`].find(t=>e.contains(t))??null}static requestUpdate(){let e=G.get(W);e&&e.handlers.forEach(t=>t(e.mediaQueryList.matches))}hostConnected(){let t=(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0;super.hostConnected(),t&&e._observer.observe(document.documentElement,e._observerConfig),this._onChangeWithStateUpdater()}hostDisconnected(){super.hostDisconnected(),(G.get(`(prefers-color-scheme: dark)`)?.handlers.size??0)===0&&e._observer.disconnect()}matches(){if(r)return!1;let e=getComputedStyle(this._host).getPropertyValue(`color-scheme`),t=e.includes(`dark`),n=e.trim()===`dark`;return super.matches(`(prefers-color-scheme: dark)`)&&t||n}};const 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 K=class{constructor(e=15){this._cutoffYearOffset=e}deserialize(e){return e==null||this.isDateInstance(e)&&this.isValid(e)?e:this.invalid()}parse(e){if(!e)return null;let t=null,n=e.match(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 K{getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()+1}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getAccessibilityFormatDate(e){return new Intl.DateTimeFormat(z.current,{year:`numeric`,month:`long`,day:`numeric`}).format(new Date(e))}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(new Date(2017,e,1)))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(new Date(2017,0,t+1)))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(new Date(2017,0,e+1)))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e),0))}today(){return new Date(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 q=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 K{constructor(e){if(super(e),typeof Temporal!=`object`)throw Error(`Temporal is not available in the current environment. Please make sure to include the temporal polyfill.`)}getYear(e){return e.year}getMonth(e){return e.month}getDate(e){return e.day}getDayOfWeek(e){return e.dayOfWeek%7}getAccessibilityFormatDate(e){return this.deserialize(e).toLocaleString(z.current,{year:`numeric`,month:`long`,day:`numeric`})}getMonthNames(e){let t=new Intl.DateTimeFormat(z.current,{month:e});return this._range(12,e=>t.format(Temporal.PlainDate.from({year:2017,month:e+1,day:1})))}getDateNames(){let e=new Intl.DateTimeFormat(z.current,{day:`numeric`});return this._range(31,t=>e.format(Temporal.PlainDate.from({year:2017,month:1,day:t+1})))}getDayOfWeekNames(e){let t=new Intl.DateTimeFormat(z.current,{weekday:e});return this._range(7,e=>t.format(Temporal.PlainDate.from({year:2017,month:1,day:e+1})))}getFirstDayOfWeek(){return 1}getNumDaysInMonth(e){return e.daysInMonth}today(){return Temporal.Now.plainDateISO()}createDate(e,t,n){if(t<1||t>12)throw Error(`Invalid month "${t}". Month has to be between 1 and 12.`);if(n<1)throw Error(`Invalid day "${n}". Day has to be greater than 0.`);try{return Temporal.PlainDate.from({year:e,month:t,day:n},{overflow:`reject`})}catch{throw Error(`Invalid date "${n}" for month with index "${t}".`)}}isDateInstance(e){return e instanceof Temporal.PlainDate}isValid(e){return this.isDateInstance(e)}clone(e){return Temporal.PlainDate.from(e)}addCalendarYears(e,t){return e.add({years:t})}addCalendarMonths(e,t){return e.add({months:t})}addCalendarDays(e,t){return e.add({days:t})}deserialize(e){if(typeof e==`string`){if(!e)return null;if(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}`)},J=new WeakMap,Y=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)??Y.get(this.host);if(n&&typeof n==`string`&&(!e||e.has(n))){let e=this.rootNode?.getElementById?.(n)??null;t.access.get(this.host)!==e&&t.access.set(this.host,e)}},hostConnected(){this.rootNode=this.host.getRootNode(),this.checkIdReference();let e=J.get(this.rootNode);if(e)e.controllers.add(this);else{let e=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}),J.set(this.rootNode,{observer:t,controllers:e})}},hostDisconnected(){if(r||!this.rootNode)return;let e=J.get(this.rootNode);if(!e){this.rootNode=null;return}e.controllers.delete(this),e.controllers.size===0&&(e.observer.disconnect(),J.delete(this.rootNode)),this.rootNode=null}})}),{set(t){if(typeof t!=`string`)Y.delete(this),t instanceof HTMLElement&&this.hasAttribute(o)&&t.id!==this.getAttribute(o)&&this.removeAttribute(o);else if(this.hasAttribute(o)&&this.getAttribute(o)!==t)return;else{let e=t?this.getRootNode?.()?.getElementById?.(t):null;e?t=e:t&&=(Y.set(this,t),null)}e.set.call(this,t)}}}throw Error(`Unsupported decorator location: ${n}`)},Or={toAttribute(e,t){let n=R().datetime?.dateAdapter??q;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??q;e=n.getValidDateOrNull(n.deserialize(e)),e=e?n.createDate(n.getYear(e),n.getMonth(e),n.getDate(e)):null,t.set.call(this,e)},get(){let n=R().datetime?.dateAdapter??q,r=t.get.call(this);return n.isValid(r)?n.clone(r):e?.fallback?.(n)}};throw Error(`Unsupported decorator location: ${r}`)};function Ar(e,t){if(r||globalThis.disableAnimation)return!0;let n=getComputedStyle(e).getPropertyValue(t);return parseFloat(n)===0}function X(e,t){let n=t;for(;n;){if(n===e)return!0;n=n instanceof ShadowRoot?n.host:n.parentNode}return!1}function 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 Z(){return document.body.hasAttribute(`data-sbb-scroll-disabled`)}var Nr=class{disableScroll(){if(Z())return;this._height=document.body.style.height,this._position=document.body.style.position,this._overflow=document.body.style.overflow,this._marginInlineEnd=document.body.style.marginInlineEnd;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow=`hidden`,document.body.style.height=`100dvh`,document.body.style.position=`relative`,document.body.style.marginInlineEnd=`${e}px`,document.body.style.setProperty(`--sbb-scrollbar-width`,`${e}px`),document.body.toggleAttribute(`data-sbb-scroll-disabled`,!0)}enableScroll(){Z()&&(document.body.style.height=this._height||``,document.body.style.position=this._position||``,document.body.style.overflow=this._overflow||``,document.body.style.marginInlineEnd=this._marginInlineEnd||``,document.body.style.setProperty(`--sbb-scrollbar-width`,`0`),document.body.removeAttribute(`data-sbb-scroll-disabled`))}};function Pr(e){e.key===` `&&e.preventDefault()}function Fr(e,t){let n=Object.getPrototypeOf(e).constructor,r=new n(e.type,e);t.dispatchEvent(r)}const Ir=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},Lr=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`,Pr),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`)}}})(),Rr=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)}})(),zr=(()=>{if(r)return!1;let e=document.createElement(`div`);return e.setAttribute(`contenteditable`,`PLAINTEXT-ONLY`),e.contentEditable===`plaintext-only`})(),Br=e=>(()=>{let t=Rr(V(H(L(e)))),i=[],a,u,d;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;a=[l()],u=[l({attribute:!1})],d=[c({passive:!0})],o(this,null,a,{kind:`setter`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,set:(e,t)=>{e.value=t}},metadata:e},null,i),o(this,null,u,{kind:`setter`,name:`placeholder`,static:!1,private:!1,access:{has:e=>`placeholder`in e,set:(e,t)=>{e.placeholder=t}},metadata:e},null,i),o(this,null,d,{kind:`method`,name:`_cleanChildren`,static:!1,private:!1,access:{has:e=>`_cleanChildren`in e,get:e=>e._cleanChildren},metadata:e},null,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`textbox`}static{this.formFieldAssociated=!0}get type(){return`text`}set value(e){this._value=this._cleanText(e),this.hasUpdated&&this._assignValue(this._value),this.dispatchEvent(new Event(`displayvaluechange`,{bubbles:!0,composed:!0}))}get value(){return this._value??``}set placeholder(e){e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this.internals.ariaPlaceholder=e||null}get placeholder(){return this.getAttribute(`placeholder`)??``}constructor(){super(),this._shouldEmitChange=(s(this,i),!1),this._shouldTriggerSubmit=!1,this.language=new z(this),this._value=``,this.addEventListener?.(`input`,()=>{let e=this._value;this._value=this._cleanText(this.textContent??``),this.requestUpdate(`value`,e),this.internals.states.add(`interacted`),this._shouldEmitChange=!0},{capture:!0}),this.addEventListener?.(`change`,()=>this._shouldEmitChange=!1,{capture:!0}),this.addEventListener?.(`keydown`,e=>{if(this._requiresEmptyPatch()&&this._assignValue(``),(e.key===`Enter`||e.key===`
|
|
44
44
|
`)&&e.isTrusted)e.preventDefault(),e.stopImmediatePropagation(),this._shouldTriggerSubmit=this.dispatchEvent(new KeyboardEvent(`keydown`,e));else if(A&&this.value&&(e.key===`Backspace`||e.key===`Delete`)&&e.isTrusted){if(e.preventDefault(),e.stopImmediatePropagation(),!this.dispatchEvent(new KeyboardEvent(`keydown`,e)))return;let t=window.getSelection()?.getRangeAt(0);if(!t)return;t.startOffset===t.endOffset?e.key===`Backspace`&&t.startOffset>0?(t.setStart(t.startContainer,t.startOffset-1),t.deleteContents(),this._dispatchInputEvent()):e.key===`Delete`&&t.endOffset<this.value.length&&(t.setEnd(t.endContainer,t.endOffset+1),t.deleteContents(),this._dispatchInputEvent()):(t.deleteContents(),this._dispatchInputEvent())}},{capture:!0}),this.addEventListener?.(`keyup`,e=>{e.key===`Enter`||e.key===`
|
|
45
45
|
`?(this._emitChangeIfNecessary(),this._shouldTriggerSubmit&&(this._shouldTriggerSubmit=!1,this.form?.requestSubmit())):this._requiresEmptyPatch()&&this._setCursorAt(0)},{capture:!0}),this.addEventListener?.(`paste`,e=>{e.preventDefault(),this._requiresEmptyPatch()&&this._assignValue(``);let t=this._cleanText(e.clipboardData?.getData(`text/plain`)??``),n=window.getSelection()?.getRangeAt(0);!n||!t||(n.deleteContents(),n.insertNode(document.createTextNode(this.preparePastedText(t))),n.setStart(n.endContainer,n.endOffset),this._dispatchInputEvent())}),this.addEventListener?.(`focus`,()=>{T.mostRecentModality===`keyboard`&&window.getSelection()?.selectAllChildren(this)}),this.addEventListener?.(`touchend`,()=>{this._requiresEmptyPatch()&&(this._assignValue(` `),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`:zr?`plaintext-only`:`true`;this.setAttribute(`contenteditable`,e),this.readOnly?this.setAttribute(`tabindex`,`0`):this.removeAttribute(`tabindex`)}}_emitChangeIfNecessary(){this._shouldEmitChange&&(this._shouldEmitChange=!1,this.dispatchEvent(new Event(`change`,{bubbles:!0})))}_canSelect(){return!r&&!this.disabled&&!this.readOnly&&!!this.value}render(){return n`<slot @slotchange=${this._cleanChildren}></slot>`}}})(),Q=new WeakMap,Vr=e=>(()=>{let t=V(H(L(e))),n=[],i,a;return class extends t{static{let e=typeof Symbol==`function`&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;i=[l({type:Boolean})],a=[l()],o(this,null,i,{kind:`setter`,name:`checked`,static:!1,private:!1,access:{has:e=>`checked`in e,set:(e,t)=>{e.checked=t}},metadata:e},null,n),o(this,null,a,{kind:`setter`,name:`name`,static:!1,private:!1,access:{has:e=>`name`in e,set:(e,t)=>{e.name=t}},metadata:e},null,n),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}static{this.role=`radio`}set checked(e){this._checked=!!e,this.toggleState(`checked`,this.checked),this.internals.ariaChecked=this.checked.toString(),this.updateFormValue(),this._synchronizeGroupState()}get checked(){return this._checked}set name(e){let t=this.name;e!==t&&(super.name=e,this._disconnectFromRegistry(t),this._connectToRegistry(),this._synchronizeGroupState())}get name(){return super.name}get type(){return`radio`}constructor(){super(),this._checked=(s(this,n),!1),this._languageController=new z(this),this.addEventListener?.(`keydown`,e=>this._handleArrowKeyDown(e))}connectedCallback(){super.connectedCallback(),this._connectToRegistry(),this._synchronizeGroupState()}disconnectedCallback(){super.disconnectedCallback(),this._disconnectFromRegistry(this.name)}formResetCallback(){this.checked=this.hasAttribute(`checked`)}formStateRestoreCallback(e,t){typeof e==`string`||e==null?this.checked=e===this.value:e instanceof FormData&&this._readFormData(e).then(e=>{this.checked=e===this.value})}async _readFormData(e){let t=e.get(this.name);return t instanceof Blob?JSON.parse(await t.text()):t}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.updateFocusableRadios()}firstUpdated(e){super.firstUpdated(e),this.updateFocusableRadios()}updateFormValue(){this.checked?super.updateFormValue():this.internals.setFormValue(null)}shouldValidate(e){return super.shouldValidate(e)||e===`checked`||e===`required`}validate(){if(super.validate(),!this.associatedRadioButtons)return;let e=!1,t=!1;for(let n of this.associatedRadioButtons)e||=n.required,t||=n.checked;e&&!t?this.associatedRadioButtons.forEach(e=>e.setValidityFlag(`valueMissing`,pn[this._languageController.current])):this.associatedRadioButtons.forEach(e=>e.removeValidityFlag(`valueMissing`))}updateFocusableRadios(){if(!this.hasUpdated)return;let e=this._interactableGroupedRadios(),t=e.findIndex(e=>e.checked&&!e.disabled&&!e.formDisabled),n=t===-1?e.findIndex(e=>!e.disabled&&!e.formDisabled):t;n!==-1&&(e[n].tabIndex=0,e.splice(n,1)),e.forEach(e=>e.removeAttribute(`tabindex`))}async navigateByKeyboard(e){e.checked=!0,this.emitChangeEvents(),await e.updateComplete,e.focus()}emitChangeEvents(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0}))}_synchronizeGroupState(){this.checked&&this._deselectGroupedRadios(),this.updateFocusableRadios()}_connectToRegistry(){if(!this.name||r)return;let e=this.form??this.getRootNode();this._radioButtonGroupsMap=Q.get(e),this._radioButtonGroupsMap||(this._radioButtonGroupsMap=new Map,Q.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 Hr=`: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
|
`,Ur=`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}
|
|
@@ -6,7 +6,7 @@ import { SbbSecondaryButtonElement } from "./button.pure.js";
|
|
|
6
6
|
import { SbbIconElement } from "./icon.pure.js";
|
|
7
7
|
|
|
8
8
|
//#region src/elements/calendar/common/calendar-cell-base-element.scss?inline
|
|
9
|
-
var calendar_cell_base_element_default = ":host {\n --sbb-focus-outline-offset: 0.125rem;\n --sbb-calendar-cell-transition-duration: var(\n --sbb-disable-animation-duration,\n var(--sbb-animation-duration-2x)\n );\n display: block;\n font-size: var(--sbb-calendar-cell-font-size);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n cursor: var(--sbb-calendar-cell-cursor);\n color: var(--sbb-calendar-cell-color);\n border-radius: calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));\n margin: var(--sbb-calendar-cell-margin);\n padding: var(--sbb-calendar-cell-border-width);\n background-clip: content-box;\n transition-duration: var(--sbb-calendar-cell-transition-duration);\n transition-timing-function: var(--sbb-calendar-cell-transition-easing-function);\n transition-property: background-color;\n}\n\n:host(:is(sbb-calendar-weekday, sbb-calendar-weeknumber)) {\n --sbb-calendar-cell-font-size: var(--sbb-text-font-size-xs);\n --sbb-calendar-day-height: var(--sbb-calendar-day-size);\n color: var(--sbb-calendar-header-color);\n}\n\n:host(:is(sbb-calendar-day, sbb-calendar-weekday, sbb-calendar-weeknumber)) {\n height: var(--sbb-calendar-day-height);\n width: var(--sbb-calendar-day-width);\n}\n\n:host(:is(:state(current),[state--current])) {\n font-weight: bold;\n}\n\n:host(:is(:state(selected),[state--selected])) {\n border: var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);\n padding: 0;\n}\n\n:host(:disabled) {\n --sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);\n --sbb-calendar-cell-cursor:
|
|
9
|
+
var calendar_cell_base_element_default = ":host {\n --sbb-focus-outline-offset: 0.125rem;\n --sbb-calendar-cell-transition-duration: var(\n --sbb-disable-animation-duration,\n var(--sbb-animation-duration-2x)\n );\n display: block;\n font-size: var(--sbb-calendar-cell-font-size);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n cursor: var(--sbb-calendar-cell-cursor);\n color: var(--sbb-calendar-cell-color);\n border-radius: calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));\n margin: var(--sbb-calendar-cell-margin);\n padding: var(--sbb-calendar-cell-border-width);\n background-clip: content-box;\n transition-duration: var(--sbb-calendar-cell-transition-duration);\n transition-timing-function: var(--sbb-calendar-cell-transition-easing-function);\n transition-property: background-color;\n}\n\n:host(:is(sbb-calendar-weekday, sbb-calendar-weeknumber)) {\n --sbb-calendar-cell-font-size: var(--sbb-text-font-size-xs);\n --sbb-calendar-day-height: var(--sbb-calendar-day-size);\n color: var(--sbb-calendar-header-color);\n}\n\n:host(:is(sbb-calendar-day, sbb-calendar-weekday, sbb-calendar-weeknumber)) {\n height: var(--sbb-calendar-day-height);\n width: var(--sbb-calendar-day-width);\n}\n\n:host(:is(:state(current),[state--current])) {\n font-weight: bold;\n}\n\n:host(:is(:state(selected),[state--selected])) {\n border: var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);\n padding: 0;\n}\n\n:host(:disabled) {\n --sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);\n --sbb-calendar-cell-cursor: default;\n}\n\n:host(:disabled:is(:state(crossed-out),[state--crossed-out])) {\n --sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-crossed-out-color);\n}\n\n:host(:focus-visible) {\n outline-offset: var(--sbb-focus-outline-offset);\n outline: var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);\n}\n\n@media (any-hover: hover) {\n :host(:not(:disabled, :where(:is(:state(active),[state--active]), :active)):hover) {\n background-color: var(--sbb-calendar-cell-background-color-hover);\n }\n}\n\n@media (any-hover: hover) and (forced-colors: active) {\n :host(:not(:disabled):hover) {\n outline-offset: var(--sbb-focus-outline-offset);\n outline: var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);\n --sbb-focus-outline-style: initial;\n }\n}\n\n:host(:not(:disabled):where(:is(:state(active),[state--active]), :active)) {\n background-color: var(--sbb-calendar-cell-background-color-active);\n}\n\n.sbb-action-base {\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n\n.sbb-calendar-year,\n.sbb-calendar-month {\n height: var(--sbb-calendar-cell-year-month-height);\n width: var(--sbb-calendar-cell-year-month-width);\n}\n\n:host(:is(:state(crossed-out),[state--crossed-out])) :is(.sbb-calendar-year, .sbb-calendar-month, .sbb-calendar-day__value)::after {\n position: absolute;\n top: 50%;\n left: 50%;\n translate: -50% -50%;\n content: \"\";\n height: var(--sbb-calendar-cell-disabled-height);\n width: var(--sbb-calendar-cell-disabled-width);\n background-color: var(--sbb-calendar-cell-disabled-crossed-out-color);\n rotate: -45deg;\n}\n";
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/elements/calendar/common/calendar-cell-base-element.ts
|
|
@@ -1339,7 +1339,7 @@ let SbbCalendarElement = (() => {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
_goToDifferentYear(years) {
|
|
1341
1341
|
this._chosenYear += years;
|
|
1342
|
-
this._activeDate = this._dateAdapter.createDate(this._chosenYear, this._dateAdapter.getMonth(this._activeDate),
|
|
1342
|
+
this._activeDate = this._dateAdapter.createDate(this._chosenYear, this._dateAdapter.getMonth(this._activeDate), 1);
|
|
1343
1343
|
this._init();
|
|
1344
1344
|
}
|
|
1345
1345
|
_goToDifferentYearRange(years) {
|
|
@@ -1806,7 +1806,7 @@ let SbbCalendarElement = (() => {
|
|
|
1806
1806
|
_onMonthSelection(month, year) {
|
|
1807
1807
|
this._chosenMonth = month;
|
|
1808
1808
|
this._calendarView = "day";
|
|
1809
|
-
this._init(this._dateAdapter.createDate(year, this._chosenMonth,
|
|
1809
|
+
this._init(this._dateAdapter.createDate(year, this._chosenMonth, 1));
|
|
1810
1810
|
this._emitMonthChange();
|
|
1811
1811
|
}
|
|
1812
1812
|
/** Render the view for the year selection. */
|
|
@@ -1850,7 +1850,7 @@ let SbbCalendarElement = (() => {
|
|
|
1850
1850
|
_onYearSelection(year) {
|
|
1851
1851
|
this._chosenYear = year;
|
|
1852
1852
|
this._calendarView = "month";
|
|
1853
|
-
this._assignActiveDate(this._dateAdapter.createDate(
|
|
1853
|
+
this._assignActiveDate(this._dateAdapter.createDate(year, this._dateAdapter.getMonth(this._activeDate), 1));
|
|
1854
1854
|
}
|
|
1855
1855
|
/** Creates the button arrow for all the views. */
|
|
1856
1856
|
_getArrow(direction, click, ariaLabel, disabled = false) {
|
package/development/chip.pure.js
CHANGED
|
@@ -320,6 +320,9 @@ let SbbChipGroupElement = (() => {
|
|
|
320
320
|
willUpdate(changedProperties) {
|
|
321
321
|
super.willUpdate(changedProperties);
|
|
322
322
|
if (changedProperties.has("disabled") || changedProperties.has("formDisabled") || changedProperties.has("negative")) this._proxyStateToChips();
|
|
323
|
+
if (changedProperties.has("disabled") && this._inputElement) {
|
|
324
|
+
if (this._inputElement.disabled !== this.disabled) this._inputElement.disabled = this.disabled;
|
|
325
|
+
}
|
|
323
326
|
}
|
|
324
327
|
/** @internal */
|
|
325
328
|
formResetCallback() {
|
|
@@ -482,7 +485,8 @@ let SbbChipGroupElement = (() => {
|
|
|
482
485
|
this.insertBefore(newChip, this._inputElement ?? this.querySelector("input"));
|
|
483
486
|
}
|
|
484
487
|
_reactToInputChanges() {
|
|
485
|
-
|
|
488
|
+
const inputDisabled = this._inputElement?.disabled ?? false;
|
|
489
|
+
if (this.disabled !== inputDisabled) this.disabled = inputDisabled;
|
|
486
490
|
this._proxyStateToChips();
|
|
487
491
|
}
|
|
488
492
|
_proxyStateToChips() {
|
package/development/core.js
CHANGED
|
@@ -3899,7 +3899,10 @@ var DateAdapter = class {
|
|
|
3899
3899
|
} catch {}
|
|
3900
3900
|
if (this.isValid(date)) return date;
|
|
3901
3901
|
const match = value.replace(/\D/g, " ").trim()?.match(FORMAT_DATE);
|
|
3902
|
-
|
|
3902
|
+
try {
|
|
3903
|
+
date = match ? this.createDate(+match[3], +match[2], +match[1]) : null;
|
|
3904
|
+
} catch {}
|
|
3905
|
+
if (!match || match.index !== 0 || match.length <= 2 || match.some((e) => e === void 0) || !this.isValid(date)) return null;
|
|
3903
3906
|
let year = +match[3];
|
|
3904
3907
|
if (typeof year === "number" && year < 100 && year >= 0) {
|
|
3905
3908
|
const shift = this.getYear(this.today()) - 2e3 + this._cutoffYearOffset;
|
package/lean-off-brand-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/lean-safety-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/lean-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/off-brand-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbb-esta/lyne-elements-dev",
|
|
3
|
-
"version": "5.4.1-dev.
|
|
3
|
+
"version": "5.4.1-dev.1785915890",
|
|
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/
|
|
9
|
+
"https://github.com/sbb-design-systems/lyne-components/commit/25dc6b15a63e6784527589a79cbf6a8c7c24c40c"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
package/safety-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
package/standard-theme.css
CHANGED
|
@@ -1190,8 +1190,16 @@ summary {
|
|
|
1190
1190
|
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
1191
1191
|
--sbb-calendar-cell-disabled-height: 0.09375rem;
|
|
1192
1192
|
--sbb-calendar-cell-disabled-width: 1.59375rem;
|
|
1193
|
-
--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);
|
|
1194
|
-
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1193
|
+
--sbb-calendar-cell-disabled-crossed-out-color: var(--sbb-color-granite);
|
|
1194
|
+
--sbb-calendar-cell-disabled-crossed-out-color: light-dark(
|
|
1195
|
+
var(--sbb-color-granite),
|
|
1196
|
+
var(--sbb-color-smoke)
|
|
1197
|
+
);
|
|
1198
|
+
--sbb-calendar-cell-disabled-color: var(--sbb-color-graphite);
|
|
1199
|
+
--sbb-calendar-cell-disabled-color: light-dark(
|
|
1200
|
+
var(--sbb-color-graphite),
|
|
1201
|
+
var(--sbb-color-anthracite)
|
|
1202
|
+
);
|
|
1195
1203
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
1196
1204
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
1197
1205
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|