@sbb-esta/lyne-elements-experimental 2.11.1 → 2.11.2
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/datetime/date-helper.js +142 -142
- package/core/timetable/access-leg-helper.js +49 -52
- package/core/timetable/timetable-helper.js +7 -8
- package/development/core/datetime/date-helper.js +10 -10
- package/development/core/timetable/access-leg-helper.js +12 -15
- package/development/core/timetable/timetable-helper.js +6 -7
- package/development/{differenceInMinutes-CHSyWiQs.js → differenceInMinutes-D5Nj8Stc.js} +3 -3
- package/development/{format-D0-yhzi4.js → format-BQfaa1ZT.js} +22 -26
- package/development/{isValid-Bo4R7iA7.js → isValid-DvieCZVi.js} +3 -3
- package/development/journey-summary/journey-summary.component.js +4 -5
- package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/development/pearl-chain/pearl-chain.component.js +28 -39
- package/development/pearl-chain-time/pearl-chain-time.component.js +5 -6
- package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +1 -1
- package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +1 -1
- package/development/seat-reservation/common/mapper/icon-mapper.js +1 -1
- package/development/seat-reservation/common/mapper/mapper.js +14 -16
- package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +1 -1
- package/development/seat-reservation/common/svgs.js +1 -1
- package/development/seat-reservation/common/translations/i18n.js +2 -3
- package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +22 -33
- package/development/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +6 -7
- package/development/seat-reservation/seat-reservation/seat-reservation.component.js +16 -23
- package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +2 -3
- package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +7 -8
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +7 -11
- package/development/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +2 -3
- package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +4 -5
- package/development/timetable-duration/timetable-duration.component.js +1 -1
- package/development/timetable-row/timetable-row.component.js +58 -89
- package/differenceInMinutes-CP_C5onR.js +23 -0
- package/{format-Dg8rkk7h.js → format-lqeCzmzS.js} +438 -442
- package/isValid-Ceq2O0NQ.js +45 -0
- package/journey-summary/journey-summary.component.js +3 -4
- package/package.json +2 -2
- package/pearl-chain/pearl-chain.component.d.ts.map +1 -1
- package/pearl-chain/pearl-chain.component.js +78 -95
- package/pearl-chain-time/pearl-chain-time.component.js +44 -45
- package/seat-reservation/common/mapper/mapper.js +50 -54
- package/seat-reservation/common/translations/i18n.js +5 -6
- package/seat-reservation/seat-reservation/seat-reservation-base-element.js +104 -115
- package/seat-reservation/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +40 -41
- package/seat-reservation/seat-reservation/seat-reservation.component.js +78 -87
- package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +15 -18
- package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +58 -59
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +71 -75
- package/seat-reservation/seat-reservation-navigation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +12 -13
- package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +23 -24
- package/timetable-row/timetable-row.component.js +207 -247
- package/differenceInMinutes-BMqUZdhj.js +0 -23
- package/isValid-DJ69OMZJ.js +0 -45
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as o, c as D, a as m } from "./toDate-BCXKL_wM.js";
|
|
2
|
+
function i(t) {
|
|
3
|
+
const e = o(t), n = new Date(
|
|
4
|
+
Date.UTC(
|
|
5
|
+
e.getFullYear(),
|
|
6
|
+
e.getMonth(),
|
|
7
|
+
e.getDate(),
|
|
8
|
+
e.getHours(),
|
|
9
|
+
e.getMinutes(),
|
|
10
|
+
e.getSeconds(),
|
|
11
|
+
e.getMilliseconds()
|
|
12
|
+
)
|
|
13
|
+
);
|
|
14
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
15
|
+
}
|
|
16
|
+
function g(t, ...e) {
|
|
17
|
+
const n = D.bind(
|
|
18
|
+
null,
|
|
19
|
+
e.find((a) => typeof a == "object")
|
|
20
|
+
);
|
|
21
|
+
return e.map(n);
|
|
22
|
+
}
|
|
23
|
+
function c(t, e) {
|
|
24
|
+
const n = o(t, e?.in);
|
|
25
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
26
|
+
}
|
|
27
|
+
function y(t, e, n) {
|
|
28
|
+
const [a, l] = g(
|
|
29
|
+
n?.in,
|
|
30
|
+
t,
|
|
31
|
+
e
|
|
32
|
+
), r = c(a), s = c(l), u = +r - i(r), f = +s - i(s);
|
|
33
|
+
return Math.round((u - f) / m);
|
|
34
|
+
}
|
|
35
|
+
function p(t) {
|
|
36
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
37
|
+
}
|
|
38
|
+
function b(t) {
|
|
39
|
+
return !(!p(t) && typeof t != "number" || isNaN(+o(t)));
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
y as d,
|
|
43
|
+
b as i,
|
|
44
|
+
g as n
|
|
45
|
+
};
|
|
@@ -15,8 +15,8 @@ import "@sbb-esta/lyne-elements/divider.js";
|
|
|
15
15
|
import "@sbb-esta/lyne-elements/screen-reader-only.js";
|
|
16
16
|
import "@sbb-esta/lyne-elements/journey-header.js";
|
|
17
17
|
import "../pearl-chain-time.js";
|
|
18
|
-
import { i as nt } from "../isValid-
|
|
19
|
-
import { f as R } from "../format-
|
|
18
|
+
import { i as nt } from "../isValid-Ceq2O0NQ.js";
|
|
19
|
+
import { f as R } from "../format-lqeCzmzS.js";
|
|
20
20
|
const ot = et`*,:before,:after{box-sizing:border-box}:host{display:block}.sbb-journey-summary{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);color:var(--sbb-color-iron);display:flex;flex-direction:column}.sbb-journey-summary__via-block{display:flex}.sbb-journey-summary__vias{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-block:0;padding-inline-start:var(--sbb-spacing-fixed-1x)}.sbb-journey-summary__date{margin-block-end:var(--sbb-spacing-fixed-2x)}.sbb-journey-summary__via{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sbb-journey-summary__divider{margin-block:var(--sbb-spacing-fixed-6x)}ul li{list-style:none;display:inline}`;
|
|
21
21
|
let wt = (() => {
|
|
22
22
|
var y, v, f, g, k, $, r;
|
|
@@ -92,8 +92,7 @@ let wt = (() => {
|
|
|
92
92
|
return this._now ?? /* @__PURE__ */ new Date();
|
|
93
93
|
}
|
|
94
94
|
connectedCallback() {
|
|
95
|
-
|
|
96
|
-
super.connectedCallback(), this._hasContentSlot = !!((e = this.querySelector) != null && e.call(this, '[slot="content"]'));
|
|
95
|
+
super.connectedCallback(), this._hasContentSlot = !!this.querySelector?.('[slot="content"]');
|
|
97
96
|
}
|
|
98
97
|
/** renders the date of the journey or if it is the current or next day */
|
|
99
98
|
_renderJourneyStart(e, t) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbb-esta/lyne-elements-experimental",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"description": "Lyne Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design system",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"customElements": "custom-elements.json",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@sbb-esta/lyne-elements": "2.11.
|
|
14
|
+
"@sbb-esta/lyne-elements": "2.11.2"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"lit": "^3.3.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pearl-chain.component.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/pearl-chain/pearl-chain.component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAKhD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW3D;;GAEG;AACH,qBAEM,oBAAqB,SAAQ,UAAU;IAC3C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;;;;;OAOG;IACH,SAA2C,IAAI,EAAE,CAAC,GAAG,GAAG,SAAS,CAAC,EAAE,CAAM;IAE1E;;;OAGG;IACH,SAEgB,gBAAgB,EAAE,OAAO,CAAS;IAElD,2HAA2H;IAC3H,IACW,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAE5C;IACD,IAAW,GAAG,IAAI,IAAI,GAAG,IAAI,CAE5B;IACD,OAAO,CAAC,IAAI,CAAqB;IAEjC,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,eAAe;cAmBJ,MAAM,IAAI,cAAc;
|
|
1
|
+
{"version":3,"file":"pearl-chain.component.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/pearl-chain/pearl-chain.component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAKhD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW3D;;GAEG;AACH,qBAEM,oBAAqB,SAAQ,UAAU;IAC3C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;;;;;OAOG;IACH,SAA2C,IAAI,EAAE,CAAC,GAAG,GAAG,SAAS,CAAC,EAAE,CAAM;IAE1E;;;OAGG;IACH,SAEgB,gBAAgB,EAAE,OAAO,CAAS;IAElD,2HAA2H;IAC3H,IACW,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAE5C;IACD,IAAW,GAAG,IAAI,IAAI,GAAG,IAAI,CAE5B;IACD,OAAO,CAAC,IAAI,CAAqB;IAEjC,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,eAAe;cAmBJ,MAAM,IAAI,cAAc;CA+I5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,iBAAiB,EAAE,oBAAoB,CAAC;KACzC;CACF"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var X = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { defaultDateAdapter as
|
|
8
|
-
import { forceType as
|
|
9
|
-
import { css as
|
|
10
|
-
import { customElement as
|
|
11
|
-
import { styleMap as
|
|
12
|
-
import { removeTimezoneFromISOTimeString as
|
|
13
|
-
import { isRideLeg as
|
|
14
|
-
import { d as
|
|
15
|
-
import { t as
|
|
16
|
-
function
|
|
17
|
-
return +
|
|
4
|
+
var q = (t, l, n) => l.has(t) || X("Cannot " + n);
|
|
5
|
+
var E = (t, l, n) => (q(t, l, "read from private field"), n ? n.call(t) : l.get(t)), P = (t, l, n) => l.has(t) ? X("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(t) : l.set(t, n), m = (t, l, n, p) => (q(t, l, "write to private field"), p ? p.call(t, n) : l.set(t, n), n);
|
|
6
|
+
import { __runInitializers as v, __esDecorate as w } from "tslib";
|
|
7
|
+
import { defaultDateAdapter as K } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
8
|
+
import { forceType as pe } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
9
|
+
import { css as he, LitElement as de, html as f, nothing as Q } from "lit";
|
|
10
|
+
import { customElement as ue, property as I } from "lit/decorators.js";
|
|
11
|
+
import { styleMap as U } from "lit/directives/style-map.js";
|
|
12
|
+
import { removeTimezoneFromISOTimeString as o } from "../core/datetime.js";
|
|
13
|
+
import { isRideLeg as _e } from "../core/timetable.js";
|
|
14
|
+
import { d as z, a as x } from "../differenceInMinutes-CP_C5onR.js";
|
|
15
|
+
import { t as S } from "../toDate-BCXKL_wM.js";
|
|
16
|
+
function ge(t, l) {
|
|
17
|
+
return +S(t) > +S(l);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return +
|
|
19
|
+
function Z(t, l) {
|
|
20
|
+
return +S(t) < +S(l);
|
|
21
21
|
}
|
|
22
|
-
const $e = Se`*,:before,:after{box-sizing:border-box}: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%;display:block;--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--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}.sbb-pearl-chain{position:relative;display:flex;justify-content:space-between;flex-wrap:nowrap;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);padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end)}.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:"";position:absolute;background-color:currentcolor;inset-block-start:0;z-index:3}.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{flex-shrink:0;flex-grow:0;position:relative;height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;background-color:currentcolor;width:var(--sbb-pearl-chain-leg-width);display:flex;align-items:center}@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{position:relative;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%}@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}}@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{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}}@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{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--disruption:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 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(to right,currentcolor 0%,currentcolor 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;background:Canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);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)}@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:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);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)}@media (forced-colors: active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:Highlight}}.sbb-pearl-chain__leg:after{content:"";position:absolute;inset-block:0;inset-inline-start:0;background-color:currentcolor;border-radius:var(--sbb-pearl-chain-height);z-index:1}@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-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.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}.sbb-pearl-chain__position{position:absolute;inset-block-start:-200%;z-index:4;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
23
|
-
let
|
|
24
|
-
var
|
|
25
|
-
let
|
|
26
|
-
return
|
|
22
|
+
const ve = he`*,:before,:after{box-sizing:border-box}: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%;display:block;--sbb-pearl-chain-bullet-size-start-end: .625rem;--sbb-pearl-chain-bullet-size-stop: .5rem;--sbb-pearl-chain-bullet-color: var(--sbb-color-charcoal);--sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);--sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-red);--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}.sbb-pearl-chain{position:relative;display:flex;justify-content:space-between;flex-wrap:nowrap;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);padding-inline-end:var(--sbb-pearl-chain-bullet-size-start-end)}.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:"";position:absolute;background-color:currentcolor;inset-block-start:0;z-index:3}.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{flex-shrink:0;flex-grow:0;position:relative;height:var(--sbb-pearl-chain-height);border-inline-end:var(--sbb-pearl-chain-spacing-small) solid Canvas;background-color:currentcolor;width:var(--sbb-pearl-chain-leg-width);display:flex;align-items:center}@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{position:relative;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%}@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}}@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{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}}@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{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--disruption:after{background-color:unset;background-image:linear-gradient(to right,currentcolor 0%,currentcolor 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(to right,currentcolor 0%,currentcolor 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;background:Canvas}.sbb-pearl-chain__stop--departure-skipped:before{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);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)}@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:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%) rotate(45deg);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)}@media (forced-colors: active){.sbb-pearl-chain--arrival-skipped:before,.sbb-pearl-chain--departure-skipped:before{background:Highlight}}.sbb-pearl-chain__leg:after{content:"";position:absolute;inset-block:0;inset-inline-start:0;background-color:currentcolor;border-radius:var(--sbb-pearl-chain-height);z-index:1}@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-bullet-color-disruption)}@media (forced-colors: active){.sbb-pearl-chain__position{--sbb-pearl-chain-bullet-color: Highlight}}@keyframes pearl-chain-bullet-position-pulse{0%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}25%{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}50%{box-shadow:0 0 0 .1875rem var(--sbb-color-red-alpha-20)}to{box-shadow:0 0 0 0 var(--sbb-pearl-chain-bullet-color-disruption)}}.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}.sbb-pearl-chain__position{position:absolute;inset-block-start:-200%;z-index:4;inset-inline-start:var(--sbb-pearl-chain-status-position)}.sbb-pearl-chain__position--no-animation{animation:unset}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
23
|
+
let Ne = (() => {
|
|
24
|
+
var _, g, h;
|
|
25
|
+
let t = [ue("sbb-pearl-chain")], l, n = [], p, H = de, O = [], J, R = [], L = [], W, G = [], V = [], B;
|
|
26
|
+
return h = class extends H {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
P(this, _);
|
|
30
|
+
P(this, g);
|
|
31
|
+
m(this, _, (v(this, O), v(this, R, []))), m(this, g, (v(this, L), v(this, G, !1))), this._now = (v(this, V), null);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Define the legs of the pearl-chain.
|
|
@@ -39,139 +39,122 @@ let Me = (() => {
|
|
|
39
39
|
* arrival at 17:00. So the change should have a duration of 33.33%.
|
|
40
40
|
*/
|
|
41
41
|
get legs() {
|
|
42
|
-
return
|
|
42
|
+
return E(this, _);
|
|
43
43
|
}
|
|
44
44
|
set legs(a) {
|
|
45
|
-
|
|
45
|
+
m(this, _, a);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Per default, the current location has a pulsating animation. You can
|
|
49
49
|
* disable the animation with this property.
|
|
50
50
|
*/
|
|
51
51
|
get disableAnimation() {
|
|
52
|
-
return
|
|
52
|
+
return E(this, g);
|
|
53
53
|
}
|
|
54
54
|
set disableAnimation(a) {
|
|
55
|
-
|
|
55
|
+
m(this, g, a);
|
|
56
56
|
}
|
|
57
57
|
/** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
|
|
58
58
|
set now(a) {
|
|
59
|
-
this._now =
|
|
59
|
+
this._now = K.getValidDateOrNull(K.deserialize(a));
|
|
60
60
|
}
|
|
61
61
|
get now() {
|
|
62
62
|
return this._now;
|
|
63
63
|
}
|
|
64
64
|
_getAllDuration(a) {
|
|
65
|
-
return a
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return i && b ? e + D(h(r.arrival.time), h(r.departure.time)) : e;
|
|
65
|
+
return a?.reduce((e, r) => {
|
|
66
|
+
const i = o(r.arrival?.time), s = o(r.departure?.time);
|
|
67
|
+
return i && s ? e + z(o(r.arrival.time), o(r.departure.time)) : e;
|
|
69
68
|
}, 0);
|
|
70
69
|
}
|
|
71
70
|
_isAllCancelled(a) {
|
|
72
|
-
return a
|
|
73
|
-
var r, i;
|
|
74
|
-
return (i = (r = e == null ? void 0 : e.serviceJourney) == null ? void 0 : r.serviceAlteration) == null ? void 0 : i.cancelled;
|
|
75
|
-
});
|
|
71
|
+
return a?.every((e) => e?.serviceJourney?.serviceAlteration?.cancelled);
|
|
76
72
|
}
|
|
77
73
|
_getRelativeDuration(a, e) {
|
|
78
|
-
|
|
79
|
-
const r = h((b = e.arrival) == null ? void 0 : b.time), i = h((c = e.departure) == null ? void 0 : c.time);
|
|
74
|
+
const r = o(e.arrival?.time), i = o(e.departure?.time);
|
|
80
75
|
if (r && i) {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
76
|
+
const s = z(o(e.arrival.time), o(e.departure.time)), b = this._getAllDuration(a);
|
|
77
|
+
return b === 0 ? 100 : s / b * 100;
|
|
83
78
|
}
|
|
84
79
|
return 0;
|
|
85
80
|
}
|
|
86
81
|
_getProgress(a, e, r) {
|
|
87
|
-
if (!
|
|
82
|
+
if (!e?.time || !r?.time)
|
|
88
83
|
return 0;
|
|
89
|
-
const i =
|
|
90
|
-
return
|
|
84
|
+
const i = x(e.time, e.delay ?? 0), s = x(r.time, r.delay ?? 0), b = z(s, i), D = z(a, i);
|
|
85
|
+
return b && D / b * 100;
|
|
91
86
|
}
|
|
92
87
|
_getStatus(a, e, r) {
|
|
93
|
-
const i = e && e.time &&
|
|
94
|
-
return i &&
|
|
88
|
+
const i = e && e.time && x(e.time, e.delay ?? 0), s = r && r.time && x(r.time, r.delay ?? 0);
|
|
89
|
+
return i && Z(i, a) && s && ge(s, a) ? "progress" : s && Z(s, a) ? "past" : "future";
|
|
95
90
|
}
|
|
96
91
|
_renderPosition(a, e, r) {
|
|
97
92
|
const i = this._getProgress(a, e, r);
|
|
98
93
|
if (i < 0 && i > 100)
|
|
99
94
|
return;
|
|
100
|
-
const
|
|
95
|
+
const s = () => ({
|
|
101
96
|
"--sbb-pearl-chain-status-position": `${i}%`,
|
|
102
97
|
...i >= 50 ? { transform: "translateX(-100%)" } : {}
|
|
103
|
-
}),
|
|
104
|
-
return
|
|
105
|
-
style=${
|
|
106
|
-
class="sbb-pearl-chain__position ${
|
|
98
|
+
}), b = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
|
|
99
|
+
return f`<span
|
|
100
|
+
style=${U(s())}
|
|
101
|
+
class="sbb-pearl-chain__position ${b}"
|
|
107
102
|
></span>`;
|
|
108
103
|
}
|
|
109
104
|
render() {
|
|
110
|
-
|
|
111
|
-
const a = this.now ?? /* @__PURE__ */ new Date(), e = (X = this.legs) == null ? void 0 : X.filter((t) => Ae(t)), r = (e == null ? void 0 : e.length) && h((K = (q = e[0]) == null ? void 0 : q.departure) == null ? void 0 : K.time), i = r && {
|
|
105
|
+
const a = this.now ?? /* @__PURE__ */ new Date(), e = this.legs?.filter((c) => _e(c)), r = e?.length && o(e[0]?.departure?.time), i = r && {
|
|
112
106
|
time: r,
|
|
113
107
|
delay: e[0].departure.delay ?? 0
|
|
114
|
-
},
|
|
115
|
-
time:
|
|
116
|
-
delay:
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
return
|
|
120
|
-
})(),
|
|
121
|
-
|
|
122
|
-
const t = e && e[e.length - 1], o = t && ((s = t.serviceJourney) == null ? void 0 : s.stopPoints);
|
|
123
|
-
return o && o[o.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
|
|
124
|
-
})(), F = (() => {
|
|
125
|
-
var t, o, s;
|
|
126
|
-
return e && ((s = (o = (t = e[0]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--departure-disruption" : "";
|
|
127
|
-
})(), L = (() => {
|
|
128
|
-
var t, o, s;
|
|
129
|
-
return e && ((s = (o = (t = e[e.length - 1]) == null ? void 0 : t.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--arrival-disruption" : "";
|
|
130
|
-
})(), C = i && c && this._getStatus(a, i, c), ue = e && C && !F ? "sbb-pearl-chain__bullet--" + C : "", _e = e && C && !L ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, c) : "";
|
|
131
|
-
return this._isAllCancelled(e) ? y`
|
|
108
|
+
}, s = e?.length && o(e[e.length - 1].arrival?.time), b = s && {
|
|
109
|
+
time: s,
|
|
110
|
+
delay: e[e.length - 1]?.arrival.delay ?? 0
|
|
111
|
+
}, D = e && e[0]?.serviceJourney?.stopPoints && e[0]?.serviceJourney?.stopPoints[0].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "", ee = (() => {
|
|
112
|
+
const c = e && e[e.length - 1], d = c && c.serviceJourney?.stopPoints;
|
|
113
|
+
return d && d[d.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
|
|
114
|
+
})(), j = e && e[0]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--departure-disruption" : "", M = e && e[e.length - 1]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--arrival-disruption" : "", A = i && b && this._getStatus(a, i, b), ae = e && A && !j ? "sbb-pearl-chain__bullet--" + A : "", re = e && A && !M ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, b) : "";
|
|
115
|
+
return this._isAllCancelled(e) ? f`
|
|
132
116
|
<div class="sbb-pearl-chain">
|
|
133
117
|
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
134
118
|
<div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
|
|
135
119
|
<span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
|
|
136
120
|
</div>
|
|
137
|
-
` :
|
|
121
|
+
` : f`
|
|
138
122
|
<div class="sbb-pearl-chain">
|
|
139
123
|
<span
|
|
140
|
-
class="sbb-pearl-chain__bullet ${
|
|
124
|
+
class="sbb-pearl-chain__bullet ${ae} ${D} ${j}"
|
|
141
125
|
></span>
|
|
142
|
-
${e
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
"--sbb-pearl-chain-leg-status": `${this._getProgress(a, N, E)}%`
|
|
126
|
+
${e?.map((c, d) => {
|
|
127
|
+
const { stopPoints: u, serviceAlteration: Y } = c?.serviceJourney || {}, te = this._getRelativeDuration(e, c), le = o(c.departure?.time), ie = o(c.arrival?.time), se = u && u[u.length - 1]?.stopStatus === "NOT_SERVICED", ne = u && u[u.length - 1]?.stopStatus === "PLANNED", F = u && u[0]?.stopStatus === "NOT_SERVICED", T = d > 0 && e[d - 1].serviceJourney.stopPoints, oe = T && T[T.length - 1]?.stopStatus === "NOT_SERVICED", k = se || F && ne ? "sbb-pearl-chain__leg--skipped" : "", be = F || oe ? "sbb-pearl-chain__stop--departure-skipped" : "", y = Y?.cancelled || Y?.partiallyCancelled ? "sbb-pearl-chain__leg--disruption" : "", C = { time: le, delay: c.departure?.delay ?? 0 }, $ = { time: ie, delay: c.arrival?.delay ?? 0 }, N = this._getStatus(a, C, $), ce = !y && !k && "sbb-pearl-chain__leg--" + N;
|
|
128
|
+
return f` <div
|
|
129
|
+
class="sbb-pearl-chain__leg ${ce || ""} ${y} ${k}"
|
|
130
|
+
style=${U({
|
|
131
|
+
"--sbb-pearl-chain-leg-width": `${te}%`,
|
|
132
|
+
...N === "progress" && !y && !k ? {
|
|
133
|
+
"--sbb-pearl-chain-leg-status": `${this._getProgress(a, C, $)}%`
|
|
151
134
|
} : {}
|
|
152
135
|
})}
|
|
153
136
|
>
|
|
154
|
-
${
|
|
155
|
-
${
|
|
137
|
+
${d > 0 && d < e.length ? f`<span class="sbb-pearl-chain__stop ${be}"></span>` : Q}
|
|
138
|
+
${N === "progress" && !y && !k ? this._renderPosition(a, C, $) : Q}
|
|
156
139
|
</div>`;
|
|
157
140
|
})}
|
|
158
141
|
<span
|
|
159
|
-
class="sbb-pearl-chain__bullet ${
|
|
142
|
+
class="sbb-pearl-chain__bullet ${re} ${ee} ${M}"
|
|
160
143
|
></span>
|
|
161
144
|
</div>
|
|
162
145
|
`;
|
|
163
146
|
}
|
|
164
|
-
},
|
|
165
|
-
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
166
|
-
|
|
147
|
+
}, _ = new WeakMap(), g = new WeakMap(), p = h, (() => {
|
|
148
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(H[Symbol.metadata] ?? null) : void 0;
|
|
149
|
+
J = [I({ type: Array })], W = [pe(), I({ attribute: "disable-animation", type: Boolean })], B = [I()], w(h, null, J, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, r) => {
|
|
167
150
|
e.legs = r;
|
|
168
|
-
} }, metadata: a },
|
|
151
|
+
} }, metadata: a }, R, L), w(h, null, W, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
|
|
169
152
|
e.disableAnimation = r;
|
|
170
|
-
} }, metadata: a },
|
|
153
|
+
} }, metadata: a }, G, V), w(h, null, B, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
|
|
171
154
|
e.now = r;
|
|
172
|
-
} }, metadata: a }, null,
|
|
173
|
-
})(),
|
|
155
|
+
} }, metadata: a }, null, O), w(null, l = { value: p }, t, { kind: "class", name: p.name, metadata: a }, null, n), p = l.value, a && Object.defineProperty(p, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
156
|
+
})(), h.styles = ve, v(p, n), p;
|
|
174
157
|
})();
|
|
175
158
|
export {
|
|
176
|
-
|
|
159
|
+
Ne as SbbPearlChainElement
|
|
177
160
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Q = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var h = (a, s, o) => (
|
|
4
|
+
var U = (a, s, o) => s.has(a) || Q("Cannot " + o);
|
|
5
|
+
var h = (a, s, o) => (U(a, s, "read from private field"), o ? o.call(a) : s.get(a)), b = (a, s, o) => s.has(a) ? Q("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(a) : s.set(a, o), n = (a, s, o, m) => (U(a, s, "write to private field"), m ? m.call(a, o) : s.set(a, o), o);
|
|
6
6
|
import { __runInitializers as r, __esDecorate as c } from "tslib";
|
|
7
|
-
import { SbbLanguageController as
|
|
8
|
-
import { defaultDateAdapter as
|
|
9
|
-
import { forceType as
|
|
10
|
-
import { i18nDeparture as
|
|
11
|
-
import { css as
|
|
12
|
-
import { customElement as
|
|
13
|
-
import { removeTimezoneFromISOTimeString as
|
|
14
|
-
import { getDepartureArrivalTimeAttribute as
|
|
7
|
+
import { SbbLanguageController as ae } from "@sbb-esta/lyne-elements/core/controllers.js";
|
|
8
|
+
import { defaultDateAdapter as X } from "@sbb-esta/lyne-elements/core/datetime.js";
|
|
9
|
+
import { forceType as x } from "@sbb-esta/lyne-elements/core/decorators.js";
|
|
10
|
+
import { i18nDeparture as ie, i18nTransferProcedures as re, i18nArrival as se } from "@sbb-esta/lyne-elements/core/i18n.js";
|
|
11
|
+
import { css as le, LitElement as ne, nothing as w, html as k } from "lit";
|
|
12
|
+
import { customElement as oe, property as p } from "lit/decorators.js";
|
|
13
|
+
import { removeTimezoneFromISOTimeString as Y } from "../core/datetime.js";
|
|
14
|
+
import { getDepartureArrivalTimeAttribute as me, isRideLeg as ce } from "../core/timetable.js";
|
|
15
15
|
import "../pearl-chain.js";
|
|
16
|
-
import { f as
|
|
17
|
-
const
|
|
18
|
-
let
|
|
16
|
+
import { f as Z } from "../format-lqeCzmzS.js";
|
|
17
|
+
const he = le`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-pearl-chain-time-height: auto}@media (min-width: 37.5rem){:host{--sbb-pearl-chain-time-height: 1.5625rem}}@media (min-width: 52.5rem){:host{--sbb-pearl-chain-time-height: 1.75rem}}.sbb-pearl-chain__time{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;height:var(--sbb-pearl-chain-time-height)}.sbb-pearl-chain__time-walktime,.sbb-pearl-chain__time-transfer{--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:inline-flex;align-items:center}.sbb-pearl-chain__time-walktime--walk-small-left{transform:translate(-.4375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .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{transform:translate(-.375rem);margin-inline-end:calc(var(--sbb-spacing-fixed-2x) - .4375rem)}.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{flex:1 1 auto;align-self:center;margin-inline:var(--sbb-spacing-fixed-3x)}.sbb-pearl-chain__time-time{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);font-weight:700;color:var(--sbb-color-charcoal)}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
|
|
18
|
+
let ze = (() => {
|
|
19
19
|
var d, _, g, u, f, v, y, l;
|
|
20
|
-
let a = [
|
|
21
|
-
return l = class extends
|
|
20
|
+
let a = [oe("sbb-pearl-chain-time")], s, o = [], m, T = ne, z = [], W, A = [], $ = [], F, I = [], D = [], S, N = [], E = [], H, L = [], O = [], j, P = [], B = [], C, R = [], V = [], q, G = [], J = [], K;
|
|
21
|
+
return l = class extends T {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
24
|
b(this, d);
|
|
@@ -28,7 +28,7 @@ let We = (() => {
|
|
|
28
28
|
b(this, f);
|
|
29
29
|
b(this, v);
|
|
30
30
|
b(this, y);
|
|
31
|
-
n(this, d, (r(this,
|
|
31
|
+
n(this, d, (r(this, z), r(this, A, []))), n(this, _, (r(this, $), r(this, I, ""))), n(this, g, (r(this, D), r(this, N, ""))), n(this, u, (r(this, E), r(this, L, NaN))), n(this, f, (r(this, O), r(this, P, NaN))), n(this, v, (r(this, B), r(this, R, !1))), n(this, y, (r(this, V), r(this, G, !1))), this._now = (r(this, J), null), this._language = new ae(this);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* define the legs of the pearl-chain.
|
|
@@ -91,63 +91,62 @@ let We = (() => {
|
|
|
91
91
|
}
|
|
92
92
|
/** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
|
|
93
93
|
set now(t) {
|
|
94
|
-
this._now =
|
|
94
|
+
this._now = X.getValidDateOrNull(X.deserialize(t));
|
|
95
95
|
}
|
|
96
96
|
get now() {
|
|
97
97
|
return this._now ?? /* @__PURE__ */ new Date();
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return w`
|
|
100
|
+
const t = this.departureTime ? Y(this.departureTime) : void 0, e = this.arrivalTime ? Y(this.arrivalTime) : void 0, { renderDepartureTimeAttribute: i, renderArrivalTimeAttribute: ee } = me(this.legs, this.departureWalk || 0, this.arrivalWalk || 0, this._language.current, this.a11yFootpath), M = this.legs?.filter((te) => ce(te));
|
|
101
|
+
return k`
|
|
103
102
|
<div class="sbb-pearl-chain__time">
|
|
104
103
|
${i()}
|
|
105
|
-
${t ?
|
|
104
|
+
${t ? k`<time class="sbb-pearl-chain__time-time" datetime=${this.departureTime}>
|
|
106
105
|
<span class="sbb-screen-reader-only"
|
|
107
|
-
>${
|
|
106
|
+
>${ie[this._language.current]}: </span
|
|
108
107
|
>
|
|
109
|
-
${
|
|
110
|
-
</time>` :
|
|
111
|
-
${
|
|
112
|
-
${
|
|
113
|
-
</span>` :
|
|
108
|
+
${Z(t, "HH:mm")}
|
|
109
|
+
</time>` : w}
|
|
110
|
+
${M?.length > 1 ? k`<span class="sbb-screen-reader-only" role="paragraph">
|
|
111
|
+
${M?.length - 1} ${re[this._language.current]}
|
|
112
|
+
</span>` : w}
|
|
114
113
|
<sbb-pearl-chain
|
|
115
114
|
class="sbb-pearl-chain__time-chain"
|
|
116
115
|
.legs=${this.legs}
|
|
117
116
|
.disableAnimation=${this.disableAnimation}
|
|
118
117
|
.now=${this.now}
|
|
119
118
|
></sbb-pearl-chain>
|
|
120
|
-
${e ?
|
|
119
|
+
${e ? k`<time class="sbb-pearl-chain__time-time" datetime=${this.arrivalTime}>
|
|
121
120
|
<span class="sbb-screen-reader-only"
|
|
122
|
-
>${
|
|
121
|
+
>${se[this._language.current]}: </span
|
|
123
122
|
>
|
|
124
|
-
${
|
|
125
|
-
</time>` :
|
|
126
|
-
${
|
|
123
|
+
${Z(e, "HH:mm")}
|
|
124
|
+
</time>` : w}
|
|
125
|
+
${ee()}
|
|
127
126
|
</div>
|
|
128
127
|
`;
|
|
129
128
|
}
|
|
130
129
|
}, d = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), u = new WeakMap(), f = new WeakMap(), v = new WeakMap(), y = new WeakMap(), m = l, (() => {
|
|
131
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
132
|
-
|
|
130
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(T[Symbol.metadata] ?? null) : void 0;
|
|
131
|
+
W = [p({ type: Array })], F = [x(), p({ attribute: "departure-time" })], S = [x(), p({ attribute: "arrival-time" })], H = [x(), p({ attribute: "departure-walk", type: Number })], j = [x(), p({ attribute: "arrival-walk", type: Number })], C = [x(), p({ attribute: "disable-animation", type: Boolean })], q = [x(), p({ attribute: "a11y-footpath", type: Boolean })], K = [p()], c(l, null, W, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, i) => {
|
|
133
132
|
e.legs = i;
|
|
134
|
-
} }, metadata: t },
|
|
133
|
+
} }, metadata: t }, A, $), c(l, null, F, { kind: "accessor", name: "departureTime", static: !1, private: !1, access: { has: (e) => "departureTime" in e, get: (e) => e.departureTime, set: (e, i) => {
|
|
135
134
|
e.departureTime = i;
|
|
136
|
-
} }, metadata: t },
|
|
135
|
+
} }, metadata: t }, I, D), c(l, null, S, { kind: "accessor", name: "arrivalTime", static: !1, private: !1, access: { has: (e) => "arrivalTime" in e, get: (e) => e.arrivalTime, set: (e, i) => {
|
|
137
136
|
e.arrivalTime = i;
|
|
138
|
-
} }, metadata: t },
|
|
137
|
+
} }, metadata: t }, N, E), c(l, null, H, { kind: "accessor", name: "departureWalk", static: !1, private: !1, access: { has: (e) => "departureWalk" in e, get: (e) => e.departureWalk, set: (e, i) => {
|
|
139
138
|
e.departureWalk = i;
|
|
140
|
-
} }, metadata: t },
|
|
139
|
+
} }, metadata: t }, L, O), c(l, null, j, { kind: "accessor", name: "arrivalWalk", static: !1, private: !1, access: { has: (e) => "arrivalWalk" in e, get: (e) => e.arrivalWalk, set: (e, i) => {
|
|
141
140
|
e.arrivalWalk = i;
|
|
142
|
-
} }, metadata: t },
|
|
141
|
+
} }, metadata: t }, P, B), c(l, null, C, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, i) => {
|
|
143
142
|
e.disableAnimation = i;
|
|
144
|
-
} }, metadata: t },
|
|
143
|
+
} }, metadata: t }, R, V), c(l, null, q, { kind: "accessor", name: "a11yFootpath", static: !1, private: !1, access: { has: (e) => "a11yFootpath" in e, get: (e) => e.a11yFootpath, set: (e, i) => {
|
|
145
144
|
e.a11yFootpath = i;
|
|
146
|
-
} }, metadata: t },
|
|
145
|
+
} }, metadata: t }, G, J), c(l, null, K, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, i) => {
|
|
147
146
|
e.now = i;
|
|
148
|
-
} }, metadata: t }, null,
|
|
149
|
-
})(), l.styles =
|
|
147
|
+
} }, metadata: t }, null, z), c(null, s = { value: m }, a, { kind: "class", name: m.name, metadata: t }, null, o), m = s.value, t && Object.defineProperty(m, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
148
|
+
})(), l.styles = he, r(m, o), m;
|
|
150
149
|
})();
|
|
151
150
|
export {
|
|
152
|
-
|
|
151
|
+
ze as SbbPearlChainTimeElement
|
|
153
152
|
};
|