@sbb-esta/lyne-elements-experimental 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/autocomplete-grid.js +1 -10
  2. package/autocomplete-grid.pure.js +12 -7
  3. package/core.js +31 -5
  4. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +0 -1
  5. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts +4 -5
  6. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts +1 -2
  7. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts +2 -3
  8. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts +1 -2
  9. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts +1 -2
  10. package/development/autocomplete-grid.d.ts +0 -1
  11. package/development/autocomplete-grid.js +5 -10
  12. package/development/autocomplete-grid.pure.d.ts +0 -1
  13. package/development/autocomplete-grid.pure.js +328 -7
  14. package/development/core/datetime/date-helper.d.ts +0 -1
  15. package/development/core/timetable/access-leg-helper.d.ts +3 -3
  16. package/development/core/timetable/timetable-helper.d.ts +1 -2
  17. package/development/core/timetable/timetable-properties.d.ts +2 -1
  18. package/development/core.d.ts +0 -1
  19. package/development/core.js +1195 -5
  20. package/development/journey-summary/journey-summary.component.d.ts +3 -4
  21. package/development/journey-summary.d.ts +0 -1
  22. package/development/journey-summary.js +5 -5
  23. package/development/journey-summary.pure.d.ts +0 -1
  24. package/development/journey-summary.pure.js +2605 -2
  25. package/development/pearl-chain/pearl-chain.component.d.ts +2 -3
  26. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +3 -4
  27. package/development/pearl-chain-time.d.ts +0 -1
  28. package/development/pearl-chain-time.js +5 -5
  29. package/development/pearl-chain-time.pure.d.ts +0 -1
  30. package/development/pearl-chain-time.pure.js +2582 -2
  31. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts +1 -2
  32. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts +1 -2
  33. package/development/pearl-chain-vertical-item.d.ts +0 -1
  34. package/development/pearl-chain-vertical-item.js +5 -5
  35. package/development/pearl-chain-vertical-item.pure.d.ts +0 -1
  36. package/development/pearl-chain-vertical-item.pure.js +132 -2
  37. package/development/pearl-chain-vertical.d.ts +0 -1
  38. package/development/pearl-chain-vertical.js +5 -5
  39. package/development/pearl-chain-vertical.pure.d.ts +0 -1
  40. package/development/pearl-chain-vertical.pure.js +31 -2
  41. package/development/pearl-chain.d.ts +0 -1
  42. package/development/pearl-chain.js +5 -5
  43. package/development/pearl-chain.pure.d.ts +0 -1
  44. package/development/pearl-chain.pure.js +619 -2
  45. package/development/seat-reservation/common/mapper/icon-mapper.d.ts +0 -1
  46. package/development/seat-reservation/common/mapper/mapper.d.ts +1 -2
  47. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.private.d.ts +68 -0
  48. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.private.d.ts +122 -0
  49. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.private.d.ts +68 -0
  50. package/development/seat-reservation/common/mapper.d.ts +0 -1
  51. package/development/seat-reservation/common/svgs.d.ts +20 -21
  52. package/development/seat-reservation/common/translations/i18n.d.ts +0 -1
  53. package/development/seat-reservation/common/translations.d.ts +0 -1
  54. package/development/seat-reservation/common/types.d.ts +0 -1
  55. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +2 -3
  56. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +2 -3
  57. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +1 -2
  58. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +2 -3
  59. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +3 -4
  60. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +2 -3
  61. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +3 -4
  62. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +1 -2
  63. package/development/seat-reservation.d.ts +0 -1
  64. package/development/seat-reservation.js +5 -16
  65. package/development/seat-reservation.pure.d.ts +0 -1
  66. package/development/seat-reservation.pure.js +16019 -14
  67. package/development/timetable-duration/timetable-duration.component.d.ts +1 -2
  68. package/development/timetable-duration.d.ts +0 -1
  69. package/development/timetable-duration.js +5 -5
  70. package/development/timetable-duration.pure.d.ts +0 -1
  71. package/development/timetable-duration.pure.js +97 -2
  72. package/development/timetable-row/timetable-row.component.d.ts +3 -4
  73. package/development/timetable-row.d.ts +0 -1
  74. package/development/timetable-row.js +5 -5
  75. package/development/timetable-row.pure.d.ts +0 -1
  76. package/development/timetable-row.pure.js +3005 -2
  77. package/journey-summary.js +1 -6
  78. package/journey-summary.pure.js +55 -2
  79. package/package.json +2 -2
  80. package/pearl-chain-time.js +1 -6
  81. package/pearl-chain-time.pure.js +28 -2
  82. package/pearl-chain-vertical-item.js +1 -6
  83. package/pearl-chain-vertical-item.pure.js +26 -2
  84. package/pearl-chain-vertical.js +1 -6
  85. package/pearl-chain-vertical.pure.js +6 -2
  86. package/pearl-chain.js +1 -6
  87. package/pearl-chain.pure.js +27 -2
  88. package/seat-reservation.js +1 -16
  89. package/seat-reservation.pure.js +468 -14
  90. package/timetable-duration.js +1 -6
  91. package/timetable-duration.pure.js +9 -2
  92. package/timetable-row.js +1 -6
  93. package/timetable-row.pure.js +113 -2
  94. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -65
  95. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -44
  96. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  97. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -21
  98. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  99. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  100. package/autocomplete-grid-cell.component-79IjA__I.js +0 -23
  101. package/autocomplete-grid-option.component-DUFBhQwI.js +0 -35
  102. package/autocomplete-grid-row.component-B3U15Rwa.js +0 -26
  103. package/core/datetime/date-helper.js +0 -2
  104. package/core/timetable/access-leg-helper.js +0 -96
  105. package/core/timetable/timetable-helper.js +0 -10
  106. package/core/timetable/timetable-properties.js +0 -0
  107. package/date-helper-DNzMLcyb.js +0 -185
  108. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +0 -1
  109. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -118
  110. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts.map +0 -1
  111. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -69
  112. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts.map +0 -1
  113. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  114. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts.map +0 -1
  115. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -30
  116. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts.map +0 -1
  117. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  118. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts.map +0 -1
  119. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  120. package/development/autocomplete-grid-cell.component-BbdELDro.js +0 -33
  121. package/development/autocomplete-grid-option.component-C7WuqRit.js +0 -57
  122. package/development/autocomplete-grid-row.component-DoXbOsQM.js +0 -38
  123. package/development/autocomplete-grid.d.ts.map +0 -1
  124. package/development/autocomplete-grid.pure.d.ts.map +0 -1
  125. package/development/core/datetime/date-helper.d.ts.map +0 -1
  126. package/development/core/datetime/date-helper.js +0 -2
  127. package/development/core/timetable/access-leg-helper.d.ts.map +0 -1
  128. package/development/core/timetable/access-leg-helper.js +0 -147
  129. package/development/core/timetable/timetable-helper.d.ts.map +0 -1
  130. package/development/core/timetable/timetable-helper.js +0 -19
  131. package/development/core/timetable/timetable-properties.d.ts.map +0 -1
  132. package/development/core/timetable/timetable-properties.js +0 -0
  133. package/development/core.d.ts.map +0 -1
  134. package/development/date-helper-BcTDWVeP.js +0 -539
  135. package/development/differenceInMinutes-CxAbGYQ3.js +0 -110
  136. package/development/format-Cx3zmmaF.js +0 -1848
  137. package/development/isValid-40Olgzo1.js +0 -178
  138. package/development/journey-summary/journey-summary.component.d.ts.map +0 -1
  139. package/development/journey-summary/journey-summary.component.js +0 -2
  140. package/development/journey-summary.component-BsC7wBIn.js +0 -341
  141. package/development/journey-summary.d.ts.map +0 -1
  142. package/development/journey-summary.pure.d.ts.map +0 -1
  143. package/development/mapper-BrZOqqfe.js +0 -11454
  144. package/development/pearl-chain/pearl-chain.component.d.ts.map +0 -1
  145. package/development/pearl-chain/pearl-chain.component.js +0 -2
  146. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +0 -1
  147. package/development/pearl-chain-time/pearl-chain-time.component.js +0 -2
  148. package/development/pearl-chain-time.component-C-CuC1ke.js +0 -317
  149. package/development/pearl-chain-time.d.ts.map +0 -1
  150. package/development/pearl-chain-time.pure.d.ts.map +0 -1
  151. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts.map +0 -1
  152. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  153. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +0 -1
  154. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  155. package/development/pearl-chain-vertical-item.component-CLu9QrqJ.js +0 -131
  156. package/development/pearl-chain-vertical-item.d.ts.map +0 -1
  157. package/development/pearl-chain-vertical-item.pure.d.ts.map +0 -1
  158. package/development/pearl-chain-vertical.component-DbPz5k_R.js +0 -30
  159. package/development/pearl-chain-vertical.d.ts.map +0 -1
  160. package/development/pearl-chain-vertical.pure.d.ts.map +0 -1
  161. package/development/pearl-chain.component-10OsJZIX.js +0 -318
  162. package/development/pearl-chain.d.ts.map +0 -1
  163. package/development/pearl-chain.pure.d.ts.map +0 -1
  164. package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +0 -1
  165. package/development/seat-reservation/common/mapper/icon-mapper.js +0 -170
  166. package/development/seat-reservation/common/mapper/mapper.d.ts.map +0 -1
  167. package/development/seat-reservation/common/mapper/mapper.js +0 -2
  168. package/development/seat-reservation/common/mapper.d.ts.map +0 -1
  169. package/development/seat-reservation/common/mapper.js +0 -3
  170. package/development/seat-reservation/common/svgs.d.ts.map +0 -1
  171. package/development/seat-reservation/common/svgs.js +0 -2
  172. package/development/seat-reservation/common/translations/i18n.d.ts.map +0 -1
  173. package/development/seat-reservation/common/translations/i18n.js +0 -1120
  174. package/development/seat-reservation/common/translations.d.ts.map +0 -1
  175. package/development/seat-reservation/common/translations.js +0 -2
  176. package/development/seat-reservation/common/types.d.ts.map +0 -1
  177. package/development/seat-reservation/common/types.js +0 -0
  178. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +0 -1
  179. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -1476
  180. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +0 -1
  181. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  182. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +0 -1
  183. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  184. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +0 -1
  185. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  186. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
  187. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  188. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
  189. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  190. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +0 -1
  191. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  192. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
  193. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  194. package/development/seat-reservation-area.component-DPhQJFid.js +0 -94
  195. package/development/seat-reservation-graphic.component-0LYsmerm.js +0 -129
  196. package/development/seat-reservation-navigation-coach.component-B97jKD7Y.js +0 -438
  197. package/development/seat-reservation-navigation-services.component-Cx0Is97w.js +0 -159
  198. package/development/seat-reservation-place-control.component-DaL1g8WH.js +0 -431
  199. package/development/seat-reservation-scoped.component-BHbORVsR.js +0 -24
  200. package/development/seat-reservation.component-DI9pSlzt.js +0 -473
  201. package/development/seat-reservation.d.ts.map +0 -1
  202. package/development/seat-reservation.pure.d.ts.map +0 -1
  203. package/development/svgs-Dj-RKmRs.js +0 -28
  204. package/development/timetable-duration/timetable-duration.component.d.ts.map +0 -1
  205. package/development/timetable-duration/timetable-duration.component.js +0 -2
  206. package/development/timetable-duration.component-Chk5D4Is.js +0 -96
  207. package/development/timetable-duration.d.ts.map +0 -1
  208. package/development/timetable-duration.pure.d.ts.map +0 -1
  209. package/development/timetable-row/timetable-row.component.d.ts.map +0 -1
  210. package/development/timetable-row/timetable-row.component.js +0 -2
  211. package/development/timetable-row.component-nzrQzxL6.js +0 -736
  212. package/development/timetable-row.d.ts.map +0 -1
  213. package/development/timetable-row.pure.d.ts.map +0 -1
  214. package/development/toDate-CDWut5fS.js +0 -150
  215. package/differenceInMinutes-BAZ-Fham.js +0 -27
  216. package/format-DjgG1QPc.js +0 -1103
  217. package/isValid-CXnsFZVu.js +0 -36
  218. package/journey-summary/journey-summary.component.js +0 -2
  219. package/journey-summary.component-DNoO3OCf.js +0 -265
  220. package/mapper-Dcou8VEf.js +0 -11382
  221. package/pearl-chain/pearl-chain.component.js +0 -2
  222. package/pearl-chain-time/pearl-chain-time.component.js +0 -2
  223. package/pearl-chain-time.component-BuvA6IE1.js +0 -237
  224. package/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  225. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  226. package/pearl-chain-vertical-item.component-QZ4s8Jbv.js +0 -106
  227. package/pearl-chain-vertical.component-Dc3vaHsQ.js +0 -20
  228. package/pearl-chain.component-DtGXXkY6.js +0 -190
  229. package/seat-reservation/common/mapper/icon-mapper.js +0 -72
  230. package/seat-reservation/common/mapper/mapper.js +0 -2
  231. package/seat-reservation/common/mapper.js +0 -3
  232. package/seat-reservation/common/svgs.js +0 -2
  233. package/seat-reservation/common/translations/i18n.js +0 -1085
  234. package/seat-reservation/common/translations.js +0 -2
  235. package/seat-reservation/common/types.js +0 -0
  236. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -926
  237. package/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  238. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  239. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  240. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  241. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  242. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  243. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  244. package/seat-reservation-area.component-G9lHb7S8.js +0 -73
  245. package/seat-reservation-graphic.component-BXFcQDxY.js +0 -102
  246. package/seat-reservation-navigation-coach.component-BXy8EkJe.js +0 -338
  247. package/seat-reservation-navigation-services.component-49XmV9rv.js +0 -124
  248. package/seat-reservation-place-control.component-DToIW328.js +0 -317
  249. package/seat-reservation-scoped.component-D8dAmrP7.js +0 -16
  250. package/seat-reservation.component--0XnrCkk.js +0 -372
  251. package/svgs-D4fuYTHV.js +0 -26
  252. package/timetable-duration/timetable-duration.component.js +0 -2
  253. package/timetable-duration.component-iMCvh1zr.js +0 -61
  254. package/timetable-row/timetable-row.component.js +0 -2
  255. package/timetable-row.component-mNKmhRmP.js +0 -566
  256. package/toDate-BhNUyM4s.js +0 -16
@@ -1,2 +1,619 @@
1
- import { t as SbbPearlChainElement } from "./pearl-chain.component-10OsJZIX.js";
2
- export { SbbPearlChainElement };
1
+ import { __esDecorate, __runInitializers } from "tslib";
2
+ import { SbbElement, defaultDateAdapter, forceType, screenReaderOnlyStyles } from "@sbb-esta/lyne-elements/core.js";
3
+ import { html, nothing, unsafeCSS } from "lit";
4
+ import { property } from "lit/decorators.js";
5
+ import { styleMap } from "lit/directives/style-map.js";
6
+ import { isRideLeg, removeTimezoneFromISOTimeString } from "./core.js";
7
+
8
+ //#region node_modules/date-fns/constants.js
9
+ /**
10
+ * @constant
11
+ * @name daysInYear
12
+ * @summary Days in 1 year.
13
+ *
14
+ * @description
15
+ * How many days in a year.
16
+ *
17
+ * One years equals 365.2425 days according to the formula:
18
+ *
19
+ * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
20
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
21
+ */
22
+ const daysInYear = 365.2425;
23
+ /**
24
+ * @constant
25
+ * @name maxTime
26
+ * @summary Maximum allowed time.
27
+ *
28
+ * @example
29
+ * import { maxTime } from "./constants/date-fns/constants";
30
+ *
31
+ * const isValid = 8640000000000001 <= maxTime;
32
+ * //=> false
33
+ *
34
+ * new Date(8640000000000001);
35
+ * //=> Invalid Date
36
+ */
37
+ const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
38
+ /**
39
+ * @constant
40
+ * @name minTime
41
+ * @summary Minimum allowed time.
42
+ *
43
+ * @example
44
+ * import { minTime } from "./constants/date-fns/constants";
45
+ *
46
+ * const isValid = -8640000000000001 >= minTime;
47
+ * //=> false
48
+ *
49
+ * new Date(-8640000000000001)
50
+ * //=> Invalid Date
51
+ */
52
+ const minTime = -maxTime;
53
+ /**
54
+ * @constant
55
+ * @name millisecondsInMinute
56
+ * @summary Milliseconds in 1 minute
57
+ */
58
+ const millisecondsInMinute = 6e4;
59
+ /**
60
+ * @constant
61
+ * @name secondsInHour
62
+ * @summary Seconds in 1 hour.
63
+ */
64
+ const secondsInHour = 3600;
65
+ /**
66
+ * @constant
67
+ * @name secondsInDay
68
+ * @summary Seconds in 1 day.
69
+ */
70
+ const secondsInDay = secondsInHour * 24;
71
+ /**
72
+ * @constant
73
+ * @name secondsInWeek
74
+ * @summary Seconds in 1 week.
75
+ */
76
+ const secondsInWeek = secondsInDay * 7;
77
+ /**
78
+ * @constant
79
+ * @name secondsInYear
80
+ * @summary Seconds in 1 year.
81
+ */
82
+ const secondsInYear = secondsInDay * daysInYear;
83
+ /**
84
+ * @constant
85
+ * @name secondsInMonth
86
+ * @summary Seconds in 1 month
87
+ */
88
+ const secondsInMonth = secondsInYear / 12;
89
+ /**
90
+ * @constant
91
+ * @name secondsInQuarter
92
+ * @summary Seconds in 1 quarter.
93
+ */
94
+ const secondsInQuarter = secondsInMonth * 3;
95
+ /**
96
+ * @constant
97
+ * @name constructFromSymbol
98
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
99
+ *
100
+ * The symbol is used to enable the `constructFrom` function to construct a date
101
+ * using a reference date and a value. It allows to transfer extra properties
102
+ * from the reference date to the new date. It's useful for extensions like
103
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
104
+ * a constructor argument.
105
+ */
106
+ const constructFromSymbol = Symbol.for("constructDateFrom");
107
+
108
+ //#endregion
109
+ //#region node_modules/date-fns/constructFrom.js
110
+ /**
111
+ * @name constructFrom
112
+ * @category Generic Helpers
113
+ * @summary Constructs a date using the reference date and the value
114
+ *
115
+ * @description
116
+ * The function constructs a new date using the constructor from the reference
117
+ * date and the given value. It helps to build generic functions that accept
118
+ * date extensions.
119
+ *
120
+ * It defaults to `Date` if the passed reference date is a number or a string.
121
+ *
122
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
123
+ * enabling to transfer extra properties from the reference date to the new date.
124
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
125
+ * that accept a time zone as a constructor argument.
126
+ *
127
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
128
+ *
129
+ * @param date - The reference date to take constructor from
130
+ * @param value - The value to create the date
131
+ *
132
+ * @returns Date initialized using the given date and value
133
+ *
134
+ * @example
135
+ * import { constructFrom } from "./constructFrom/date-fns";
136
+ *
137
+ * // A function that clones a date preserving the original type
138
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
139
+ * return constructFrom(
140
+ * date, // Use constructor from the given date
141
+ * date.getTime() // Use the date value to create a new date
142
+ * );
143
+ * }
144
+ */
145
+ function constructFrom(date, value) {
146
+ if (typeof date === "function") return date(value);
147
+ if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
148
+ if (date instanceof Date) return new date.constructor(value);
149
+ return new Date(value);
150
+ }
151
+
152
+ //#endregion
153
+ //#region node_modules/date-fns/toDate.js
154
+ /**
155
+ * @name toDate
156
+ * @category Common Helpers
157
+ * @summary Convert the given argument to an instance of Date.
158
+ *
159
+ * @description
160
+ * Convert the given argument to an instance of Date.
161
+ *
162
+ * If the argument is an instance of Date, the function returns its clone.
163
+ *
164
+ * If the argument is a number, it is treated as a timestamp.
165
+ *
166
+ * If the argument is none of the above, the function returns Invalid Date.
167
+ *
168
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
169
+ * enabling to transfer extra properties from the reference date to the new date.
170
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
171
+ * that accept a time zone as a constructor argument.
172
+ *
173
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
174
+ *
175
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
176
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
177
+ *
178
+ * @param argument - The value to convert
179
+ *
180
+ * @returns The parsed date in the local time zone
181
+ *
182
+ * @example
183
+ * // Clone the date:
184
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
185
+ * //=> Tue Feb 11 2014 11:30:30
186
+ *
187
+ * @example
188
+ * // Convert the timestamp to date:
189
+ * const result = toDate(1392098430000)
190
+ * //=> Tue Feb 11 2014 11:30:30
191
+ */
192
+ function toDate(argument, context) {
193
+ return constructFrom(context || argument, argument);
194
+ }
195
+
196
+ //#endregion
197
+ //#region node_modules/date-fns/addMinutes.js
198
+ /**
199
+ * The {@link addMinutes} function options.
200
+ */
201
+ /**
202
+ * @name addMinutes
203
+ * @category Minute Helpers
204
+ * @summary Add the specified number of minutes to the given date.
205
+ *
206
+ * @description
207
+ * Add the specified number of minutes to the given date.
208
+ *
209
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
210
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
211
+ *
212
+ * @param date - The date to be changed
213
+ * @param amount - The amount of minutes to be added.
214
+ * @param options - An object with options
215
+ *
216
+ * @returns The new date with the minutes added
217
+ *
218
+ * @example
219
+ * // Add 30 minutes to 10 July 2014 12:00:00:
220
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
221
+ * //=> Thu Jul 10 2014 12:30:00
222
+ */
223
+ function addMinutes(date, amount, options) {
224
+ const _date = toDate(date, options?.in);
225
+ _date.setTime(_date.getTime() + amount * millisecondsInMinute);
226
+ return _date;
227
+ }
228
+
229
+ //#endregion
230
+ //#region node_modules/date-fns/differenceInMilliseconds.js
231
+ /**
232
+ * @name differenceInMilliseconds
233
+ * @category Millisecond Helpers
234
+ * @summary Get the number of milliseconds between the given dates.
235
+ *
236
+ * @description
237
+ * Get the number of milliseconds between the given dates.
238
+ *
239
+ * @param laterDate - The later date
240
+ * @param earlierDate - The earlier date
241
+ *
242
+ * @returns The number of milliseconds
243
+ *
244
+ * @example
245
+ * // How many milliseconds are between
246
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
247
+ * const result = differenceInMilliseconds(
248
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
249
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
250
+ * )
251
+ * //=> 1100
252
+ */
253
+ function differenceInMilliseconds(laterDate, earlierDate) {
254
+ return +toDate(laterDate) - +toDate(earlierDate);
255
+ }
256
+
257
+ //#endregion
258
+ //#region node_modules/date-fns/_lib/getRoundingMethod.js
259
+ function getRoundingMethod(method) {
260
+ return (number) => {
261
+ const result = (method ? Math[method] : Math.trunc)(number);
262
+ return result === 0 ? 0 : result;
263
+ };
264
+ }
265
+
266
+ //#endregion
267
+ //#region node_modules/date-fns/differenceInMinutes.js
268
+ /**
269
+ * The {@link differenceInMinutes} function options.
270
+ */
271
+ /**
272
+ * @name differenceInMinutes
273
+ * @category Minute Helpers
274
+ * @summary Get the number of minutes between the given dates.
275
+ *
276
+ * @description
277
+ * Get the signed number of full (rounded towards 0) minutes between the given dates.
278
+ *
279
+ * @param dateLeft - The later date
280
+ * @param dateRight - The earlier date
281
+ * @param options - An object with options.
282
+ *
283
+ * @returns The number of minutes
284
+ *
285
+ * @example
286
+ * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
287
+ * const result = differenceInMinutes(
288
+ * new Date(2014, 6, 2, 12, 20, 0),
289
+ * new Date(2014, 6, 2, 12, 7, 59)
290
+ * )
291
+ * //=> 12
292
+ *
293
+ * @example
294
+ * // How many minutes are between 10:01:59 and 10:00:00
295
+ * const result = differenceInMinutes(
296
+ * new Date(2000, 0, 1, 10, 0, 0),
297
+ * new Date(2000, 0, 1, 10, 1, 59)
298
+ * )
299
+ * //=> -1
300
+ */
301
+ function differenceInMinutes(dateLeft, dateRight, options) {
302
+ const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
303
+ return getRoundingMethod(options?.roundingMethod)(diff);
304
+ }
305
+
306
+ //#endregion
307
+ //#region node_modules/date-fns/isAfter.js
308
+ /**
309
+ * @name isAfter
310
+ * @category Common Helpers
311
+ * @summary Is the first date after the second one?
312
+ *
313
+ * @description
314
+ * Is the first date after the second one?
315
+ *
316
+ * @param date - The date that should be after the other one to return true
317
+ * @param dateToCompare - The date to compare with
318
+ *
319
+ * @returns The first date is after the second date
320
+ *
321
+ * @example
322
+ * // Is 10 July 1989 after 11 February 1987?
323
+ * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
324
+ * //=> true
325
+ */
326
+ function isAfter(date, dateToCompare) {
327
+ return +toDate(date) > +toDate(dateToCompare);
328
+ }
329
+
330
+ //#endregion
331
+ //#region node_modules/date-fns/isBefore.js
332
+ /**
333
+ * @name isBefore
334
+ * @category Common Helpers
335
+ * @summary Is the first date before the second one?
336
+ *
337
+ * @description
338
+ * Is the first date before the second one?
339
+ *
340
+ * @param date - The date that should be before the other one to return true
341
+ * @param dateToCompare - The date to compare with
342
+ *
343
+ * @returns The first date is before the second date
344
+ *
345
+ * @example
346
+ * // Is 10 July 1989 before 11 February 1987?
347
+ * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
348
+ * //=> false
349
+ */
350
+ function isBefore(date, dateToCompare) {
351
+ return +toDate(date) < +toDate(dateToCompare);
352
+ }
353
+
354
+ //#endregion
355
+ //#region src/elements-experimental/pearl-chain/pearl-chain.scss?inline
356
+ var pearl_chain_default = ":host {\n --sbb-pearl-chain-height: var(--sbb-border-width-2x);\n --sbb-pearl-chain-spacing-small: 0.125rem;\n --sbb-pearl-chain-color: var(--sbb-pearl-chain-bullet-color);\n --sbb-pearl-chain-color-disruption: var(--sbb-pearl-chain-bullet-color-disruption);\n --sbb-pearl-chain-color-past: var(--sbb-pearl-chain-bullet-color-past);\n --sbb-pearl-chain-leg-width: 100%;\n display: block;\n --sbb-pearl-chain-position-color: var(--sbb-color-primary);\n --sbb-pearl-chain-bullet-size-start-end: 0.625rem;\n --sbb-pearl-chain-bullet-size-stop: 0.5rem;\n --sbb-pearl-chain-bullet-color: var(--sbb-background-color-3-inverted);\n --sbb-pearl-chain-bullet-color-past: var(--sbb-color-metal);\n --sbb-pearl-chain-bullet-color-past: light-dark(var(--sbb-color-metal), var(--sbb-color-granite));\n --sbb-pearl-chain-bullet-color-irrelevant: var(--sbb-color-metal);\n --sbb-pearl-chain-bullet-color-irrelevant: light-dark(\n var(--sbb-color-metal),\n var(--sbb-color-granite)\n );\n --sbb-pearl-chain-bullet-color-disruption: var(--sbb-color-error);\n --sbb-pearl-chain-bullet-border-width: var(--sbb-border-width-2x);\n --sbb-pearl-chain-bullet-animation-duration: 1920ms;\n --sbb-pearl-chain-bullet-animation-easing: ease-out;\n --sbb-pearl-chain-bullet-crossed-width: 0.88375rem;\n --sbb-pearl-chain-bullet-crossed-height: 0.21875rem;\n --sbb-pearl-chain-bullet-crossed-border-width: 0.09375rem;\n}\n\n.sbb-pearl-chain {\n position: relative;\n display: flex;\n justify-content: space-between;\n flex-wrap: nowrap;\n color: var(--sbb-pearl-chain-color);\n width: 100%;\n padding-block: calc((var(--sbb-pearl-chain-bullet-size-start-end) - var(--sbb-pearl-chain-height)) / 2);\n padding-inline-end: var(--sbb-pearl-chain-bullet-size-start-end);\n}\n\n.sbb-pearl-chain__bullet {\n min-height: var(--sbb-pearl-chain-bullet-size-start-end);\n min-width: var(--sbb-pearl-chain-bullet-size-start-end);\n height: var(--sbb-pearl-chain-bullet-size-start-end);\n width: var(--sbb-pearl-chain-bullet-size-start-end);\n background: var(--sbb-pearl-chain-bullet-color);\n color: var(--sbb-pearl-chain-bullet-color);\n border-color: var(--sbb-pearl-chain-bullet-color);\n border-radius: 100%;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__bullet {\n --sbb-pearl-chain-bullet-color: CanvasText;\n }\n}\n.sbb-pearl-chain__bullet {\n content: \"\";\n position: absolute;\n background-color: currentcolor;\n inset-block-start: 0;\n z-index: 3;\n}\n\n.sbb-pearl-chain__bullet:first-of-type {\n inset-inline-start: 0;\n}\n\n.sbb-pearl-chain__bullet:last-of-type {\n inset-inline-end: 0;\n}\n\n.sbb-pearl-chain__leg {\n flex-shrink: 0;\n flex-grow: 0;\n position: relative;\n height: var(--sbb-pearl-chain-height);\n border-inline-end: var(--sbb-pearl-chain-spacing-small) solid Canvas;\n background-color: currentcolor;\n width: var(--sbb-pearl-chain-leg-width);\n display: flex;\n align-items: center;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg {\n background-color: CanvasText;\n }\n .sbb-pearl-chain--past .sbb-pearl-chain__leg {\n background-color: GrayText;\n }\n}\n\n.sbb-pearl-chain__leg:last-of-type {\n border: none;\n}\n\n.sbb-pearl-chain__stop {\n position: relative;\n z-index: 2;\n background: var(--sbb-pearl-chain-bullet-color);\n color: var(--sbb-pearl-chain-bullet-color);\n border-color: var(--sbb-pearl-chain-bullet-color);\n border-radius: 100%;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__stop {\n --sbb-pearl-chain-bullet-color: CanvasText;\n }\n}\n.sbb-pearl-chain__stop {\n min-height: var(--sbb-pearl-chain-bullet-size-stop);\n min-width: var(--sbb-pearl-chain-bullet-size-stop);\n height: var(--sbb-pearl-chain-bullet-size-stop);\n width: var(--sbb-pearl-chain-bullet-size-stop);\n border: var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;\n background: Canvas;\n}\n\n.sbb-pearl-chain__bullet--future {\n background: var(--sbb-pearl-chain-bullet-color);\n color: var(--sbb-pearl-chain-bullet-color);\n border-color: var(--sbb-pearl-chain-bullet-color);\n border-radius: 100%;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__bullet--future {\n --sbb-pearl-chain-bullet-color: CanvasText;\n }\n}\n\n.sbb-pearl-chain__leg--past,\n.sbb-pearl-chain--past,\n.sbb-pearl-chain__leg--past::after,\n.sbb-pearl-chain__leg--progress::after,\n.sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,\n.sbb-pearl-chain--progress,\n.sbb-pearl-chain__bullet--past {\n color: var(--sbb-pearl-chain-color-past);\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--past,\n .sbb-pearl-chain--past,\n .sbb-pearl-chain__leg--past::after,\n .sbb-pearl-chain__leg--progress::after,\n .sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,\n .sbb-pearl-chain--progress,\n .sbb-pearl-chain__bullet--past {\n --sbb-pearl-chain-bullet-color: GrayText !important;\n }\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--past,\n .sbb-pearl-chain--past,\n .sbb-pearl-chain__leg--past::after,\n .sbb-pearl-chain__leg--progress::after,\n .sbb-pearl-chain__leg--progress .sbb-pearl-chain__stop,\n .sbb-pearl-chain--progress,\n .sbb-pearl-chain__bullet--past {\n background-color: GrayText !important;\n }\n}\n\n.sbb-pearl-chain__bullet--progress {\n background: var(--sbb-pearl-chain-bullet-color);\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__bullet--progress {\n --sbb-pearl-chain-bullet-color: GrayText !important;\n }\n}\n\n.sbb-pearl-chain__bullet--departure-disruption,\n.sbb-pearl-chain--arrival-disruption,\n.sbb-pearl-chain--departure-disruption,\n.sbb-pearl-chain__leg--disruption {\n color: var(--sbb-pearl-chain-color-disruption);\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__bullet--departure-disruption,\n .sbb-pearl-chain--arrival-disruption,\n .sbb-pearl-chain--departure-disruption,\n .sbb-pearl-chain__leg--disruption {\n --sbb-pearl-chain-bullet-color: Highlight;\n }\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__bullet--departure-disruption,\n .sbb-pearl-chain--arrival-disruption,\n .sbb-pearl-chain--departure-disruption,\n .sbb-pearl-chain__leg--disruption {\n color: Highlight;\n background: Highlight;\n }\n}\n\n.sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop {\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-disruption);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--disruption .sbb-pearl-chain__stop {\n --sbb-pearl-chain-bullet-color: Highlight;\n }\n}\n\n.sbb-pearl-chain__leg--past .sbb-pearl-chain__stop {\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-bullet-color-past);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--past .sbb-pearl-chain__stop {\n --sbb-pearl-chain-bullet-color: GrayText !important;\n }\n}\n\n.sbb-pearl-chain__leg--cancelled-expected::after {\n background-color: unset;\n background-image: linear-gradient(to right, currentcolor 0%, currentcolor 50%, Canvas 50%);\n background-repeat: repeat-x;\n background-size: calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);\n inset-inline-end: var(--sbb-pearl-chain-height);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--cancelled-expected::after {\n background: unset;\n border-block-start: 0.0625rem dashed Highlight;\n transform: translateY(0.0625rem);\n }\n}\n\n.sbb-pearl-chain__leg--disruption::after {\n background-color: unset;\n background-image: linear-gradient(to right, currentcolor 0%, currentcolor 50%, Canvas 50%);\n background-repeat: repeat-x;\n background-size: calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);\n inset-inline-end: var(--sbb-pearl-chain-height);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--disruption::after {\n background: unset;\n border-block-start: 0.0625rem dashed Highlight;\n transform: translateY(0.0625rem);\n }\n}\n\n.sbb-pearl-chain__leg--skipped {\n color: var(--sbb-pearl-chain-color-disruption);\n}\n.sbb-pearl-chain__leg--skipped::after {\n background-color: unset;\n background-image: linear-gradient(to right, currentcolor 0%, currentcolor 50%, Canvas 50%);\n background-repeat: repeat-x;\n background-size: calc(2 * var(--sbb-pearl-chain-spacing-small)) var(--sbb-pearl-chain-height);\n inset-inline-end: var(--sbb-pearl-chain-height);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg--skipped::after {\n background: unset;\n border-block-start: 0.0625rem dashed Highlight;\n transform: translateY(0.0625rem);\n }\n}\n\n.sbb-pearl-chain__stop--departure-skipped {\n min-height: var(--sbb-pearl-chain-bullet-size-stop);\n min-width: var(--sbb-pearl-chain-bullet-size-stop);\n height: var(--sbb-pearl-chain-bullet-size-stop);\n width: var(--sbb-pearl-chain-bullet-size-stop);\n border: var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;\n background: Canvas;\n border: var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;\n background: Canvas;\n}\n.sbb-pearl-chain__stop--departure-skipped::before {\n content: \"\";\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n transform: translate(-50%, -50%) rotate(45deg);\n border-block-start: var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;\n background: var(--sbb-pearl-chain-bullet-color-disruption);\n height: var(--sbb-pearl-chain-bullet-crossed-height);\n width: var(--sbb-pearl-chain-bullet-crossed-width);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__stop--departure-skipped::before {\n background: Highlight;\n }\n}\n\n.sbb-pearl-chain--arrival-skipped,\n.sbb-pearl-chain--departure-skipped {\n min-height: var(--sbb-pearl-chain-bullet-size-start-end);\n min-width: var(--sbb-pearl-chain-bullet-size-start-end);\n height: var(--sbb-pearl-chain-bullet-size-start-end);\n width: var(--sbb-pearl-chain-bullet-size-start-end);\n border: var(--sbb-pearl-chain-bullet-border-width) solid currentcolor;\n background: Canvas;\n}\n.sbb-pearl-chain--arrival-skipped::before,\n.sbb-pearl-chain--departure-skipped::before {\n content: \"\";\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n transform: translate(-50%, -50%) rotate(45deg);\n border-block-start: var(--sbb-pearl-chain-bullet-crossed-border-width) solid canvas;\n background: var(--sbb-pearl-chain-bullet-color-disruption);\n height: var(--sbb-pearl-chain-bullet-crossed-height);\n width: var(--sbb-pearl-chain-bullet-crossed-width);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain--arrival-skipped::before,\n .sbb-pearl-chain--departure-skipped::before {\n background: Highlight;\n }\n}\n\n.sbb-pearl-chain__leg::after {\n content: \"\";\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n background-color: currentcolor;\n border-radius: var(--sbb-pearl-chain-height);\n z-index: 1;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__leg::after {\n background-color: CanvasText;\n }\n .sbb-pearl-chain--past .sbb-pearl-chain__leg::after {\n background-color: GrayText;\n }\n}\n\n.sbb-pearl-chain__leg:last-of-type::after {\n inset-inline-end: calc(-1 * var(--sbb-pearl-chain-height));\n}\n\n.sbb-pearl-chain__leg--progress::after {\n background-color: var(--sbb-pearl-chain-color-past);\n width: var(--sbb-pearl-chain-leg-status);\n}\n\n.sbb-pearl-chain__position {\n min-height: var(--sbb-pearl-chain-bullet-size-start-end);\n min-width: var(--sbb-pearl-chain-bullet-size-start-end);\n height: var(--sbb-pearl-chain-bullet-size-start-end);\n width: var(--sbb-pearl-chain-bullet-size-start-end);\n background: var(--sbb-pearl-chain-bullet-color);\n color: var(--sbb-pearl-chain-bullet-color);\n border-color: var(--sbb-pearl-chain-bullet-color);\n border-radius: 100%;\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__position {\n --sbb-pearl-chain-bullet-color: CanvasText;\n }\n}\n.sbb-pearl-chain__position {\n --sbb-pearl-chain-bullet-color: var(--sbb-pearl-chain-position-color);\n}\n@media (forced-colors: active) {\n .sbb-pearl-chain__position {\n --sbb-pearl-chain-position-color: Highlight;\n }\n}\n@keyframes pearl-chain-bullet-position-pulse {\n 0% {\n box-shadow: 0 0 0 0 var(--sbb-pearl-chain-position-color);\n }\n 25% {\n box-shadow: 0 0 0 0 var(--sbb-pearl-chain-position-color);\n }\n 50% {\n box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--sbb-pearl-chain-position-color) 20%, transparent);\n }\n 100% {\n box-shadow: 0 0 0 0 var(--sbb-pearl-chain-position-color);\n }\n}\n.sbb-pearl-chain__position {\n animation: pearl-chain-bullet-position-pulse var(--sbb-pearl-chain-bullet-animation-duration) var(--sbb-pearl-chain-bullet-animation-easing) infinite;\n position: absolute;\n inset-block-start: -200%;\n z-index: 4;\n inset-inline-start: var(--sbb-pearl-chain-status-position);\n}\n\n.sbb-pearl-chain__position--no-animation {\n animation: unset;\n}\n";
357
+
358
+ //#endregion
359
+ //#region src/elements-experimental/pearl-chain/pearl-chain.component.ts
360
+ /**
361
+ * It visually displays journey information.
362
+ */
363
+ let SbbPearlChainElement = (() => {
364
+ let _classSuper = SbbElement;
365
+ let _instanceExtraInitializers = [];
366
+ let _legs_decorators;
367
+ let _legs_initializers = [];
368
+ let _legs_extraInitializers = [];
369
+ let _disableAnimation_decorators;
370
+ let _disableAnimation_initializers = [];
371
+ let _disableAnimation_extraInitializers = [];
372
+ let _set_now_decorators;
373
+ return class SbbPearlChainElement extends _classSuper {
374
+ constructor() {
375
+ super(...arguments);
376
+ this.#legs_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _legs_initializers, []));
377
+ this.#disableAnimation_accessor_storage = (__runInitializers(this, _legs_extraInitializers), __runInitializers(this, _disableAnimation_initializers, false));
378
+ this._now = (__runInitializers(this, _disableAnimation_extraInitializers), null);
379
+ }
380
+ static {
381
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
382
+ _legs_decorators = [property({ type: Array })];
383
+ _disableAnimation_decorators = [forceType(), property({
384
+ attribute: "disable-animation",
385
+ type: Boolean
386
+ })];
387
+ _set_now_decorators = [property()];
388
+ __esDecorate(this, null, _legs_decorators, {
389
+ kind: "accessor",
390
+ name: "legs",
391
+ static: false,
392
+ private: false,
393
+ access: {
394
+ has: (obj) => "legs" in obj,
395
+ get: (obj) => obj.legs,
396
+ set: (obj, value) => {
397
+ obj.legs = value;
398
+ }
399
+ },
400
+ metadata: _metadata
401
+ }, _legs_initializers, _legs_extraInitializers);
402
+ __esDecorate(this, null, _disableAnimation_decorators, {
403
+ kind: "accessor",
404
+ name: "disableAnimation",
405
+ static: false,
406
+ private: false,
407
+ access: {
408
+ has: (obj) => "disableAnimation" in obj,
409
+ get: (obj) => obj.disableAnimation,
410
+ set: (obj, value) => {
411
+ obj.disableAnimation = value;
412
+ }
413
+ },
414
+ metadata: _metadata
415
+ }, _disableAnimation_initializers, _disableAnimation_extraInitializers);
416
+ __esDecorate(this, null, _set_now_decorators, {
417
+ kind: "setter",
418
+ name: "now",
419
+ static: false,
420
+ private: false,
421
+ access: {
422
+ has: (obj) => "now" in obj,
423
+ set: (obj, value) => {
424
+ obj.now = value;
425
+ }
426
+ },
427
+ metadata: _metadata
428
+ }, null, _instanceExtraInitializers);
429
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, {
430
+ enumerable: true,
431
+ configurable: true,
432
+ writable: true,
433
+ value: _metadata
434
+ });
435
+ }
436
+ static {
437
+ this.elementName = "sbb-pearl-chain";
438
+ }
439
+ static {
440
+ this.styles = [screenReaderOnlyStyles, unsafeCSS(pearl_chain_default)];
441
+ }
442
+ #legs_accessor_storage;
443
+ /**
444
+ * Define the legs of the pearl-chain.
445
+ * Format:
446
+ * `{"legs": [{"duration": 25}, ...]}`
447
+ * `duration` in minutes. Duration of the leg is relative
448
+ * to the total travel time. Example: departure 16:30, change at 16:40,
449
+ * arrival at 17:00. So the change should have a duration of 33.33%.
450
+ */
451
+ get legs() {
452
+ return this.#legs_accessor_storage;
453
+ }
454
+ set legs(value) {
455
+ this.#legs_accessor_storage = value;
456
+ }
457
+ #disableAnimation_accessor_storage;
458
+ /**
459
+ * Per default, the current location has a pulsating animation. You can
460
+ * disable the animation with this property.
461
+ */
462
+ get disableAnimation() {
463
+ return this.#disableAnimation_accessor_storage;
464
+ }
465
+ set disableAnimation(value) {
466
+ this.#disableAnimation_accessor_storage = value;
467
+ }
468
+ /**
469
+ * A configured date which acts as the current date instead of the real current date.
470
+ * Only recommended for testing purposes.
471
+ */
472
+ set now(value) {
473
+ this._now = defaultDateAdapter.getValidDateOrNull(defaultDateAdapter.deserialize(value));
474
+ }
475
+ get now() {
476
+ return this._now;
477
+ }
478
+ _getAllDuration(legs) {
479
+ return legs?.reduce((sum, leg) => {
480
+ const arrivalNoTz = removeTimezoneFromISOTimeString(leg.arrival?.time);
481
+ const departureNoTz = removeTimezoneFromISOTimeString(leg.departure?.time);
482
+ if (arrivalNoTz && departureNoTz) return sum + differenceInMinutes(removeTimezoneFromISOTimeString(leg.arrival.time), removeTimezoneFromISOTimeString(leg.departure.time));
483
+ return sum;
484
+ }, 0);
485
+ }
486
+ _isAllCancelled(legs) {
487
+ return legs?.every((leg) => leg?.serviceJourney?.serviceAlteration?.cancelled);
488
+ }
489
+ _getRelativeDuration(legs, leg) {
490
+ const arrivalNoTz = removeTimezoneFromISOTimeString(leg.arrival?.time);
491
+ const departureNoTz = removeTimezoneFromISOTimeString(leg.departure?.time);
492
+ if (arrivalNoTz && departureNoTz) {
493
+ const duration = differenceInMinutes(removeTimezoneFromISOTimeString(leg.arrival.time), removeTimezoneFromISOTimeString(leg.departure.time));
494
+ const allDurations = this._getAllDuration(legs);
495
+ if (allDurations === 0) return 100;
496
+ return duration / allDurations * 100;
497
+ }
498
+ return 0;
499
+ }
500
+ _getProgress(now, start, end) {
501
+ if (!start?.time || !end?.time) return 0;
502
+ const startWithDelay = addMinutes(start.time, start.delay ?? 0);
503
+ const total = differenceInMinutes(addMinutes(end.time, end.delay ?? 0), startWithDelay);
504
+ const progress = differenceInMinutes(now, startWithDelay);
505
+ return total && progress / total * 100;
506
+ }
507
+ _getStatus(now, start, end) {
508
+ const startWithDelay = start && start.time && addMinutes(start.time, start.delay ?? 0);
509
+ const endWithDelay = end && end.time && addMinutes(end.time, end.delay ?? 0);
510
+ if (startWithDelay && isBefore(startWithDelay, now) && endWithDelay && isAfter(endWithDelay, now)) return "progress";
511
+ else if (endWithDelay && isBefore(endWithDelay, now)) return "past";
512
+ return "future";
513
+ }
514
+ _renderPosition(now, start, end) {
515
+ const currentPosition = this._getProgress(now, start, end);
516
+ if (currentPosition < 0 && currentPosition > 100) return;
517
+ const statusStyle = () => {
518
+ return {
519
+ "--sbb-pearl-chain-status-position": `${currentPosition}%`,
520
+ ...currentPosition >= 50 ? { transform: `translateX(-100%)` } : {}
521
+ };
522
+ };
523
+ const animation = this.disableAnimation ? "sbb-pearl-chain__position--no-animation" : "";
524
+ return html`<span
525
+ style=${styleMap(statusStyle())}
526
+ class="sbb-pearl-chain__position ${animation}"
527
+ ></span>`;
528
+ }
529
+ render() {
530
+ const now = this.now ?? /* @__PURE__ */ new Date();
531
+ const rideLegs = this.legs?.filter((leg) => isRideLeg(leg));
532
+ const departureTime = rideLegs?.length && removeTimezoneFromISOTimeString(rideLegs[0]?.departure?.time);
533
+ const departureWithDelay = departureTime && {
534
+ time: departureTime,
535
+ delay: rideLegs[0].departure.delay ?? 0
536
+ };
537
+ const arrivalTime = rideLegs?.length && removeTimezoneFromISOTimeString(rideLegs[rideLegs.length - 1].arrival?.time);
538
+ const arrivalTimeDelay = arrivalTime && {
539
+ time: arrivalTime,
540
+ delay: rideLegs[rideLegs.length - 1]?.arrival.delay ?? 0
541
+ };
542
+ const departureNotServiced = (() => {
543
+ return rideLegs && rideLegs[0]?.serviceJourney?.stopPoints && rideLegs[0]?.serviceJourney?.stopPoints[0].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--departure-skipped" : "";
544
+ })();
545
+ const arrivalNotServiced = (() => {
546
+ const lastLeg = rideLegs && rideLegs[rideLegs.length - 1];
547
+ const stops = lastLeg && lastLeg.serviceJourney?.stopPoints;
548
+ return stops && stops[stops.length - 1].stopStatus === "NOT_SERVICED" ? "sbb-pearl-chain--arrival-skipped" : "";
549
+ })();
550
+ const departureCancelClass = (() => {
551
+ return rideLegs && rideLegs[0]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--departure-disruption" : "";
552
+ })();
553
+ const arrivalCancelClass = (() => {
554
+ return rideLegs && rideLegs[rideLegs.length - 1]?.serviceJourney?.serviceAlteration?.cancelled ? "sbb-pearl-chain--arrival-disruption" : "";
555
+ })();
556
+ const status = departureWithDelay && arrivalTimeDelay && this._getStatus(now, departureWithDelay, arrivalTimeDelay);
557
+ const statusClassDeparture = rideLegs && status && !departureCancelClass ? "sbb-pearl-chain__bullet--" + status : "";
558
+ const statusClassArrival = rideLegs && status && !arrivalCancelClass ? "sbb-pearl-chain__bullet--" + this._getStatus(now, void 0, arrivalTimeDelay) : "";
559
+ if (this._isAllCancelled(rideLegs)) return html`
560
+ <div class="sbb-pearl-chain">
561
+ <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
562
+ <div class="sbb-pearl-chain__leg sbb-pearl-chain__leg--disruption"></div>
563
+ <span class="sbb-pearl-chain__bullet sbb-pearl-chain--departure-disruption"></span>
564
+ </div>
565
+ `;
566
+ return html`
567
+ <div class="sbb-pearl-chain">
568
+ <span
569
+ class="sbb-pearl-chain__bullet ${statusClassDeparture} ${departureNotServiced} ${departureCancelClass}"
570
+ ></span>
571
+ ${rideLegs?.map((leg, index) => {
572
+ const { stopPoints, serviceAlteration } = leg?.serviceJourney || {};
573
+ const duration = this._getRelativeDuration(rideLegs, leg);
574
+ const departure = removeTimezoneFromISOTimeString(leg.departure?.time);
575
+ const arrival = removeTimezoneFromISOTimeString(leg.arrival?.time);
576
+ const isArrivalNotServiced = stopPoints && stopPoints[stopPoints.length - 1]?.stopStatus === "NOT_SERVICED";
577
+ const isArrivalPlanned = stopPoints && stopPoints[stopPoints.length - 1]?.stopStatus === "PLANNED";
578
+ const isDepartureNotServiced = stopPoints && stopPoints[0]?.stopStatus === "NOT_SERVICED";
579
+ const stopPointsBefore = index > 0 && rideLegs[index - 1].serviceJourney.stopPoints;
580
+ const isBeforeLegArrivalNotServiced = stopPointsBefore && stopPointsBefore[stopPointsBefore.length - 1]?.stopStatus === "NOT_SERVICED";
581
+ const skippedLeg = isArrivalNotServiced || isDepartureNotServiced && isArrivalPlanned ? "sbb-pearl-chain__leg--skipped" : "";
582
+ const departureSkippedBullet = isDepartureNotServiced || isBeforeLegArrivalNotServiced ? "sbb-pearl-chain__stop--departure-skipped" : "";
583
+ const cancelled = serviceAlteration?.cancelled || serviceAlteration?.partiallyCancelled ? "sbb-pearl-chain__leg--disruption" : "";
584
+ const cancelledExpected = leg.serviceJourney?.serviceAlteration?.cancelledExpected ? "sbb-pearl-chain__leg--cancelled-expected" : "";
585
+ const legDepartureWithDelay = {
586
+ time: departure,
587
+ delay: leg.departure?.delay ?? 0
588
+ };
589
+ const legArrivalWithDelay = {
590
+ time: arrival,
591
+ delay: leg.arrival?.delay ?? 0
592
+ };
593
+ const status = this._getStatus(now, legDepartureWithDelay, legArrivalWithDelay);
594
+ const legStatus = !cancelled && !skippedLeg && "sbb-pearl-chain__leg--" + status;
595
+ const legStyle = () => {
596
+ return {
597
+ "--sbb-pearl-chain-leg-width": `${duration}%`,
598
+ ...status === "progress" && !cancelled && !skippedLeg && !cancelledExpected ? { "--sbb-pearl-chain-leg-status": `${this._getProgress(now, legDepartureWithDelay, legArrivalWithDelay)}%` } : {}
599
+ };
600
+ };
601
+ return html` <div
602
+ class="sbb-pearl-chain__leg ${legStatus || ""} ${cancelled} ${skippedLeg} ${cancelledExpected}"
603
+ style=${styleMap(legStyle())}
604
+ >
605
+ ${index > 0 && index < rideLegs.length ? html`<span class="sbb-pearl-chain__stop ${departureSkippedBullet}"></span>` : nothing}
606
+ ${status === "progress" && !cancelled && !skippedLeg ? this._renderPosition(now, legDepartureWithDelay, legArrivalWithDelay) : nothing}
607
+ </div>`;
608
+ })}
609
+ <span
610
+ class="sbb-pearl-chain__bullet ${statusClassArrival} ${arrivalNotServiced} ${arrivalCancelClass}"
611
+ ></span>
612
+ </div>
613
+ `;
614
+ }
615
+ };
616
+ })();
617
+
618
+ //#endregion
619
+ export { SbbPearlChainElement };
@@ -103,4 +103,3 @@ export declare const mapIconToSvg: Record<string, SeatReservationIcon>;
103
103
  * - TROLLEY_ICON
104
104
  * - WHEELCHAIR_ICON
105
105
  */
106
- //# sourceMappingURL=icon-mapper.d.ts.map
@@ -1,4 +1,4 @@
1
- import { CoachDeckLevel, CoachItem, CoachNumberOfFreePlaces, Place, PlaceSelection, SeatReservation, SeatReservationPlaceSelection, SeatReservationSelectedCoach, VehicleType } from '../types.ts';
1
+ import type { CoachDeckLevel, CoachItem, CoachNumberOfFreePlaces, Place, PlaceSelection, SeatReservation, SeatReservationPlaceSelection, SeatReservationSelectedCoach, VehicleType } from '../types.ts';
2
2
  /**
3
3
  * Map function that converts the RAW OSDM mock data into SeatReservation
4
4
  */
@@ -31,4 +31,3 @@ export declare const mapPlaceAndCoachToSeatReservationPlaceSelection: (place: Pl
31
31
  * @returns PlaceSelection
32
32
  */
33
33
  export declare const mapCoachInfosToCoachSelection: (coachIndex: number, coach: CoachItem, coachNumberOfFreePlaces: CoachNumberOfFreePlaces) => SeatReservationSelectedCoach;
34
- //# sourceMappingURL=mapper.d.ts.map