@sbb-esta/lyne-elements-experimental 1.13.0 → 1.14.1

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.
Files changed (49) hide show
  1. package/core/datetime.js +3 -9
  2. package/core/timetable.js +10 -64
  3. package/custom-elements.json +90 -40
  4. package/development/core/datetime.js +4 -10
  5. package/development/core/timetable.js +11 -65
  6. package/development/differenceInMinutes-Cmyza6nm.js +1 -1
  7. package/development/format-DTy5_IOt.js +1 -1
  8. package/development/isValid-DO_pHwcW.js +1 -1
  9. package/development/journey-summary/journey-summary.d.ts +6 -6
  10. package/development/journey-summary/journey-summary.d.ts.map +1 -1
  11. package/development/journey-summary.js +180 -82
  12. package/development/pearl-chain/pearl-chain.d.ts +2 -2
  13. package/development/pearl-chain/pearl-chain.d.ts.map +1 -1
  14. package/development/pearl-chain-time/pearl-chain-time.d.ts +7 -7
  15. package/development/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
  16. package/development/pearl-chain-time.js +176 -68
  17. package/development/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -1
  18. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +2 -2
  19. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -1
  20. package/development/pearl-chain-vertical-item.js +67 -30
  21. package/development/pearl-chain-vertical.js +22 -21
  22. package/development/pearl-chain.js +210 -166
  23. package/development/timetable-duration/timetable-duration.d.ts +1 -1
  24. package/development/timetable-duration/timetable-duration.d.ts.map +1 -1
  25. package/development/timetable-duration.js +72 -45
  26. package/development/timetable-row/timetable-row.d.ts +10 -10
  27. package/development/timetable-row/timetable-row.d.ts.map +1 -1
  28. package/development/timetable-row.js +337 -205
  29. package/journey-summary/journey-summary.d.ts +6 -6
  30. package/journey-summary/journey-summary.d.ts.map +1 -1
  31. package/journey-summary.js +156 -100
  32. package/package.json +4 -3
  33. package/pearl-chain/pearl-chain.d.ts +2 -2
  34. package/pearl-chain/pearl-chain.d.ts.map +1 -1
  35. package/pearl-chain-time/pearl-chain-time.d.ts +7 -7
  36. package/pearl-chain-time/pearl-chain-time.d.ts.map +1 -1
  37. package/pearl-chain-time.js +137 -78
  38. package/pearl-chain-vertical/pearl-chain-vertical.d.ts.map +1 -1
  39. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts +2 -2
  40. package/pearl-chain-vertical-item/pearl-chain-vertical-item.d.ts.map +1 -1
  41. package/pearl-chain-vertical-item.js +57 -34
  42. package/pearl-chain-vertical.js +17 -18
  43. package/pearl-chain.js +156 -131
  44. package/timetable-duration/timetable-duration.d.ts +1 -1
  45. package/timetable-duration/timetable-duration.d.ts.map +1 -1
  46. package/timetable-duration.js +48 -30
  47. package/timetable-row/timetable-row.d.ts +10 -10
  48. package/timetable-row/timetable-row.d.ts.map +1 -1
  49. package/timetable-row.js +331 -267
package/pearl-chain.js CHANGED
@@ -1,152 +1,177 @@
1
- import { defaultDateAdapter as j } from "@sbb-esta/lyne-elements/core/datetime.js";
2
- import { css as te, LitElement as le, html as u, nothing as M } from "lit";
3
- import { property as S, customElement as ie } from "lit/decorators.js";
4
- import { styleMap as Y } from "lit/directives/style-map.js";
5
- import { removeTimezoneFromISOTimeString as c } from "./core/datetime.js";
6
- import { isRideLeg as se } from "./core/timetable.js";
7
- import { d as g, a as m } from "./differenceInMinutes-BI2zjbtS.js";
8
- import { t as f } from "./toDate-DQg4ZFnf.js";
9
- function be(a, e) {
10
- return +f(a) > +f(e);
1
+ var oe = (l) => {
2
+ throw TypeError(l);
3
+ };
4
+ var be = (l, n, p) => n.has(l) || oe("Cannot " + p);
5
+ var I = (l, n, p) => (be(l, n, "read from private field"), p ? p.call(l) : n.get(l)), H = (l, n, p) => n.has(l) ? oe("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(l) : n.set(l, p), k = (l, n, p, d) => (be(l, n, "write to private field"), d ? d.call(l, p) : n.set(l, p), p);
6
+ import { __runInitializers as f, __esDecorate as S } from "tslib";
7
+ import { defaultDateAdapter as ce } from "@sbb-esta/lyne-elements/core/datetime.js";
8
+ import { forceType as xe } from "@sbb-esta/lyne-elements/core/decorators.js";
9
+ import { css as Se, html as y, nothing as pe, LitElement as De } from "lit";
10
+ import { customElement as Te, property as O } from "lit/decorators.js";
11
+ import { styleMap as he } from "lit/directives/style-map.js";
12
+ import { removeTimezoneFromISOTimeString as h } from "./core/datetime.js";
13
+ import { isRideLeg as Ae } from "./core/timetable.js";
14
+ import { d as D, a as T } from "./differenceInMinutes-BI2zjbtS.js";
15
+ import { t as A } from "./toDate-DQg4ZFnf.js";
16
+ function Ce(l, n) {
17
+ return +A(l) > +A(n);
11
18
  }
12
- function F(a, e) {
13
- return +f(a) < +f(e);
19
+ function de(l, n) {
20
+ return +A(l) < +A(n);
14
21
  }
15
- const oe = te`*,: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}`;
16
- var ne = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, y = (a, e, r, t) => {
17
- for (var l = t > 1 ? void 0 : t ? ce(e, r) : e, b = a.length - 1, n; b >= 0; b--)
18
- (n = a[b]) && (l = (t ? n(e, r, l) : n(l)) || l);
19
- return t && l && ne(e, r, l), l;
20
- };
21
- let h = class extends le {
22
- constructor() {
23
- super(...arguments), this._now = null;
24
- }
25
- set now(a) {
26
- this._now = j.getValidDateOrNull(j.deserialize(a));
27
- }
28
- get now() {
29
- return this._now;
30
- }
31
- _getAllDuration(a) {
32
- return a == null ? void 0 : a.reduce((e, r) => {
33
- var b, n;
34
- const t = c((b = r.arrival) == null ? void 0 : b.time), l = c((n = r.departure) == null ? void 0 : n.time);
35
- return t && l ? e + g(
36
- c(r.arrival.time),
37
- c(r.departure.time)
38
- ) : e;
39
- }, 0);
40
- }
41
- _isAllCancelled(a) {
42
- return a == null ? void 0 : a.every((e) => {
43
- var r, t;
44
- return (t = (r = e == null ? void 0 : e.serviceJourney) == null ? void 0 : r.serviceAlteration) == null ? void 0 : t.cancelled;
45
- });
46
- }
47
- _getRelativeDuration(a, e) {
48
- var l, b;
49
- const r = c((l = e.arrival) == null ? void 0 : l.time), t = c((b = e.departure) == null ? void 0 : b.time);
50
- if (r && t) {
51
- const n = g(
52
- c(e.arrival.time),
53
- c(e.departure.time)
54
- ), d = this._getAllDuration(a);
55
- return d === 0 ? 100 : n / d * 100;
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 Me = (() => {
24
+ var v, g, u;
25
+ let l = [Te("sbb-pearl-chain")], n, p = [], d, J = De, R = [], W, G = [], V = [], B, j = [], M = [], Y;
26
+ return u = class extends J {
27
+ constructor() {
28
+ super(...arguments);
29
+ H(this, v);
30
+ H(this, g);
31
+ k(this, v, (f(this, R), f(this, G, []))), k(this, g, (f(this, V), f(this, j, !1))), this._now = (f(this, M), null);
32
+ }
33
+ /**
34
+ * Define the legs of the pearl-chain.
35
+ * Format:
36
+ * `{"legs": [{"duration": 25}, ...]}`
37
+ * `duration` in minutes. Duration of the leg is relative
38
+ * to the total travel time. Example: departure 16:30, change at 16:40,
39
+ * arrival at 17:00. So the change should have a duration of 33.33%.
40
+ */
41
+ get legs() {
42
+ return I(this, v);
43
+ }
44
+ set legs(a) {
45
+ k(this, v, a);
46
+ }
47
+ /**
48
+ * Per default, the current location has a pulsating animation. You can
49
+ * disable the animation with this property.
50
+ */
51
+ get disableAnimation() {
52
+ return I(this, g);
53
+ }
54
+ set disableAnimation(a) {
55
+ k(this, g, a);
56
+ }
57
+ /** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
58
+ set now(a) {
59
+ this._now = ce.getValidDateOrNull(ce.deserialize(a));
60
+ }
61
+ get now() {
62
+ return this._now;
63
+ }
64
+ _getAllDuration(a) {
65
+ return a == null ? void 0 : a.reduce((e, r) => {
66
+ var c, _;
67
+ const i = h((c = r.arrival) == null ? void 0 : c.time), b = h((_ = r.departure) == null ? void 0 : _.time);
68
+ return i && b ? e + D(h(r.arrival.time), h(r.departure.time)) : e;
69
+ }, 0);
56
70
  }
57
- return 0;
58
- }
59
- _getProgress(a, e, r) {
60
- if (!(e != null && e.time) || !(r != null && r.time))
71
+ _isAllCancelled(a) {
72
+ return a == null ? void 0 : a.every((e) => {
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
+ });
76
+ }
77
+ _getRelativeDuration(a, e) {
78
+ var b, c;
79
+ const r = h((b = e.arrival) == null ? void 0 : b.time), i = h((c = e.departure) == null ? void 0 : c.time);
80
+ if (r && i) {
81
+ const _ = D(h(e.arrival.time), h(e.departure.time)), w = this._getAllDuration(a);
82
+ return w === 0 ? 100 : _ / w * 100;
83
+ }
61
84
  return 0;
62
- const t = m(e.time, e.delay ?? 0), l = m(r.time, r.delay ?? 0), b = g(l, t), n = g(a, t);
63
- return b && n / b * 100;
64
- }
65
- _getStatus(a, e, r) {
66
- const t = e && e.time && m(e.time, e.delay ?? 0), l = r && r.time && m(r.time, r.delay ?? 0);
67
- return t && F(t, a) && l && be(l, a) ? "progress" : l && F(l, a) ? "past" : "future";
68
- }
69
- _renderPosition(a, e, r) {
70
- const t = this._getProgress(a, e, r);
71
- if (t < 0 && t > 100) return;
72
- const l = () => ({
73
- "--sbb-pearl-chain-status-position": `${t}%`,
74
- ...t >= 50 ? { transform: "translateX(-100%)" } : {}
75
- }), b = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
76
- return u`<span
77
- style=${Y(l())}
78
- class="sbb-pearl-chain__position ${b}"
85
+ }
86
+ _getProgress(a, e, r) {
87
+ if (!(e != null && e.time) || !(r != null && r.time))
88
+ return 0;
89
+ const i = T(e.time, e.delay ?? 0), b = T(r.time, r.delay ?? 0), c = D(b, i), _ = D(a, i);
90
+ return c && _ / c * 100;
91
+ }
92
+ _getStatus(a, e, r) {
93
+ const i = e && e.time && T(e.time, e.delay ?? 0), b = r && r.time && T(r.time, r.delay ?? 0);
94
+ return i && de(i, a) && b && Ce(b, a) ? "progress" : b && de(b, a) ? "past" : "future";
95
+ }
96
+ _renderPosition(a, e, r) {
97
+ const i = this._getProgress(a, e, r);
98
+ if (i < 0 && i > 100)
99
+ return;
100
+ const b = () => ({
101
+ "--sbb-pearl-chain-status-position": `${i}%`,
102
+ ...i >= 50 ? { transform: "translateX(-100%)" } : {}
103
+ }), c = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
104
+ return y`<span
105
+ style=${he(b())}
106
+ class="sbb-pearl-chain__position ${c}"
79
107
  ></span>`;
80
- }
81
- render() {
82
- var P, $, A, N, E;
83
- const a = this.now ?? /* @__PURE__ */ new Date(), e = (P = this.legs) == null ? void 0 : P.filter((i) => se(i)), r = (e == null ? void 0 : e.length) && c((A = ($ = e[0]) == null ? void 0 : $.departure) == null ? void 0 : A.time), t = r && {
84
- time: r,
85
- delay: e[0].departure.delay ?? 0
86
- }, l = (e == null ? void 0 : e.length) && c((N = e[e.length - 1].arrival) == null ? void 0 : N.time), b = l && {
87
- time: l,
88
- delay: ((E = e[e.length - 1]) == null ? void 0 : E.arrival.delay) ?? 0
89
- }, n = (() => {
90
- var i, o, s, p;
91
- return e && ((o = (i = e[0]) == null ? void 0 : i.serviceJourney) != null && o.stopPoints) && ((p = (s = e[0]) == null ? void 0 : s.serviceJourney) == null ? void 0 : p.stopPoints[0].stopStatus) === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "";
92
- })(), d = (() => {
93
- var s;
94
- const i = e && e[e.length - 1], o = i && ((s = i.serviceJourney) == null ? void 0 : s.stopPoints);
95
- return o && o[o.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
96
- })(), C = (() => {
97
- var i, o, s;
98
- return e && ((s = (o = (i = e[0]) == null ? void 0 : i.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--departure-disruption" : "";
99
- })(), T = (() => {
100
- var i, o, s;
101
- return e && ((s = (o = (i = e[e.length - 1]) == null ? void 0 : i.serviceJourney) == null ? void 0 : o.serviceAlteration) != null && s.cancelled) ? "sbb-pearl-chain--arrival-disruption" : "";
102
- })(), k = t && b && this._getStatus(a, t, b), L = e && k && !C ? "sbb-pearl-chain__bullet--" + k : "", X = e && k && !T ? "sbb-pearl-chain__bullet--" + this._getStatus(a, void 0, b) : "";
103
- return this._isAllCancelled(e) ? u`
108
+ }
109
+ render() {
110
+ var X, q, K, Q, U;
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 && {
112
+ time: r,
113
+ delay: e[0].departure.delay ?? 0
114
+ }, b = (e == null ? void 0 : e.length) && h((Q = e[e.length - 1].arrival) == null ? void 0 : Q.time), c = b && {
115
+ time: b,
116
+ delay: ((U = e[e.length - 1]) == null ? void 0 : U.arrival.delay) ?? 0
117
+ }, _ = (() => {
118
+ var t, o, s, m;
119
+ return e && ((o = (t = e[0]) == null ? void 0 : t.serviceJourney) != null && o.stopPoints) && ((m = (s = e[0]) == null ? void 0 : s.serviceJourney) == null ? void 0 : m.stopPoints[0].stopStatus) === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "";
120
+ })(), w = (() => {
121
+ var s;
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`
104
132
  <div class="sbb-pearl-chain">
105
133
  <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
106
134
  <div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
107
135
  <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
108
136
  </div>
109
- ` : u`
137
+ ` : y`
110
138
  <div class="sbb-pearl-chain">
111
139
  <span
112
- class="sbb-pearl-chain__bullet ${L} ${n} ${C}"
140
+ class="sbb-pearl-chain__bullet ${ue} ${_} ${F}"
113
141
  ></span>
114
- ${e == null ? void 0 : e.map((i, o) => {
115
- var H, J, R, I, W, G, V, B;
116
- const { stopPoints: s, serviceAlteration: p } = (i == null ? void 0 : i.serviceJourney) || {}, q = this._getRelativeDuration(e, i), K = c((H = i.departure) == null ? void 0 : H.time), Q = c((J = i.arrival) == null ? void 0 : J.time), U = s && ((R = s[s.length - 1]) == null ? void 0 : R.stopStatus) === "NOT_SERVICED", Z = s && ((I = s[s.length - 1]) == null ? void 0 : I.stopStatus) === "PLANNED", O = s && ((W = s[0]) == null ? void 0 : W.stopStatus) === "NOT_SERVICED", w = o > 0 && e[o - 1].serviceJourney.stopPoints, ee = w && ((G = w[w.length - 1]) == null ? void 0 : G.stopStatus) === "NOT_SERVICED", _ = U || O && Z ? "sbb-pearl-chain__leg--skipped" : "", ae = O || ee ? "sbb-pearl-chain__stop--departure-skipped" : "", v = p != null && p.cancelled ? "sbb-pearl-chain__leg--disruption" : "", z = { time: K, delay: ((V = i.departure) == null ? void 0 : V.delay) ?? 0 }, x = { time: Q, delay: ((B = i.arrival) == null ? void 0 : B.delay) ?? 0 }, D = this._getStatus(a, z, x), re = !v && !_ && "sbb-pearl-chain__leg--" + D;
117
- return u` <div
118
- class="sbb-pearl-chain__leg ${re || ""} ${v} ${_}"
119
- style=${Y({
120
- "--sbb-pearl-chain-leg-width": `${q}%`,
121
- ...D === "progress" && !v && !_ ? {
122
- "--sbb-pearl-chain-leg-status": `${this._getProgress(a, z, x)}%`
123
- } : {}
124
- })}
142
+ ${e == null ? void 0 : e.map((t, o) => {
143
+ var ee, ae, re, te, le, ie, se, ne;
144
+ const { stopPoints: s, serviceAlteration: m } = (t == null ? void 0 : t.serviceJourney) || {}, ve = this._getRelativeDuration(e, t), ge = h((ee = t.departure) == null ? void 0 : ee.time), me = h((ae = t.arrival) == null ? void 0 : ae.time), fe = s && ((re = s[s.length - 1]) == null ? void 0 : re.stopStatus) === "NOT_SERVICED", ke = s && ((te = s[s.length - 1]) == null ? void 0 : te.stopStatus) === "PLANNED", Z = s && ((le = s[0]) == null ? void 0 : le.stopStatus) === "NOT_SERVICED", $ = o > 0 && e[o - 1].serviceJourney.stopPoints, ye = $ && ((ie = $[$.length - 1]) == null ? void 0 : ie.stopStatus) === "NOT_SERVICED", z = fe || Z && ke ? "sbb-pearl-chain__leg--skipped" : "", we = Z || ye ? "sbb-pearl-chain__stop--departure-skipped" : "", x = m != null && m.cancelled ? "sbb-pearl-chain__leg--disruption" : "", N = { time: ge, delay: ((se = t.departure) == null ? void 0 : se.delay) ?? 0 }, E = { time: me, delay: ((ne = t.arrival) == null ? void 0 : ne.delay) ?? 0 }, P = this._getStatus(a, N, E), ze = !x && !z && "sbb-pearl-chain__leg--" + P;
145
+ return y` <div
146
+ class="sbb-pearl-chain__leg ${ze || ""} ${x} ${z}"
147
+ style=${he({
148
+ "--sbb-pearl-chain-leg-width": `${ve}%`,
149
+ ...P === "progress" && !x && !z ? {
150
+ "--sbb-pearl-chain-leg-status": `${this._getProgress(a, N, E)}%`
151
+ } : {}
152
+ })}
125
153
  >
126
- ${o > 0 && o < e.length ? u`<span class="sbb-pearl-chain__stop ${ae}"></span>` : M}
127
- ${D === "progress" && !v && !_ ? this._renderPosition(a, z, x) : M}
154
+ ${o > 0 && o < e.length ? y`<span class="sbb-pearl-chain__stop ${we}"></span>` : pe}
155
+ ${P === "progress" && !x && !z ? this._renderPosition(a, N, E) : pe}
128
156
  </div>`;
129
- })}
157
+ })}
130
158
  <span
131
- class="sbb-pearl-chain__bullet ${X} ${d} ${T}"
159
+ class="sbb-pearl-chain__bullet ${_e} ${w} ${L}"
132
160
  ></span>
133
161
  </div>
134
162
  `;
135
- }
136
- };
137
- h.styles = oe;
138
- y([
139
- S({ type: Array })
140
- ], h.prototype, "legs", 2);
141
- y([
142
- S({ attribute: "disable-animation", type: Boolean })
143
- ], h.prototype, "disableAnimation", 2);
144
- y([
145
- S()
146
- ], h.prototype, "now", 1);
147
- h = y([
148
- ie("sbb-pearl-chain")
149
- ], h);
163
+ }
164
+ }, v = new WeakMap(), g = new WeakMap(), d = u, (() => {
165
+ const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(J[Symbol.metadata] ?? null) : void 0;
166
+ W = [O({ type: Array })], B = [xe(), O({ attribute: "disable-animation", type: Boolean })], Y = [O()], S(u, null, W, { kind: "accessor", name: "legs", static: !1, private: !1, access: { has: (e) => "legs" in e, get: (e) => e.legs, set: (e, r) => {
167
+ e.legs = r;
168
+ } }, metadata: a }, G, V), S(u, null, B, { kind: "accessor", name: "disableAnimation", static: !1, private: !1, access: { has: (e) => "disableAnimation" in e, get: (e) => e.disableAnimation, set: (e, r) => {
169
+ e.disableAnimation = r;
170
+ } }, metadata: a }, j, M), S(u, null, Y, { kind: "setter", name: "now", static: !1, private: !1, access: { has: (e) => "now" in e, set: (e, r) => {
171
+ e.now = r;
172
+ } }, metadata: a }, null, R), S(null, n = { value: d }, l, { kind: "class", name: d.name, metadata: a }, null, p), d = n.value, a && Object.defineProperty(d, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
173
+ })(), u.styles = $e, f(d, p), d;
174
+ })();
150
175
  export {
151
- h as SbbPearlChainElement
176
+ Me as SbbPearlChainElement
152
177
  };
@@ -10,7 +10,7 @@ export declare class SbbTimetableDurationElement extends LitElement {
10
10
  * individual stories to get an idea of the
11
11
  * structure.
12
12
  */
13
- config: string;
13
+ accessor config: string;
14
14
  private _language;
15
15
  protected render(): TemplateResult;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"timetable-duration.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/timetable-duration/timetable-duration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC;;GAEG;AACH,qBACa,2BAA4B,SAAQ,UAAU;IACzD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;;;OAKG;IACgB,MAAM,EAAG,MAAM,CAAC;IAEnC,OAAO,CAAC,SAAS,CAAmC;cAEjC,MAAM,IAAI,cAAc;CAqC5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,wBAAwB,EAAE,2BAA2B,CAAC;KACvD;CACF"}
1
+ {"version":3,"file":"timetable-duration.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/timetable-duration/timetable-duration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC;;GAEG;AACH,qBAEM,2BAA4B,SAAQ,UAAU;IAClD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;;;OAKG;IACH,SAEgB,MAAM,EAAE,MAAM,CAAM;IAEpC,OAAO,CAAC,SAAS,CAAmC;cAEjC,MAAM,IAAI,cAAc;CAqC5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,wBAAwB,EAAE,2BAA2B,CAAC;KACvD;CACF"}
@@ -1,37 +1,55 @@
1
- import { SbbLanguageController as g } from "@sbb-esta/lyne-elements/core/controllers.js";
2
- import { i18nDurationHour as l, i18nDurationMinute as u } from "@sbb-esta/lyne-elements/core/i18n.js";
3
- import { css as b, LitElement as h, html as c } from "lit";
4
- import { property as m, customElement as f } from "lit/decorators.js";
5
- const d = b`*,:before,:after{box-sizing:border-box}:host{display:inline-block}.duration{--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);margin:0;white-space:nowrap}.duration__text--visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
6
- var _ = Object.defineProperty, x = Object.getOwnPropertyDescriptor, p = (e, n, s, r) => {
7
- for (var t = r > 1 ? void 0 : r ? x(n, s) : n, i = e.length - 1, o; i >= 0; i--)
8
- (o = e[i]) && (t = (r ? o(n, s, t) : o(t)) || t);
9
- return r && t && _(n, s, t), t;
1
+ var v = (t) => {
2
+ throw TypeError(t);
10
3
  };
11
- let a = class extends h {
12
- constructor() {
13
- super(...arguments), this._language = new g(this);
14
- }
15
- render() {
16
- const e = JSON.parse(this.config), n = l.multiple.short[this._language.current], s = u.multiple.short[this._language.current];
17
- let r = "", t = "", i = l.multiple.long[this._language.current], o = u.multiple.long[this._language.current];
18
- return e.hours === 1 && (i = l.single.long[this._language.current]), e.minutes === 1 && (o = u.single.long[this._language.current]), e.hours !== 0 && (r += `${e.hours} ${n}`, t += `${e.hours} ${i}`), r += ` ${e.minutes} ${s}`, t += ` ${e.minutes} ${o}.`, c`
19
- <p aria-label=${t} class="duration" role="text">
4
+ var $ = (t, e, a) => e.has(t) || v("Cannot " + a);
5
+ var S = (t, e, a) => ($(t, e, "read from private field"), a ? a.call(t) : e.get(t)), w = (t, e, a) => e.has(t) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), g = (t, e, a, s) => ($(t, e, "write to private field"), s ? s.call(t, a) : e.set(t, a), a);
6
+ import { __runInitializers as m, __esDecorate as z } from "tslib";
7
+ import { SbbLanguageController as L } from "@sbb-esta/lyne-elements/core/controllers.js";
8
+ import { forceType as D } from "@sbb-esta/lyne-elements/core/decorators.js";
9
+ import { i18nDurationHour as h, i18nDurationMinute as b } from "@sbb-esta/lyne-elements/core/i18n.js";
10
+ import { css as E, html as T, LitElement as k } from "lit";
11
+ import { customElement as I, property as O } from "lit/decorators.js";
12
+ const j = E`*,:before,:after{box-sizing:border-box}:host{display:inline-block}.duration{--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);margin:0;white-space:nowrap}.duration__text--visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`;
13
+ let B = (() => {
14
+ var o, n;
15
+ let t = [I("sbb-timetable-duration")], e, a = [], s, p = k, f, d = [], _ = [];
16
+ return n = class extends p {
17
+ constructor() {
18
+ super(...arguments);
19
+ w(this, o);
20
+ g(this, o, m(this, d, "")), this._language = (m(this, _), new L(this));
21
+ }
22
+ /**
23
+ * Stringified JSON which defines most of the
24
+ * content of the component. Please check the
25
+ * individual stories to get an idea of the
26
+ * structure.
27
+ */
28
+ get config() {
29
+ return S(this, o);
30
+ }
31
+ set config(i) {
32
+ g(this, o, i);
33
+ }
34
+ render() {
35
+ const i = JSON.parse(this.config), r = h.multiple.short[this._language.current], u = b.multiple.short[this._language.current];
36
+ let c = "", l = "", y = h.multiple.long[this._language.current], x = b.multiple.long[this._language.current];
37
+ return i.hours === 1 && (y = h.single.long[this._language.current]), i.minutes === 1 && (x = b.single.long[this._language.current]), i.hours !== 0 && (c += `${i.hours} ${r}`, l += `${i.hours} ${y}`), c += ` ${i.minutes} ${u}`, l += ` ${i.minutes} ${x}.`, T`
38
+ <p aria-label=${l} class="duration" role="text">
20
39
  <span aria-hidden="true" class="duration__text--visual" role="presentation">
21
- ${r}
40
+ ${c}
22
41
  </span>
23
- <span class="duration__text--visually-hidden">${t}</span>
42
+ <span class="duration__text--visually-hidden">${l}</span>
24
43
  </p>
25
44
  `;
26
- }
27
- };
28
- a.styles = d;
29
- p([
30
- m()
31
- ], a.prototype, "config", 2);
32
- a = p([
33
- f("sbb-timetable-duration")
34
- ], a);
45
+ }
46
+ }, o = new WeakMap(), s = n, (() => {
47
+ const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
48
+ f = [D(), O()], z(n, null, f, { kind: "accessor", name: "config", static: !1, private: !1, access: { has: (r) => "config" in r, get: (r) => r.config, set: (r, u) => {
49
+ r.config = u;
50
+ } }, metadata: i }, d, _), z(null, e = { value: s }, t, { kind: "class", name: s.name, metadata: i }, null, a), s = e.value, i && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
51
+ })(), n.styles = j, m(s, a), s;
52
+ })();
35
53
  export {
36
- a as SbbTimetableDurationElement
54
+ B as SbbTimetableDurationElement
37
55
  };
@@ -29,38 +29,38 @@ export declare const handleNotices: (notices: Notice[]) => Notice[];
29
29
  export declare class SbbTimetableRowElement extends LitElement {
30
30
  static styles: CSSResultGroup;
31
31
  /** The trip Prop. */
32
- trip: ITripItem;
32
+ accessor trip: ITripItem;
33
33
  /** The price Prop, which consists of the data for the badge. */
34
- price?: Price;
34
+ accessor price: Price;
35
35
  /** This will be forwarded to the sbb-pearl-chain component - if true the position won't be animated. */
36
- disableAnimation?: boolean;
36
+ accessor disableAnimation: boolean;
37
37
  /** This will be forwarded to the notices section */
38
- boarding?: Boarding;
38
+ accessor boarding: Boarding;
39
39
  /**
40
40
  * The loading state -
41
41
  * when this is true it will be render skeleton with an idling animation
42
42
  */
43
- loadingTrip: boolean;
43
+ accessor loadingTrip: boolean;
44
44
  /**
45
45
  * The Footpath attribute for rendering different icons
46
46
  * true: render a11y-icon
47
47
  * false: render walk-icon
48
48
  * default: render walk-icon
49
49
  */
50
- a11yFootpath?: boolean;
50
+ accessor a11yFootpath: boolean;
51
51
  /**
52
52
  * The loading state -
53
53
  * when this is true it will be render skeleton with an idling animation
54
54
  */
55
- loadingPrice: boolean;
55
+ accessor loadingPrice: boolean;
56
56
  /**
57
57
  * Hidden label for the card action. It overrides the automatically generated accessibility text for the component. Use this prop to provide custom accessibility information for the component.
58
58
  */
59
- cardActionLabel?: string;
59
+ accessor cardActionLabel: string;
60
60
  /** This will be forwarded to the sbb-card component as aria-expanded. */
61
- accessibilityExpanded?: boolean;
61
+ accessor accessibilityExpanded: boolean;
62
62
  /** When this prop is true the sbb-card will be in the active state. */
63
- active?: boolean;
63
+ accessor active: boolean;
64
64
  /** A configured date which acts as the current date instead of the real current date. Recommended for testing purposes. */
65
65
  set now(value: SbbDateLike | undefined);
66
66
  get now(): Date;
@@ -1 +1 @@
1
- {"version":3,"file":"timetable-row.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/timetable-row/timetable-row.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,4CAA4C,CAAC;AAE5F,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAIhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAa,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKtF,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,gDAAgD,CAAC;AACxD,OAAO,wBAAwB,CAAC;AAEhC,qDAAqD;AACrD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,SAAU,MAAM,QAAQ,MAAM,KAAG,cAK9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBAAiB,MAAM,SAAS,MAAM,GAAG,IAAI,KAAG,cAK/E,CAAC;AAsBF,eAAO,MAAM,aAAa,eAAgB,WAAW,EAAE,KAAG,WAAW,EAapE,CAAC;AAEF,eAAO,MAAM,UAAU,cAAe,WAAW,KAAG,MAiCnD,CAAC;AAEF,eAAO,MAAM,MAAM,SAAU,SAAS,mBAAmB,MAAM,KAAG,MAuBjE,CAAC;AAaF,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAG,MAAM,EAUvD,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAG,MAAM,EAcvD,CAAC;AAEF;;KAEK;AACL,qBACa,sBAAuB,SAAQ,UAAU;IACpD,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,qBAAqB;IACc,IAAI,EAAG,SAAS,CAAC;IAEpD,gEAAgE;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;IAEjD,wGAAwG;IAEjG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAElC,oDAAoD;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEvD;;;OAGG;IAC4D,WAAW,UAAS;IAEnF;;;;;OAKG;IAC6D,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvF;;;OAGG;IAC6D,YAAY,UAAS;IAErF;;OAEG;IACkD,eAAe,CAAC,EAAE,MAAM,CAAC;IAE9E,yEAAyE;IAElE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEvC,uEAAuE;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IAErD,2HAA2H;IAC3H,IACW,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAE5C;IACD,IAAW,GAAG,IAAI,IAAI,CAErB;IACD,OAAO,CAAC,IAAI,CAAqB;IAEjC,OAAO,CAAC,SAAS,CAAmC;cAEjC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQ5E,yDAAyD;IACzD,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,mBAAmB;IAc3B,eAAe;IACf,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,qBAAqB;cAyIV,MAAM,IAAI,cAAc;CAwJ5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,mBAAmB,EAAE,sBAAsB,CAAC;KAC7C;CACF"}
1
+ {"version":3,"file":"timetable-row.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/timetable-row/timetable-row.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,4CAA4C,CAAC;AAE5F,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAIhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAa,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKtF,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,gDAAgD,CAAC;AACxD,OAAO,wBAAwB,CAAC;AAEhC,qDAAqD;AACrD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,SAAU,MAAM,QAAQ,MAAM,KAAG,cAK9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,gBAAiB,MAAM,SAAS,MAAM,GAAG,IAAI,KAAG,cAK/E,CAAC;AAsBF,eAAO,MAAM,aAAa,eAAgB,WAAW,EAAE,KAAG,WAAW,EAapE,CAAC;AAEF,eAAO,MAAM,UAAU,cAAe,WAAW,KAAG,MAiCnD,CAAC;AAEF,eAAO,MAAM,MAAM,SAAU,SAAS,mBAAmB,MAAM,KAAG,MAuBjE,CAAC;AAaF,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAG,MAAM,EAUvD,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,MAAM,EAAE,KAAG,MAAM,EAcvD,CAAC;AAEF;;KAEK;AACL,qBAEM,sBAAuB,SAAQ,UAAU;IAC7C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,qBAAqB;IACrB,SAA4C,IAAI,EAAE,SAAS,CAAS;IAEpE,gEAAgE;IAChE,SAA4C,KAAK,EAAE,KAAK,CAAS;IAEjE,wGAAwG;IACxG,SAEgB,gBAAgB,EAAE,OAAO,CAAS;IAElD,oDAAoD;IACpD,SAA4C,QAAQ,EAAE,QAAQ,CAAS;IAEvE;;;OAGG;IACH,SAEgB,WAAW,EAAE,OAAO,CAAS;IAE7C;;;;;OAKG;IACH,SAEgB,YAAY,EAAE,OAAO,CAAS;IAE9C;;;OAGG;IACH,SAEgB,YAAY,EAAE,OAAO,CAAS;IAE9C;;OAEG;IACH,SAEgB,eAAe,EAAE,MAAM,CAAM;IAE7C,yEAAyE;IACzE,SAEgB,qBAAqB,EAAE,OAAO,CAAS;IAEvD,uEAAuE;IACvE,SAEgB,MAAM,EAAE,OAAO,CAAS;IAExC,2HAA2H;IAC3H,IACW,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAE5C;IACD,IAAW,GAAG,IAAI,IAAI,CAErB;IACD,OAAO,CAAC,IAAI,CAAqB;IAEjC,OAAO,CAAC,SAAS,CAAmC;cAEjC,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQ5E,yDAAyD;IACzD,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,mBAAmB;IAc3B,eAAe;IACf,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,qBAAqB;cAyIV,MAAM,IAAI,cAAc;CAwJ5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,mBAAmB,EAAE,sBAAsB,CAAC;KAC7C;CACF"}