@sbb-esta/lyne-elements-experimental 5.1.0 → 5.2.0
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/core.js +1 -1
- package/development/core.js +124 -124
- package/development/journey-summary.pure.js +307 -307
- package/development/pearl-chain-time.pure.js +303 -303
- package/development/pearl-chain-vertical-item.pure.js +8 -8
- package/development/pearl-chain.pure.js +9 -9
- package/development/seat-reservation.pure.js +27 -27
- package/development/timetable-row.pure.js +338 -338
- package/journey-summary.pure.js +19 -19
- package/package.json +3 -4
- package/pearl-chain-time.pure.js +13 -13
- package/pearl-chain-vertical-item.pure.js +8 -8
- package/pearl-chain.pure.js +1 -1
- package/seat-reservation.pure.js +27 -27
- package/timetable-row.pure.js +54 -54
package/journey-summary.pure.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,SbbLanguageController as r,defaultDateAdapter as i,forceType as a,i18nTripDuration as o,screenReaderOnlyStyles as s}from"@sbb-esta/lyne-elements/core.js";import{SbbDividerElement as c}from"@sbb-esta/lyne-elements/divider.pure.js";import{SbbJourneyHeaderElement as l}from"@sbb-esta/lyne-elements/journey-header.pure.js";import{html as u,nothing as d,unsafeCSS as ee}from"lit";import{property as f}from"lit/decorators.js";import{durationToTime as te,removeTimezoneFromISOTimeString as ne}from"./core.js";import{SbbPearlChainTimeElement as re}from"./pearl-chain-time.pure.js";const p=6048e5,m=Symbol.for(`constructDateFrom`);function h(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&m in e?e[m](t):e instanceof Date?new e.constructor(t):new Date(t)}function g(e,t){return h(t||e,e)}function _(e){let t=g(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function v(e,...t){let n=h.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function y(e,t){let n=g(e,t?.in);return n.setHours(0,0,0,0),n}function b(e,t,n){let[r,i]=v(n?.in,e,t),a=y(r),o=y(i),s=+a-_(a),c=+o-_(o);return Math.round((s-c)/864e5)}const x={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},S=(e,t,n)=>{let r,i=x[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function C(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const w={date:C({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:C({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:C({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},T={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},E=(e,t,n,r)=>T[e];function D(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const O={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:D({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:D({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:D({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:D({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:D({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function k(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?j(s,e=>e.test(o)):A(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function A(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function j(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function M(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const N={code:`en-US`,formatDistance:S,formatLong:w,formatRelative:E,localize:O,match:{ordinalNumber:M({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:k({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:k({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:k({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:k({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:k({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let P={};function F(){return P}function I(e,t){let n=g(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ie(e,t){let n=g(e,t?.in);return b(n,I(n))+1}function L(e,t){let n=F(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=g(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function R(e,t){return L(e,{...t,weekStartsOn:1})}function z(e,t){let n=g(e,t?.in),r=n.getFullYear(),i=h(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=R(i),o=h(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=R(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ae(e,t){let n=z(e,t),r=h(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),R(r)}function B(e,t){let n=g(e,t?.in),r=R(n)-+ae(n);return Math.round(r/p)+1}function V(e,t){let n=g(e,t?.in),r=n.getFullYear(),i=F(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=h(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=L(o,t),c=h(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=L(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function oe(e,t){let n=F(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=V(e,t),a=h(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),L(a,t)}function se(e,t){let n=g(e,t?.in),r=L(n,t)-+oe(n,t);return Math.round(r/p)+1}function H(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const U={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return H(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):H(n+1,2)},d(e,t){return H(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return H(e.getHours()%12||12,t.length)},H(e,t){return H(e.getHours(),t.length)},m(e,t){return H(e.getMinutes(),t.length)},s(e,t){return H(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return H(Math.trunc(r*10**(n-3)),t.length)}},W={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},G={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return U.y(e,t)},Y:function(e,t,n,r){let i=V(e,r),a=i>0?i:1-i;return t===`YY`?H(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):H(a,t.length)},R:function(e,t){return H(z(e),t.length)},u:function(e,t){return H(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return H(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return H(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return U.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return H(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=se(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):H(i,t.length)},I:function(e,t,n){let r=B(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):H(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):U.d(e,t)},D:function(e,t,n){let r=ie(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):H(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return H(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return H(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return H(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?W.noon:r===0?W.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?W.evening:r>=12?W.afternoon:r>=4?W.morning:W.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return U.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):U.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):H(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):H(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):U.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):U.s(e,t)},S:function(e,t){return U.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return q(r);case`XXXX`:case`XX`:return J(r);default:return J(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return q(r);case`xxxx`:case`xx`:return J(r);default:return J(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+K(r,`:`);default:return`GMT`+J(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+K(r,`:`);default:return`GMT`+J(r,`:`)}},t:function(e,t,n){return H(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return H(+e,t.length)}};function K(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+H(a,2)}function q(e,t){return e%60==0?(e>0?`-`:`+`)+H(Math.abs(e)/60,2):J(e,t)}function J(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=H(Math.trunc(r/60),2),a=H(r%60,2);return n+i+t+a}const Y=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},X=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},ce={p:X,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Y(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Y(r,t)).replace(`{{time}}`,X(i,t))}},le=/^D+$/,ue=/^Y+$/,de=[`D`,`DD`,`YY`,`YYYY`];function fe(e){return le.test(e)}function pe(e){return ue.test(e)}function me(e,t,n){let r=he(e,t,n);if(console.warn(r),de.includes(e))throw RangeError(r)}function he(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function ge(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Z(e){return!(!ge(e)&&typeof e!=`number`||isNaN(+g(e)))}const _e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Q=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ve=/^'([^]*?)'?$/,ye=/''/g,be=/[a-zA-Z]/;function $(e,t,n){let r=F(),i=n?.locale??r.locale??N,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=g(e,n?.in);if(!Z(s))throw RangeError(`Invalid time value`);let c=t.match(Q).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=ce[t];return n(e,i.formatLong)}return e}).join(``).match(_e).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:xe(e)};if(G[t])return{isToken:!0,value:e};if(t.match(be))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&pe(a)||!n?.useAdditionalDayOfYearTokens&&fe(a))&&me(a,t,String(e));let o=G[a[0]];return o(s,a,i.localize,l)}).join(``)}function xe(e){let t=e.match(ve);return t?t[1].replace(ye,`'`):e}var Se=`:host{display:block}.sbb-journey-summary{--sbb-text-font-size:var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-4);flex-direction:column;display:flex}.sbb-journey-summary__via-block{display:flex}.sbb-journey-summary__vias{white-space:nowrap;text-overflow:ellipsis;margin-block:0;padding-inline-start:var(--sbb-spacing-fixed-1x);overflow:hidden}.sbb-journey-summary__date{margin-block-end:var(--sbb-spacing-fixed-2x)}.sbb-journey-summary__via{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sbb-journey-summary__divider{margin-block:var(--sbb-spacing-fixed-6x)}ul li{list-style:none;display:inline}
|
|
2
|
-
`;let Ce=(()=>{let
|
|
1
|
+
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,SbbLanguageController as r,defaultDateAdapter as i,forceType as a,i18nTripDuration as o,screenReaderOnlyStyles as s}from"@sbb-esta/lyne-elements/core.js";import{SbbDividerElement as c}from"@sbb-esta/lyne-elements/divider.pure.js";import{SbbJourneyHeaderElement as l}from"@sbb-esta/lyne-elements/journey-header.pure.js";import{html as u,nothing as d,unsafeCSS as f}from"lit";import{property as p}from"lit/decorators.js";import{durationToTime as m,removeTimezoneFromISOTimeString as ee}from"./core.js";import{SbbPearlChainTimeElement as te}from"./pearl-chain-time.pure.js";const h=6048e5,g=Symbol.for(`constructDateFrom`);function _(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&g in e?e[g](t):e instanceof Date?new e.constructor(t):new Date(t)}function v(e,t){return _(t||e,e)}let y={};function b(){return y}function x(e,t){let n=b(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=v(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function S(e,t){return x(e,{...t,weekStartsOn:1})}function C(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=_(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=S(i),o=_(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=S(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function w(e){let t=v(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function T(e,...t){let n=_.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function E(e,t){let n=v(e,t?.in);return n.setHours(0,0,0,0),n}function D(e,t,n){let[r,i]=T(n?.in,e,t),a=E(r),o=E(i),s=+a-w(a),c=+o-w(o);return Math.round((s-c)/864e5)}function O(e,t){let n=C(e,t),r=_(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),S(r)}function k(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function A(e){return!(!k(e)&&typeof e!=`number`||isNaN(+v(e)))}function j(e,t){let n=v(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const M={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},N=(e,t,n)=>{let r,i=M[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function P(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const F={date:P({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:P({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},I={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},ne=(e,t,n,r)=>I[e];function L(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const R={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:L({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:L({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:L({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:L({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:L({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function z(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ie(s,e=>e.test(o)):re(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function re(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ie(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ae(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const oe={code:`en-US`,formatDistance:N,formatLong:F,formatRelative:ne,localize:R,match:{ordinalNumber:ae({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function B(e,t){let n=v(e,t?.in);return D(n,j(n))+1}function se(e,t){let n=v(e,t?.in),r=S(n)-+O(n);return Math.round(r/h)+1}function V(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=b(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=_(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=x(o,t),c=_(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=x(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function H(e,t){let n=b(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=V(e,t),a=_(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),x(a,t)}function U(e,t){let n=v(e,t?.in),r=x(n,t)-+H(n,t);return Math.round(r/h)+1}function W(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const G={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return W(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):W(n+1,2)},d(e,t){return W(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return W(e.getHours()%12||12,t.length)},H(e,t){return W(e.getHours(),t.length)},m(e,t){return W(e.getMinutes(),t.length)},s(e,t){return W(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return W(Math.trunc(r*10**(n-3)),t.length)}},K={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},q={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return G.y(e,t)},Y:function(e,t,n,r){let i=V(e,r),a=i>0?i:1-i;return t===`YY`?W(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):W(a,t.length)},R:function(e,t){return W(C(e),t.length)},u:function(e,t){return W(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return W(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return W(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return G.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return W(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=U(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):W(i,t.length)},I:function(e,t,n){let r=se(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):W(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):G.d(e,t)},D:function(e,t,n){let r=B(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):W(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return W(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return W(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return W(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?K.noon:r===0?K.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?K.evening:r>=12?K.afternoon:r>=4?K.morning:K.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return G.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):G.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):W(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):W(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):G.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):G.s(e,t)},S:function(e,t){return G.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Y(r);case`XXXX`:case`XX`:return X(r);default:return X(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Y(r);case`xxxx`:case`xx`:return X(r);default:return X(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+J(r,`:`);default:return`GMT`+X(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+J(r,`:`);default:return`GMT`+X(r,`:`)}},t:function(e,t,n){return W(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return W(+e,t.length)}};function J(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+W(a,2)}function Y(e,t){return e%60==0?(e>0?`-`:`+`)+W(Math.abs(e)/60,2):X(e,t)}function X(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=W(Math.trunc(r/60),2),a=W(r%60,2);return n+i+t+a}const Z=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Q=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},ce={p:Q,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Z(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Z(r,t)).replace(`{{time}}`,Q(i,t))}},le=/^D+$/,ue=/^Y+$/,de=[`D`,`DD`,`YY`,`YYYY`];function fe(e){return le.test(e)}function pe(e){return ue.test(e)}function me(e,t,n){let r=he(e,t,n);if(console.warn(r),de.includes(e))throw RangeError(r)}function he(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ve=/^'([^]*?)'?$/,ye=/''/g,be=/[a-zA-Z]/;function $(e,t,n){let r=b(),i=n?.locale??r.locale??oe,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=v(e,n?.in);if(!A(s))throw RangeError(`Invalid time value`);let c=t.match(_e).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=ce[t];return n(e,i.formatLong)}return e}).join(``).match(ge).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:xe(e)};if(q[t])return{isToken:!0,value:e};if(t.match(be))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&pe(a)||!n?.useAdditionalDayOfYearTokens&&fe(a))&&me(a,t,String(e));let o=q[a[0]];return o(s,a,i.localize,l)}).join(``)}function xe(e){let t=e.match(ve);return t?t[1].replace(ye,`'`):e}var Se=`:host{display:block}.sbb-journey-summary{--sbb-text-font-size:var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-4);flex-direction:column;display:flex}.sbb-journey-summary__via-block{display:flex}.sbb-journey-summary__vias{white-space:nowrap;text-overflow:ellipsis;margin-block:0;padding-inline-start:var(--sbb-spacing-fixed-1x);overflow:hidden}.sbb-journey-summary__date{margin-block-end:var(--sbb-spacing-fixed-2x)}.sbb-journey-summary__via{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sbb-journey-summary__divider{margin-block:var(--sbb-spacing-fixed-6x)}ul li{list-style:none;display:inline}
|
|
2
|
+
`;let Ce=(()=>{let h=n,g=[],_,v=[],y=[],b,x=[],S=[],C,w=[],T=[],E,D=[],O=[],k,j=[],M=[],N,P=[],F=[],I;return class extends h{constructor(){super(...arguments),this.#e=(t(this,g),t(this,v,null)),this.#t=(t(this,y),t(this,x,null)),this.#n=(t(this,S),t(this,w,!1)),this.#r=(t(this,T),t(this,D,`3`)),this.#i=(t(this,O),t(this,j,!1)),this.#a=(t(this,M),t(this,P,!1)),this._now=(t(this,F),null),this._hasContentSlot=!1,this._language=new r(this)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;_=[p({type:Object})],b=[p({attribute:`trip-back`,type:Object})],C=[a(),p({attribute:`round-trip`,type:Boolean})],E=[p({attribute:`header-level`})],k=[a(),p({attribute:`disable-animation`,type:Boolean})],N=[a(),p({attribute:`a11y-footpath`,type:Boolean})],I=[p()],e(this,null,_,{kind:`accessor`,name:`trip`,static:!1,private:!1,access:{has:e=>`trip`in e,get:e=>e.trip,set:(e,t)=>{e.trip=t}},metadata:t},v,y),e(this,null,b,{kind:`accessor`,name:`tripBack`,static:!1,private:!1,access:{has:e=>`tripBack`in e,get:e=>e.tripBack,set:(e,t)=>{e.tripBack=t}},metadata:t},x,S),e(this,null,C,{kind:`accessor`,name:`roundTrip`,static:!1,private:!1,access:{has:e=>`roundTrip`in e,get:e=>e.roundTrip,set:(e,t)=>{e.roundTrip=t}},metadata:t},w,T),e(this,null,E,{kind:`accessor`,name:`headerLevel`,static:!1,private:!1,access:{has:e=>`headerLevel`in e,get:e=>e.headerLevel,set:(e,t)=>{e.headerLevel=t}},metadata:t},D,O),e(this,null,k,{kind:`accessor`,name:`disableAnimation`,static:!1,private:!1,access:{has:e=>`disableAnimation`in e,get:e=>e.disableAnimation,set:(e,t)=>{e.disableAnimation=t}},metadata:t},j,M),e(this,null,N,{kind:`accessor`,name:`a11yFootpath`,static:!1,private:!1,access:{has:e=>`a11yFootpath`in e,get:e=>e.a11yFootpath,set:(e,t)=>{e.a11yFootpath=t}},metadata:t},P,F),e(this,null,I,{kind:`setter`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,set:(e,t)=>{e.now=t}},metadata:t},null,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-journey-summary`}static{this.elementDependencies=[c,l,te]}static{this.styles=[s,f(Se)]}#e;get trip(){return this.#e}set trip(e){this.#e=e}#t;get tripBack(){return this.#t}set tripBack(e){this.#t=e}#n;get roundTrip(){return this.#n}set roundTrip(e){this.#n=e}#r;get headerLevel(){return this.#r}set headerLevel(e){this.#r=e}#i;get disableAnimation(){return this.#i}set disableAnimation(e){this.#i=e}#a;get a11yFootpath(){return this.#a}set a11yFootpath(e){this.#a=e}set now(e){this._now=i.getValidDateOrNull(i.deserialize(e))}get now(){return this._now??new Date}connectedCallback(){super.connectedCallback(),this._hasContentSlot=!!this.querySelector?.(`[slot="content"]`)}_renderJourneyStart(e,t){let n=i,r=t?m(t,this._language.current):null;if(A(e))return u`
|
|
3
3
|
<time datetime=${$(e,`d`)+` `+$(e,`M`)}>
|
|
4
4
|
${n.format(e).replace(`,`,`.`)}</time
|
|
5
5
|
>${t&&t>0?u`,<time>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
<span class="sbb-screen-reader-only">
|
|
7
|
+
${o[this._language.current]} ${r.long}
|
|
8
|
+
</span>
|
|
9
|
+
<span aria-hidden="true">${r.short}</span>
|
|
10
|
+
</time>`:d}
|
|
11
11
|
`}_renderJourneyVias(e){let t=e.slice(0,5);return u`
|
|
12
12
|
<div class="sbb-journey-summary__via-block">
|
|
13
13
|
<span class="sbb-journey-summary__via-text">Via</span>
|
|
@@ -21,7 +21,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as
|
|
|
21
21
|
<div>
|
|
22
22
|
${t&&t.length>0?this._renderJourneyVias(t):d}
|
|
23
23
|
<div class="sbb-journey-summary__date">
|
|
24
|
-
${this._renderJourneyStart(
|
|
24
|
+
${this._renderJourneyStart(ee(i),n)}
|
|
25
25
|
</div>
|
|
26
26
|
<sbb-pearl-chain-time
|
|
27
27
|
.arrivalTime=${o}
|
|
@@ -37,19 +37,19 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as
|
|
|
37
37
|
`}render(){let{origin:e,destination:t}=this.trip||{};return u`
|
|
38
38
|
<div class="sbb-journey-summary">
|
|
39
39
|
${e?u`<sbb-journey-header
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
visual-level="4"
|
|
41
|
+
.level=${this.headerLevel||d}
|
|
42
|
+
.origin=${e}
|
|
43
|
+
.destination=${t}
|
|
44
|
+
.roundTrip=${this.roundTrip??d}
|
|
45
|
+
></sbb-journey-header>`:d}
|
|
46
46
|
${this._renderJourneyInformation(this.trip)}
|
|
47
47
|
${this.tripBack?u`<div>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
<sbb-divider class="sbb-journey-summary__divider"></sbb-divider>
|
|
49
|
+
${this._renderJourneyInformation(this.tripBack)}
|
|
50
|
+
</div>`:d}
|
|
51
51
|
${this._hasContentSlot?u` <div class="sbb-journey-summary__slot">
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
<slot name="content"></slot>
|
|
53
|
+
</div>`:d}
|
|
54
54
|
</div>
|
|
55
55
|
`}}})();export{Ce as SbbJourneySummaryElement};
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbb-esta/lyne-elements-experimental",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Lyne Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design system",
|
|
7
7
|
"web components",
|
|
8
|
-
"lit"
|
|
9
|
-
"storybook"
|
|
8
|
+
"lit"
|
|
10
9
|
],
|
|
11
10
|
"type": "module",
|
|
12
11
|
"exports": {
|
|
@@ -143,7 +142,7 @@
|
|
|
143
142
|
},
|
|
144
143
|
"customElements": "custom-elements.json",
|
|
145
144
|
"peerDependencies": {
|
|
146
|
-
"@sbb-esta/lyne-elements": "5.
|
|
145
|
+
"@sbb-esta/lyne-elements": "5.2.0"
|
|
147
146
|
},
|
|
148
147
|
"dependencies": {
|
|
149
148
|
"lit": "^3.3.3",
|
package/pearl-chain-time.pure.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,SbbLanguageController as r,defaultDateAdapter as i,forceType as a,i18nArrival as o,i18nDeparture as s,i18nTransferProcedures as c,screenReaderOnlyStyles as l}from"@sbb-esta/lyne-elements/core.js";import{SbbIconElement as u}from"@sbb-esta/lyne-elements/icon.pure.js";import{html as d,nothing as f,unsafeCSS as ee}from"lit";import{property as p}from"lit/decorators.js";import{getDepartureArrivalTimeAttribute as te,isRideLeg as ne,removeTimezoneFromISOTimeString as m}from"./core.js";import{SbbPearlChainElement as re}from"./pearl-chain.pure.js";const h=6048e5,g=Symbol.for(`constructDateFrom`);function _(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&g in e?e[g](t):e instanceof Date?new e.constructor(t):new Date(t)}function v(e,t){return _(t||e,e)}function y(e){let t=v(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function b(e,...t){let n=_.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function x(e,t){let n=v(e,t?.in);return n.setHours(0,0,0,0),n}function S(e,t,n){let[r,i]=b(n?.in,e,t),a=x(r),o=x(i),s=+a-y(a),c=+o-y(o);return Math.round((s-c)/864e5)}const C={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},w=(e,t,n)=>{let r,i=C[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function T(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const E={date:T({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:T({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:T({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},D={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},O=(e,t,n,r)=>D[e];function k(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const A={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:k({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:k({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:k({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:k({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:k({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function j(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?N(s,e=>e.test(o)):M(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function M(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function N(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function P(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const F={code:`en-US`,formatDistance:w,formatLong:E,formatRelative:O,localize:A,match:{ordinalNumber:P({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:j({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:j({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:j({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:j({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:j({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let I={};function L(){return I}function R(e,t){let n=v(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ie(e,t){let n=v(e,t?.in);return S(n,R(n))+1}function z(e,t){let n=L(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=v(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function B(e,t){return z(e,{...t,weekStartsOn:1})}function V(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=_(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=B(i),o=_(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=B(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ae(e,t){let n=V(e,t),r=_(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),B(r)}function oe(e,t){let n=v(e,t?.in),r=B(n)-+ae(n);return Math.round(r/h)+1}function H(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=L(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=_(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=z(o,t),c=_(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=z(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function se(e,t){let n=L(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=H(e,t),a=_(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),z(a,t)}function ce(e,t){let n=v(e,t?.in),r=z(n,t)-+se(n,t);return Math.round(r/h)+1}function U(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const W={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return U(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):U(n+1,2)},d(e,t){return U(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return U(e.getHours()%12||12,t.length)},H(e,t){return U(e.getHours(),t.length)},m(e,t){return U(e.getMinutes(),t.length)},s(e,t){return U(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return U(Math.trunc(r*10**(n-3)),t.length)}},G={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},K={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return W.y(e,t)},Y:function(e,t,n,r){let i=H(e,r),a=i>0?i:1-i;return t===`YY`?U(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):U(a,t.length)},R:function(e,t){return U(V(e),t.length)},u:function(e,t){return U(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return U(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return U(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return W.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return U(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ce(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):U(i,t.length)},I:function(e,t,n){let r=oe(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):U(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):W.d(e,t)},D:function(e,t,n){let r=ie(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):U(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return U(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return U(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return U(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?G.noon:r===0?G.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?G.evening:r>=12?G.afternoon:r>=4?G.morning:G.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return W.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):W.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):U(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):U(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):W.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):W.s(e,t)},S:function(e,t){return W.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return J(r);case`XXXX`:case`XX`:return Y(r);default:return Y(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return J(r);case`xxxx`:case`xx`:return Y(r);default:return Y(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+q(r,`:`);default:return`GMT`+Y(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+q(r,`:`);default:return`GMT`+Y(r,`:`)}},t:function(e,t,n){return U(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return U(+e,t.length)}};function q(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+U(a,2)}function J(e,t){return e%60==0?(e>0?`-`:`+`)+U(Math.abs(e)/60,2):Y(e,t)}function Y(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=U(Math.trunc(r/60),2),a=U(r%60,2);return n+i+t+a}const X=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Z=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},le={p:Z,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return X(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,X(r,t)).replace(`{{time}}`,Z(i,t))}},ue=/^D+$/,de=/^Y+$/,fe=[`D`,`DD`,`YY`,`YYYY`];function pe(e){return ue.test(e)}function me(e){return de.test(e)}function he(e,t,n){let r=ge(e,t,n);if(console.warn(r),fe.includes(e))throw RangeError(r)}function ge(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function _e(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function ve(e){return!(!_e(e)&&typeof e!=`number`||isNaN(+v(e)))}const Q=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ye=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,be=/^'([^]*?)'?$/,xe=/''/g,Se=/[a-zA-Z]/;function $(e,t,n){let r=L(),i=n?.locale??r.locale??F,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=v(e,n?.in);if(!ve(s))throw RangeError(`Invalid time value`);let c=t.match(ye).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=le[t];return n(e,i.formatLong)}return e}).join(``).match(Q).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Ce(e)};if(K[t])return{isToken:!0,value:e};if(t.match(Se))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&me(a)||!n?.useAdditionalDayOfYearTokens&&pe(a))&&he(a,t,String(e));let o=K[a[0]];return o(s,a,i.localize,l)}).join(``)}function Ce(e){let t=e.match(be);return t?t[1].replace(xe,`'`):e}var we=`:host{--sbb-pearl-chain-time-height:auto;display:block}@media (width>=37.5rem){:host{--sbb-pearl-chain-time-height:1.5625rem}}@media (width>=64rem){:host{--sbb-pearl-chain-time-height:1.75rem}}.sbb-pearl-chain__time{height:var(--sbb-pearl-chain-time-height);flex-wrap:wrap;justify-content:space-between;align-items:center;display:flex}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size:var(--sbb-text-font-size-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);align-items:center;display:inline-flex}.sbb-pearl-chain__time-walktime--walk-small-left{margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem);transform:translate(-.4375rem)}.sbb-pearl-chain__time-walktime--walk-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-left{margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem);transform:translate(-.375rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime-prime-symbol{float:right}.sbb-pearl-chain__time-transfer{gap:var(--sbb-spacing-fixed-1x)}.sbb-pearl-chain__time-transfer--sa-ci-departure{margin-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-pearl-chain__time-transfer--sa-ci-arrival{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-chain{margin-inline:var(--sbb-spacing-fixed-3x);flex:auto;align-self:center}.sbb-pearl-chain__time-time{--sbb-text-font-size:var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-2);font-weight:700}
|
|
1
|
+
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,SbbLanguageController as r,defaultDateAdapter as i,forceType as a,i18nArrival as o,i18nDeparture as s,i18nTransferProcedures as c,screenReaderOnlyStyles as l}from"@sbb-esta/lyne-elements/core.js";import{SbbIconElement as u}from"@sbb-esta/lyne-elements/icon.pure.js";import{html as d,nothing as f,unsafeCSS as ee}from"lit";import{property as p}from"lit/decorators.js";import{getDepartureArrivalTimeAttribute as te,isRideLeg as ne,removeTimezoneFromISOTimeString as m}from"./core.js";import{SbbPearlChainElement as re}from"./pearl-chain.pure.js";const h=6048e5,g=Symbol.for(`constructDateFrom`);function _(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&g in e?e[g](t):e instanceof Date?new e.constructor(t):new Date(t)}function v(e,t){return _(t||e,e)}let y={};function b(){return y}function x(e,t){let n=b(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=v(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function S(e,t){return x(e,{...t,weekStartsOn:1})}function C(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=_(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=S(i),o=_(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=S(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function w(e){let t=v(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function T(e,...t){let n=_.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function E(e,t){let n=v(e,t?.in);return n.setHours(0,0,0,0),n}function D(e,t,n){let[r,i]=T(n?.in,e,t),a=E(r),o=E(i),s=+a-w(a),c=+o-w(o);return Math.round((s-c)/864e5)}function O(e,t){let n=C(e,t),r=_(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),S(r)}function k(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function A(e){return!(!k(e)&&typeof e!=`number`||isNaN(+v(e)))}function j(e,t){let n=v(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const M={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},N=(e,t,n)=>{let r,i=M[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function P(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const F={date:P({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:P({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},I={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},L=(e,t,n,r)=>I[e];function R(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const ie={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:R({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:R({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:R({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:R({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:R({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function z(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?oe(s,e=>e.test(o)):ae(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function ae(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function oe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function se(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const ce={code:`en-US`,formatDistance:N,formatLong:F,formatRelative:L,localize:ie,match:{ordinalNumber:se({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function le(e,t){let n=v(e,t?.in);return D(n,j(n))+1}function ue(e,t){let n=v(e,t?.in),r=S(n)-+O(n);return Math.round(r/h)+1}function B(e,t){let n=v(e,t?.in),r=n.getFullYear(),i=b(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=_(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=x(o,t),c=_(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=x(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function V(e,t){let n=b(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=B(e,t),a=_(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),x(a,t)}function H(e,t){let n=v(e,t?.in),r=x(n,t)-+V(n,t);return Math.round(r/h)+1}function U(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const W={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return U(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):U(n+1,2)},d(e,t){return U(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return U(e.getHours()%12||12,t.length)},H(e,t){return U(e.getHours(),t.length)},m(e,t){return U(e.getMinutes(),t.length)},s(e,t){return U(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return U(Math.trunc(r*10**(n-3)),t.length)}},G={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},K={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return W.y(e,t)},Y:function(e,t,n,r){let i=B(e,r),a=i>0?i:1-i;return t===`YY`?U(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):U(a,t.length)},R:function(e,t){return U(C(e),t.length)},u:function(e,t){return U(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return U(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return U(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return W.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return U(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=H(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):U(i,t.length)},I:function(e,t,n){let r=ue(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):U(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):W.d(e,t)},D:function(e,t,n){let r=le(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):U(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return U(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return U(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return U(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?G.noon:r===0?G.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?G.evening:r>=12?G.afternoon:r>=4?G.morning:G.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return W.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):W.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):U(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):U(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):W.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):W.s(e,t)},S:function(e,t){return W.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return J(r);case`XXXX`:case`XX`:return Y(r);default:return Y(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return J(r);case`xxxx`:case`xx`:return Y(r);default:return Y(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+q(r,`:`);default:return`GMT`+Y(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+q(r,`:`);default:return`GMT`+Y(r,`:`)}},t:function(e,t,n){return U(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return U(+e,t.length)}};function q(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+U(a,2)}function J(e,t){return e%60==0?(e>0?`-`:`+`)+U(Math.abs(e)/60,2):Y(e,t)}function Y(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=U(Math.trunc(r/60),2),a=U(r%60,2);return n+i+t+a}const X=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Z=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},de={p:Z,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return X(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,X(r,t)).replace(`{{time}}`,Z(i,t))}},fe=/^D+$/,pe=/^Y+$/,me=[`D`,`DD`,`YY`,`YYYY`];function he(e){return fe.test(e)}function ge(e){return pe.test(e)}function _e(e,t,n){let r=ve(e,t,n);if(console.warn(r),me.includes(e))throw RangeError(r)}function ve(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ye=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Q=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,be=/^'([^]*?)'?$/,xe=/''/g,Se=/[a-zA-Z]/;function $(e,t,n){let r=b(),i=n?.locale??r.locale??ce,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=v(e,n?.in);if(!A(s))throw RangeError(`Invalid time value`);let c=t.match(Q).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=de[t];return n(e,i.formatLong)}return e}).join(``).match(ye).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Ce(e)};if(K[t])return{isToken:!0,value:e};if(t.match(Se))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&ge(a)||!n?.useAdditionalDayOfYearTokens&&he(a))&&_e(a,t,String(e));let o=K[a[0]];return o(s,a,i.localize,l)}).join(``)}function Ce(e){let t=e.match(be);return t?t[1].replace(xe,`'`):e}var we=`:host{--sbb-pearl-chain-time-height:auto;display:block}@media (width>=37.5rem){:host{--sbb-pearl-chain-time-height:1.5625rem}}@media (width>=64rem){:host{--sbb-pearl-chain-time-height:1.75rem}}.sbb-pearl-chain__time{height:var(--sbb-pearl-chain-time-height);flex-wrap:wrap;justify-content:space-between;align-items:center;display:flex}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size:var(--sbb-text-font-size-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);align-items:center;display:inline-flex}.sbb-pearl-chain__time-walktime--walk-small-left{margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem);transform:translate(-.4375rem)}.sbb-pearl-chain__time-walktime--walk-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-left{margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem);transform:translate(-.375rem)}.sbb-pearl-chain__time-walktime--wheelchair-small-right{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-walktime-prime-symbol{float:right}.sbb-pearl-chain__time-transfer{gap:var(--sbb-spacing-fixed-1x)}.sbb-pearl-chain__time-transfer--sa-ci-departure{margin-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-pearl-chain__time-transfer--sa-ci-arrival{margin-inline-start:calc(var(--sbb-spacing-fixed-2x) - .25rem)}.sbb-pearl-chain__time-chain{margin-inline:var(--sbb-spacing-fixed-3x);flex:auto;align-self:center}.sbb-pearl-chain__time-time{--sbb-text-font-size:var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-2);font-weight:700}
|
|
2
2
|
`;let Te=(()=>{let h=n,g=[],_,v=[],y=[],b,x=[],S=[],C,w=[],T=[],E,D=[],O=[],k,A=[],j=[],M,N=[],P=[],F,I=[],L=[],R;return class extends h{constructor(){super(...arguments),this.#e=(t(this,g),t(this,v,[])),this.#t=(t(this,y),t(this,x,``)),this.#n=(t(this,S),t(this,w,``)),this.#r=(t(this,T),t(this,D,NaN)),this.#i=(t(this,O),t(this,A,NaN)),this.#a=(t(this,j),t(this,N,!1)),this.#o=(t(this,P),t(this,I,!1)),this._now=(t(this,L),null),this._language=new r(this)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;_=[p({type:Array})],b=[a(),p({attribute:`departure-time`})],C=[a(),p({attribute:`arrival-time`})],E=[a(),p({attribute:`departure-walk`,type:Number})],k=[a(),p({attribute:`arrival-walk`,type:Number})],M=[a(),p({attribute:`disable-animation`,type:Boolean})],F=[a(),p({attribute:`a11y-footpath`,type:Boolean})],R=[p()],e(this,null,_,{kind:`accessor`,name:`legs`,static:!1,private:!1,access:{has:e=>`legs`in e,get:e=>e.legs,set:(e,t)=>{e.legs=t}},metadata:t},v,y),e(this,null,b,{kind:`accessor`,name:`departureTime`,static:!1,private:!1,access:{has:e=>`departureTime`in e,get:e=>e.departureTime,set:(e,t)=>{e.departureTime=t}},metadata:t},x,S),e(this,null,C,{kind:`accessor`,name:`arrivalTime`,static:!1,private:!1,access:{has:e=>`arrivalTime`in e,get:e=>e.arrivalTime,set:(e,t)=>{e.arrivalTime=t}},metadata:t},w,T),e(this,null,E,{kind:`accessor`,name:`departureWalk`,static:!1,private:!1,access:{has:e=>`departureWalk`in e,get:e=>e.departureWalk,set:(e,t)=>{e.departureWalk=t}},metadata:t},D,O),e(this,null,k,{kind:`accessor`,name:`arrivalWalk`,static:!1,private:!1,access:{has:e=>`arrivalWalk`in e,get:e=>e.arrivalWalk,set:(e,t)=>{e.arrivalWalk=t}},metadata:t},A,j),e(this,null,M,{kind:`accessor`,name:`disableAnimation`,static:!1,private:!1,access:{has:e=>`disableAnimation`in e,get:e=>e.disableAnimation,set:(e,t)=>{e.disableAnimation=t}},metadata:t},N,P),e(this,null,F,{kind:`accessor`,name:`a11yFootpath`,static:!1,private:!1,access:{has:e=>`a11yFootpath`in e,get:e=>e.a11yFootpath,set:(e,t)=>{e.a11yFootpath=t}},metadata:t},I,L),e(this,null,R,{kind:`setter`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,set:(e,t)=>{e.now=t}},metadata:t},null,g),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-pearl-chain-time`}static{this.elementDependencies=[u,re]}static{this.styles=[l,ee(we)]}#e;get legs(){return this.#e}set legs(e){this.#e=e}#t;get departureTime(){return this.#t}set departureTime(e){this.#t=e}#n;get arrivalTime(){return this.#n}set arrivalTime(e){this.#n=e}#r;get departureWalk(){return this.#r}set departureWalk(e){this.#r=e}#i;get arrivalWalk(){return this.#i}set arrivalWalk(e){this.#i=e}#a;get disableAnimation(){return this.#a}set disableAnimation(e){this.#a=e}#o;get a11yFootpath(){return this.#o}set a11yFootpath(e){this.#o=e}set now(e){this._now=i.getValidDateOrNull(i.deserialize(e))}get now(){return this._now??new Date}render(){let e=this.departureTime?m(this.departureTime):void 0,t=this.arrivalTime?m(this.arrivalTime):void 0,{renderDepartureTimeAttribute:n,renderArrivalTimeAttribute:r}=te(this.legs,this.departureWalk||0,this.arrivalWalk||0,this._language.current,this.a11yFootpath),i=this.legs?.filter(e=>ne(e));return d`
|
|
3
3
|
<div class="sbb-pearl-chain__time">
|
|
4
4
|
${n()}
|
|
5
5
|
${e?d`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
<span class="sbb-screen-reader-only"
|
|
7
|
+
>${s[this._language.current]}: </span
|
|
8
|
+
>
|
|
9
|
+
${$(e,`HH:mm`)}
|
|
10
|
+
</time>`:f}
|
|
11
11
|
${i?.length>1?d`<span class="sbb-screen-reader-only" role="paragraph">
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
${i?.length-1} ${c[this._language.current]}
|
|
13
|
+
</span>`:f}
|
|
14
14
|
<sbb-pearl-chain
|
|
15
15
|
class="sbb-pearl-chain__time-chain"
|
|
16
16
|
.legs=${this.legs}
|
|
@@ -18,11 +18,11 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as
|
|
|
18
18
|
.now=${this.now}
|
|
19
19
|
></sbb-pearl-chain>
|
|
20
20
|
${t?d`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
<span class="sbb-screen-reader-only"
|
|
22
|
+
>${o[this._language.current]}: </span
|
|
23
|
+
>
|
|
24
|
+
${$(t,`HH:mm`)}
|
|
25
|
+
</time>`:f}
|
|
26
26
|
${r()}
|
|
27
27
|
</div>
|
|
28
28
|
`}}})();export{Te as SbbPearlChainTimeElement};
|
|
@@ -11,16 +11,16 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as
|
|
|
11
11
|
class="sbb-pearl-chain-vertical-item__column sbb-pearl-chain-vertical-item__column--middle"
|
|
12
12
|
>
|
|
13
13
|
${r?a:i`<div
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
style=${c({"--sbb-pearl-chain-vertical-item-leg-status":`${l}%`})}
|
|
15
|
+
class="sbb-pearl-chain-vertical-item__line sbb-pearl-chain-vertical-item__line--${t} sbb-pearl-chain-vertical-item__line--${n}"
|
|
16
|
+
></div>`}
|
|
17
17
|
${e?i`<div
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
class="sbb-pearl-chain-vertical-item__bullet sbb-pearl-chain-vertical-item__bullet--${s} ${u}"
|
|
19
|
+
></div>`:a}
|
|
20
20
|
${l&&l>0?i`<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
style=${c({"--sbb-pearl-chain-vertical-item-position":`${l}%`})}
|
|
22
|
+
class="sbb-pearl-chain-vertical-item__bullet--position"
|
|
23
|
+
></div>`:a}
|
|
24
24
|
</div>
|
|
25
25
|
<slot name="right"></slot>
|
|
26
26
|
`}constructor(){super(...arguments),t(this,g)}}})();export{u as SbbPearlChainVerticalItemElement};
|
package/pearl-chain.pure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,defaultDateAdapter as r,forceType as i,screenReaderOnlyStyles as a}from"@sbb-esta/lyne-elements/core.js";import{html as o,nothing as s,unsafeCSS as c}from"lit";import{property as l}from"lit/decorators.js";import{styleMap as u}from"lit/directives/style-map.js";import{isRideLeg as d,removeTimezoneFromISOTimeString as f}from"./core.js";const p=6e4,m=Symbol.for(`constructDateFrom`);function h(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&m in e?e[m](t):e instanceof Date?new e.constructor(t):new Date(t)}function g(e,t){return h(t||e,e)}function _(e,t,n){let r=g(e,n?.in);return r.setTime(r.getTime()+t*p),r}function v(e,t){return g(e)-+g(t)}function y(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function b(e,t,n){let r=v(e,t)/p;return y(n?.roundingMethod)(r)}function x(e,t){return+g(e)>+g(t)}function S(e,t){return+g(e)<+g(t)}var C=`:host{--sbb-pearl-chain-height:var(--sbb-border-width-2x);--sbb-pearl-chain-spacing-small:.125rem;--sbb-pearl-chain-color:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-color-disruption:var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-color-past:var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-leg-width:100%;--sbb-pearl-chain-position-color:var(--sbb-color-primary);--sbb-pearl-chain-bullet-size-start-end:.625rem;--sbb-pearl-chain-bullet-size-stop:.5rem;--sbb-pearl-chain-bullet-color:var(--sbb-background-color-3-inverted);--sbb-pearl-chain-bullet-color-past:light-dark(var(--sbb-color-metal),var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-irrelevant:light-dark(var(--sbb-color-metal),var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-disruption:var(--sbb-color-error);--sbb-pearl-chain-bullet-border-width:var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration:1.92s;--sbb-pearl-chain-bullet-animation-easing:ease-out;--sbb-pearl-chain-bullet-crossed-width:.88375rem;--sbb-pearl-chain-bullet-crossed-height:.21875rem;--sbb-pearl-chain-bullet-crossed-border-width:.09375rem;display:block}.sbb-pearl-chain{color:var(--sbb-pearl-chain-color);width:100%;padding-block:calc((var(--sbb-pearl-chain-bullet-size-start-end) - var(--sbb-pearl-chain-height)) / 2);flex-wrap:nowrap;justify-content:space-between;padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end);display:flex;position:relative}.sbb-pearl-chain__bullet{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__bullet{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__bullet{content:"";z-index:3;background-color:currentColor;position:absolute;inset-block-start:0}.sbb-pearl-chain__bullet:first-of-type{inset-inline-start:0}.sbb-pearl-chain__bullet:last-of-type{inset-inline-end:0}.sbb-pearl-chain__leg{height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;width:var(--sbb-pearl-chain-leg-width);background-color:currentColor;flex-grow:0;flex-shrink:0;align-items:center;display:flex;position:relative}@media (forced-colors:active){.sbb-pearl-chain__leg{background-color:canvastext}.sbb-pearl-chain--past .sbb-pearl-chain__leg{background-color:graytext}}.sbb-pearl-chain__leg:last-of-type{border:none}.sbb-pearl-chain__stop{z-index:2;background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%;position:relative}@media (forced-colors:active){.sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain__bullet--future{background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__bullet--future{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{color:var(--sbb-pearl-chain-color-past);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{--sbb-pearl-chain-bullet-color:GrayText!important;background-color:graytext!important}}.sbb-pearl-chain__bullet--progress{background:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__bullet--progress{--sbb-pearl-chain-bullet-color:GrayText!important}}.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:var(--sbb-pearl-chain-color-disruption);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors:active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{--sbb-pearl-chain-bullet-color:Highlight;color:highlight;background:highlight}}.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors:active){.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:Highlight}}.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:GrayText!important}}.sbb-pearl-chain__leg--cancelled-expected:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--cancelled-expected:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--disruption:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--disruption:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--skipped{color:var(--sbb-pearl-chain-color-disruption)}.sbb-pearl-chain__leg--skipped:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--skipped:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__stop--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width);position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)rotate(45deg)}@media (forced-colors:active){.sbb-pearl-chain__stop--departure-skipped:before{background:highlight}}.sbb-pearl-chain--arrival-skipped,.sbb-pearl-chain--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{content:"";border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width);position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)rotate(45deg)}@media (forced-colors:active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:highlight}}.sbb-pearl-chain__leg:after{content:"";border-radius:var(--sbb-pearl-chain-height);z-index:1;background-color:currentColor;position:absolute;inset-block:0;inset-inline-start:0}@media (forced-colors:active){.sbb-pearl-chain__leg:after{background-color:canvastext}.sbb-pearl-chain--past .sbb-pearl-chain__leg:after{background-color:graytext}}.sbb-pearl-chain__leg:last-of-type:after{inset-inline-end:calc(-1 * var(--sbb-pearl-chain-height))}.sbb-pearl-chain__leg--progress:after{background-color:var(--sbb-pearl-chain-color-past);width:var(--sbb-pearl-chain-leg-status)}.sbb-pearl-chain__position{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-position-color)}@media (forced-colors:active){.sbb-pearl-chain__position{--sbb-pearl-chain-position-color:Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}50%{box-shadow:0 0 0 .1875rem color-mix(in srgb, var(--sbb-pearl-chain-position-color) 20%, transparent)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}}.sbb-pearl-chain__position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite;z-index:4;position:absolute;inset-block-start:-200%;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}
|
|
1
|
+
import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbElement as n,defaultDateAdapter as r,forceType as i,screenReaderOnlyStyles as a}from"@sbb-esta/lyne-elements/core.js";import{html as o,nothing as s,unsafeCSS as c}from"lit";import{property as l}from"lit/decorators.js";import{styleMap as u}from"lit/directives/style-map.js";import{isRideLeg as d,removeTimezoneFromISOTimeString as f}from"./core.js";const p=6e4,m=Symbol.for(`constructDateFrom`);function h(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&m in e?e[m](t):e instanceof Date?new e.constructor(t):new Date(t)}function g(e,t){return h(t||e,e)}function _(e,t,n){let r=g(e,n?.in);return r.setTime(r.getTime()+t*p),r}function v(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function y(e,t){return g(e)-+g(t)}function b(e,t,n){let r=y(e,t)/p;return v(n?.roundingMethod)(r)}function x(e,t){return+g(e)>+g(t)}function S(e,t){return+g(e)<+g(t)}var C=`:host{--sbb-pearl-chain-height:var(--sbb-border-width-2x);--sbb-pearl-chain-spacing-small:.125rem;--sbb-pearl-chain-color:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-color-disruption:var(--sbb-pearl-chain-bullet-color-disruption);--sbb-pearl-chain-color-past:var(--sbb-pearl-chain-bullet-color-past);--sbb-pearl-chain-leg-width:100%;--sbb-pearl-chain-position-color:var(--sbb-color-primary);--sbb-pearl-chain-bullet-size-start-end:.625rem;--sbb-pearl-chain-bullet-size-stop:.5rem;--sbb-pearl-chain-bullet-color:var(--sbb-background-color-3-inverted);--sbb-pearl-chain-bullet-color-past:light-dark(var(--sbb-color-metal),var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-irrelevant:light-dark(var(--sbb-color-metal),var(--sbb-color-granite));--sbb-pearl-chain-bullet-color-disruption:var(--sbb-color-error);--sbb-pearl-chain-bullet-border-width:var(--sbb-border-width-2x);--sbb-pearl-chain-bullet-animation-duration:1.92s;--sbb-pearl-chain-bullet-animation-easing:ease-out;--sbb-pearl-chain-bullet-crossed-width:.88375rem;--sbb-pearl-chain-bullet-crossed-height:.21875rem;--sbb-pearl-chain-bullet-crossed-border-width:.09375rem;display:block}.sbb-pearl-chain{color:var(--sbb-pearl-chain-color);width:100%;padding-block:calc((var(--sbb-pearl-chain-bullet-size-start-end) - var(--sbb-pearl-chain-height)) / 2);flex-wrap:nowrap;justify-content:space-between;padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end);display:flex;position:relative}.sbb-pearl-chain__bullet{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__bullet{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__bullet{content:"";z-index:3;background-color:currentColor;position:absolute;inset-block-start:0}.sbb-pearl-chain__bullet:first-of-type{inset-inline-start:0}.sbb-pearl-chain__bullet:last-of-type{inset-inline-end:0}.sbb-pearl-chain__leg{height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;width:var(--sbb-pearl-chain-leg-width);background-color:currentColor;flex-grow:0;flex-shrink:0;align-items:center;display:flex;position:relative}@media (forced-colors:active){.sbb-pearl-chain__leg{background-color:canvastext}.sbb-pearl-chain--past .sbb-pearl-chain__leg{background-color:graytext}}.sbb-pearl-chain__leg:last-of-type{border:none}.sbb-pearl-chain__stop{z-index:2;background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%;position:relative}@media (forced-colors:active){.sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__stop{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain__bullet--future{background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__bullet--future{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{color:var(--sbb-pearl-chain-color-past);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__leg--past,.sbb-pearl-chain--past,.sbb-pearl-chain__leg--past:after,.sbb-pearl-chain__leg--progress:after,.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,.sbb-pearl-chain--progress,.sbb-pearl-chain__bullet--past{--sbb-pearl-chain-bullet-color:GrayText!important;background-color:graytext!important}}.sbb-pearl-chain__bullet--progress{background:var(--sbb-pearl-chain-bullet-color);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__bullet--progress{--sbb-pearl-chain-bullet-color:GrayText!important}}.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{color:var(--sbb-pearl-chain-color-disruption);--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors:active){.sbb-pearl-chain__bullet--departure-disruption,.sbb-pearl-chain--arrival-disruption,.sbb-pearl-chain--departure-disruption,.sbb-pearl-chain__leg--disruption{--sbb-pearl-chain-bullet-color:Highlight;color:highlight;background:highlight}}.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-disruption)}@media (forced-colors:active){.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:Highlight}}.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-bullet-color-past)}@media (forced-colors:active){.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop{--sbb-pearl-chain-bullet-color:GrayText!important}}.sbb-pearl-chain__leg--cancelled-expected:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--cancelled-expected:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--disruption:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--disruption:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__leg--skipped{color:var(--sbb-pearl-chain-color-disruption)}.sbb-pearl-chain__leg--skipped:after{background-color:unset;background-image:linear-gradient(90deg,currentColor 0% 50%,canvas 50%);background-repeat:repeat-x;background-size:calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);inset-inline-end:var(--sbb-pearl-chain-height)}@media (forced-colors:active){.sbb-pearl-chain__leg--skipped:after{background:unset;border-block-start:.0625rem dashed highlight;transform:translateY(.0625rem)}}.sbb-pearl-chain__stop--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-stop);min-width:var(--sbb-pearl-chain-bullet-size-stop);height:var(--sbb-pearl-chain-bullet-size-stop);width:var(--sbb-pearl-chain-bullet-size-stop);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width);position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)rotate(45deg)}@media (forced-colors:active){.sbb-pearl-chain__stop--departure-skipped:before{background:highlight}}.sbb-pearl-chain--arrival-skipped,.sbb-pearl-chain--departure-skipped{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);border:var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;background:canvas}.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{content:"";border-block-start:var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;background:var(--sbb-pearl-chain-bullet-color-disruption);height:var(--sbb-pearl-chain-bullet-crossed-height);width:var(--sbb-pearl-chain-bullet-crossed-width);position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)rotate(45deg)}@media (forced-colors:active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:highlight}}.sbb-pearl-chain__leg:after{content:"";border-radius:var(--sbb-pearl-chain-height);z-index:1;background-color:currentColor;position:absolute;inset-block:0;inset-inline-start:0}@media (forced-colors:active){.sbb-pearl-chain__leg:after{background-color:canvastext}.sbb-pearl-chain--past .sbb-pearl-chain__leg:after{background-color:graytext}}.sbb-pearl-chain__leg:last-of-type:after{inset-inline-end:calc(-1 * var(--sbb-pearl-chain-height))}.sbb-pearl-chain__leg--progress:after{background-color:var(--sbb-pearl-chain-color-past);width:var(--sbb-pearl-chain-leg-status)}.sbb-pearl-chain__position{min-height:var(--sbb-pearl-chain-bullet-size-start-end);min-width:var(--sbb-pearl-chain-bullet-size-start-end);height:var(--sbb-pearl-chain-bullet-size-start-end);width:var(--sbb-pearl-chain-bullet-size-start-end);background:var(--sbb-pearl-chain-bullet-color);color:var(--sbb-pearl-chain-bullet-color);border-color:var(--sbb-pearl-chain-bullet-color);border-radius:100%}@media (forced-colors:active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color:CanvasText}}.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color:var(--sbb-pearl-chain-position-color)}@media (forced-colors:active){.sbb-pearl-chain__position{--sbb-pearl-chain-position-color:Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}50%{box-shadow:0 0 0 .1875rem color-mix(in srgb, var(--sbb-pearl-chain-position-color) 20%, transparent)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-position-color)}}.sbb-pearl-chain__position{animation:pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite;z-index:4;position:absolute;inset-block-start:-200%;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}
|
|
2
2
|
`;let w=(()=>{let p=n,m=[],h,g=[],v=[],y,w=[],T=[],E;return class extends p{constructor(){super(...arguments),this.#e=(t(this,m),t(this,g,[])),this.#t=(t(this,v),t(this,w,!1)),this._now=(t(this,T),null)}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;h=[l({type:Array})],y=[i(),l({attribute:`disable-animation`,type:Boolean})],E=[l()],e(this,null,h,{kind:`accessor`,name:`legs`,static:!1,private:!1,access:{has:e=>`legs`in e,get:e=>e.legs,set:(e,t)=>{e.legs=t}},metadata:t},g,v),e(this,null,y,{kind:`accessor`,name:`disableAnimation`,static:!1,private:!1,access:{has:e=>`disableAnimation`in e,get:e=>e.disableAnimation,set:(e,t)=>{e.disableAnimation=t}},metadata:t},w,T),e(this,null,E,{kind:`setter`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,set:(e,t)=>{e.now=t}},metadata:t},null,m),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-pearl-chain`}static{this.styles=[a,c(C)]}#e;get legs(){return this.#e}set legs(e){this.#e=e}#t;get disableAnimation(){return this.#t}set disableAnimation(e){this.#t=e}set now(e){this._now=r.getValidDateOrNull(r.deserialize(e))}get now(){return this._now}_getAllDuration(e){return e?.reduce((e,t)=>{let n=f(t.arrival?.time),r=f(t.departure?.time);return n&&r?e+b(f(t.arrival.time),f(t.departure.time)):e},0)}_isAllCancelled(e){return e?.every(e=>e?.serviceJourney?.serviceAlteration?.cancelled)}_getRelativeDuration(e,t){let n=f(t.arrival?.time),r=f(t.departure?.time);if(n&&r){let n=b(f(t.arrival.time),f(t.departure.time)),r=this._getAllDuration(e);return r===0?100:n/r*100}return 0}_getProgress(e,t,n){if(!t?.time||!n?.time)return 0;let r=_(t.time,t.delay??0),i=b(_(n.time,n.delay??0),r),a=b(e,r);return i&&a/i*100}_getStatus(e,t,n){let r=t&&t.time&&_(t.time,t.delay??0),i=n&&n.time&&_(n.time,n.delay??0);return r&&S(r,e)&&i&&x(i,e)?`progress`:i&&S(i,e)?`past`:`future`}_renderPosition(e,t,n){let r=this._getProgress(e,t,n);if(r<0&&r>100)return;let i=()=>({"--sbb-pearl-chain-status-position":`${r}%`,...r>=50?{transform:`translateX(-100%)`}:{}}),a=this.disableAnimation?`sbb-pearl-chain__position--no-animation`:``;return o`<span
|
|
3
3
|
style=${u(i())}
|
|
4
4
|
class="sbb-pearl-chain__position ${a}"
|
package/seat-reservation.pure.js
CHANGED
|
@@ -221,10 +221,10 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbButtonBase
|
|
|
221
221
|
class="${y({"sbb-sr-icon":!!e.svgName,"sbb-sr-graphic":!!e.svg})}"
|
|
222
222
|
>
|
|
223
223
|
${e.svgName?d` <sbb-icon
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
name="${e.svgName||``}"
|
|
225
|
+
aria-hidden="false"
|
|
226
|
+
aria-label="${I(e.svgName,this._language.current)}"
|
|
227
|
+
></sbb-icon>`:d`${this._getSvgElement(e.svg)}`}
|
|
228
228
|
</span>`}_getSvgElement(e){if(!f){let t=new DOMParser,n=e||`<svg></svg>`,r=t.parseFromString(n,`image/svg+xml`).firstElementChild;return this.stretch&&r?.nodeName.toLowerCase()===`svg`&&r.setAttribute(`preserveAspectRatio`,`none`),r}return null}}})();var V=`.sbb-sr-navigation__signs{justify-content:center;gap:var(--sbb-spacing-fixed-2x);color:light-dark(var(--sbb-color-granite),var(--sbb-color-graphite));flex-direction:row;line-height:normal;display:flex;overflow:hidden}.sbb-sr-navigation__signs:has(:nth-child(n+3 of .auto-width)):has([name^=SILENCE],[name^=BUSINESS]){gap:calc(6 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}.sbb-sr-navigation__signs:has(:nth-child(n+3 of .auto-width)):has([name^=SILENCE],[name^=BUSINESS]):has([name^=BICYCLE]){gap:calc(3 * var(--sbb-seat-reservation-one-px-rem,.0625rem))}:host([vertical]) .sbb-sr-navigation__signs{flex-direction:column;height:100%}
|
|
229
229
|
`;let H=(()=>{let n=r,a,s=[],c=[],u,f=[],h=[],_,v=[],y=[];return class extends n{constructor(){super(...arguments),this.#e=t(this,s,[]),this.#t=(t(this,c),t(this,f,!1)),this.#n=(t(this,h),t(this,v,!1)),this._language=(t(this,y),new i(this))}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;a=[g({attribute:`property-ids`,type:Array})],u=[o(),g({type:Boolean,reflect:!0,useDefault:!0})],_=[o(),g({type:Boolean})],e(this,null,a,{kind:`accessor`,name:`propertyIds`,static:!1,private:!1,access:{has:e=>`propertyIds`in e,get:e=>e.propertyIds,set:(e,t)=>{e.propertyIds=t}},metadata:t},s,c),e(this,null,u,{kind:`accessor`,name:`vertical`,static:!1,private:!1,access:{has:e=>`vertical`in e,get:e=>e.vertical,set:(e,t)=>{e.vertical=t}},metadata:t},f,h),e(this,null,_,{kind:`accessor`,name:`showTitleInfo`,static:!1,private:!1,access:{has:e=>`showTitleInfo`in e,get:e=>e.showTitleInfo,set:(e,t)=>{e.showTitleInfo=t}},metadata:t},v,y),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-seat-reservation-navigation-services`}static{this.elementDependencies=[B]}static{this.styles=[l,m(V)]}#e;get propertyIds(){return this.#e}set propertyIds(e){this.#e=e}#t;get vertical(){return this.#t}set vertical(e){this.#t=e}#n;get showTitleInfo(){return this.#n}set showTitleInfo(e){this.#n=e}render(){let e=this.propertyIds?.length?this._getServiceLabelDescription():null;return d` <div class="sbb-sr-navigation__signs">
|
|
230
230
|
<span
|
|
@@ -247,10 +247,10 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbButtonBase
|
|
|
247
247
|
>
|
|
248
248
|
${this._getNavigationButton()}
|
|
249
249
|
${this.coachItemDetails.propertyIds?.length?d`<sbb-seat-reservation-navigation-services
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
?vertical="${this.vertical}"
|
|
251
|
+
.propertyIds="${this.coachItemDetails.propertyIds}"
|
|
252
|
+
?showTitleInfo="${this.showTitleInfo}"
|
|
253
|
+
></sbb-seat-reservation-navigation-services>`:p}
|
|
254
254
|
</div>
|
|
255
255
|
`}_getNavigationButton(){let e=this._getCoachServiceClassNumber(),t=this._getTitleDescriptionNavCoachButton(e),n=this._getAriaDescriptionCoachServices();return d` <button
|
|
256
256
|
@click=${()=>this._selectNavCoach(this.index)}
|
|
@@ -268,17 +268,17 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbButtonBase
|
|
|
268
268
|
</button>`}_getBtnInformation(e){return this.coachItemDetails.isDriverArea?null:d`
|
|
269
269
|
${e===1?d`<span class="sbb-sr-navigation--first-class"></span>`:p}
|
|
270
270
|
${this.coachItemDetails.travelClass?.length>0||this.coachItemDetails.id?d`<div class="sbb-sr-navigation__additional-information">
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
271
|
+
${this.coachItemDetails.id?d`<div class="sbb-sr-navigation__item-coach-number" aria-hidden="true">
|
|
272
|
+
${this.coachItemDetails.id}
|
|
273
|
+
</div>`:p}
|
|
274
|
+
<div
|
|
275
|
+
${e??p}
|
|
276
|
+
class="sbb-sr-navigation__item-coach-travelclass"
|
|
277
|
+
aria-hidden="true"
|
|
278
|
+
>
|
|
279
|
+
${e}
|
|
280
|
+
</div>
|
|
281
|
+
</div>`:p}
|
|
282
282
|
`}_getTitleDescriptionNavCoachButton(e){if(this.coachItemDetails.isDriverArea&&!this.coachItemDetails.isLocomotive)return I(`NAVIGATE_COACH_BLOCKED`,this._language.current,[this.coachItemDetails.id]);if(this.coachItemDetails.isLocomotive)return I(`COACH_LOCOMOTIVE`,this._language.current);let t=I(`NAVIGATE_TO_COACH`,this._language.current,[this.coachItemDetails.id]);if(e){let n=I(e===1?`SERVICE_CLASS_FIRST`:`SERVICE_CLASS_SECOND`,this._language.current),r=I(`NAVIGATE_TO_COACH_SERVICE_CLASS_SUB`,this._language.current,[n]);t=t.concat(r)}let n=I(`COACH_AVAILABLE_NUMBER_OF_PLACES`,this._language.current,[this.coachItemDetails.freePlaces?.seats,this.coachItemDetails.freePlaces?.bicycles]);return t=t.concat(`. `).concat(n),t}_getAriaDescriptionCoachServices(){let e=null;return this.coachItemDetails.propertyIds?.length&&(e=I(`COACH_AVAILABLE_SERVICES`,this._language.current)+`: `,e+=this.coachItemDetails.propertyIds.map(e=>I(e,this._language.current)).join()+`.`),e}_selectNavCoach(e){this.dispatchEvent(new W(e))}_getCoachServiceClassNumber(){return this.coachItemDetails.travelClass?.includes(`FIRST`)?1:this.coachItemDetails.travelClass?.includes(`SECOND`)?2:null}}})();var K=`:host{--sbb-seat-reservation-place-control-text-scale-value:1;--sbb-seat-reservation-place-control-width:16;--sbb-seat-reservation-place-control-height:16;--sbb-seat-reservation-place-control-top:0;--sbb-seat-reservation-place-control-left:0;--sbb-seat-reservation-place-control-rotation:0;--sbb-seat-reservation-place-control-text-rotation:0;--sbb-seat-reservation-place-control-text-size:calc(var(--sbb-seat-reservation-place-control-text-scale-value,1) * .5);--sbb-seat-reservation-place-control-default-text:light-dark(var(--sbb-color-black),var(--sbb-color-white));--sbb-seat-reservation-place-control-hover-text:light-dark(var(--sbb-color-iron),var(--sbb-color-silver));--sbb-seat-reservation-place-control-focus-text:light-dark(var(--sbb-color-anthracite),var(--sbb-color-graphite));--sbb-seat-reservation-place-control-allocated-text:light-dark(var(--sbb-color-smoke),var(--sbb-color-metal));--sbb-seat-reservation-place-control-free-background-default:var(--sbb-background-color-2);--sbb-seat-reservation-place-control-free-background-hover:light-dark(var(--sbb-color-cloud),var(--sbb-color-midnight));--sbb-seat-reservation-place-control-free-background-focus:light-dark(var(--sbb-color-silver),var(--sbb-color-black));--sbb-seat-reservation-place-control-free-backrest-background-default:light-dark(var(--sbb-color-black),var(--sbb-color-white));--sbb-seat-reservation-place-control-free-backrest-background-hover:light-dark(var(--sbb-color-black),var(--sbb-color-white));--sbb-seat-reservation-place-control-free-backrest-background-focus:light-dark(var(--sbb-color-black),var(--sbb-color-white));--sbb-seat-reservation-place-control-selected-background-default:var(--sbb-color-primary);--sbb-seat-reservation-place-control-selected-background-hover:var(--sbb-color-primary125);--sbb-seat-reservation-place-control-selected-background-focus:var(--sbb-color-primary150);--sbb-seat-reservation-place-control-selected-backrest-background-default:var(--sbb-color-primary150);--sbb-seat-reservation-place-control-selected-backrest-background-hover:#7d000f;--sbb-seat-reservation-place-control-selected-backrest-background-focus:#5a000b;--sbb-seat-reservation-place-control-allocated-background-default:light-dark(var(--sbb-color-milk),var(--sbb-color-midnight));--sbb-seat-reservation-place-control-free-backrest-high-contrast:CanvasText;--sbb-seat-reservation-place-control-free-background-high-contrast:Canvas;--sbb-seat-reservation-place-control-free-text-high-contrast:ButtonText;--sbb-seat-reservation-place-control-free-icon-high-contrast:CanvasText;--sbb-seat-reservation-place-control-allocated-backrest-high-contrast:GrayText;--sbb-seat-reservation-place-control-allocated-background-high-contrast:Canvas;--sbb-seat-reservation-place-control-allocated-text-high-contrast:GrayText;--sbb-seat-reservation-place-control-allocated-icon-high-contrast:GrayText;width:calc(var(--sbb-seat-reservation-place-control-width) * var(--sbb-seat-reservation-one-px-rem,.0625rem));height:calc(var(--sbb-seat-reservation-place-control-height) * var(--sbb-seat-reservation-one-px-rem,.0625rem));cursor:var(--sbb-cursor-pointer);font-weight:300;position:absolute;inset-block-start:calc(var(--sbb-seat-reservation-place-control-top) * var(--sbb-seat-reservation-one-px-rem,.0625rem));inset-inline-start:calc(var(--sbb-seat-reservation-place-control-left) * var(--sbb-seat-reservation-one-px-rem,.0625rem))}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-hover);color:var(--sbb-seat-reservation-place-control-free-text)}@media (forced-colors:active){:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-high-contrast)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-icon){fill:var(--sbb-seat-reservation-place-control-free-icon-high-contrast)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-seatline){stroke:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}:host(:hover) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{forced-color-adjust:none;background-color:var(--sbb-seat-reservation-place-control-free-background-high-contrast);color:var(--sbb-seat-reservation-place-control-free-text-high-contrast)}}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-hover)}:host(:hover) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-hover);color:var(--sbb-seat-reservation-place-control-selected-text)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-focus)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-focus)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-focus);color:var(--sbb-seat-reservation-place-control-free-text)}@media (forced-colors:active){:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-high-contrast)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-icon){fill:var(--sbb-seat-reservation-place-control-free-icon-high-contrast)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) ::part(svg-seatline){stroke:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}:host(:focus-visible) .sbb-sr-place-ctrl--state-free:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{forced-color-adjust:none;background-color:var(--sbb-seat-reservation-place-control-free-background-high-contrast);color:var(--sbb-seat-reservation-place-control-free-text-high-contrast)}}:host(:active) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-focus)}:host(:active) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-focus)}:host(:active) .sbb-sr-place-ctrl--state-selected:not(.sbb-reservation-place-control--disabled) .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-focus);color:var(--sbb-seat-reservation-place-control-selected-text)}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(svg-place){rotate:180deg}.sbb-sr-place-ctrl{width:max-content;font-size:calc(var(--sbb-seat-reservation-place-control-text-size) * var(--sbb-seat-reservation-one-px-rem,.0625rem));position:relative}.sbb-sr-place-ctrl--state-free ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-default)}.sbb-sr-place-ctrl--state-free ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-background-default)}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-free-background-default);color:var(--sbb-seat-reservation-place-control-free-text)}@media (forced-colors:active){.sbb-sr-place-ctrl--state-free ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-free-background-high-contrast)}.sbb-sr-place-ctrl--state-free ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}.sbb-sr-place-ctrl--state-free ::part(svg-icon){fill:var(--sbb-seat-reservation-place-control-free-icon-high-contrast)}.sbb-sr-place-ctrl--state-free ::part(svg-seatline){stroke:var(--sbb-seat-reservation-place-control-free-backrest-high-contrast)}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text{forced-color-adjust:none;background-color:var(--sbb-seat-reservation-place-control-free-background-high-contrast);color:var(--sbb-seat-reservation-place-control-free-text-high-contrast)}}.sbb-sr-place-ctrl--state-selected ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-selected-background-default)}.sbb-sr-place-ctrl--state-selected ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-selected-backrest-background-default)}.sbb-sr-place-ctrl--state-selected .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-selected-background-default);color:var(--sbb-seat-reservation-place-control-selected-text)}.sbb-sr-place-ctrl--state-allocated ::part(svg-place),.sbb-sr-place-ctrl--state-restricted ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-allocated-background-default)}.sbb-sr-place-ctrl--state-allocated ::part(svg-backrest),.sbb-sr-place-ctrl--state-restricted ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-allocated-backrest-background-default)}.sbb-sr-place-ctrl--state-allocated .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-restricted .sbb-sr-place-ctrl__text{background-color:var(--sbb-seat-reservation-place-control-allocated-background-default);color:var(--sbb-seat-reservation-place-control-allocated-text)}@media (forced-colors:active){.sbb-sr-place-ctrl--state-allocated ::part(svg-place),.sbb-sr-place-ctrl--state-restricted ::part(svg-place){fill:var(--sbb-seat-reservation-place-control-allocated-background-high-contrast)}.sbb-sr-place-ctrl--state-allocated ::part(svg-backrest),.sbb-sr-place-ctrl--state-restricted ::part(svg-backrest){fill:var(--sbb-seat-reservation-place-control-allocated-backrest-high-contrast)}.sbb-sr-place-ctrl--state-allocated ::part(svg-icon),.sbb-sr-place-ctrl--state-restricted ::part(svg-icon){fill:var(--sbb-seat-reservation-place-control-allocated-icon-high-contrast)}.sbb-sr-place-ctrl--state-allocated ::part(svg-seatline),.sbb-sr-place-ctrl--state-restricted ::part(svg-seatline){stroke:var(--sbb-seat-reservation-place-control-allocated-backrest-high-contrast)}.sbb-sr-place-ctrl--state-allocated .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-restricted .sbb-sr-place-ctrl__text{forced-color-adjust:none;background-color:var(--sbb-seat-reservation-place-control-allocated-background-high-contrast);color:var(--sbb-seat-reservation-place-control-allocated-text-high-contrast)}}.sbb-sr-place-ctrl--state-allocated,.sbb-sr-place-ctrl--state-restricted{cursor:not-allowed}.sbb-sr-place-ctrl__text{translate:-50% -50%;rotate:calc(var(--sbb-seat-reservation-place-control-text-rotation) * 1deg);font-family:var(--sbb-typo-font-family);font-size:.75em;line-height:initial;display:none;position:absolute;inset-block-start:50%;overflow:hidden}.sbb-sr-place-ctrl--state-free .sbb-sr-place-ctrl__text,.sbb-sr-place-ctrl--state-allocated .sbb-sr-place-ctrl__text{display:block}.sbb-sr-place-ctrl--type-bicycle .sbb-sr-place-ctrl__text{transform-origin:50% 16%;font-size:.6875em;inset-block-start:65%;inset-inline-start:50%}.sbb-sr-place-ctrl--orientation-0.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-inline-start:45%}.sbb-sr-place-ctrl--orientation-90.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-block-start:46%;inset-inline-start:50%}.sbb-sr-place-ctrl--orientation-180.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-inline-start:55%}.sbb-sr-place-ctrl--orientation-270.sbb-sr-place-ctrl--type-seat .sbb-sr-place-ctrl__text{inset-block-start:52%;inset-inline-start:52%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-0 .sbb-sr-place-ctrl__text{inset-inline-start:3%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-90 .sbb-sr-place-ctrl__text,:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-180 .sbb-sr-place-ctrl__text{inset-inline-start:10%}:host(:dir(rtl)) .sbb-sr-place-ctrl--orientation-270 .sbb-sr-place-ctrl__text{inset-inline-start:5%}:host(:dir(rtl)) .sbb-sr-place-ctrl--type-bicycle .sbb-sr-place-ctrl__text{inset-inline-start:-10%}
|
|
283
283
|
`,q=class extends Event{get detail(){return this._detail}constructor(e){super(`selectplace`,{bubbles:!0,composed:!0}),this._detail=e}};let J=(()=>{let r=n,a,s=[],c=[],l,u=[],f=[],h,_=[],v=[],y,x=[],S=[],C,w=[],T=[],E,D=[],O=[],k,A=[],j=[],M,N=[],P=[],F,L=[],R=[],z,V=[],H=[];return class extends r{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[o(),g({attribute:`type`})],l=[o(),g({attribute:`state`,reflect:!0})],h=[g({attribute:`travel-direction`})],y=[g({attribute:`propertyIds`,type:Array})],C=[o(),g({attribute:`text`})],E=[o(),g({attribute:`deck-index`,type:Number})],k=[o(),g({attribute:`coach-index`,type:Number})],M=[o(),g({attribute:`prevent-click`,type:Boolean})],F=[o(),g({attribute:`keyfocus`})],z=[o(),g({type:Boolean,useDefault:!0})],e(this,null,a,{kind:`accessor`,name:`placeType`,static:!1,private:!1,access:{has:e=>`placeType`in e,get:e=>e.placeType,set:(e,t)=>{e.placeType=t}},metadata:t},s,c),e(this,null,l,{kind:`accessor`,name:`state`,static:!1,private:!1,access:{has:e=>`state`in e,get:e=>e.state,set:(e,t)=>{e.state=t}},metadata:t},u,f),e(this,null,h,{kind:`accessor`,name:`travelDirection`,static:!1,private:!1,access:{has:e=>`travelDirection`in e,get:e=>e.travelDirection,set:(e,t)=>{e.travelDirection=t}},metadata:t},_,v),e(this,null,y,{kind:`accessor`,name:`propertyIds`,static:!1,private:!1,access:{has:e=>`propertyIds`in e,get:e=>e.propertyIds,set:(e,t)=>{e.propertyIds=t}},metadata:t},x,S),e(this,null,C,{kind:`accessor`,name:`text`,static:!1,private:!1,access:{has:e=>`text`in e,get:e=>e.text,set:(e,t)=>{e.text=t}},metadata:t},w,T),e(this,null,E,{kind:`accessor`,name:`deckIndex`,static:!1,private:!1,access:{has:e=>`deckIndex`in e,get:e=>e.deckIndex,set:(e,t)=>{e.deckIndex=t}},metadata:t},D,O),e(this,null,k,{kind:`accessor`,name:`coachIndex`,static:!1,private:!1,access:{has:e=>`coachIndex`in e,get:e=>e.coachIndex,set:(e,t)=>{e.coachIndex=t}},metadata:t},A,j),e(this,null,M,{kind:`accessor`,name:`preventClick`,static:!1,private:!1,access:{has:e=>`preventClick`in e,get:e=>e.preventClick,set:(e,t)=>{e.preventClick=t}},metadata:t},N,P),e(this,null,F,{kind:`accessor`,name:`keyfocus`,static:!1,private:!1,access:{has:e=>`keyfocus`in e,get:e=>e.keyfocus,set:(e,t)=>{e.keyfocus=t}},metadata:t},L,R),e(this,null,z,{kind:`accessor`,name:`showTitleInfo`,static:!1,private:!1,access:{has:e=>`showTitleInfo`in e,get:e=>e.showTitleInfo,set:(e,t)=>{e.showTitleInfo=t}},metadata:t},V,H),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-seat-reservation-place-control`}static{this.elementDependencies=[B]}static{this.styles=[m(K)]}static{this.events={selectplace:`selectplace`}}#e;get placeType(){return this.#e}set placeType(e){this.#e=e}#t;get state(){return this.#t}set state(e){this.#t=e}#n;get travelDirection(){return this.#n}set travelDirection(e){this.#n=e}#r;get propertyIds(){return this.#r}set propertyIds(e){this.#r=e}#i;get text(){return this.#i}set text(e){this.#i=e}#a;get deckIndex(){return this.#a}set deckIndex(e){this.#a=e}#o;get coachIndex(){return this.#o}set coachIndex(e){this.#o=e}#s;get preventClick(){return this.#s}set preventClick(e){this.#s=e}#c;get keyfocus(){return this.#c}set keyfocus(e){this.#c=e}#l;get showTitleInfo(){return this.#l}set showTitleInfo(e){this.#l=e}constructor(){super(),this.#e=t(this,s,`SEAT`),this.#t=(t(this,c),t(this,u,`FREE`)),this.#n=(t(this,f),t(this,_,`NONE`)),this.#r=(t(this,v),t(this,x,[])),this.#i=(t(this,S),t(this,w,``)),this.#a=(t(this,T),t(this,D,null)),this.#o=(t(this,O),t(this,A,null)),this.#s=(t(this,j),t(this,N,!1)),this.#c=(t(this,P),t(this,L,`unfocus`)),this.#l=(t(this,R),t(this,V,!1)),this._language=(t(this,H),new i(this)),this.addEventListener(`click`,()=>this._selectPlace())}willUpdate(e){super.willUpdate(e),e.has(`keyfocus`)&&this.keyfocus===`focus`&&this.focus()}render(){let e=this._getPlaceSvg(this.placeType,this.state),t=this.type.toLowerCase(),n=this.state.toLowerCase(),r=this.text,i=this.style?.getPropertyValue(`--sbb-seat-reservation-place-control-width`),a=this.style?.getPropertyValue(`--sbb-seat-reservation-place-control-height`),o=this.style?.getPropertyValue(`--sbb-seat-reservation-place-control-rotation`),s=this.style?.getPropertyValue(`--sbb-seat-reservation-place-control-text-rotation`),c=Number(s)-Number(o),l=this.preventClick?`sbb-reservation-place-control--disabled`:null,u=this._getTitleDescriptionPlace(o);return this.showTitleInfo?(this.title=u,this.internals.ariaLabel=null):(this.internals.ariaLabel=u,this.removeAttribute(`title`)),this.tabIndex=-1,d` <div
|
|
284
284
|
part="sbb-sr-place-part"
|
|
@@ -441,14 +441,14 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{SbbButtonBase
|
|
|
441
441
|
aria-hidden="true"
|
|
442
442
|
>
|
|
443
443
|
${a?d`
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
444
|
+
<sbb-seat-reservation-graphic
|
|
445
|
+
style=${b({"--sbb-seat-reservation-graphic-max-width":this.globalAreaIconDim.w,"--sbb-seat-reservation-graphic-max-height":this.globalAreaIconDim.h,"--sbb-seat-reservation-graphic-width":n.dimension.w,"--sbb-seat-reservation-graphic-height":n.dimension.h,"--sbb-seat-reservation-graphic-rotation":n.rotation,"--sbb-seat-reservation-graphic-padding-percent":a===`ENTRY_EXIT`?1:this.globalAreaIconPadding})}
|
|
446
|
+
name=${a}
|
|
447
|
+
role="img"
|
|
448
|
+
aria-hidden="true"
|
|
449
|
+
class="sbb-sr-graphic__dimension--square-dim"
|
|
450
|
+
></sbb-seat-reservation-graphic>
|
|
451
|
+
`:p}
|
|
452
452
|
</sbb-seat-reservation-area>
|
|
453
453
|
${a?this._popover(r,o):p}
|
|
454
454
|
`})}_getRenderedServiceElements(e,t){return this.seatReservationStructure.decks[e].deckCoaches[t].serviceElements.map(n=>{let r=`popover-trigger-${e}-${t}-${n.position.x}-${n.position.y}`,i=n.icon?I(n.icon,this._language.current):null;return d`
|