@sbb-esta/lyne-elements-experimental 5.0.2 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +3 -4
  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,3005 @@
1
- import { a as handleNotices, c as sortSituation, i as getHimIcon, n as filterNotices, o as renderIconProduct, r as getCus, s as renderStringProduct, t as SbbTimetableRowElement } from "./timetable-row.component-nzrQzxL6.js";
2
- export { SbbTimetableRowElement, filterNotices, getCus, getHimIcon, handleNotices, renderIconProduct, renderStringProduct, sortSituation };
1
+ import { __esDecorate, __runInitializers } from "tslib";
2
+ import { SbbCardBadgeElement, SbbCardButtonElement, SbbCardElement } from "@sbb-esta/lyne-elements/card.pure.js";
3
+ import { SbbElement, SbbLanguageController, defaultDateAdapter, forceType, i18nArrival, i18nClass, i18nDeparture, i18nDirection, i18nFromPlatform, i18nMeansOfTransport, i18nNew, i18nOccupancy, i18nRealTimeInfo, i18nSupersaver, i18nTransferProcedure, i18nTransferProcedures, i18nTravelhints, i18nTripDuration, i18nTripQuayChange, listResetStyles, screenReaderOnlyStyles } from "@sbb-esta/lyne-elements/core.js";
4
+ import { SbbIconElement } from "@sbb-esta/lyne-elements/icon.pure.js";
5
+ import { SbbTimetableOccupancyElement } from "@sbb-esta/lyne-elements/timetable-occupancy.pure.js";
6
+ import { html, nothing, unsafeCSS } from "lit";
7
+ import { property } from "lit/decorators.js";
8
+ import { durationToTime, getDepartureArrivalTimeAttribute, isRideLeg, removeTimezoneFromISOTimeString } from "./core.js";
9
+ import { SbbPearlChainTimeElement } from "./pearl-chain-time.pure.js";
10
+
11
+ //#region node_modules/date-fns/constants.js
12
+ /**
13
+ * @constant
14
+ * @name daysInYear
15
+ * @summary Days in 1 year.
16
+ *
17
+ * @description
18
+ * How many days in a year.
19
+ *
20
+ * One years equals 365.2425 days according to the formula:
21
+ *
22
+ * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
23
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
24
+ */
25
+ const daysInYear = 365.2425;
26
+ /**
27
+ * @constant
28
+ * @name maxTime
29
+ * @summary Maximum allowed time.
30
+ *
31
+ * @example
32
+ * import { maxTime } from "./constants/date-fns/constants";
33
+ *
34
+ * const isValid = 8640000000000001 <= maxTime;
35
+ * //=> false
36
+ *
37
+ * new Date(8640000000000001);
38
+ * //=> Invalid Date
39
+ */
40
+ const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
41
+ /**
42
+ * @constant
43
+ * @name minTime
44
+ * @summary Minimum allowed time.
45
+ *
46
+ * @example
47
+ * import { minTime } from "./constants/date-fns/constants";
48
+ *
49
+ * const isValid = -8640000000000001 >= minTime;
50
+ * //=> false
51
+ *
52
+ * new Date(-8640000000000001)
53
+ * //=> Invalid Date
54
+ */
55
+ const minTime = -maxTime;
56
+ /**
57
+ * @constant
58
+ * @name millisecondsInWeek
59
+ * @summary Milliseconds in 1 week.
60
+ */
61
+ const millisecondsInWeek = 6048e5;
62
+ /**
63
+ * @constant
64
+ * @name millisecondsInDay
65
+ * @summary Milliseconds in 1 day.
66
+ */
67
+ const millisecondsInDay = 864e5;
68
+ /**
69
+ * @constant
70
+ * @name secondsInHour
71
+ * @summary Seconds in 1 hour.
72
+ */
73
+ const secondsInHour = 3600;
74
+ /**
75
+ * @constant
76
+ * @name secondsInDay
77
+ * @summary Seconds in 1 day.
78
+ */
79
+ const secondsInDay = secondsInHour * 24;
80
+ /**
81
+ * @constant
82
+ * @name secondsInWeek
83
+ * @summary Seconds in 1 week.
84
+ */
85
+ const secondsInWeek = secondsInDay * 7;
86
+ /**
87
+ * @constant
88
+ * @name secondsInYear
89
+ * @summary Seconds in 1 year.
90
+ */
91
+ const secondsInYear = secondsInDay * daysInYear;
92
+ /**
93
+ * @constant
94
+ * @name secondsInMonth
95
+ * @summary Seconds in 1 month
96
+ */
97
+ const secondsInMonth = secondsInYear / 12;
98
+ /**
99
+ * @constant
100
+ * @name secondsInQuarter
101
+ * @summary Seconds in 1 quarter.
102
+ */
103
+ const secondsInQuarter = secondsInMonth * 3;
104
+ /**
105
+ * @constant
106
+ * @name constructFromSymbol
107
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
108
+ *
109
+ * The symbol is used to enable the `constructFrom` function to construct a date
110
+ * using a reference date and a value. It allows to transfer extra properties
111
+ * from the reference date to the new date. It's useful for extensions like
112
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
113
+ * a constructor argument.
114
+ */
115
+ const constructFromSymbol = Symbol.for("constructDateFrom");
116
+
117
+ //#endregion
118
+ //#region node_modules/date-fns/constructFrom.js
119
+ /**
120
+ * @name constructFrom
121
+ * @category Generic Helpers
122
+ * @summary Constructs a date using the reference date and the value
123
+ *
124
+ * @description
125
+ * The function constructs a new date using the constructor from the reference
126
+ * date and the given value. It helps to build generic functions that accept
127
+ * date extensions.
128
+ *
129
+ * It defaults to `Date` if the passed reference date is a number or a string.
130
+ *
131
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
132
+ * enabling to transfer extra properties from the reference date to the new date.
133
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
134
+ * that accept a time zone as a constructor argument.
135
+ *
136
+ * @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).
137
+ *
138
+ * @param date - The reference date to take constructor from
139
+ * @param value - The value to create the date
140
+ *
141
+ * @returns Date initialized using the given date and value
142
+ *
143
+ * @example
144
+ * import { constructFrom } from "./constructFrom/date-fns";
145
+ *
146
+ * // A function that clones a date preserving the original type
147
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
148
+ * return constructFrom(
149
+ * date, // Use constructor from the given date
150
+ * date.getTime() // Use the date value to create a new date
151
+ * );
152
+ * }
153
+ */
154
+ function constructFrom(date, value) {
155
+ if (typeof date === "function") return date(value);
156
+ if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
157
+ if (date instanceof Date) return new date.constructor(value);
158
+ return new Date(value);
159
+ }
160
+
161
+ //#endregion
162
+ //#region node_modules/date-fns/toDate.js
163
+ /**
164
+ * @name toDate
165
+ * @category Common Helpers
166
+ * @summary Convert the given argument to an instance of Date.
167
+ *
168
+ * @description
169
+ * Convert the given argument to an instance of Date.
170
+ *
171
+ * If the argument is an instance of Date, the function returns its clone.
172
+ *
173
+ * If the argument is a number, it is treated as a timestamp.
174
+ *
175
+ * If the argument is none of the above, the function returns Invalid Date.
176
+ *
177
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
178
+ * enabling to transfer extra properties from the reference date to the new date.
179
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
180
+ * that accept a time zone as a constructor argument.
181
+ *
182
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
183
+ *
184
+ * @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).
185
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
186
+ *
187
+ * @param argument - The value to convert
188
+ *
189
+ * @returns The parsed date in the local time zone
190
+ *
191
+ * @example
192
+ * // Clone the date:
193
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
194
+ * //=> Tue Feb 11 2014 11:30:30
195
+ *
196
+ * @example
197
+ * // Convert the timestamp to date:
198
+ * const result = toDate(1392098430000)
199
+ * //=> Tue Feb 11 2014 11:30:30
200
+ */
201
+ function toDate(argument, context) {
202
+ return constructFrom(context || argument, argument);
203
+ }
204
+
205
+ //#endregion
206
+ //#region node_modules/date-fns/_lib/defaultOptions.js
207
+ let defaultOptions = {};
208
+ function getDefaultOptions() {
209
+ return defaultOptions;
210
+ }
211
+
212
+ //#endregion
213
+ //#region node_modules/date-fns/startOfWeek.js
214
+ /**
215
+ * The {@link startOfWeek} function options.
216
+ */
217
+ /**
218
+ * @name startOfWeek
219
+ * @category Week Helpers
220
+ * @summary Return the start of a week for the given date.
221
+ *
222
+ * @description
223
+ * Return the start of a week for the given date.
224
+ * The result will be in the local timezone.
225
+ *
226
+ * @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).
227
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
228
+ *
229
+ * @param date - The original date
230
+ * @param options - An object with options
231
+ *
232
+ * @returns The start of a week
233
+ *
234
+ * @example
235
+ * // The start of a week for 2 September 2014 11:55:00:
236
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
237
+ * //=> Sun Aug 31 2014 00:00:00
238
+ *
239
+ * @example
240
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
241
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
242
+ * //=> Mon Sep 01 2014 00:00:00
243
+ */
244
+ function startOfWeek(date, options) {
245
+ const defaultOptions = getDefaultOptions();
246
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
247
+ const _date = toDate(date, options?.in);
248
+ const day = _date.getDay();
249
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
250
+ _date.setDate(_date.getDate() - diff);
251
+ _date.setHours(0, 0, 0, 0);
252
+ return _date;
253
+ }
254
+
255
+ //#endregion
256
+ //#region node_modules/date-fns/startOfISOWeek.js
257
+ /**
258
+ * The {@link startOfISOWeek} function options.
259
+ */
260
+ /**
261
+ * @name startOfISOWeek
262
+ * @category ISO Week Helpers
263
+ * @summary Return the start of an ISO week for the given date.
264
+ *
265
+ * @description
266
+ * Return the start of an ISO week for the given date.
267
+ * The result will be in the local timezone.
268
+ *
269
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
270
+ *
271
+ * @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).
272
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
273
+ *
274
+ * @param date - The original date
275
+ * @param options - An object with options
276
+ *
277
+ * @returns The start of an ISO week
278
+ *
279
+ * @example
280
+ * // The start of an ISO week for 2 September 2014 11:55:00:
281
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
282
+ * //=> Mon Sep 01 2014 00:00:00
283
+ */
284
+ function startOfISOWeek(date, options) {
285
+ return startOfWeek(date, {
286
+ ...options,
287
+ weekStartsOn: 1
288
+ });
289
+ }
290
+
291
+ //#endregion
292
+ //#region node_modules/date-fns/getISOWeekYear.js
293
+ /**
294
+ * The {@link getISOWeekYear} function options.
295
+ */
296
+ /**
297
+ * @name getISOWeekYear
298
+ * @category ISO Week-Numbering Year Helpers
299
+ * @summary Get the ISO week-numbering year of the given date.
300
+ *
301
+ * @description
302
+ * Get the ISO week-numbering year of the given date,
303
+ * which always starts 3 days before the year's first Thursday.
304
+ *
305
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
306
+ *
307
+ * @param date - The given date
308
+ *
309
+ * @returns The ISO week-numbering year
310
+ *
311
+ * @example
312
+ * // Which ISO-week numbering year is 2 January 2005?
313
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
314
+ * //=> 2004
315
+ */
316
+ function getISOWeekYear(date, options) {
317
+ const _date = toDate(date, options?.in);
318
+ const year = _date.getFullYear();
319
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
320
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
321
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
322
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
323
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
324
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
325
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
326
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
327
+ if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
328
+ else if (_date.getTime() >= startOfThisYear.getTime()) return year;
329
+ else return year - 1;
330
+ }
331
+
332
+ //#endregion
333
+ //#region node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
334
+ /**
335
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
336
+ * They usually appear for dates that denote time before the timezones were introduced
337
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
338
+ * and GMT+01:00:00 after that date)
339
+ *
340
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
341
+ * which would lead to incorrect calculations.
342
+ *
343
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
344
+ */
345
+ function getTimezoneOffsetInMilliseconds(date) {
346
+ const _date = toDate(date);
347
+ const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
348
+ utcDate.setUTCFullYear(_date.getFullYear());
349
+ return +date - +utcDate;
350
+ }
351
+
352
+ //#endregion
353
+ //#region node_modules/date-fns/_lib/normalizeDates.js
354
+ function normalizeDates(context, ...dates) {
355
+ const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === "object"));
356
+ return dates.map(normalize);
357
+ }
358
+
359
+ //#endregion
360
+ //#region node_modules/date-fns/startOfDay.js
361
+ /**
362
+ * The {@link startOfDay} function options.
363
+ */
364
+ /**
365
+ * @name startOfDay
366
+ * @category Day Helpers
367
+ * @summary Return the start of a day for the given date.
368
+ *
369
+ * @description
370
+ * Return the start of a day for the given date.
371
+ * The result will be in the local timezone.
372
+ *
373
+ * @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).
374
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
375
+ *
376
+ * @param date - The original date
377
+ * @param options - The options
378
+ *
379
+ * @returns The start of a day
380
+ *
381
+ * @example
382
+ * // The start of a day for 2 September 2014 11:55:00:
383
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
384
+ * //=> Tue Sep 02 2014 00:00:00
385
+ */
386
+ function startOfDay(date, options) {
387
+ const _date = toDate(date, options?.in);
388
+ _date.setHours(0, 0, 0, 0);
389
+ return _date;
390
+ }
391
+
392
+ //#endregion
393
+ //#region node_modules/date-fns/differenceInCalendarDays.js
394
+ /**
395
+ * The {@link differenceInCalendarDays} function options.
396
+ */
397
+ /**
398
+ * @name differenceInCalendarDays
399
+ * @category Day Helpers
400
+ * @summary Get the number of calendar days between the given dates.
401
+ *
402
+ * @description
403
+ * Get the number of calendar days between the given dates. This means that the times are removed
404
+ * from the dates and then the difference in days is calculated.
405
+ *
406
+ * @param laterDate - The later date
407
+ * @param earlierDate - The earlier date
408
+ * @param options - The options object
409
+ *
410
+ * @returns The number of calendar days
411
+ *
412
+ * @example
413
+ * // How many calendar days are between
414
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
415
+ * const result = differenceInCalendarDays(
416
+ * new Date(2012, 6, 2, 0, 0),
417
+ * new Date(2011, 6, 2, 23, 0)
418
+ * )
419
+ * //=> 366
420
+ * // How many calendar days are between
421
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
422
+ * const result = differenceInCalendarDays(
423
+ * new Date(2011, 6, 3, 0, 1),
424
+ * new Date(2011, 6, 2, 23, 59)
425
+ * )
426
+ * //=> 1
427
+ */
428
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
429
+ const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
430
+ const laterStartOfDay = startOfDay(laterDate_);
431
+ const earlierStartOfDay = startOfDay(earlierDate_);
432
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
433
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
434
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
435
+ }
436
+
437
+ //#endregion
438
+ //#region node_modules/date-fns/startOfISOWeekYear.js
439
+ /**
440
+ * The {@link startOfISOWeekYear} function options.
441
+ */
442
+ /**
443
+ * @name startOfISOWeekYear
444
+ * @category ISO Week-Numbering Year Helpers
445
+ * @summary Return the start of an ISO week-numbering year for the given date.
446
+ *
447
+ * @description
448
+ * Return the start of an ISO week-numbering year,
449
+ * which always starts 3 days before the year's first Thursday.
450
+ * The result will be in the local timezone.
451
+ *
452
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
453
+ *
454
+ * @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).
455
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
456
+ *
457
+ * @param date - The original date
458
+ * @param options - An object with options
459
+ *
460
+ * @returns The start of an ISO week-numbering year
461
+ *
462
+ * @example
463
+ * // The start of an ISO week-numbering year for 2 July 2005:
464
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
465
+ * //=> Mon Jan 03 2005 00:00:00
466
+ */
467
+ function startOfISOWeekYear(date, options) {
468
+ const year = getISOWeekYear(date, options);
469
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
470
+ fourthOfJanuary.setFullYear(year, 0, 4);
471
+ fourthOfJanuary.setHours(0, 0, 0, 0);
472
+ return startOfISOWeek(fourthOfJanuary);
473
+ }
474
+
475
+ //#endregion
476
+ //#region node_modules/date-fns/isDate.js
477
+ /**
478
+ * @name isDate
479
+ * @category Common Helpers
480
+ * @summary Is the given value a date?
481
+ *
482
+ * @description
483
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
484
+ *
485
+ * @param value - The value to check
486
+ *
487
+ * @returns True if the given value is a date
488
+ *
489
+ * @example
490
+ * // For a valid date:
491
+ * const result = isDate(new Date())
492
+ * //=> true
493
+ *
494
+ * @example
495
+ * // For an invalid date:
496
+ * const result = isDate(new Date(NaN))
497
+ * //=> true
498
+ *
499
+ * @example
500
+ * // For some value:
501
+ * const result = isDate('2014-02-31')
502
+ * //=> false
503
+ *
504
+ * @example
505
+ * // For an object:
506
+ * const result = isDate({})
507
+ * //=> false
508
+ */
509
+ function isDate(value) {
510
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
511
+ }
512
+
513
+ //#endregion
514
+ //#region node_modules/date-fns/isValid.js
515
+ /**
516
+ * @name isValid
517
+ * @category Common Helpers
518
+ * @summary Is the given date valid?
519
+ *
520
+ * @description
521
+ * Returns false if argument is Invalid Date and true otherwise.
522
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
523
+ * Invalid Date is a Date, whose time value is NaN.
524
+ *
525
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
526
+ *
527
+ * @param date - The date to check
528
+ *
529
+ * @returns The date is valid
530
+ *
531
+ * @example
532
+ * // For the valid date:
533
+ * const result = isValid(new Date(2014, 1, 31))
534
+ * //=> true
535
+ *
536
+ * @example
537
+ * // For the value, convertible into a date:
538
+ * const result = isValid(1393804800000)
539
+ * //=> true
540
+ *
541
+ * @example
542
+ * // For the invalid date:
543
+ * const result = isValid(new Date(''))
544
+ * //=> false
545
+ */
546
+ function isValid(date) {
547
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
548
+ }
549
+
550
+ //#endregion
551
+ //#region node_modules/date-fns/startOfYear.js
552
+ /**
553
+ * The {@link startOfYear} function options.
554
+ */
555
+ /**
556
+ * @name startOfYear
557
+ * @category Year Helpers
558
+ * @summary Return the start of a year for the given date.
559
+ *
560
+ * @description
561
+ * Return the start of a year for the given date.
562
+ * The result will be in the local timezone.
563
+ *
564
+ * @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).
565
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
566
+ *
567
+ * @param date - The original date
568
+ * @param options - The options
569
+ *
570
+ * @returns The start of a year
571
+ *
572
+ * @example
573
+ * // The start of a year for 2 September 2014 11:55:00:
574
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
575
+ * //=> Wed Jan 01 2014 00:00:00
576
+ */
577
+ function startOfYear(date, options) {
578
+ const date_ = toDate(date, options?.in);
579
+ date_.setFullYear(date_.getFullYear(), 0, 1);
580
+ date_.setHours(0, 0, 0, 0);
581
+ return date_;
582
+ }
583
+
584
+ //#endregion
585
+ //#region node_modules/date-fns/locale/en-US/_lib/formatDistance.js
586
+ const formatDistanceLocale = {
587
+ lessThanXSeconds: {
588
+ one: "less than a second",
589
+ other: "less than {{count}} seconds"
590
+ },
591
+ xSeconds: {
592
+ one: "1 second",
593
+ other: "{{count}} seconds"
594
+ },
595
+ halfAMinute: "half a minute",
596
+ lessThanXMinutes: {
597
+ one: "less than a minute",
598
+ other: "less than {{count}} minutes"
599
+ },
600
+ xMinutes: {
601
+ one: "1 minute",
602
+ other: "{{count}} minutes"
603
+ },
604
+ aboutXHours: {
605
+ one: "about 1 hour",
606
+ other: "about {{count}} hours"
607
+ },
608
+ xHours: {
609
+ one: "1 hour",
610
+ other: "{{count}} hours"
611
+ },
612
+ xDays: {
613
+ one: "1 day",
614
+ other: "{{count}} days"
615
+ },
616
+ aboutXWeeks: {
617
+ one: "about 1 week",
618
+ other: "about {{count}} weeks"
619
+ },
620
+ xWeeks: {
621
+ one: "1 week",
622
+ other: "{{count}} weeks"
623
+ },
624
+ aboutXMonths: {
625
+ one: "about 1 month",
626
+ other: "about {{count}} months"
627
+ },
628
+ xMonths: {
629
+ one: "1 month",
630
+ other: "{{count}} months"
631
+ },
632
+ aboutXYears: {
633
+ one: "about 1 year",
634
+ other: "about {{count}} years"
635
+ },
636
+ xYears: {
637
+ one: "1 year",
638
+ other: "{{count}} years"
639
+ },
640
+ overXYears: {
641
+ one: "over 1 year",
642
+ other: "over {{count}} years"
643
+ },
644
+ almostXYears: {
645
+ one: "almost 1 year",
646
+ other: "almost {{count}} years"
647
+ }
648
+ };
649
+ const formatDistance = (token, count, options) => {
650
+ let result;
651
+ const tokenValue = formatDistanceLocale[token];
652
+ if (typeof tokenValue === "string") result = tokenValue;
653
+ else if (count === 1) result = tokenValue.one;
654
+ else result = tokenValue.other.replace("{{count}}", count.toString());
655
+ if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
656
+ else return result + " ago";
657
+ return result;
658
+ };
659
+
660
+ //#endregion
661
+ //#region node_modules/date-fns/locale/_lib/buildFormatLongFn.js
662
+ function buildFormatLongFn(args) {
663
+ return (options = {}) => {
664
+ const width = options.width ? String(options.width) : args.defaultWidth;
665
+ return args.formats[width] || args.formats[args.defaultWidth];
666
+ };
667
+ }
668
+
669
+ //#endregion
670
+ //#region node_modules/date-fns/locale/en-US/_lib/formatLong.js
671
+ const dateFormats = {
672
+ full: "EEEE, MMMM do, y",
673
+ long: "MMMM do, y",
674
+ medium: "MMM d, y",
675
+ short: "MM/dd/yyyy"
676
+ };
677
+ const timeFormats = {
678
+ full: "h:mm:ss a zzzz",
679
+ long: "h:mm:ss a z",
680
+ medium: "h:mm:ss a",
681
+ short: "h:mm a"
682
+ };
683
+ const dateTimeFormats = {
684
+ full: "{{date}} 'at' {{time}}",
685
+ long: "{{date}} 'at' {{time}}",
686
+ medium: "{{date}}, {{time}}",
687
+ short: "{{date}}, {{time}}"
688
+ };
689
+ const formatLong = {
690
+ date: buildFormatLongFn({
691
+ formats: dateFormats,
692
+ defaultWidth: "full"
693
+ }),
694
+ time: buildFormatLongFn({
695
+ formats: timeFormats,
696
+ defaultWidth: "full"
697
+ }),
698
+ dateTime: buildFormatLongFn({
699
+ formats: dateTimeFormats,
700
+ defaultWidth: "full"
701
+ })
702
+ };
703
+
704
+ //#endregion
705
+ //#region node_modules/date-fns/locale/en-US/_lib/formatRelative.js
706
+ const formatRelativeLocale = {
707
+ lastWeek: "'last' eeee 'at' p",
708
+ yesterday: "'yesterday at' p",
709
+ today: "'today at' p",
710
+ tomorrow: "'tomorrow at' p",
711
+ nextWeek: "eeee 'at' p",
712
+ other: "P"
713
+ };
714
+ const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
715
+
716
+ //#endregion
717
+ //#region node_modules/date-fns/locale/_lib/buildLocalizeFn.js
718
+ /**
719
+ * The localize function argument callback which allows to convert raw value to
720
+ * the actual type.
721
+ *
722
+ * @param value - The value to convert
723
+ *
724
+ * @returns The converted value
725
+ */
726
+ /**
727
+ * The map of localized values for each width.
728
+ */
729
+ /**
730
+ * The index type of the locale unit value. It types conversion of units of
731
+ * values that don't start at 0 (i.e. quarters).
732
+ */
733
+ /**
734
+ * Converts the unit value to the tuple of values.
735
+ */
736
+ /**
737
+ * The tuple of localized era values. The first element represents BC,
738
+ * the second element represents AD.
739
+ */
740
+ /**
741
+ * The tuple of localized quarter values. The first element represents Q1.
742
+ */
743
+ /**
744
+ * The tuple of localized day values. The first element represents Sunday.
745
+ */
746
+ /**
747
+ * The tuple of localized month values. The first element represents January.
748
+ */
749
+ function buildLocalizeFn(args) {
750
+ return (value, options) => {
751
+ const context = options?.context ? String(options.context) : "standalone";
752
+ let valuesArray;
753
+ if (context === "formatting" && args.formattingValues) {
754
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
755
+ const width = options?.width ? String(options.width) : defaultWidth;
756
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
757
+ } else {
758
+ const defaultWidth = args.defaultWidth;
759
+ const width = options?.width ? String(options.width) : args.defaultWidth;
760
+ valuesArray = args.values[width] || args.values[defaultWidth];
761
+ }
762
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
763
+ return valuesArray[index];
764
+ };
765
+ }
766
+
767
+ //#endregion
768
+ //#region node_modules/date-fns/locale/en-US/_lib/localize.js
769
+ const eraValues = {
770
+ narrow: ["B", "A"],
771
+ abbreviated: ["BC", "AD"],
772
+ wide: ["Before Christ", "Anno Domini"]
773
+ };
774
+ const quarterValues = {
775
+ narrow: [
776
+ "1",
777
+ "2",
778
+ "3",
779
+ "4"
780
+ ],
781
+ abbreviated: [
782
+ "Q1",
783
+ "Q2",
784
+ "Q3",
785
+ "Q4"
786
+ ],
787
+ wide: [
788
+ "1st quarter",
789
+ "2nd quarter",
790
+ "3rd quarter",
791
+ "4th quarter"
792
+ ]
793
+ };
794
+ const monthValues = {
795
+ narrow: [
796
+ "J",
797
+ "F",
798
+ "M",
799
+ "A",
800
+ "M",
801
+ "J",
802
+ "J",
803
+ "A",
804
+ "S",
805
+ "O",
806
+ "N",
807
+ "D"
808
+ ],
809
+ abbreviated: [
810
+ "Jan",
811
+ "Feb",
812
+ "Mar",
813
+ "Apr",
814
+ "May",
815
+ "Jun",
816
+ "Jul",
817
+ "Aug",
818
+ "Sep",
819
+ "Oct",
820
+ "Nov",
821
+ "Dec"
822
+ ],
823
+ wide: [
824
+ "January",
825
+ "February",
826
+ "March",
827
+ "April",
828
+ "May",
829
+ "June",
830
+ "July",
831
+ "August",
832
+ "September",
833
+ "October",
834
+ "November",
835
+ "December"
836
+ ]
837
+ };
838
+ const dayValues = {
839
+ narrow: [
840
+ "S",
841
+ "M",
842
+ "T",
843
+ "W",
844
+ "T",
845
+ "F",
846
+ "S"
847
+ ],
848
+ short: [
849
+ "Su",
850
+ "Mo",
851
+ "Tu",
852
+ "We",
853
+ "Th",
854
+ "Fr",
855
+ "Sa"
856
+ ],
857
+ abbreviated: [
858
+ "Sun",
859
+ "Mon",
860
+ "Tue",
861
+ "Wed",
862
+ "Thu",
863
+ "Fri",
864
+ "Sat"
865
+ ],
866
+ wide: [
867
+ "Sunday",
868
+ "Monday",
869
+ "Tuesday",
870
+ "Wednesday",
871
+ "Thursday",
872
+ "Friday",
873
+ "Saturday"
874
+ ]
875
+ };
876
+ const dayPeriodValues = {
877
+ narrow: {
878
+ am: "a",
879
+ pm: "p",
880
+ midnight: "mi",
881
+ noon: "n",
882
+ morning: "morning",
883
+ afternoon: "afternoon",
884
+ evening: "evening",
885
+ night: "night"
886
+ },
887
+ abbreviated: {
888
+ am: "AM",
889
+ pm: "PM",
890
+ midnight: "midnight",
891
+ noon: "noon",
892
+ morning: "morning",
893
+ afternoon: "afternoon",
894
+ evening: "evening",
895
+ night: "night"
896
+ },
897
+ wide: {
898
+ am: "a.m.",
899
+ pm: "p.m.",
900
+ midnight: "midnight",
901
+ noon: "noon",
902
+ morning: "morning",
903
+ afternoon: "afternoon",
904
+ evening: "evening",
905
+ night: "night"
906
+ }
907
+ };
908
+ const formattingDayPeriodValues = {
909
+ narrow: {
910
+ am: "a",
911
+ pm: "p",
912
+ midnight: "mi",
913
+ noon: "n",
914
+ morning: "in the morning",
915
+ afternoon: "in the afternoon",
916
+ evening: "in the evening",
917
+ night: "at night"
918
+ },
919
+ abbreviated: {
920
+ am: "AM",
921
+ pm: "PM",
922
+ midnight: "midnight",
923
+ noon: "noon",
924
+ morning: "in the morning",
925
+ afternoon: "in the afternoon",
926
+ evening: "in the evening",
927
+ night: "at night"
928
+ },
929
+ wide: {
930
+ am: "a.m.",
931
+ pm: "p.m.",
932
+ midnight: "midnight",
933
+ noon: "noon",
934
+ morning: "in the morning",
935
+ afternoon: "in the afternoon",
936
+ evening: "in the evening",
937
+ night: "at night"
938
+ }
939
+ };
940
+ const ordinalNumber = (dirtyNumber, _options) => {
941
+ const number = Number(dirtyNumber);
942
+ const rem100 = number % 100;
943
+ if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
944
+ case 1: return number + "st";
945
+ case 2: return number + "nd";
946
+ case 3: return number + "rd";
947
+ }
948
+ return number + "th";
949
+ };
950
+ const localize = {
951
+ ordinalNumber,
952
+ era: buildLocalizeFn({
953
+ values: eraValues,
954
+ defaultWidth: "wide"
955
+ }),
956
+ quarter: buildLocalizeFn({
957
+ values: quarterValues,
958
+ defaultWidth: "wide",
959
+ argumentCallback: (quarter) => quarter - 1
960
+ }),
961
+ month: buildLocalizeFn({
962
+ values: monthValues,
963
+ defaultWidth: "wide"
964
+ }),
965
+ day: buildLocalizeFn({
966
+ values: dayValues,
967
+ defaultWidth: "wide"
968
+ }),
969
+ dayPeriod: buildLocalizeFn({
970
+ values: dayPeriodValues,
971
+ defaultWidth: "wide",
972
+ formattingValues: formattingDayPeriodValues,
973
+ defaultFormattingWidth: "wide"
974
+ })
975
+ };
976
+
977
+ //#endregion
978
+ //#region node_modules/date-fns/locale/_lib/buildMatchFn.js
979
+ function buildMatchFn(args) {
980
+ return (string, options = {}) => {
981
+ const width = options.width;
982
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
983
+ const matchResult = string.match(matchPattern);
984
+ if (!matchResult) return null;
985
+ const matchedString = matchResult[0];
986
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
987
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
988
+ let value;
989
+ value = args.valueCallback ? args.valueCallback(key) : key;
990
+ value = options.valueCallback ? options.valueCallback(value) : value;
991
+ const rest = string.slice(matchedString.length);
992
+ return {
993
+ value,
994
+ rest
995
+ };
996
+ };
997
+ }
998
+ function findKey(object, predicate) {
999
+ for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
1000
+ }
1001
+ function findIndex(array, predicate) {
1002
+ for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
1003
+ }
1004
+
1005
+ //#endregion
1006
+ //#region node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
1007
+ function buildMatchPatternFn(args) {
1008
+ return (string, options = {}) => {
1009
+ const matchResult = string.match(args.matchPattern);
1010
+ if (!matchResult) return null;
1011
+ const matchedString = matchResult[0];
1012
+ const parseResult = string.match(args.parsePattern);
1013
+ if (!parseResult) return null;
1014
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1015
+ value = options.valueCallback ? options.valueCallback(value) : value;
1016
+ const rest = string.slice(matchedString.length);
1017
+ return {
1018
+ value,
1019
+ rest
1020
+ };
1021
+ };
1022
+ }
1023
+
1024
+ //#endregion
1025
+ //#region node_modules/date-fns/locale/en-US/_lib/match.js
1026
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1027
+ const parseOrdinalNumberPattern = /\d+/i;
1028
+ const matchEraPatterns = {
1029
+ narrow: /^(b|a)/i,
1030
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1031
+ wide: /^(before christ|before common era|anno domini|common era)/i
1032
+ };
1033
+ const parseEraPatterns = { any: [/^b/i, /^(a|c)/i] };
1034
+ const matchQuarterPatterns = {
1035
+ narrow: /^[1234]/i,
1036
+ abbreviated: /^q[1234]/i,
1037
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1038
+ };
1039
+ const parseQuarterPatterns = { any: [
1040
+ /1/i,
1041
+ /2/i,
1042
+ /3/i,
1043
+ /4/i
1044
+ ] };
1045
+ const matchMonthPatterns = {
1046
+ narrow: /^[jfmasond]/i,
1047
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1048
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1049
+ };
1050
+ const parseMonthPatterns = {
1051
+ narrow: [
1052
+ /^j/i,
1053
+ /^f/i,
1054
+ /^m/i,
1055
+ /^a/i,
1056
+ /^m/i,
1057
+ /^j/i,
1058
+ /^j/i,
1059
+ /^a/i,
1060
+ /^s/i,
1061
+ /^o/i,
1062
+ /^n/i,
1063
+ /^d/i
1064
+ ],
1065
+ any: [
1066
+ /^ja/i,
1067
+ /^f/i,
1068
+ /^mar/i,
1069
+ /^ap/i,
1070
+ /^may/i,
1071
+ /^jun/i,
1072
+ /^jul/i,
1073
+ /^au/i,
1074
+ /^s/i,
1075
+ /^o/i,
1076
+ /^n/i,
1077
+ /^d/i
1078
+ ]
1079
+ };
1080
+ const matchDayPatterns = {
1081
+ narrow: /^[smtwf]/i,
1082
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1083
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1084
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1085
+ };
1086
+ const parseDayPatterns = {
1087
+ narrow: [
1088
+ /^s/i,
1089
+ /^m/i,
1090
+ /^t/i,
1091
+ /^w/i,
1092
+ /^t/i,
1093
+ /^f/i,
1094
+ /^s/i
1095
+ ],
1096
+ any: [
1097
+ /^su/i,
1098
+ /^m/i,
1099
+ /^tu/i,
1100
+ /^w/i,
1101
+ /^th/i,
1102
+ /^f/i,
1103
+ /^sa/i
1104
+ ]
1105
+ };
1106
+ const matchDayPeriodPatterns = {
1107
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1108
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1109
+ };
1110
+ const parseDayPeriodPatterns = { any: {
1111
+ am: /^a/i,
1112
+ pm: /^p/i,
1113
+ midnight: /^mi/i,
1114
+ noon: /^no/i,
1115
+ morning: /morning/i,
1116
+ afternoon: /afternoon/i,
1117
+ evening: /evening/i,
1118
+ night: /night/i
1119
+ } };
1120
+ const match = {
1121
+ ordinalNumber: buildMatchPatternFn({
1122
+ matchPattern: matchOrdinalNumberPattern,
1123
+ parsePattern: parseOrdinalNumberPattern,
1124
+ valueCallback: (value) => parseInt(value, 10)
1125
+ }),
1126
+ era: buildMatchFn({
1127
+ matchPatterns: matchEraPatterns,
1128
+ defaultMatchWidth: "wide",
1129
+ parsePatterns: parseEraPatterns,
1130
+ defaultParseWidth: "any"
1131
+ }),
1132
+ quarter: buildMatchFn({
1133
+ matchPatterns: matchQuarterPatterns,
1134
+ defaultMatchWidth: "wide",
1135
+ parsePatterns: parseQuarterPatterns,
1136
+ defaultParseWidth: "any",
1137
+ valueCallback: (index) => index + 1
1138
+ }),
1139
+ month: buildMatchFn({
1140
+ matchPatterns: matchMonthPatterns,
1141
+ defaultMatchWidth: "wide",
1142
+ parsePatterns: parseMonthPatterns,
1143
+ defaultParseWidth: "any"
1144
+ }),
1145
+ day: buildMatchFn({
1146
+ matchPatterns: matchDayPatterns,
1147
+ defaultMatchWidth: "wide",
1148
+ parsePatterns: parseDayPatterns,
1149
+ defaultParseWidth: "any"
1150
+ }),
1151
+ dayPeriod: buildMatchFn({
1152
+ matchPatterns: matchDayPeriodPatterns,
1153
+ defaultMatchWidth: "any",
1154
+ parsePatterns: parseDayPeriodPatterns,
1155
+ defaultParseWidth: "any"
1156
+ })
1157
+ };
1158
+
1159
+ //#endregion
1160
+ //#region node_modules/date-fns/locale/en-US.js
1161
+ /**
1162
+ * @category Locales
1163
+ * @summary English locale (United States).
1164
+ * @language English
1165
+ * @iso-639-2 eng
1166
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
1167
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
1168
+ */
1169
+ const enUS = {
1170
+ code: "en-US",
1171
+ formatDistance,
1172
+ formatLong,
1173
+ formatRelative,
1174
+ localize,
1175
+ match,
1176
+ options: {
1177
+ weekStartsOn: 0,
1178
+ firstWeekContainsDate: 1
1179
+ }
1180
+ };
1181
+
1182
+ //#endregion
1183
+ //#region node_modules/date-fns/getDayOfYear.js
1184
+ /**
1185
+ * The {@link getDayOfYear} function options.
1186
+ */
1187
+ /**
1188
+ * @name getDayOfYear
1189
+ * @category Day Helpers
1190
+ * @summary Get the day of the year of the given date.
1191
+ *
1192
+ * @description
1193
+ * Get the day of the year of the given date.
1194
+ *
1195
+ * @param date - The given date
1196
+ * @param options - The options
1197
+ *
1198
+ * @returns The day of year
1199
+ *
1200
+ * @example
1201
+ * // Which day of the year is 2 July 2014?
1202
+ * const result = getDayOfYear(new Date(2014, 6, 2))
1203
+ * //=> 183
1204
+ */
1205
+ function getDayOfYear(date, options) {
1206
+ const _date = toDate(date, options?.in);
1207
+ return differenceInCalendarDays(_date, startOfYear(_date)) + 1;
1208
+ }
1209
+
1210
+ //#endregion
1211
+ //#region node_modules/date-fns/getISOWeek.js
1212
+ /**
1213
+ * The {@link getISOWeek} function options.
1214
+ */
1215
+ /**
1216
+ * @name getISOWeek
1217
+ * @category ISO Week Helpers
1218
+ * @summary Get the ISO week of the given date.
1219
+ *
1220
+ * @description
1221
+ * Get the ISO week of the given date.
1222
+ *
1223
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1224
+ *
1225
+ * @param date - The given date
1226
+ * @param options - The options
1227
+ *
1228
+ * @returns The ISO week
1229
+ *
1230
+ * @example
1231
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1232
+ * const result = getISOWeek(new Date(2005, 0, 2))
1233
+ * //=> 53
1234
+ */
1235
+ function getISOWeek(date, options) {
1236
+ const _date = toDate(date, options?.in);
1237
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1238
+ return Math.round(diff / millisecondsInWeek) + 1;
1239
+ }
1240
+
1241
+ //#endregion
1242
+ //#region node_modules/date-fns/getWeekYear.js
1243
+ /**
1244
+ * The {@link getWeekYear} function options.
1245
+ */
1246
+ /**
1247
+ * @name getWeekYear
1248
+ * @category Week-Numbering Year Helpers
1249
+ * @summary Get the local week-numbering year of the given date.
1250
+ *
1251
+ * @description
1252
+ * Get the local week-numbering year of the given date.
1253
+ * The exact calculation depends on the values of
1254
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1255
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1256
+ * the first week of the week-numbering year)
1257
+ *
1258
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1259
+ *
1260
+ * @param date - The given date
1261
+ * @param options - An object with options.
1262
+ *
1263
+ * @returns The local week-numbering year
1264
+ *
1265
+ * @example
1266
+ * // Which week numbering year is 26 December 2004 with the default settings?
1267
+ * const result = getWeekYear(new Date(2004, 11, 26))
1268
+ * //=> 2005
1269
+ *
1270
+ * @example
1271
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1272
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1273
+ * //=> 2004
1274
+ *
1275
+ * @example
1276
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1277
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1278
+ * //=> 2004
1279
+ */
1280
+ function getWeekYear(date, options) {
1281
+ const _date = toDate(date, options?.in);
1282
+ const year = _date.getFullYear();
1283
+ const defaultOptions = getDefaultOptions();
1284
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1285
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1286
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1287
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1288
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1289
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1290
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1291
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1292
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1293
+ if (+_date >= +startOfNextYear) return year + 1;
1294
+ else if (+_date >= +startOfThisYear) return year;
1295
+ else return year - 1;
1296
+ }
1297
+
1298
+ //#endregion
1299
+ //#region node_modules/date-fns/startOfWeekYear.js
1300
+ /**
1301
+ * The {@link startOfWeekYear} function options.
1302
+ */
1303
+ /**
1304
+ * @name startOfWeekYear
1305
+ * @category Week-Numbering Year Helpers
1306
+ * @summary Return the start of a local week-numbering year for the given date.
1307
+ *
1308
+ * @description
1309
+ * Return the start of a local week-numbering year.
1310
+ * The exact calculation depends on the values of
1311
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1312
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1313
+ * the first week of the week-numbering year)
1314
+ *
1315
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1316
+ *
1317
+ * @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).
1318
+ * @typeParam ResultDate - The result `Date` type.
1319
+ *
1320
+ * @param date - The original date
1321
+ * @param options - An object with options
1322
+ *
1323
+ * @returns The start of a week-numbering year
1324
+ *
1325
+ * @example
1326
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1327
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1328
+ * //=> Sun Dec 26 2004 00:00:00
1329
+ *
1330
+ * @example
1331
+ * // The start of a week-numbering year for 2 July 2005
1332
+ * // if Monday is the first day of week
1333
+ * // and 4 January is always in the first week of the year:
1334
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1335
+ * weekStartsOn: 1,
1336
+ * firstWeekContainsDate: 4
1337
+ * })
1338
+ * //=> Mon Jan 03 2005 00:00:00
1339
+ */
1340
+ function startOfWeekYear(date, options) {
1341
+ const defaultOptions = getDefaultOptions();
1342
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1343
+ const year = getWeekYear(date, options);
1344
+ const firstWeek = constructFrom(options?.in || date, 0);
1345
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1346
+ firstWeek.setHours(0, 0, 0, 0);
1347
+ return startOfWeek(firstWeek, options);
1348
+ }
1349
+
1350
+ //#endregion
1351
+ //#region node_modules/date-fns/getWeek.js
1352
+ /**
1353
+ * The {@link getWeek} function options.
1354
+ */
1355
+ /**
1356
+ * @name getWeek
1357
+ * @category Week Helpers
1358
+ * @summary Get the local week index of the given date.
1359
+ *
1360
+ * @description
1361
+ * Get the local week index of the given date.
1362
+ * The exact calculation depends on the values of
1363
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1364
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1365
+ * the first week of the week-numbering year)
1366
+ *
1367
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1368
+ *
1369
+ * @param date - The given date
1370
+ * @param options - An object with options
1371
+ *
1372
+ * @returns The week
1373
+ *
1374
+ * @example
1375
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1376
+ * const result = getWeek(new Date(2005, 0, 2))
1377
+ * //=> 2
1378
+ *
1379
+ * @example
1380
+ * // Which week of the local week numbering year is 2 January 2005,
1381
+ * // if Monday is the first day of the week,
1382
+ * // and the first week of the year always contains 4 January?
1383
+ * const result = getWeek(new Date(2005, 0, 2), {
1384
+ * weekStartsOn: 1,
1385
+ * firstWeekContainsDate: 4
1386
+ * })
1387
+ * //=> 53
1388
+ */
1389
+ function getWeek(date, options) {
1390
+ const _date = toDate(date, options?.in);
1391
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1392
+ return Math.round(diff / millisecondsInWeek) + 1;
1393
+ }
1394
+
1395
+ //#endregion
1396
+ //#region node_modules/date-fns/_lib/addLeadingZeros.js
1397
+ function addLeadingZeros(number, targetLength) {
1398
+ return (number < 0 ? "-" : "") + Math.abs(number).toString().padStart(targetLength, "0");
1399
+ }
1400
+
1401
+ //#endregion
1402
+ //#region node_modules/date-fns/_lib/format/lightFormatters.js
1403
+ const lightFormatters = {
1404
+ y(date, token) {
1405
+ const signedYear = date.getFullYear();
1406
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1407
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1408
+ },
1409
+ M(date, token) {
1410
+ const month = date.getMonth();
1411
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1412
+ },
1413
+ d(date, token) {
1414
+ return addLeadingZeros(date.getDate(), token.length);
1415
+ },
1416
+ a(date, token) {
1417
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1418
+ switch (token) {
1419
+ case "a":
1420
+ case "aa": return dayPeriodEnumValue.toUpperCase();
1421
+ case "aaa": return dayPeriodEnumValue;
1422
+ case "aaaaa": return dayPeriodEnumValue[0];
1423
+ default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1424
+ }
1425
+ },
1426
+ h(date, token) {
1427
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1428
+ },
1429
+ H(date, token) {
1430
+ return addLeadingZeros(date.getHours(), token.length);
1431
+ },
1432
+ m(date, token) {
1433
+ return addLeadingZeros(date.getMinutes(), token.length);
1434
+ },
1435
+ s(date, token) {
1436
+ return addLeadingZeros(date.getSeconds(), token.length);
1437
+ },
1438
+ S(date, token) {
1439
+ const numberOfDigits = token.length;
1440
+ const milliseconds = date.getMilliseconds();
1441
+ return addLeadingZeros(Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3)), token.length);
1442
+ }
1443
+ };
1444
+
1445
+ //#endregion
1446
+ //#region node_modules/date-fns/_lib/format/formatters.js
1447
+ const dayPeriodEnum = {
1448
+ am: "am",
1449
+ pm: "pm",
1450
+ midnight: "midnight",
1451
+ noon: "noon",
1452
+ morning: "morning",
1453
+ afternoon: "afternoon",
1454
+ evening: "evening",
1455
+ night: "night"
1456
+ };
1457
+ const formatters = {
1458
+ G: function(date, token, localize) {
1459
+ const era = date.getFullYear() > 0 ? 1 : 0;
1460
+ switch (token) {
1461
+ case "G":
1462
+ case "GG":
1463
+ case "GGG": return localize.era(era, { width: "abbreviated" });
1464
+ case "GGGGG": return localize.era(era, { width: "narrow" });
1465
+ default: return localize.era(era, { width: "wide" });
1466
+ }
1467
+ },
1468
+ y: function(date, token, localize) {
1469
+ if (token === "yo") {
1470
+ const signedYear = date.getFullYear();
1471
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1472
+ return localize.ordinalNumber(year, { unit: "year" });
1473
+ }
1474
+ return lightFormatters.y(date, token);
1475
+ },
1476
+ Y: function(date, token, localize, options) {
1477
+ const signedWeekYear = getWeekYear(date, options);
1478
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1479
+ if (token === "YY") return addLeadingZeros(weekYear % 100, 2);
1480
+ if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
1481
+ return addLeadingZeros(weekYear, token.length);
1482
+ },
1483
+ R: function(date, token) {
1484
+ return addLeadingZeros(getISOWeekYear(date), token.length);
1485
+ },
1486
+ u: function(date, token) {
1487
+ return addLeadingZeros(date.getFullYear(), token.length);
1488
+ },
1489
+ Q: function(date, token, localize) {
1490
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1491
+ switch (token) {
1492
+ case "Q": return String(quarter);
1493
+ case "QQ": return addLeadingZeros(quarter, 2);
1494
+ case "Qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1495
+ case "QQQ": return localize.quarter(quarter, {
1496
+ width: "abbreviated",
1497
+ context: "formatting"
1498
+ });
1499
+ case "QQQQQ": return localize.quarter(quarter, {
1500
+ width: "narrow",
1501
+ context: "formatting"
1502
+ });
1503
+ default: return localize.quarter(quarter, {
1504
+ width: "wide",
1505
+ context: "formatting"
1506
+ });
1507
+ }
1508
+ },
1509
+ q: function(date, token, localize) {
1510
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1511
+ switch (token) {
1512
+ case "q": return String(quarter);
1513
+ case "qq": return addLeadingZeros(quarter, 2);
1514
+ case "qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1515
+ case "qqq": return localize.quarter(quarter, {
1516
+ width: "abbreviated",
1517
+ context: "standalone"
1518
+ });
1519
+ case "qqqqq": return localize.quarter(quarter, {
1520
+ width: "narrow",
1521
+ context: "standalone"
1522
+ });
1523
+ default: return localize.quarter(quarter, {
1524
+ width: "wide",
1525
+ context: "standalone"
1526
+ });
1527
+ }
1528
+ },
1529
+ M: function(date, token, localize) {
1530
+ const month = date.getMonth();
1531
+ switch (token) {
1532
+ case "M":
1533
+ case "MM": return lightFormatters.M(date, token);
1534
+ case "Mo": return localize.ordinalNumber(month + 1, { unit: "month" });
1535
+ case "MMM": return localize.month(month, {
1536
+ width: "abbreviated",
1537
+ context: "formatting"
1538
+ });
1539
+ case "MMMMM": return localize.month(month, {
1540
+ width: "narrow",
1541
+ context: "formatting"
1542
+ });
1543
+ default: return localize.month(month, {
1544
+ width: "wide",
1545
+ context: "formatting"
1546
+ });
1547
+ }
1548
+ },
1549
+ L: function(date, token, localize) {
1550
+ const month = date.getMonth();
1551
+ switch (token) {
1552
+ case "L": return String(month + 1);
1553
+ case "LL": return addLeadingZeros(month + 1, 2);
1554
+ case "Lo": return localize.ordinalNumber(month + 1, { unit: "month" });
1555
+ case "LLL": return localize.month(month, {
1556
+ width: "abbreviated",
1557
+ context: "standalone"
1558
+ });
1559
+ case "LLLLL": return localize.month(month, {
1560
+ width: "narrow",
1561
+ context: "standalone"
1562
+ });
1563
+ default: return localize.month(month, {
1564
+ width: "wide",
1565
+ context: "standalone"
1566
+ });
1567
+ }
1568
+ },
1569
+ w: function(date, token, localize, options) {
1570
+ const week = getWeek(date, options);
1571
+ if (token === "wo") return localize.ordinalNumber(week, { unit: "week" });
1572
+ return addLeadingZeros(week, token.length);
1573
+ },
1574
+ I: function(date, token, localize) {
1575
+ const isoWeek = getISOWeek(date);
1576
+ if (token === "Io") return localize.ordinalNumber(isoWeek, { unit: "week" });
1577
+ return addLeadingZeros(isoWeek, token.length);
1578
+ },
1579
+ d: function(date, token, localize) {
1580
+ if (token === "do") return localize.ordinalNumber(date.getDate(), { unit: "date" });
1581
+ return lightFormatters.d(date, token);
1582
+ },
1583
+ D: function(date, token, localize) {
1584
+ const dayOfYear = getDayOfYear(date);
1585
+ if (token === "Do") return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
1586
+ return addLeadingZeros(dayOfYear, token.length);
1587
+ },
1588
+ E: function(date, token, localize) {
1589
+ const dayOfWeek = date.getDay();
1590
+ switch (token) {
1591
+ case "E":
1592
+ case "EE":
1593
+ case "EEE": return localize.day(dayOfWeek, {
1594
+ width: "abbreviated",
1595
+ context: "formatting"
1596
+ });
1597
+ case "EEEEE": return localize.day(dayOfWeek, {
1598
+ width: "narrow",
1599
+ context: "formatting"
1600
+ });
1601
+ case "EEEEEE": return localize.day(dayOfWeek, {
1602
+ width: "short",
1603
+ context: "formatting"
1604
+ });
1605
+ default: return localize.day(dayOfWeek, {
1606
+ width: "wide",
1607
+ context: "formatting"
1608
+ });
1609
+ }
1610
+ },
1611
+ e: function(date, token, localize, options) {
1612
+ const dayOfWeek = date.getDay();
1613
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1614
+ switch (token) {
1615
+ case "e": return String(localDayOfWeek);
1616
+ case "ee": return addLeadingZeros(localDayOfWeek, 2);
1617
+ case "eo": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1618
+ case "eee": return localize.day(dayOfWeek, {
1619
+ width: "abbreviated",
1620
+ context: "formatting"
1621
+ });
1622
+ case "eeeee": return localize.day(dayOfWeek, {
1623
+ width: "narrow",
1624
+ context: "formatting"
1625
+ });
1626
+ case "eeeeee": return localize.day(dayOfWeek, {
1627
+ width: "short",
1628
+ context: "formatting"
1629
+ });
1630
+ default: return localize.day(dayOfWeek, {
1631
+ width: "wide",
1632
+ context: "formatting"
1633
+ });
1634
+ }
1635
+ },
1636
+ c: function(date, token, localize, options) {
1637
+ const dayOfWeek = date.getDay();
1638
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1639
+ switch (token) {
1640
+ case "c": return String(localDayOfWeek);
1641
+ case "cc": return addLeadingZeros(localDayOfWeek, token.length);
1642
+ case "co": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1643
+ case "ccc": return localize.day(dayOfWeek, {
1644
+ width: "abbreviated",
1645
+ context: "standalone"
1646
+ });
1647
+ case "ccccc": return localize.day(dayOfWeek, {
1648
+ width: "narrow",
1649
+ context: "standalone"
1650
+ });
1651
+ case "cccccc": return localize.day(dayOfWeek, {
1652
+ width: "short",
1653
+ context: "standalone"
1654
+ });
1655
+ default: return localize.day(dayOfWeek, {
1656
+ width: "wide",
1657
+ context: "standalone"
1658
+ });
1659
+ }
1660
+ },
1661
+ i: function(date, token, localize) {
1662
+ const dayOfWeek = date.getDay();
1663
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1664
+ switch (token) {
1665
+ case "i": return String(isoDayOfWeek);
1666
+ case "ii": return addLeadingZeros(isoDayOfWeek, token.length);
1667
+ case "io": return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
1668
+ case "iii": return localize.day(dayOfWeek, {
1669
+ width: "abbreviated",
1670
+ context: "formatting"
1671
+ });
1672
+ case "iiiii": return localize.day(dayOfWeek, {
1673
+ width: "narrow",
1674
+ context: "formatting"
1675
+ });
1676
+ case "iiiiii": return localize.day(dayOfWeek, {
1677
+ width: "short",
1678
+ context: "formatting"
1679
+ });
1680
+ default: return localize.day(dayOfWeek, {
1681
+ width: "wide",
1682
+ context: "formatting"
1683
+ });
1684
+ }
1685
+ },
1686
+ a: function(date, token, localize) {
1687
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1688
+ switch (token) {
1689
+ case "a":
1690
+ case "aa": return localize.dayPeriod(dayPeriodEnumValue, {
1691
+ width: "abbreviated",
1692
+ context: "formatting"
1693
+ });
1694
+ case "aaa": return localize.dayPeriod(dayPeriodEnumValue, {
1695
+ width: "abbreviated",
1696
+ context: "formatting"
1697
+ }).toLowerCase();
1698
+ case "aaaaa": return localize.dayPeriod(dayPeriodEnumValue, {
1699
+ width: "narrow",
1700
+ context: "formatting"
1701
+ });
1702
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1703
+ width: "wide",
1704
+ context: "formatting"
1705
+ });
1706
+ }
1707
+ },
1708
+ b: function(date, token, localize) {
1709
+ const hours = date.getHours();
1710
+ let dayPeriodEnumValue;
1711
+ if (hours === 12) dayPeriodEnumValue = dayPeriodEnum.noon;
1712
+ else if (hours === 0) dayPeriodEnumValue = dayPeriodEnum.midnight;
1713
+ else dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1714
+ switch (token) {
1715
+ case "b":
1716
+ case "bb": return localize.dayPeriod(dayPeriodEnumValue, {
1717
+ width: "abbreviated",
1718
+ context: "formatting"
1719
+ });
1720
+ case "bbb": return localize.dayPeriod(dayPeriodEnumValue, {
1721
+ width: "abbreviated",
1722
+ context: "formatting"
1723
+ }).toLowerCase();
1724
+ case "bbbbb": return localize.dayPeriod(dayPeriodEnumValue, {
1725
+ width: "narrow",
1726
+ context: "formatting"
1727
+ });
1728
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1729
+ width: "wide",
1730
+ context: "formatting"
1731
+ });
1732
+ }
1733
+ },
1734
+ B: function(date, token, localize) {
1735
+ const hours = date.getHours();
1736
+ let dayPeriodEnumValue;
1737
+ if (hours >= 17) dayPeriodEnumValue = dayPeriodEnum.evening;
1738
+ else if (hours >= 12) dayPeriodEnumValue = dayPeriodEnum.afternoon;
1739
+ else if (hours >= 4) dayPeriodEnumValue = dayPeriodEnum.morning;
1740
+ else dayPeriodEnumValue = dayPeriodEnum.night;
1741
+ switch (token) {
1742
+ case "B":
1743
+ case "BB":
1744
+ case "BBB": return localize.dayPeriod(dayPeriodEnumValue, {
1745
+ width: "abbreviated",
1746
+ context: "formatting"
1747
+ });
1748
+ case "BBBBB": return localize.dayPeriod(dayPeriodEnumValue, {
1749
+ width: "narrow",
1750
+ context: "formatting"
1751
+ });
1752
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1753
+ width: "wide",
1754
+ context: "formatting"
1755
+ });
1756
+ }
1757
+ },
1758
+ h: function(date, token, localize) {
1759
+ if (token === "ho") {
1760
+ let hours = date.getHours() % 12;
1761
+ if (hours === 0) hours = 12;
1762
+ return localize.ordinalNumber(hours, { unit: "hour" });
1763
+ }
1764
+ return lightFormatters.h(date, token);
1765
+ },
1766
+ H: function(date, token, localize) {
1767
+ if (token === "Ho") return localize.ordinalNumber(date.getHours(), { unit: "hour" });
1768
+ return lightFormatters.H(date, token);
1769
+ },
1770
+ K: function(date, token, localize) {
1771
+ const hours = date.getHours() % 12;
1772
+ if (token === "Ko") return localize.ordinalNumber(hours, { unit: "hour" });
1773
+ return addLeadingZeros(hours, token.length);
1774
+ },
1775
+ k: function(date, token, localize) {
1776
+ let hours = date.getHours();
1777
+ if (hours === 0) hours = 24;
1778
+ if (token === "ko") return localize.ordinalNumber(hours, { unit: "hour" });
1779
+ return addLeadingZeros(hours, token.length);
1780
+ },
1781
+ m: function(date, token, localize) {
1782
+ if (token === "mo") return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
1783
+ return lightFormatters.m(date, token);
1784
+ },
1785
+ s: function(date, token, localize) {
1786
+ if (token === "so") return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
1787
+ return lightFormatters.s(date, token);
1788
+ },
1789
+ S: function(date, token) {
1790
+ return lightFormatters.S(date, token);
1791
+ },
1792
+ X: function(date, token, _localize) {
1793
+ const timezoneOffset = date.getTimezoneOffset();
1794
+ if (timezoneOffset === 0) return "Z";
1795
+ switch (token) {
1796
+ case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1797
+ case "XXXX":
1798
+ case "XX": return formatTimezone(timezoneOffset);
1799
+ default: return formatTimezone(timezoneOffset, ":");
1800
+ }
1801
+ },
1802
+ x: function(date, token, _localize) {
1803
+ const timezoneOffset = date.getTimezoneOffset();
1804
+ switch (token) {
1805
+ case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1806
+ case "xxxx":
1807
+ case "xx": return formatTimezone(timezoneOffset);
1808
+ default: return formatTimezone(timezoneOffset, ":");
1809
+ }
1810
+ },
1811
+ O: function(date, token, _localize) {
1812
+ const timezoneOffset = date.getTimezoneOffset();
1813
+ switch (token) {
1814
+ case "O":
1815
+ case "OO":
1816
+ case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1817
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1818
+ }
1819
+ },
1820
+ z: function(date, token, _localize) {
1821
+ const timezoneOffset = date.getTimezoneOffset();
1822
+ switch (token) {
1823
+ case "z":
1824
+ case "zz":
1825
+ case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1826
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1827
+ }
1828
+ },
1829
+ t: function(date, token, _localize) {
1830
+ return addLeadingZeros(Math.trunc(+date / 1e3), token.length);
1831
+ },
1832
+ T: function(date, token, _localize) {
1833
+ return addLeadingZeros(+date, token.length);
1834
+ }
1835
+ };
1836
+ function formatTimezoneShort(offset, delimiter = "") {
1837
+ const sign = offset > 0 ? "-" : "+";
1838
+ const absOffset = Math.abs(offset);
1839
+ const hours = Math.trunc(absOffset / 60);
1840
+ const minutes = absOffset % 60;
1841
+ if (minutes === 0) return sign + String(hours);
1842
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1843
+ }
1844
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1845
+ if (offset % 60 === 0) return (offset > 0 ? "-" : "+") + addLeadingZeros(Math.abs(offset) / 60, 2);
1846
+ return formatTimezone(offset, delimiter);
1847
+ }
1848
+ function formatTimezone(offset, delimiter = "") {
1849
+ const sign = offset > 0 ? "-" : "+";
1850
+ const absOffset = Math.abs(offset);
1851
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1852
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1853
+ return sign + hours + delimiter + minutes;
1854
+ }
1855
+
1856
+ //#endregion
1857
+ //#region node_modules/date-fns/_lib/format/longFormatters.js
1858
+ const dateLongFormatter = (pattern, formatLong) => {
1859
+ switch (pattern) {
1860
+ case "P": return formatLong.date({ width: "short" });
1861
+ case "PP": return formatLong.date({ width: "medium" });
1862
+ case "PPP": return formatLong.date({ width: "long" });
1863
+ default: return formatLong.date({ width: "full" });
1864
+ }
1865
+ };
1866
+ const timeLongFormatter = (pattern, formatLong) => {
1867
+ switch (pattern) {
1868
+ case "p": return formatLong.time({ width: "short" });
1869
+ case "pp": return formatLong.time({ width: "medium" });
1870
+ case "ppp": return formatLong.time({ width: "long" });
1871
+ default: return formatLong.time({ width: "full" });
1872
+ }
1873
+ };
1874
+ const dateTimeLongFormatter = (pattern, formatLong) => {
1875
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1876
+ const datePattern = matchResult[1];
1877
+ const timePattern = matchResult[2];
1878
+ if (!timePattern) return dateLongFormatter(pattern, formatLong);
1879
+ let dateTimeFormat;
1880
+ switch (datePattern) {
1881
+ case "P":
1882
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
1883
+ break;
1884
+ case "PP":
1885
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
1886
+ break;
1887
+ case "PPP":
1888
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
1889
+ break;
1890
+ default:
1891
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
1892
+ break;
1893
+ }
1894
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
1895
+ };
1896
+ const longFormatters = {
1897
+ p: timeLongFormatter,
1898
+ P: dateTimeLongFormatter
1899
+ };
1900
+
1901
+ //#endregion
1902
+ //#region node_modules/date-fns/_lib/protectedTokens.js
1903
+ const dayOfYearTokenRE = /^D+$/;
1904
+ const weekYearTokenRE = /^Y+$/;
1905
+ const throwTokens = [
1906
+ "D",
1907
+ "DD",
1908
+ "YY",
1909
+ "YYYY"
1910
+ ];
1911
+ function isProtectedDayOfYearToken(token) {
1912
+ return dayOfYearTokenRE.test(token);
1913
+ }
1914
+ function isProtectedWeekYearToken(token) {
1915
+ return weekYearTokenRE.test(token);
1916
+ }
1917
+ function warnOrThrowProtectedError(token, format, input) {
1918
+ const _message = message(token, format, input);
1919
+ console.warn(_message);
1920
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1921
+ }
1922
+ function message(token, format, input) {
1923
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1924
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1925
+ }
1926
+
1927
+ //#endregion
1928
+ //#region node_modules/date-fns/format.js
1929
+ const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1930
+ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1931
+ const escapedStringRegExp = /^'([^]*?)'?$/;
1932
+ const doubleQuoteRegExp = /''/g;
1933
+ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1934
+ /**
1935
+ * The {@link format} function options.
1936
+ */
1937
+ /**
1938
+ * @name format
1939
+ * @alias formatDate
1940
+ * @category Common Helpers
1941
+ * @summary Format the date.
1942
+ *
1943
+ * @description
1944
+ * Return the formatted date string in the given format. The result may vary by locale.
1945
+ *
1946
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1947
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1948
+ *
1949
+ * The characters wrapped between two single quotes characters (') are escaped.
1950
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1951
+ * (see the last example)
1952
+ *
1953
+ * Format of the string is based on Unicode Technical Standard #35:
1954
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1955
+ * with a few additions (see note 7 below the table).
1956
+ *
1957
+ * Accepted patterns:
1958
+ * | Unit | Pattern | Result examples | Notes |
1959
+ * |---------------------------------|---------|-----------------------------------|-------|
1960
+ * | Era | G..GGG | AD, BC | |
1961
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1962
+ * | | GGGGG | A, B | |
1963
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1964
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1965
+ * | | yy | 44, 01, 00, 17 | 5 |
1966
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1967
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1968
+ * | | yyyyy | ... | 3,5 |
1969
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1970
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1971
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1972
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1973
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1974
+ * | | YYYYY | ... | 3,5 |
1975
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1976
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1977
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1978
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1979
+ * | | RRRRR | ... | 3,5,7 |
1980
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1981
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1982
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1983
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1984
+ * | | uuuuu | ... | 3,5 |
1985
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1986
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1987
+ * | | QQ | 01, 02, 03, 04 | |
1988
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1989
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1990
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
1991
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1992
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1993
+ * | | qq | 01, 02, 03, 04 | |
1994
+ * | | qqq | Q1, Q2, Q3, Q4 | |
1995
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1996
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
1997
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
1998
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
1999
+ * | | MM | 01, 02, ..., 12 | |
2000
+ * | | MMM | Jan, Feb, ..., Dec | |
2001
+ * | | MMMM | January, February, ..., December | 2 |
2002
+ * | | MMMMM | J, F, ..., D | |
2003
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2004
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2005
+ * | | LL | 01, 02, ..., 12 | |
2006
+ * | | LLL | Jan, Feb, ..., Dec | |
2007
+ * | | LLLL | January, February, ..., December | 2 |
2008
+ * | | LLLLL | J, F, ..., D | |
2009
+ * | Local week of year | w | 1, 2, ..., 53 | |
2010
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2011
+ * | | ww | 01, 02, ..., 53 | |
2012
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2013
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2014
+ * | | II | 01, 02, ..., 53 | 7 |
2015
+ * | Day of month | d | 1, 2, ..., 31 | |
2016
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2017
+ * | | dd | 01, 02, ..., 31 | |
2018
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2019
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2020
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2021
+ * | | DDD | 001, 002, ..., 365, 366 | |
2022
+ * | | DDDD | ... | 3 |
2023
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2024
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2025
+ * | | EEEEE | M, T, W, T, F, S, S | |
2026
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2027
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2028
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2029
+ * | | ii | 01, 02, ..., 07 | 7 |
2030
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2031
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2032
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2033
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2034
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2035
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2036
+ * | | ee | 02, 03, ..., 01 | |
2037
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2038
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2039
+ * | | eeeee | M, T, W, T, F, S, S | |
2040
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2041
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2042
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2043
+ * | | cc | 02, 03, ..., 01 | |
2044
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2045
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2046
+ * | | ccccc | M, T, W, T, F, S, S | |
2047
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2048
+ * | AM, PM | a..aa | AM, PM | |
2049
+ * | | aaa | am, pm | |
2050
+ * | | aaaa | a.m., p.m. | 2 |
2051
+ * | | aaaaa | a, p | |
2052
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2053
+ * | | bbb | am, pm, noon, midnight | |
2054
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2055
+ * | | bbbbb | a, p, n, mi | |
2056
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2057
+ * | | BBBB | at night, in the morning, ... | 2 |
2058
+ * | | BBBBB | at night, in the morning, ... | |
2059
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2060
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2061
+ * | | hh | 01, 02, ..., 11, 12 | |
2062
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2063
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2064
+ * | | HH | 00, 01, 02, ..., 23 | |
2065
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2066
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2067
+ * | | KK | 01, 02, ..., 11, 00 | |
2068
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2069
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2070
+ * | | kk | 24, 01, 02, ..., 23 | |
2071
+ * | Minute | m | 0, 1, ..., 59 | |
2072
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2073
+ * | | mm | 00, 01, ..., 59 | |
2074
+ * | Second | s | 0, 1, ..., 59 | |
2075
+ * | | so | 0th, 1st, ..., 59th | 7 |
2076
+ * | | ss | 00, 01, ..., 59 | |
2077
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2078
+ * | | SS | 00, 01, ..., 99 | |
2079
+ * | | SSS | 000, 001, ..., 999 | |
2080
+ * | | SSSS | ... | 3 |
2081
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2082
+ * | | XX | -0800, +0530, Z | |
2083
+ * | | XXX | -08:00, +05:30, Z | |
2084
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2085
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2086
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2087
+ * | | xx | -0800, +0530, +0000 | |
2088
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2089
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2090
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2091
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2092
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2093
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2094
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2095
+ * | Seconds timestamp | t | 512969520 | 7 |
2096
+ * | | tt | ... | 3,7 |
2097
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2098
+ * | | TT | ... | 3,7 |
2099
+ * | Long localized date | P | 04/29/1453 | 7 |
2100
+ * | | PP | Apr 29, 1453 | 7 |
2101
+ * | | PPP | April 29th, 1453 | 7 |
2102
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2103
+ * | Long localized time | p | 12:00 AM | 7 |
2104
+ * | | pp | 12:00:00 AM | 7 |
2105
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2106
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2107
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2108
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2109
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2110
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2111
+ * Notes:
2112
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2113
+ * are the same as "stand-alone" units, but are different in some languages.
2114
+ * "Formatting" units are declined according to the rules of the language
2115
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2116
+ *
2117
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2118
+ *
2119
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2120
+ *
2121
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2122
+ * the single quote characters (see below).
2123
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2124
+ * the output will be the same as default pattern for this unit, usually
2125
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2126
+ * are marked with "2" in the last column of the table.
2127
+ *
2128
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2129
+ *
2130
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2131
+ *
2132
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2133
+ *
2134
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2135
+ *
2136
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2137
+ *
2138
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2139
+ * The output will be padded with zeros to match the length of the pattern.
2140
+ *
2141
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2142
+ *
2143
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2144
+ * These tokens represent the shortest form of the quarter.
2145
+ *
2146
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2147
+ *
2148
+ * | Year | `y` | `u` |
2149
+ * |------|-----|-----|
2150
+ * | AC 1 | 1 | 1 |
2151
+ * | BC 1 | 1 | 0 |
2152
+ * | BC 2 | 2 | -1 |
2153
+ *
2154
+ * Also `yy` always returns the last two digits of a year,
2155
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2156
+ *
2157
+ * | Year | `yy` | `uu` |
2158
+ * |------|------|------|
2159
+ * | 1 | 01 | 01 |
2160
+ * | 14 | 14 | 14 |
2161
+ * | 376 | 76 | 376 |
2162
+ * | 1453 | 53 | 1453 |
2163
+ *
2164
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2165
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2166
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
2167
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
2168
+ *
2169
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2170
+ * so right now these tokens fall back to GMT timezones.
2171
+ *
2172
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2173
+ * - `i`: ISO day of week
2174
+ * - `I`: ISO week of year
2175
+ * - `R`: ISO week-numbering year
2176
+ * - `t`: seconds timestamp
2177
+ * - `T`: milliseconds timestamp
2178
+ * - `o`: ordinal number modifier
2179
+ * - `P`: long localized date
2180
+ * - `p`: long localized time
2181
+ *
2182
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2183
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2184
+ *
2185
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2186
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2187
+ *
2188
+ * @param date - The original date
2189
+ * @param format - The string of tokens
2190
+ * @param options - An object with options
2191
+ *
2192
+ * @returns The formatted date string
2193
+ *
2194
+ * @throws `date` must not be Invalid Date
2195
+ * @throws `options.locale` must contain `localize` property
2196
+ * @throws `options.locale` must contain `formatLong` property
2197
+ * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2198
+ * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2199
+ * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2200
+ * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2201
+ * @throws format string contains an unescaped latin alphabet character
2202
+ *
2203
+ * @example
2204
+ * // Represent 11 February 2014 in middle-endian format:
2205
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2206
+ * //=> '02/11/2014'
2207
+ *
2208
+ * @example
2209
+ * // Represent 2 July 2014 in Esperanto:
2210
+ * import { eoLocale } from 'date-fns/locale/eo'
2211
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2212
+ * locale: eoLocale
2213
+ * })
2214
+ * //=> '2-a de julio 2014'
2215
+ *
2216
+ * @example
2217
+ * // Escape string by single quote characters:
2218
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2219
+ * //=> "3 o'clock"
2220
+ */
2221
+ function format(date, formatStr, options) {
2222
+ const defaultOptions = getDefaultOptions();
2223
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS;
2224
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
2225
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
2226
+ const originalDate = toDate(date, options?.in);
2227
+ if (!isValid(originalDate)) throw new RangeError("Invalid time value");
2228
+ let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
2229
+ const firstCharacter = substring[0];
2230
+ if (firstCharacter === "p" || firstCharacter === "P") {
2231
+ const longFormatter = longFormatters[firstCharacter];
2232
+ return longFormatter(substring, locale.formatLong);
2233
+ }
2234
+ return substring;
2235
+ }).join("").match(formattingTokensRegExp).map((substring) => {
2236
+ if (substring === "''") return {
2237
+ isToken: false,
2238
+ value: "'"
2239
+ };
2240
+ const firstCharacter = substring[0];
2241
+ if (firstCharacter === "'") return {
2242
+ isToken: false,
2243
+ value: cleanEscapedString(substring)
2244
+ };
2245
+ if (formatters[firstCharacter]) return {
2246
+ isToken: true,
2247
+ value: substring
2248
+ };
2249
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
2250
+ return {
2251
+ isToken: false,
2252
+ value: substring
2253
+ };
2254
+ });
2255
+ if (locale.localize.preprocessor) parts = locale.localize.preprocessor(originalDate, parts);
2256
+ const formatterOptions = {
2257
+ firstWeekContainsDate,
2258
+ weekStartsOn,
2259
+ locale
2260
+ };
2261
+ return parts.map((part) => {
2262
+ if (!part.isToken) return part.value;
2263
+ const token = part.value;
2264
+ if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, String(date));
2265
+ const formatter = formatters[token[0]];
2266
+ return formatter(originalDate, token, locale.localize, formatterOptions);
2267
+ }).join("");
2268
+ }
2269
+ function cleanEscapedString(input) {
2270
+ const matched = input.match(escapedStringRegExp);
2271
+ if (!matched) return input;
2272
+ return matched[1].replace(doubleQuoteRegExp, "'");
2273
+ }
2274
+
2275
+ //#endregion
2276
+ //#region src/elements-experimental/timetable-row/timetable-row.scss?inline
2277
+ var timetable_row_default = ":host {\n --sbb-timetable-row-gap: var(--sbb-spacing-fixed-2x);\n --sbb-timetable-row-height: 1.5625rem;\n --sbb-timetable-row-height-header: 1.25rem;\n --sbb-timetable-row-height-footer: 1rem;\n --sbb-timetable-row-skeleton-pulse-duration: 1800ms;\n display: block;\n}\n\n:host([disable-animation]) {\n --sbb-timetable-row-skeleton-pulse-duration: 0;\n}\n\n.sbb-timetable__row-transport-icon {\n --sbb-icon-svg-width: 1.25rem;\n --sbb-icon-svg-height: 1.25rem;\n}\n\n.sbb-travel-hints__item {\n --sbb-icon-svg-height: 0.875rem;\n}\n\n.sbb-timetable__row--quay {\n margin-inline-end: var(--sbb-spacing-fixed-1x);\n}\n\n.sbb-timetable__row--quay-type {\n float: left;\n}\n\nul {\n display: inline-flex;\n}\n\nli {\n display: inline-flex;\n align-self: center;\n}\n\n.sbb-timetable__row-transport {\n display: inline-flex;\n align-self: center;\n}\n\n.sbb-timetable__row-transportnumber,\n.sbb-timetable__row-time {\n --sbb-text-font-size: var(--sbb-text-font-size-s);\n font-family: var(--sbb-typo-font-family);\n font-weight: normal;\n line-height: var(--sbb-typo-line-height-text);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n font-size: var(--sbb-text-font-size);\n font-weight: bold;\n line-height: unset;\n white-space: nowrap;\n align-self: center;\n}\n\n.sbb-timetable__row {\n --sbb-text-font-size: var(--sbb-text-font-size-s);\n font-family: var(--sbb-typo-font-family);\n font-weight: normal;\n line-height: var(--sbb-typo-line-height-text);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n font-size: var(--sbb-text-font-size);\n display: flex;\n flex-direction: column;\n gap: var(--sbb-timetable-row-gap);\n}\n\n.sbb-timetable__row-header,\n.sbb-timetable__row-footer {\n animation: none;\n}\n\n.sbb-timetable__row-card {\n --sbb-card-padding-block: var(--sbb-card-with-badge-padding-block);\n}\n\n.sbb-timetable__row-header {\n display: flex;\n gap: var(--sbb-spacing-fixed-2x);\n align-items: center;\n line-height: var(--sbb-timetable-row-height-header);\n}\n\n.sbb-timetable__row-details,\n.sbb-timetable__row-hints {\n display: inline-flex;\n gap: var(--sbb-spacing-fixed-1x);\n align-items: center;\n}\n\n.sbb-timetable__row-header p {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0;\n align-self: center;\n}\n\n.sbb-timetable__row-footer {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n align-items: center;\n gap: var(--sbb-spacing-fixed-2x);\n line-height: var(--sbb-timetable-row-height-footer);\n}\n.sbb-timetable__row-footer > span {\n align-self: center;\n}\n.sbb-timetable__row-footer :only-child {\n margin-inline-start: auto;\n}\n\n.sbb-timetable__row-quay--changed {\n color: var(--sbb-color-primary);\n}\n\n.sbb-timetable__row-transport-wrapper,\n.sbb-timetable__row-warning {\n display: inline-flex;\n}\n\n.sbb-loading {\n pointer-events: none;\n}\n\n.sbb-loading__wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--sbb-spacing-fixed-2x);\n}\n\n.sbb-loading__row {\n width: 100%;\n border-radius: var(--sbb-border-radius-1x);\n height: var(--sbb-timetable-row-height);\n}\n@media (min-width: calc(64rem)) {\n .sbb-loading__row {\n height: 1.75rem;\n }\n}\n@media (forced-colors: active) {\n .sbb-loading__row {\n border: var(--sbb-border-width-1x) solid ButtonBorder !important;\n }\n}\n\n.sbb-loading__row,\n.sbb-loading__badge {\n background: var(--sbb-background-color-4);\n animation: skeleton-pulse var(--sbb-timetable-row-skeleton-pulse-duration) ease-out infinite;\n}\n\n.sbb-loading__row:first-of-type {\n height: var(--sbb-timetable-row-height-header);\n width: 50%;\n}\n\n.sbb-loading__row:last-of-type {\n height: var(--sbb-timetable-row-height-footer);\n}\n\n.sbb-loading__badge {\n margin-inline: auto calc(var(--sbb-spacing-fixed-3x) * -1);\n padding-inline-end: var(--sbb-spacing-fixed-6x);\n border-end-start-radius: var(--sbb-card-badge-border-radius);\n transform: var(--sbb-card-badge-skew);\n width: 7.1875rem;\n height: 1.25rem;\n}\n\n@keyframes skeleton-pulse {\n 0% {\n background: var(--sbb-background-color-4);\n }\n 17% {\n background: var(--sbb-background-color-4);\n }\n 50% {\n background: var(--sbb-background-color-3);\n }\n 67% {\n background: var(--sbb-background-color-3);\n }\n 100% {\n background: var(--sbb-background-color-4);\n }\n}\n";
2278
+
2279
+ //#endregion
2280
+ //#region src/elements-experimental/timetable-row/timetable-row.component.ts
2281
+ const renderIconProduct = (icon, name) => {
2282
+ return html`<span class="sbb-timetable__row-transport">
2283
+ <sbb-icon name=${icon}></sbb-icon>
2284
+ <span class="sbb-screen-reader-only">${name}</span>
2285
+ </span>`;
2286
+ };
2287
+ const renderStringProduct = (vehicleName, line) => {
2288
+ const space = [
2289
+ "M",
2290
+ "B",
2291
+ "T"
2292
+ ].includes(vehicleName) ? " " : "";
2293
+ return html`<span class="sbb-timetable__row-transportnumber">
2294
+ ${line !== null ? vehicleName + space + line : vehicleName}
2295
+ </span>`;
2296
+ };
2297
+ const getReachableText = (legs) => {
2298
+ return legs?.find((leg) => leg.serviceJourney?.serviceAlteration?.reachableText)?.serviceJourney?.serviceAlteration?.reachableText;
2299
+ };
2300
+ const getDelayText = (legs) => {
2301
+ return legs?.find((leg) => leg.serviceJourney?.serviceAlteration?.delayText)?.serviceJourney?.serviceAlteration?.delayText;
2302
+ };
2303
+ const getRedirectedText = (legs) => {
2304
+ return legs?.find((leg) => !!leg.serviceJourney?.serviceAlteration?.redirectedText)?.serviceJourney?.serviceAlteration?.redirectedText;
2305
+ };
2306
+ const getUnplannedStop = (legs) => {
2307
+ return legs?.find((leg) => !!leg.serviceJourney?.serviceAlteration?.unplannedStopPointsText)?.serviceJourney?.serviceAlteration?.unplannedStopPointsText;
2308
+ };
2309
+ const sortSituation = (situations) => {
2310
+ const priorities = {
2311
+ DISTURBANCE: 0,
2312
+ INFORMATION: 1,
2313
+ DELAY: 2,
2314
+ TRAIN_REPLACEMENT_BY_BUS: 3,
2315
+ CONSTRUCTION_SITE: 4,
2316
+ END_MESSAGE: 5
2317
+ };
2318
+ return [...situations].sort((a, b) => priorities[a.cause] - priorities[b.cause]);
2319
+ };
2320
+ const getHimIcon = (situation) => {
2321
+ switch (situation?.cause) {
2322
+ case "DISTURBANCE": return {
2323
+ name: "disruption",
2324
+ text: situation?.broadcastMessages?.length ? situation?.broadcastMessages[0].title : ""
2325
+ };
2326
+ case "INFORMATION": return {
2327
+ name: "info",
2328
+ text: situation?.broadcastMessages.length ? situation?.broadcastMessages[0].title : ""
2329
+ };
2330
+ case "DELAY": return {
2331
+ name: "delay",
2332
+ text: situation?.broadcastMessages.length ? situation?.broadcastMessages[0].title : ""
2333
+ };
2334
+ case "TRAIN_REPLACEMENT_BY_BUS": return {
2335
+ name: "replacementbus",
2336
+ text: situation?.broadcastMessages.length ? situation?.broadcastMessages[0].title : ""
2337
+ };
2338
+ case "CONSTRUCTION_SITE": return {
2339
+ name: "construction",
2340
+ text: situation?.broadcastMessages.length ? situation?.broadcastMessages[0].title : ""
2341
+ };
2342
+ default: return {
2343
+ name: "info",
2344
+ text: situation?.broadcastMessages.length ? situation?.broadcastMessages[0].title : ""
2345
+ };
2346
+ }
2347
+ };
2348
+ const getCus = (trip, currentLanguage) => {
2349
+ const { summary, legs } = trip || {};
2350
+ const rideLegs = legs?.filter((leg) => isRideLeg(leg));
2351
+ const { tripStatus } = summary || {};
2352
+ if (tripStatus?.cancelled || tripStatus?.partiallyCancelled) return {
2353
+ name: "cancellation",
2354
+ text: tripStatus?.cancelledText
2355
+ };
2356
+ if (rideLegs?.some((leg) => leg.serviceJourney?.serviceAlteration?.cancelledExpected)) return {
2357
+ name: "disruption",
2358
+ text: tripStatus?.cancelledText
2359
+ };
2360
+ if (getReachableText(rideLegs)) return {
2361
+ name: "missed-connection",
2362
+ text: getReachableText(rideLegs)
2363
+ };
2364
+ if (tripStatus?.alternative) return {
2365
+ name: "alternative",
2366
+ text: tripStatus.alternativeText
2367
+ };
2368
+ if (getRedirectedText(rideLegs)) return {
2369
+ name: "reroute",
2370
+ text: getRedirectedText(rideLegs)
2371
+ };
2372
+ if (getUnplannedStop(rideLegs)) return {
2373
+ name: "add-stop",
2374
+ text: getUnplannedStop(rideLegs)
2375
+ };
2376
+ if (tripStatus?.delayed || tripStatus?.delayedUnknown) return {
2377
+ name: "delay",
2378
+ text: getDelayText(rideLegs)
2379
+ };
2380
+ if (tripStatus?.quayChanged) {
2381
+ const departure = rideLegs[0].departure;
2382
+ return {
2383
+ name: "platform-change",
2384
+ text: departure.quayChanged ? departure.quayChangedText : i18nTripQuayChange[currentLanguage]
2385
+ };
2386
+ }
2387
+ return {};
2388
+ };
2389
+ const findAndReplaceNotice = (notices) => {
2390
+ const reservationNotice = [
2391
+ "RR",
2392
+ "RK",
2393
+ "RC",
2394
+ "RL",
2395
+ "RM",
2396
+ "RS",
2397
+ "RU",
2398
+ "XP",
2399
+ "XR",
2400
+ "XT"
2401
+ ];
2402
+ return notices.reduce((foundNotice, notice) => {
2403
+ if (foundNotice) return foundNotice;
2404
+ if (reservationNotice.includes(notice.name)) return {
2405
+ ...notice,
2406
+ name: "RR"
2407
+ };
2408
+ }, void 0);
2409
+ };
2410
+ const filterNotices = (notices) => {
2411
+ const allowedNames = [
2412
+ "Z",
2413
+ "SB",
2414
+ "SZ",
2415
+ "VR",
2416
+ "TG"
2417
+ ];
2418
+ return notices.filter((notice, index) => {
2419
+ return notices.findIndex((n) => n.name === notice.name) === index;
2420
+ }).filter((notice) => allowedNames.includes(notice.name)).sort((a, b) => allowedNames.indexOf(a.name) - allowedNames.indexOf(b.name));
2421
+ };
2422
+ const handleNotices = (notices) => {
2423
+ const reservationNotice = findAndReplaceNotice(notices);
2424
+ const filteredNotices = filterNotices(notices);
2425
+ if (reservationNotice === void 0) return filteredNotices;
2426
+ if (!filteredNotices.length) return [reservationNotice];
2427
+ if (filteredNotices[0].name === "Z" && filteredNotices[1]) return [
2428
+ filteredNotices[0],
2429
+ reservationNotice,
2430
+ filteredNotices[1]
2431
+ ].concat(filteredNotices.slice(2));
2432
+ return [reservationNotice, ...filteredNotices];
2433
+ };
2434
+ /**
2435
+ * It displays information about the trip, acting as a container for all the `sbb-timetable-*` components.
2436
+ * */
2437
+ let SbbTimetableRowElement = (() => {
2438
+ let _classSuper = SbbElement;
2439
+ let _instanceExtraInitializers = [];
2440
+ let _trip_decorators;
2441
+ let _trip_initializers = [];
2442
+ let _trip_extraInitializers = [];
2443
+ let _price_decorators;
2444
+ let _price_initializers = [];
2445
+ let _price_extraInitializers = [];
2446
+ let _disableAnimation_decorators;
2447
+ let _disableAnimation_initializers = [];
2448
+ let _disableAnimation_extraInitializers = [];
2449
+ let _boarding_decorators;
2450
+ let _boarding_initializers = [];
2451
+ let _boarding_extraInitializers = [];
2452
+ let _loadingTrip_decorators;
2453
+ let _loadingTrip_initializers = [];
2454
+ let _loadingTrip_extraInitializers = [];
2455
+ let _a11yFootpath_decorators;
2456
+ let _a11yFootpath_initializers = [];
2457
+ let _a11yFootpath_extraInitializers = [];
2458
+ let _loadingPrice_decorators;
2459
+ let _loadingPrice_initializers = [];
2460
+ let _loadingPrice_extraInitializers = [];
2461
+ let _cardActionLabel_decorators;
2462
+ let _cardActionLabel_initializers = [];
2463
+ let _cardActionLabel_extraInitializers = [];
2464
+ let _accessibilityExpanded_decorators;
2465
+ let _accessibilityExpanded_initializers = [];
2466
+ let _accessibilityExpanded_extraInitializers = [];
2467
+ let _active_decorators;
2468
+ let _active_initializers = [];
2469
+ let _active_extraInitializers = [];
2470
+ let _set_now_decorators;
2471
+ return class SbbTimetableRowElement extends _classSuper {
2472
+ constructor() {
2473
+ super(...arguments);
2474
+ this.#trip_accessor_storage = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _trip_initializers, null));
2475
+ this.#price_accessor_storage = (__runInitializers(this, _trip_extraInitializers), __runInitializers(this, _price_initializers, null));
2476
+ this.#disableAnimation_accessor_storage = (__runInitializers(this, _price_extraInitializers), __runInitializers(this, _disableAnimation_initializers, false));
2477
+ this.#boarding_accessor_storage = (__runInitializers(this, _disableAnimation_extraInitializers), __runInitializers(this, _boarding_initializers, null));
2478
+ this.#loadingTrip_accessor_storage = (__runInitializers(this, _boarding_extraInitializers), __runInitializers(this, _loadingTrip_initializers, false));
2479
+ this.#a11yFootpath_accessor_storage = (__runInitializers(this, _loadingTrip_extraInitializers), __runInitializers(this, _a11yFootpath_initializers, false));
2480
+ this.#loadingPrice_accessor_storage = (__runInitializers(this, _a11yFootpath_extraInitializers), __runInitializers(this, _loadingPrice_initializers, false));
2481
+ this.#cardActionLabel_accessor_storage = (__runInitializers(this, _loadingPrice_extraInitializers), __runInitializers(this, _cardActionLabel_initializers, ""));
2482
+ this.#accessibilityExpanded_accessor_storage = (__runInitializers(this, _cardActionLabel_extraInitializers), __runInitializers(this, _accessibilityExpanded_initializers, false));
2483
+ this.#active_accessor_storage = (__runInitializers(this, _accessibilityExpanded_extraInitializers), __runInitializers(this, _active_initializers, false));
2484
+ this._now = (__runInitializers(this, _active_extraInitializers), null);
2485
+ this._language = new SbbLanguageController(this);
2486
+ }
2487
+ static {
2488
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2489
+ _trip_decorators = [property({ type: Object })];
2490
+ _price_decorators = [property({ type: Object })];
2491
+ _disableAnimation_decorators = [forceType(), property({
2492
+ attribute: "disable-animation",
2493
+ reflect: true,
2494
+ type: Boolean
2495
+ })];
2496
+ _boarding_decorators = [property({ type: Object })];
2497
+ _loadingTrip_decorators = [forceType(), property({
2498
+ attribute: "loading-trip",
2499
+ type: Boolean
2500
+ })];
2501
+ _a11yFootpath_decorators = [forceType(), property({
2502
+ attribute: "a11y-footpath",
2503
+ type: Boolean
2504
+ })];
2505
+ _loadingPrice_decorators = [forceType(), property({
2506
+ attribute: "loading-price",
2507
+ type: Boolean
2508
+ })];
2509
+ _cardActionLabel_decorators = [forceType(), property({ attribute: "card-action-label" })];
2510
+ _accessibilityExpanded_decorators = [forceType(), property({
2511
+ attribute: "accessibility-expanded",
2512
+ type: Boolean
2513
+ })];
2514
+ _active_decorators = [forceType(), property({ type: Boolean })];
2515
+ _set_now_decorators = [property()];
2516
+ __esDecorate(this, null, _trip_decorators, {
2517
+ kind: "accessor",
2518
+ name: "trip",
2519
+ static: false,
2520
+ private: false,
2521
+ access: {
2522
+ has: (obj) => "trip" in obj,
2523
+ get: (obj) => obj.trip,
2524
+ set: (obj, value) => {
2525
+ obj.trip = value;
2526
+ }
2527
+ },
2528
+ metadata: _metadata
2529
+ }, _trip_initializers, _trip_extraInitializers);
2530
+ __esDecorate(this, null, _price_decorators, {
2531
+ kind: "accessor",
2532
+ name: "price",
2533
+ static: false,
2534
+ private: false,
2535
+ access: {
2536
+ has: (obj) => "price" in obj,
2537
+ get: (obj) => obj.price,
2538
+ set: (obj, value) => {
2539
+ obj.price = value;
2540
+ }
2541
+ },
2542
+ metadata: _metadata
2543
+ }, _price_initializers, _price_extraInitializers);
2544
+ __esDecorate(this, null, _disableAnimation_decorators, {
2545
+ kind: "accessor",
2546
+ name: "disableAnimation",
2547
+ static: false,
2548
+ private: false,
2549
+ access: {
2550
+ has: (obj) => "disableAnimation" in obj,
2551
+ get: (obj) => obj.disableAnimation,
2552
+ set: (obj, value) => {
2553
+ obj.disableAnimation = value;
2554
+ }
2555
+ },
2556
+ metadata: _metadata
2557
+ }, _disableAnimation_initializers, _disableAnimation_extraInitializers);
2558
+ __esDecorate(this, null, _boarding_decorators, {
2559
+ kind: "accessor",
2560
+ name: "boarding",
2561
+ static: false,
2562
+ private: false,
2563
+ access: {
2564
+ has: (obj) => "boarding" in obj,
2565
+ get: (obj) => obj.boarding,
2566
+ set: (obj, value) => {
2567
+ obj.boarding = value;
2568
+ }
2569
+ },
2570
+ metadata: _metadata
2571
+ }, _boarding_initializers, _boarding_extraInitializers);
2572
+ __esDecorate(this, null, _loadingTrip_decorators, {
2573
+ kind: "accessor",
2574
+ name: "loadingTrip",
2575
+ static: false,
2576
+ private: false,
2577
+ access: {
2578
+ has: (obj) => "loadingTrip" in obj,
2579
+ get: (obj) => obj.loadingTrip,
2580
+ set: (obj, value) => {
2581
+ obj.loadingTrip = value;
2582
+ }
2583
+ },
2584
+ metadata: _metadata
2585
+ }, _loadingTrip_initializers, _loadingTrip_extraInitializers);
2586
+ __esDecorate(this, null, _a11yFootpath_decorators, {
2587
+ kind: "accessor",
2588
+ name: "a11yFootpath",
2589
+ static: false,
2590
+ private: false,
2591
+ access: {
2592
+ has: (obj) => "a11yFootpath" in obj,
2593
+ get: (obj) => obj.a11yFootpath,
2594
+ set: (obj, value) => {
2595
+ obj.a11yFootpath = value;
2596
+ }
2597
+ },
2598
+ metadata: _metadata
2599
+ }, _a11yFootpath_initializers, _a11yFootpath_extraInitializers);
2600
+ __esDecorate(this, null, _loadingPrice_decorators, {
2601
+ kind: "accessor",
2602
+ name: "loadingPrice",
2603
+ static: false,
2604
+ private: false,
2605
+ access: {
2606
+ has: (obj) => "loadingPrice" in obj,
2607
+ get: (obj) => obj.loadingPrice,
2608
+ set: (obj, value) => {
2609
+ obj.loadingPrice = value;
2610
+ }
2611
+ },
2612
+ metadata: _metadata
2613
+ }, _loadingPrice_initializers, _loadingPrice_extraInitializers);
2614
+ __esDecorate(this, null, _cardActionLabel_decorators, {
2615
+ kind: "accessor",
2616
+ name: "cardActionLabel",
2617
+ static: false,
2618
+ private: false,
2619
+ access: {
2620
+ has: (obj) => "cardActionLabel" in obj,
2621
+ get: (obj) => obj.cardActionLabel,
2622
+ set: (obj, value) => {
2623
+ obj.cardActionLabel = value;
2624
+ }
2625
+ },
2626
+ metadata: _metadata
2627
+ }, _cardActionLabel_initializers, _cardActionLabel_extraInitializers);
2628
+ __esDecorate(this, null, _accessibilityExpanded_decorators, {
2629
+ kind: "accessor",
2630
+ name: "accessibilityExpanded",
2631
+ static: false,
2632
+ private: false,
2633
+ access: {
2634
+ has: (obj) => "accessibilityExpanded" in obj,
2635
+ get: (obj) => obj.accessibilityExpanded,
2636
+ set: (obj, value) => {
2637
+ obj.accessibilityExpanded = value;
2638
+ }
2639
+ },
2640
+ metadata: _metadata
2641
+ }, _accessibilityExpanded_initializers, _accessibilityExpanded_extraInitializers);
2642
+ __esDecorate(this, null, _active_decorators, {
2643
+ kind: "accessor",
2644
+ name: "active",
2645
+ static: false,
2646
+ private: false,
2647
+ access: {
2648
+ has: (obj) => "active" in obj,
2649
+ get: (obj) => obj.active,
2650
+ set: (obj, value) => {
2651
+ obj.active = value;
2652
+ }
2653
+ },
2654
+ metadata: _metadata
2655
+ }, _active_initializers, _active_extraInitializers);
2656
+ __esDecorate(this, null, _set_now_decorators, {
2657
+ kind: "setter",
2658
+ name: "now",
2659
+ static: false,
2660
+ private: false,
2661
+ access: {
2662
+ has: (obj) => "now" in obj,
2663
+ set: (obj, value) => {
2664
+ obj.now = value;
2665
+ }
2666
+ },
2667
+ metadata: _metadata
2668
+ }, null, _instanceExtraInitializers);
2669
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, {
2670
+ enumerable: true,
2671
+ configurable: true,
2672
+ writable: true,
2673
+ value: _metadata
2674
+ });
2675
+ }
2676
+ static {
2677
+ this.elementName = "sbb-timetable-row";
2678
+ }
2679
+ static {
2680
+ this.elementDependencies = [
2681
+ SbbCardElement,
2682
+ SbbCardBadgeElement,
2683
+ SbbCardButtonElement,
2684
+ SbbIconElement,
2685
+ SbbTimetableOccupancyElement,
2686
+ SbbPearlChainTimeElement
2687
+ ];
2688
+ }
2689
+ static {
2690
+ this.styles = [
2691
+ listResetStyles,
2692
+ screenReaderOnlyStyles,
2693
+ unsafeCSS(timetable_row_default)
2694
+ ];
2695
+ }
2696
+ #trip_accessor_storage;
2697
+ /** The trip Prop. */
2698
+ get trip() {
2699
+ return this.#trip_accessor_storage;
2700
+ }
2701
+ set trip(value) {
2702
+ this.#trip_accessor_storage = value;
2703
+ }
2704
+ #price_accessor_storage;
2705
+ /** The price Prop, which consists of the data for the badge. */
2706
+ get price() {
2707
+ return this.#price_accessor_storage;
2708
+ }
2709
+ set price(value) {
2710
+ this.#price_accessor_storage = value;
2711
+ }
2712
+ #disableAnimation_accessor_storage;
2713
+ /** This will be forwarded to the sbb-pearl-chain component - if true the position won't be animated. */
2714
+ get disableAnimation() {
2715
+ return this.#disableAnimation_accessor_storage;
2716
+ }
2717
+ set disableAnimation(value) {
2718
+ this.#disableAnimation_accessor_storage = value;
2719
+ }
2720
+ #boarding_accessor_storage;
2721
+ /** This will be forwarded to the notices section */
2722
+ get boarding() {
2723
+ return this.#boarding_accessor_storage;
2724
+ }
2725
+ set boarding(value) {
2726
+ this.#boarding_accessor_storage = value;
2727
+ }
2728
+ #loadingTrip_accessor_storage;
2729
+ /**
2730
+ * The loading state -
2731
+ * when this is true it will be render skeleton with an idling animation
2732
+ */
2733
+ get loadingTrip() {
2734
+ return this.#loadingTrip_accessor_storage;
2735
+ }
2736
+ set loadingTrip(value) {
2737
+ this.#loadingTrip_accessor_storage = value;
2738
+ }
2739
+ #a11yFootpath_accessor_storage;
2740
+ /**
2741
+ * The Footpath attribute for rendering different icons
2742
+ * true: render a11y-icon
2743
+ * false: render walk-icon
2744
+ * default: render walk-icon
2745
+ */
2746
+ get a11yFootpath() {
2747
+ return this.#a11yFootpath_accessor_storage;
2748
+ }
2749
+ set a11yFootpath(value) {
2750
+ this.#a11yFootpath_accessor_storage = value;
2751
+ }
2752
+ #loadingPrice_accessor_storage;
2753
+ /**
2754
+ * The loading state -
2755
+ * when this is true it will be render skeleton with an idling animation
2756
+ */
2757
+ get loadingPrice() {
2758
+ return this.#loadingPrice_accessor_storage;
2759
+ }
2760
+ set loadingPrice(value) {
2761
+ this.#loadingPrice_accessor_storage = value;
2762
+ }
2763
+ #cardActionLabel_accessor_storage;
2764
+ /**
2765
+ * 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.
2766
+ */
2767
+ get cardActionLabel() {
2768
+ return this.#cardActionLabel_accessor_storage;
2769
+ }
2770
+ set cardActionLabel(value) {
2771
+ this.#cardActionLabel_accessor_storage = value;
2772
+ }
2773
+ #accessibilityExpanded_accessor_storage;
2774
+ /** This will be forwarded to the sbb-card component as aria-expanded. */
2775
+ get accessibilityExpanded() {
2776
+ return this.#accessibilityExpanded_accessor_storage;
2777
+ }
2778
+ set accessibilityExpanded(value) {
2779
+ this.#accessibilityExpanded_accessor_storage = value;
2780
+ }
2781
+ #active_accessor_storage;
2782
+ /** When this prop is true the sbb-card will be in the active state. */
2783
+ get active() {
2784
+ return this.#active_accessor_storage;
2785
+ }
2786
+ set active(value) {
2787
+ this.#active_accessor_storage = value;
2788
+ }
2789
+ /**
2790
+ * A configured date which acts as the current date instead of the real current date.
2791
+ * Only recommended for testing purposes.
2792
+ */
2793
+ set now(value) {
2794
+ this._now = defaultDateAdapter.getValidDateOrNull(defaultDateAdapter.deserialize(value));
2795
+ }
2796
+ get now() {
2797
+ return this._now ?? /* @__PURE__ */ new Date();
2798
+ }
2799
+ willUpdate(changedProperties) {
2800
+ super.willUpdate(changedProperties);
2801
+ if (changedProperties.has("loadingTrip")) this.internals.role = !this.loadingTrip ? "rowgroup" : null;
2802
+ }
2803
+ /** The skeleton render function for the loading state */
2804
+ _renderSkeleton() {
2805
+ return html`
2806
+ <sbb-card class="sbb-loading sbb-card-spacing-4x-xxs sbb-timetable__row-card">
2807
+ ${this.loadingPrice ? html`<div class="sbb-loading__badge" slot="badge"></div>` : nothing}
2808
+ <div class="sbb-loading__wrapper">
2809
+ <div class="sbb-loading__row"></div>
2810
+ <div class="sbb-loading__row"></div>
2811
+ <div class="sbb-loading__row"></div>
2812
+ </div>
2813
+ </sbb-card>
2814
+ `;
2815
+ }
2816
+ _getRideLegs() {
2817
+ return this.trip?.legs?.filter((leg) => isRideLeg(leg)) ?? [];
2818
+ }
2819
+ _getQuayTypeStrings() {
2820
+ if (!this.trip.summary?.product) return null;
2821
+ const rideLegs = this._getRideLegs();
2822
+ const short = this.trip.summary.product?.vehicleMode === "TRAIN" ? rideLegs[0].serviceJourney.quayTypeShortName || "" : rideLegs[0].serviceJourney.quayTypeName || "";
2823
+ return {
2824
+ long: i18nFromPlatform[this._language.current] + " " + short,
2825
+ short
2826
+ };
2827
+ }
2828
+ /** map Quay */
2829
+ _renderQuayType() {
2830
+ if (!this.trip.summary?.product) return;
2831
+ const quayTypeStrings = this._getQuayTypeStrings();
2832
+ return html`
2833
+ <span class="sbb-timetable__row--quay">
2834
+ <span class="sbb-screen-reader-only">${quayTypeStrings?.long}&nbsp;</span>
2835
+ <span class="sbb-timetable__row--quay-type" aria-hidden="true"
2836
+ >${quayTypeStrings?.short}</span
2837
+ >
2838
+ </span>
2839
+ `;
2840
+ }
2841
+ _handleHimCus(trip) {
2842
+ const { situations } = trip || {};
2843
+ const sortedSituations = situations && sortSituation(situations);
2844
+ const cus = getCus(trip, this._language.current);
2845
+ return {
2846
+ cus: Object.keys(cus)?.length ? cus : null,
2847
+ him: situations?.length ? getHimIcon(sortedSituations[0]) : null
2848
+ };
2849
+ }
2850
+ _getAccessibilityText(trip) {
2851
+ const { summary, legs, notices } = trip || {};
2852
+ const { departureWalk, arrivalWalk, departure, arrival, product, direction, occupancy, duration } = summary || {};
2853
+ const { departureTimeAttribute, arrivalTimeAttribute } = getDepartureArrivalTimeAttribute(legs, departureWalk || 0, arrivalWalk || 0, this._language.current, this.a11yFootpath);
2854
+ const rideLegs = this._getRideLegs();
2855
+ const departureTime = departure?.time ? removeTimezoneFromISOTimeString(departure.time) : void 0;
2856
+ const arrivalTime = arrival?.time ? removeTimezoneFromISOTimeString(arrival.time) : void 0;
2857
+ const departureWalkText = departureTimeAttribute ? `${departureTimeAttribute.text} ${departureTimeAttribute.duration}, ` : "";
2858
+ const arrivalWalkText = arrivalTimeAttribute ? `${arrivalTimeAttribute.text} ${arrivalTimeAttribute.duration}, ` : "";
2859
+ const departureTimeText = departureTime ? `${i18nDeparture[this._language.current]}: ${format(departureTime, "HH:mm")}, ` : "";
2860
+ const getDepartureQuayText = () => {
2861
+ if (!departure?.quayFormatted) return "";
2862
+ return `${departure?.quayChanged ? `${i18nNew[this._language.current]} ` : ""}${this._getQuayTypeStrings()?.long} ${departure?.quayFormatted}, `;
2863
+ };
2864
+ const meansOfTransportText = product && product.vehicleMode ? i18nMeansOfTransport[product.vehicleMode.toLowerCase()] && `${i18nMeansOfTransport[product.vehicleMode.toLowerCase()][this._language.current]}, ` : "";
2865
+ const vehicleSubModeText = product?.vehicleSubModeShortName ? `${product.vehicleSubModeShortName} ${product.line || ""}, ` : "";
2866
+ const directionText = `${i18nDirection[this._language.current]} ${direction}, `;
2867
+ const himCus = this._handleHimCus(trip);
2868
+ const cusText = himCus?.cus?.text ? `${i18nRealTimeInfo[this._language.current]}: ${himCus?.cus?.text}, ` : "";
2869
+ const himText = himCus?.him?.text ? `${i18nRealTimeInfo[this._language.current]}: ${himCus?.him?.text}, ` : "";
2870
+ const boardingText = this.boarding ? `${this.boarding.text}, ` : "";
2871
+ const priceText = `${this.price?.isDiscount ? i18nSupersaver[this._language.current] : ""} ${this.price?.text && this.price?.price ? (this.price?.text || "") + " " + (this.price?.price || "") + ", " : ""}`;
2872
+ const transferProcedures = rideLegs.length > 2 ? `${rideLegs.length - 1} ${i18nTransferProcedures[this._language.current]}, ` : rideLegs.length > 1 ? `${rideLegs.length - 1} ${i18nTransferProcedure[this._language.current]}, ` : "";
2873
+ const arrivalTimeText = arrivalTime ? `${i18nArrival[this._language.current]}: ${format(arrivalTime, "HH:mm")}, ` : "";
2874
+ let occupancyText = "";
2875
+ if (occupancy) {
2876
+ if (occupancy.firstClass && occupancy.firstClass !== "UNKNOWN") occupancyText += `${i18nClass.first[this._language.current]} ${i18nOccupancy[occupancy.firstClass.toLowerCase()]?.[this._language.current]}.`;
2877
+ if (occupancy.secondClass && occupancy.secondClass !== "UNKNOWN") occupancyText += ` ${i18nClass.second[this._language.current]} ${i18nOccupancy[occupancy.secondClass.toLowerCase()]?.[this._language.current]}.`;
2878
+ }
2879
+ const attributes = notices && handleNotices(notices).length && handleNotices(notices)?.map((notice, index) => index < 4 && notice.text?.template).join(", ") + ", ";
2880
+ const attributesText = attributes ? `${i18nTravelhints[this._language.current]}: ${attributes}` : "";
2881
+ const durationText = !!duration && duration > 0 ? `${i18nTripDuration[this._language.current]} ${durationToTime(duration, this._language.current).long}, ` : "";
2882
+ return [
2883
+ departureWalkText,
2884
+ departureTimeText,
2885
+ getDepartureQuayText(),
2886
+ meansOfTransportText,
2887
+ vehicleSubModeText,
2888
+ directionText,
2889
+ cusText,
2890
+ boardingText,
2891
+ priceText,
2892
+ cusText ? "" : himText,
2893
+ arrivalTimeText,
2894
+ arrivalWalkText,
2895
+ durationText,
2896
+ transferProcedures,
2897
+ occupancyText,
2898
+ attributesText
2899
+ ].map((e) => e?.trim()).filter((e) => e && e.length > 0).join(" ");
2900
+ }
2901
+ render() {
2902
+ if (this.loadingTrip) return this._renderSkeleton();
2903
+ const { legs, id, notices, summary } = this.trip || {};
2904
+ const { product, direction, departureWalk, departure, arrival, arrivalWalk, occupancy, duration } = summary || {};
2905
+ const himCus = this._handleHimCus(this.trip);
2906
+ const hasHimCus = !!himCus.cus || !!himCus.him;
2907
+ const noticeAttributes = notices && handleNotices(notices);
2908
+ const durationObj = duration ? durationToTime(duration, this._language.current) : null;
2909
+ return html`
2910
+ <sbb-card class="sbb-card-spacing-4x-xxs sbb-timetable__row-card" id=${id}>
2911
+ <sbb-card-button
2912
+ ?active=${this.active}
2913
+ aria-expanded=${this.accessibilityExpanded ? "true" : nothing}
2914
+ >
2915
+ ${this.cardActionLabel ? this.cardActionLabel : this._getAccessibilityText(this.trip)}
2916
+ </sbb-card-button>
2917
+ ${this.loadingPrice ? html`<div class="sbb-loading__badge" slot="badge"></div>` : nothing}
2918
+ ${this.price && !this.loadingPrice ? html`<sbb-card-badge color=${this.price.isDiscount ? "charcoal" : "white"}>
2919
+ ${this.price.isDiscount ? html`<span aria-hidden="true">
2920
+ %<span class="sbb-screen-reader-only"
2921
+ >${i18nSupersaver[this._language.current]}</span
2922
+ >
2923
+ </span>` : nothing}
2924
+ ${this.price.text ? html`<span>${this.price.text}</span>` : nothing}
2925
+ ${this.price.price ? html`<span>${this.price.price}</span>` : nothing}
2926
+ </sbb-card-badge>` : nothing}
2927
+ <div class="sbb-timetable__row" role="row">
2928
+ <div class="sbb-timetable__row-header" role="gridcell">
2929
+ <div class="sbb-timetable__row-details">
2930
+ ${product?.corporateIdentityPictogram && html`<span class="sbb-timetable__row-transport-wrapper">
2931
+ <sbb-icon
2932
+ class="sbb-timetable__row-transport-icon"
2933
+ name="picto:${product.corporateIdentityPictogram}"
2934
+ ></sbb-icon>
2935
+ <span class="sbb-screen-reader-only">
2936
+ ${product && product.vehicleMode && i18nMeansOfTransport[product.vehicleMode.toLowerCase()] && i18nMeansOfTransport[product.vehicleMode.toLowerCase()][this._language.current]}
2937
+ &nbsp;
2938
+ </span>
2939
+ </span>`}
2940
+ ${product && (product.corporateIdentityIcon ? renderIconProduct(product.corporateIdentityIcon, product.name) : product.vehicleSubModeShortName && renderStringProduct(product.vehicleSubModeShortName, product?.line))}
2941
+ </div>
2942
+ ${direction ? html`<p>${`${i18nDirection[this._language.current]} ${direction}`}</p>` : nothing}
2943
+ </div>
2944
+ <sbb-pearl-chain-time
2945
+ role="gridcell"
2946
+ .legs=${legs}
2947
+ .departureTime=${departure?.time}
2948
+ .arrivalTime=${arrival?.time}
2949
+ .departureWalk=${departureWalk}
2950
+ .arrivalWalk=${arrivalWalk}
2951
+ ?disable-animation=${this.disableAnimation}
2952
+ ?a11y-footpath=${this.a11yFootpath}
2953
+ .now=${this.now}
2954
+ ></sbb-pearl-chain-time>
2955
+ <div class="sbb-timetable__row-footer" role="gridcell">
2956
+ ${product && departure?.quayFormatted ? html`<span
2957
+ class=${departure?.quayChanged ? `sbb-timetable__row-quay--changed` : nothing}
2958
+ >
2959
+ <span class="sbb-screen-reader-only">
2960
+ ${`${i18nDeparture[this._language.current]} ${departure?.quayChanged ? i18nNew[this._language.current] : ""}`}
2961
+ &nbsp;
2962
+ </span>
2963
+ ${this._renderQuayType()} ${departure?.quayFormatted}
2964
+ </span>` : nothing}
2965
+ ${occupancy?.firstClass && occupancy?.firstClass !== "UNKNOWN" || occupancy?.secondClass && occupancy.secondClass !== "UNKNOWN" ? html`<sbb-timetable-occupancy
2966
+ .firstClassOccupancy=${occupancy?.firstClass?.toLowerCase()}
2967
+ .secondClassOccupancy=${occupancy?.secondClass?.toLowerCase()}
2968
+ ></sbb-timetable-occupancy>` : nothing}
2969
+ ${noticeAttributes && noticeAttributes.length || this.boarding ? html`<ul class="sbb-timetable__row-hints" role="list">
2970
+ ${noticeAttributes?.map((notice, index) => index < 4 ? html`<li>
2971
+ <sbb-icon
2972
+ class="sbb-travel-hints__item"
2973
+ name=${"sa-" + notice.name?.toLowerCase()}
2974
+ ></sbb-icon>
2975
+ <span class="sbb-screen-reader-only">${notice.text?.template}</span>
2976
+ </li>` : nothing)}
2977
+ ${this.boarding ? html`<li>
2978
+ <sbb-icon
2979
+ class="sbb-travel-hints__item"
2980
+ name=${this.boarding?.name}
2981
+ aria-label=${this.boarding?.text}
2982
+ aria-hidden="false"
2983
+ ></sbb-icon>
2984
+ </li>` : nothing}
2985
+ </ul>` : nothing}
2986
+ ${duration && duration > 0 ? html`<time>
2987
+ <span class="sbb-screen-reader-only">
2988
+ ${`${i18nTripDuration[this._language.current]} ${durationObj.long}`}
2989
+ </span>
2990
+ <span aria-hidden="true">${durationObj.short}</span>
2991
+ </time>` : nothing}
2992
+ ${hasHimCus && (himCus.cus || himCus.him) ? html`<span class="sbb-timetable__row-warning">
2993
+ <sbb-icon name=${(himCus.cus || himCus.him).name}></sbb-icon>
2994
+ <span class="sbb-screen-reader-only">${(himCus.cus || himCus.him).text}</span>
2995
+ </span>` : nothing}
2996
+ </div>
2997
+ </div>
2998
+ </sbb-card>
2999
+ `;
3000
+ }
3001
+ };
3002
+ })();
3003
+
3004
+ //#endregion
3005
+ export { SbbTimetableRowElement, filterNotices, getCus, getHimIcon, handleNotices, renderIconProduct, renderStringProduct, sortSituation };