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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/autocomplete-grid.js +1 -10
  2. package/autocomplete-grid.pure.js +12 -7
  3. package/core.js +31 -5
  4. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +0 -1
  5. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts +4 -5
  6. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts +1 -2
  7. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts +2 -3
  8. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts +1 -2
  9. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts +1 -2
  10. package/development/autocomplete-grid.d.ts +0 -1
  11. package/development/autocomplete-grid.js +5 -10
  12. package/development/autocomplete-grid.pure.d.ts +0 -1
  13. package/development/autocomplete-grid.pure.js +328 -7
  14. package/development/core/datetime/date-helper.d.ts +0 -1
  15. package/development/core/timetable/access-leg-helper.d.ts +3 -3
  16. package/development/core/timetable/timetable-helper.d.ts +1 -2
  17. package/development/core/timetable/timetable-properties.d.ts +2 -1
  18. package/development/core.d.ts +0 -1
  19. package/development/core.js +1195 -5
  20. package/development/journey-summary/journey-summary.component.d.ts +3 -4
  21. package/development/journey-summary.d.ts +0 -1
  22. package/development/journey-summary.js +5 -5
  23. package/development/journey-summary.pure.d.ts +0 -1
  24. package/development/journey-summary.pure.js +2605 -2
  25. package/development/pearl-chain/pearl-chain.component.d.ts +2 -3
  26. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +3 -4
  27. package/development/pearl-chain-time.d.ts +0 -1
  28. package/development/pearl-chain-time.js +5 -5
  29. package/development/pearl-chain-time.pure.d.ts +0 -1
  30. package/development/pearl-chain-time.pure.js +2582 -2
  31. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts +1 -2
  32. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts +1 -2
  33. package/development/pearl-chain-vertical-item.d.ts +0 -1
  34. package/development/pearl-chain-vertical-item.js +5 -5
  35. package/development/pearl-chain-vertical-item.pure.d.ts +0 -1
  36. package/development/pearl-chain-vertical-item.pure.js +132 -2
  37. package/development/pearl-chain-vertical.d.ts +0 -1
  38. package/development/pearl-chain-vertical.js +5 -5
  39. package/development/pearl-chain-vertical.pure.d.ts +0 -1
  40. package/development/pearl-chain-vertical.pure.js +31 -2
  41. package/development/pearl-chain.d.ts +0 -1
  42. package/development/pearl-chain.js +5 -5
  43. package/development/pearl-chain.pure.d.ts +0 -1
  44. package/development/pearl-chain.pure.js +619 -2
  45. package/development/seat-reservation/common/mapper/icon-mapper.d.ts +0 -1
  46. package/development/seat-reservation/common/mapper/mapper.d.ts +1 -2
  47. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-bus.private.d.ts +68 -0
  48. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-decks.private.d.ts +122 -0
  49. package/development/seat-reservation/common/mapper/sample-data/seat-reservation-sample-data-train.private.d.ts +68 -0
  50. package/development/seat-reservation/common/mapper.d.ts +0 -1
  51. package/development/seat-reservation/common/svgs.d.ts +20 -21
  52. package/development/seat-reservation/common/translations/i18n.d.ts +0 -1
  53. package/development/seat-reservation/common/translations.d.ts +0 -1
  54. package/development/seat-reservation/common/types.d.ts +0 -1
  55. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +2 -3
  56. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +2 -3
  57. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +1 -2
  58. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +2 -3
  59. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +3 -4
  60. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +2 -3
  61. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +3 -4
  62. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +1 -2
  63. package/development/seat-reservation.d.ts +0 -1
  64. package/development/seat-reservation.js +5 -16
  65. package/development/seat-reservation.pure.d.ts +0 -1
  66. package/development/seat-reservation.pure.js +16019 -14
  67. package/development/timetable-duration/timetable-duration.component.d.ts +1 -2
  68. package/development/timetable-duration.d.ts +0 -1
  69. package/development/timetable-duration.js +5 -5
  70. package/development/timetable-duration.pure.d.ts +0 -1
  71. package/development/timetable-duration.pure.js +97 -2
  72. package/development/timetable-row/timetable-row.component.d.ts +3 -4
  73. package/development/timetable-row.d.ts +0 -1
  74. package/development/timetable-row.js +5 -5
  75. package/development/timetable-row.pure.d.ts +0 -1
  76. package/development/timetable-row.pure.js +3005 -2
  77. package/journey-summary.js +1 -6
  78. package/journey-summary.pure.js +55 -2
  79. package/package.json +2 -2
  80. package/pearl-chain-time.js +1 -6
  81. package/pearl-chain-time.pure.js +28 -2
  82. package/pearl-chain-vertical-item.js +1 -6
  83. package/pearl-chain-vertical-item.pure.js +26 -2
  84. package/pearl-chain-vertical.js +1 -6
  85. package/pearl-chain-vertical.pure.js +6 -2
  86. package/pearl-chain.js +1 -6
  87. package/pearl-chain.pure.js +27 -2
  88. package/seat-reservation.js +1 -16
  89. package/seat-reservation.pure.js +468 -14
  90. package/timetable-duration.js +1 -6
  91. package/timetable-duration.pure.js +9 -2
  92. package/timetable-row.js +1 -6
  93. package/timetable-row.pure.js +113 -2
  94. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -65
  95. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -44
  96. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  97. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -21
  98. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  99. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  100. package/autocomplete-grid-cell.component-79IjA__I.js +0 -23
  101. package/autocomplete-grid-option.component-DUFBhQwI.js +0 -35
  102. package/autocomplete-grid-row.component-B3U15Rwa.js +0 -26
  103. package/core/datetime/date-helper.js +0 -2
  104. package/core/timetable/access-leg-helper.js +0 -96
  105. package/core/timetable/timetable-helper.js +0 -10
  106. package/core/timetable/timetable-properties.js +0 -0
  107. package/date-helper-DNzMLcyb.js +0 -185
  108. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +0 -1
  109. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +0 -118
  110. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts.map +0 -1
  111. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +0 -69
  112. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts.map +0 -1
  113. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +0 -2
  114. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts.map +0 -1
  115. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +0 -30
  116. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts.map +0 -1
  117. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +0 -2
  118. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts.map +0 -1
  119. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +0 -2
  120. package/development/autocomplete-grid-cell.component-BbdELDro.js +0 -33
  121. package/development/autocomplete-grid-option.component-C7WuqRit.js +0 -57
  122. package/development/autocomplete-grid-row.component-DoXbOsQM.js +0 -38
  123. package/development/autocomplete-grid.d.ts.map +0 -1
  124. package/development/autocomplete-grid.pure.d.ts.map +0 -1
  125. package/development/core/datetime/date-helper.d.ts.map +0 -1
  126. package/development/core/datetime/date-helper.js +0 -2
  127. package/development/core/timetable/access-leg-helper.d.ts.map +0 -1
  128. package/development/core/timetable/access-leg-helper.js +0 -147
  129. package/development/core/timetable/timetable-helper.d.ts.map +0 -1
  130. package/development/core/timetable/timetable-helper.js +0 -19
  131. package/development/core/timetable/timetable-properties.d.ts.map +0 -1
  132. package/development/core/timetable/timetable-properties.js +0 -0
  133. package/development/core.d.ts.map +0 -1
  134. package/development/date-helper-BcTDWVeP.js +0 -539
  135. package/development/differenceInMinutes-CxAbGYQ3.js +0 -110
  136. package/development/format-Cx3zmmaF.js +0 -1848
  137. package/development/isValid-40Olgzo1.js +0 -178
  138. package/development/journey-summary/journey-summary.component.d.ts.map +0 -1
  139. package/development/journey-summary/journey-summary.component.js +0 -2
  140. package/development/journey-summary.component-BsC7wBIn.js +0 -341
  141. package/development/journey-summary.d.ts.map +0 -1
  142. package/development/journey-summary.pure.d.ts.map +0 -1
  143. package/development/mapper-BrZOqqfe.js +0 -11454
  144. package/development/pearl-chain/pearl-chain.component.d.ts.map +0 -1
  145. package/development/pearl-chain/pearl-chain.component.js +0 -2
  146. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +0 -1
  147. package/development/pearl-chain-time/pearl-chain-time.component.js +0 -2
  148. package/development/pearl-chain-time.component-C-CuC1ke.js +0 -317
  149. package/development/pearl-chain-time.d.ts.map +0 -1
  150. package/development/pearl-chain-time.pure.d.ts.map +0 -1
  151. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts.map +0 -1
  152. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  153. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +0 -1
  154. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  155. package/development/pearl-chain-vertical-item.component-CLu9QrqJ.js +0 -131
  156. package/development/pearl-chain-vertical-item.d.ts.map +0 -1
  157. package/development/pearl-chain-vertical-item.pure.d.ts.map +0 -1
  158. package/development/pearl-chain-vertical.component-DbPz5k_R.js +0 -30
  159. package/development/pearl-chain-vertical.d.ts.map +0 -1
  160. package/development/pearl-chain-vertical.pure.d.ts.map +0 -1
  161. package/development/pearl-chain.component-10OsJZIX.js +0 -318
  162. package/development/pearl-chain.d.ts.map +0 -1
  163. package/development/pearl-chain.pure.d.ts.map +0 -1
  164. package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +0 -1
  165. package/development/seat-reservation/common/mapper/icon-mapper.js +0 -170
  166. package/development/seat-reservation/common/mapper/mapper.d.ts.map +0 -1
  167. package/development/seat-reservation/common/mapper/mapper.js +0 -2
  168. package/development/seat-reservation/common/mapper.d.ts.map +0 -1
  169. package/development/seat-reservation/common/mapper.js +0 -3
  170. package/development/seat-reservation/common/svgs.d.ts.map +0 -1
  171. package/development/seat-reservation/common/svgs.js +0 -2
  172. package/development/seat-reservation/common/translations/i18n.d.ts.map +0 -1
  173. package/development/seat-reservation/common/translations/i18n.js +0 -1120
  174. package/development/seat-reservation/common/translations.d.ts.map +0 -1
  175. package/development/seat-reservation/common/translations.js +0 -2
  176. package/development/seat-reservation/common/types.d.ts.map +0 -1
  177. package/development/seat-reservation/common/types.js +0 -0
  178. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +0 -1
  179. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -1476
  180. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +0 -1
  181. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  182. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +0 -1
  183. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  184. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +0 -1
  185. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  186. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +0 -1
  187. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  188. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +0 -1
  189. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  190. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +0 -1
  191. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  192. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +0 -1
  193. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  194. package/development/seat-reservation-area.component-DPhQJFid.js +0 -94
  195. package/development/seat-reservation-graphic.component-0LYsmerm.js +0 -129
  196. package/development/seat-reservation-navigation-coach.component-B97jKD7Y.js +0 -438
  197. package/development/seat-reservation-navigation-services.component-Cx0Is97w.js +0 -159
  198. package/development/seat-reservation-place-control.component-DaL1g8WH.js +0 -431
  199. package/development/seat-reservation-scoped.component-BHbORVsR.js +0 -24
  200. package/development/seat-reservation.component-DI9pSlzt.js +0 -473
  201. package/development/seat-reservation.d.ts.map +0 -1
  202. package/development/seat-reservation.pure.d.ts.map +0 -1
  203. package/development/svgs-Dj-RKmRs.js +0 -28
  204. package/development/timetable-duration/timetable-duration.component.d.ts.map +0 -1
  205. package/development/timetable-duration/timetable-duration.component.js +0 -2
  206. package/development/timetable-duration.component-Chk5D4Is.js +0 -96
  207. package/development/timetable-duration.d.ts.map +0 -1
  208. package/development/timetable-duration.pure.d.ts.map +0 -1
  209. package/development/timetable-row/timetable-row.component.d.ts.map +0 -1
  210. package/development/timetable-row/timetable-row.component.js +0 -2
  211. package/development/timetable-row.component-nzrQzxL6.js +0 -736
  212. package/development/timetable-row.d.ts.map +0 -1
  213. package/development/timetable-row.pure.d.ts.map +0 -1
  214. package/development/toDate-CDWut5fS.js +0 -150
  215. package/differenceInMinutes-BAZ-Fham.js +0 -27
  216. package/format-DjgG1QPc.js +0 -1103
  217. package/isValid-CXnsFZVu.js +0 -36
  218. package/journey-summary/journey-summary.component.js +0 -2
  219. package/journey-summary.component-DNoO3OCf.js +0 -265
  220. package/mapper-Dcou8VEf.js +0 -11382
  221. package/pearl-chain/pearl-chain.component.js +0 -2
  222. package/pearl-chain-time/pearl-chain-time.component.js +0 -2
  223. package/pearl-chain-time.component-BuvA6IE1.js +0 -237
  224. package/pearl-chain-vertical/pearl-chain-vertical.component.js +0 -2
  225. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +0 -2
  226. package/pearl-chain-vertical-item.component-QZ4s8Jbv.js +0 -106
  227. package/pearl-chain-vertical.component-Dc3vaHsQ.js +0 -20
  228. package/pearl-chain.component-DtGXXkY6.js +0 -190
  229. package/seat-reservation/common/mapper/icon-mapper.js +0 -72
  230. package/seat-reservation/common/mapper/mapper.js +0 -2
  231. package/seat-reservation/common/mapper.js +0 -3
  232. package/seat-reservation/common/svgs.js +0 -2
  233. package/seat-reservation/common/translations/i18n.js +0 -1085
  234. package/seat-reservation/common/translations.js +0 -2
  235. package/seat-reservation/common/types.js +0 -0
  236. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +0 -926
  237. package/seat-reservation/seat-reservation/seat-reservation.component.js +0 -2
  238. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +0 -2
  239. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +0 -2
  240. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +0 -2
  241. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +0 -2
  242. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +0 -2
  243. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +0 -2
  244. package/seat-reservation-area.component-G9lHb7S8.js +0 -73
  245. package/seat-reservation-graphic.component-BXFcQDxY.js +0 -102
  246. package/seat-reservation-navigation-coach.component-BXy8EkJe.js +0 -338
  247. package/seat-reservation-navigation-services.component-49XmV9rv.js +0 -124
  248. package/seat-reservation-place-control.component-DToIW328.js +0 -317
  249. package/seat-reservation-scoped.component-D8dAmrP7.js +0 -16
  250. package/seat-reservation.component--0XnrCkk.js +0 -372
  251. package/svgs-D4fuYTHV.js +0 -26
  252. package/timetable-duration/timetable-duration.component.js +0 -2
  253. package/timetable-duration.component-iMCvh1zr.js +0 -61
  254. package/timetable-row/timetable-row.component.js +0 -2
  255. package/timetable-row.component-mNKmhRmP.js +0 -566
  256. package/toDate-BhNUyM4s.js +0 -16
@@ -1,2 +1,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/getTimezoneOffsetInMilliseconds.js
207
+ /**
208
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
209
+ * They usually appear for dates that denote time before the timezones were introduced
210
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
211
+ * and GMT+01:00:00 after that date)
212
+ *
213
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
214
+ * which would lead to incorrect calculations.
215
+ *
216
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
217
+ */
218
+ function getTimezoneOffsetInMilliseconds(date) {
219
+ const _date = toDate(date);
220
+ const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
221
+ utcDate.setUTCFullYear(_date.getFullYear());
222
+ return +date - +utcDate;
223
+ }
224
+
225
+ //#endregion
226
+ //#region node_modules/date-fns/_lib/normalizeDates.js
227
+ function normalizeDates(context, ...dates) {
228
+ const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === "object"));
229
+ return dates.map(normalize);
230
+ }
231
+
232
+ //#endregion
233
+ //#region node_modules/date-fns/startOfDay.js
234
+ /**
235
+ * The {@link startOfDay} function options.
236
+ */
237
+ /**
238
+ * @name startOfDay
239
+ * @category Day Helpers
240
+ * @summary Return the start of a day for the given date.
241
+ *
242
+ * @description
243
+ * Return the start of a day for the given date.
244
+ * The result will be in the local timezone.
245
+ *
246
+ * @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).
247
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
248
+ *
249
+ * @param date - The original date
250
+ * @param options - The options
251
+ *
252
+ * @returns The start of a day
253
+ *
254
+ * @example
255
+ * // The start of a day for 2 September 2014 11:55:00:
256
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
257
+ * //=> Tue Sep 02 2014 00:00:00
258
+ */
259
+ function startOfDay(date, options) {
260
+ const _date = toDate(date, options?.in);
261
+ _date.setHours(0, 0, 0, 0);
262
+ return _date;
263
+ }
264
+
265
+ //#endregion
266
+ //#region node_modules/date-fns/differenceInCalendarDays.js
267
+ /**
268
+ * The {@link differenceInCalendarDays} function options.
269
+ */
270
+ /**
271
+ * @name differenceInCalendarDays
272
+ * @category Day Helpers
273
+ * @summary Get the number of calendar days between the given dates.
274
+ *
275
+ * @description
276
+ * Get the number of calendar days between the given dates. This means that the times are removed
277
+ * from the dates and then the difference in days is calculated.
278
+ *
279
+ * @param laterDate - The later date
280
+ * @param earlierDate - The earlier date
281
+ * @param options - The options object
282
+ *
283
+ * @returns The number of calendar days
284
+ *
285
+ * @example
286
+ * // How many calendar days are between
287
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
288
+ * const result = differenceInCalendarDays(
289
+ * new Date(2012, 6, 2, 0, 0),
290
+ * new Date(2011, 6, 2, 23, 0)
291
+ * )
292
+ * //=> 366
293
+ * // How many calendar days are between
294
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
295
+ * const result = differenceInCalendarDays(
296
+ * new Date(2011, 6, 3, 0, 1),
297
+ * new Date(2011, 6, 2, 23, 59)
298
+ * )
299
+ * //=> 1
300
+ */
301
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
302
+ const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
303
+ const laterStartOfDay = startOfDay(laterDate_);
304
+ const earlierStartOfDay = startOfDay(earlierDate_);
305
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
306
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
307
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
308
+ }
309
+
310
+ //#endregion
311
+ //#region node_modules/date-fns/locale/en-US/_lib/formatDistance.js
312
+ const formatDistanceLocale = {
313
+ lessThanXSeconds: {
314
+ one: "less than a second",
315
+ other: "less than {{count}} seconds"
316
+ },
317
+ xSeconds: {
318
+ one: "1 second",
319
+ other: "{{count}} seconds"
320
+ },
321
+ halfAMinute: "half a minute",
322
+ lessThanXMinutes: {
323
+ one: "less than a minute",
324
+ other: "less than {{count}} minutes"
325
+ },
326
+ xMinutes: {
327
+ one: "1 minute",
328
+ other: "{{count}} minutes"
329
+ },
330
+ aboutXHours: {
331
+ one: "about 1 hour",
332
+ other: "about {{count}} hours"
333
+ },
334
+ xHours: {
335
+ one: "1 hour",
336
+ other: "{{count}} hours"
337
+ },
338
+ xDays: {
339
+ one: "1 day",
340
+ other: "{{count}} days"
341
+ },
342
+ aboutXWeeks: {
343
+ one: "about 1 week",
344
+ other: "about {{count}} weeks"
345
+ },
346
+ xWeeks: {
347
+ one: "1 week",
348
+ other: "{{count}} weeks"
349
+ },
350
+ aboutXMonths: {
351
+ one: "about 1 month",
352
+ other: "about {{count}} months"
353
+ },
354
+ xMonths: {
355
+ one: "1 month",
356
+ other: "{{count}} months"
357
+ },
358
+ aboutXYears: {
359
+ one: "about 1 year",
360
+ other: "about {{count}} years"
361
+ },
362
+ xYears: {
363
+ one: "1 year",
364
+ other: "{{count}} years"
365
+ },
366
+ overXYears: {
367
+ one: "over 1 year",
368
+ other: "over {{count}} years"
369
+ },
370
+ almostXYears: {
371
+ one: "almost 1 year",
372
+ other: "almost {{count}} years"
373
+ }
374
+ };
375
+ const formatDistance = (token, count, options) => {
376
+ let result;
377
+ const tokenValue = formatDistanceLocale[token];
378
+ if (typeof tokenValue === "string") result = tokenValue;
379
+ else if (count === 1) result = tokenValue.one;
380
+ else result = tokenValue.other.replace("{{count}}", count.toString());
381
+ if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
382
+ else return result + " ago";
383
+ return result;
384
+ };
385
+
386
+ //#endregion
387
+ //#region node_modules/date-fns/locale/_lib/buildFormatLongFn.js
388
+ function buildFormatLongFn(args) {
389
+ return (options = {}) => {
390
+ const width = options.width ? String(options.width) : args.defaultWidth;
391
+ return args.formats[width] || args.formats[args.defaultWidth];
392
+ };
393
+ }
394
+
395
+ //#endregion
396
+ //#region node_modules/date-fns/locale/en-US/_lib/formatLong.js
397
+ const dateFormats = {
398
+ full: "EEEE, MMMM do, y",
399
+ long: "MMMM do, y",
400
+ medium: "MMM d, y",
401
+ short: "MM/dd/yyyy"
402
+ };
403
+ const timeFormats = {
404
+ full: "h:mm:ss a zzzz",
405
+ long: "h:mm:ss a z",
406
+ medium: "h:mm:ss a",
407
+ short: "h:mm a"
408
+ };
409
+ const dateTimeFormats = {
410
+ full: "{{date}} 'at' {{time}}",
411
+ long: "{{date}} 'at' {{time}}",
412
+ medium: "{{date}}, {{time}}",
413
+ short: "{{date}}, {{time}}"
414
+ };
415
+ const formatLong = {
416
+ date: buildFormatLongFn({
417
+ formats: dateFormats,
418
+ defaultWidth: "full"
419
+ }),
420
+ time: buildFormatLongFn({
421
+ formats: timeFormats,
422
+ defaultWidth: "full"
423
+ }),
424
+ dateTime: buildFormatLongFn({
425
+ formats: dateTimeFormats,
426
+ defaultWidth: "full"
427
+ })
428
+ };
429
+
430
+ //#endregion
431
+ //#region node_modules/date-fns/locale/en-US/_lib/formatRelative.js
432
+ const formatRelativeLocale = {
433
+ lastWeek: "'last' eeee 'at' p",
434
+ yesterday: "'yesterday at' p",
435
+ today: "'today at' p",
436
+ tomorrow: "'tomorrow at' p",
437
+ nextWeek: "eeee 'at' p",
438
+ other: "P"
439
+ };
440
+ const formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
441
+
442
+ //#endregion
443
+ //#region node_modules/date-fns/locale/_lib/buildLocalizeFn.js
444
+ /**
445
+ * The localize function argument callback which allows to convert raw value to
446
+ * the actual type.
447
+ *
448
+ * @param value - The value to convert
449
+ *
450
+ * @returns The converted value
451
+ */
452
+ /**
453
+ * The map of localized values for each width.
454
+ */
455
+ /**
456
+ * The index type of the locale unit value. It types conversion of units of
457
+ * values that don't start at 0 (i.e. quarters).
458
+ */
459
+ /**
460
+ * Converts the unit value to the tuple of values.
461
+ */
462
+ /**
463
+ * The tuple of localized era values. The first element represents BC,
464
+ * the second element represents AD.
465
+ */
466
+ /**
467
+ * The tuple of localized quarter values. The first element represents Q1.
468
+ */
469
+ /**
470
+ * The tuple of localized day values. The first element represents Sunday.
471
+ */
472
+ /**
473
+ * The tuple of localized month values. The first element represents January.
474
+ */
475
+ function buildLocalizeFn(args) {
476
+ return (value, options) => {
477
+ const context = options?.context ? String(options.context) : "standalone";
478
+ let valuesArray;
479
+ if (context === "formatting" && args.formattingValues) {
480
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
481
+ const width = options?.width ? String(options.width) : defaultWidth;
482
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
483
+ } else {
484
+ const defaultWidth = args.defaultWidth;
485
+ const width = options?.width ? String(options.width) : args.defaultWidth;
486
+ valuesArray = args.values[width] || args.values[defaultWidth];
487
+ }
488
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
489
+ return valuesArray[index];
490
+ };
491
+ }
492
+
493
+ //#endregion
494
+ //#region node_modules/date-fns/locale/en-US/_lib/localize.js
495
+ const eraValues = {
496
+ narrow: ["B", "A"],
497
+ abbreviated: ["BC", "AD"],
498
+ wide: ["Before Christ", "Anno Domini"]
499
+ };
500
+ const quarterValues = {
501
+ narrow: [
502
+ "1",
503
+ "2",
504
+ "3",
505
+ "4"
506
+ ],
507
+ abbreviated: [
508
+ "Q1",
509
+ "Q2",
510
+ "Q3",
511
+ "Q4"
512
+ ],
513
+ wide: [
514
+ "1st quarter",
515
+ "2nd quarter",
516
+ "3rd quarter",
517
+ "4th quarter"
518
+ ]
519
+ };
520
+ const monthValues = {
521
+ narrow: [
522
+ "J",
523
+ "F",
524
+ "M",
525
+ "A",
526
+ "M",
527
+ "J",
528
+ "J",
529
+ "A",
530
+ "S",
531
+ "O",
532
+ "N",
533
+ "D"
534
+ ],
535
+ abbreviated: [
536
+ "Jan",
537
+ "Feb",
538
+ "Mar",
539
+ "Apr",
540
+ "May",
541
+ "Jun",
542
+ "Jul",
543
+ "Aug",
544
+ "Sep",
545
+ "Oct",
546
+ "Nov",
547
+ "Dec"
548
+ ],
549
+ wide: [
550
+ "January",
551
+ "February",
552
+ "March",
553
+ "April",
554
+ "May",
555
+ "June",
556
+ "July",
557
+ "August",
558
+ "September",
559
+ "October",
560
+ "November",
561
+ "December"
562
+ ]
563
+ };
564
+ const dayValues = {
565
+ narrow: [
566
+ "S",
567
+ "M",
568
+ "T",
569
+ "W",
570
+ "T",
571
+ "F",
572
+ "S"
573
+ ],
574
+ short: [
575
+ "Su",
576
+ "Mo",
577
+ "Tu",
578
+ "We",
579
+ "Th",
580
+ "Fr",
581
+ "Sa"
582
+ ],
583
+ abbreviated: [
584
+ "Sun",
585
+ "Mon",
586
+ "Tue",
587
+ "Wed",
588
+ "Thu",
589
+ "Fri",
590
+ "Sat"
591
+ ],
592
+ wide: [
593
+ "Sunday",
594
+ "Monday",
595
+ "Tuesday",
596
+ "Wednesday",
597
+ "Thursday",
598
+ "Friday",
599
+ "Saturday"
600
+ ]
601
+ };
602
+ const dayPeriodValues = {
603
+ narrow: {
604
+ am: "a",
605
+ pm: "p",
606
+ midnight: "mi",
607
+ noon: "n",
608
+ morning: "morning",
609
+ afternoon: "afternoon",
610
+ evening: "evening",
611
+ night: "night"
612
+ },
613
+ abbreviated: {
614
+ am: "AM",
615
+ pm: "PM",
616
+ midnight: "midnight",
617
+ noon: "noon",
618
+ morning: "morning",
619
+ afternoon: "afternoon",
620
+ evening: "evening",
621
+ night: "night"
622
+ },
623
+ wide: {
624
+ am: "a.m.",
625
+ pm: "p.m.",
626
+ midnight: "midnight",
627
+ noon: "noon",
628
+ morning: "morning",
629
+ afternoon: "afternoon",
630
+ evening: "evening",
631
+ night: "night"
632
+ }
633
+ };
634
+ const formattingDayPeriodValues = {
635
+ narrow: {
636
+ am: "a",
637
+ pm: "p",
638
+ midnight: "mi",
639
+ noon: "n",
640
+ morning: "in the morning",
641
+ afternoon: "in the afternoon",
642
+ evening: "in the evening",
643
+ night: "at night"
644
+ },
645
+ abbreviated: {
646
+ am: "AM",
647
+ pm: "PM",
648
+ midnight: "midnight",
649
+ noon: "noon",
650
+ morning: "in the morning",
651
+ afternoon: "in the afternoon",
652
+ evening: "in the evening",
653
+ night: "at night"
654
+ },
655
+ wide: {
656
+ am: "a.m.",
657
+ pm: "p.m.",
658
+ midnight: "midnight",
659
+ noon: "noon",
660
+ morning: "in the morning",
661
+ afternoon: "in the afternoon",
662
+ evening: "in the evening",
663
+ night: "at night"
664
+ }
665
+ };
666
+ const ordinalNumber = (dirtyNumber, _options) => {
667
+ const number = Number(dirtyNumber);
668
+ const rem100 = number % 100;
669
+ if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
670
+ case 1: return number + "st";
671
+ case 2: return number + "nd";
672
+ case 3: return number + "rd";
673
+ }
674
+ return number + "th";
675
+ };
676
+ const localize = {
677
+ ordinalNumber,
678
+ era: buildLocalizeFn({
679
+ values: eraValues,
680
+ defaultWidth: "wide"
681
+ }),
682
+ quarter: buildLocalizeFn({
683
+ values: quarterValues,
684
+ defaultWidth: "wide",
685
+ argumentCallback: (quarter) => quarter - 1
686
+ }),
687
+ month: buildLocalizeFn({
688
+ values: monthValues,
689
+ defaultWidth: "wide"
690
+ }),
691
+ day: buildLocalizeFn({
692
+ values: dayValues,
693
+ defaultWidth: "wide"
694
+ }),
695
+ dayPeriod: buildLocalizeFn({
696
+ values: dayPeriodValues,
697
+ defaultWidth: "wide",
698
+ formattingValues: formattingDayPeriodValues,
699
+ defaultFormattingWidth: "wide"
700
+ })
701
+ };
702
+
703
+ //#endregion
704
+ //#region node_modules/date-fns/locale/_lib/buildMatchFn.js
705
+ function buildMatchFn(args) {
706
+ return (string, options = {}) => {
707
+ const width = options.width;
708
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
709
+ const matchResult = string.match(matchPattern);
710
+ if (!matchResult) return null;
711
+ const matchedString = matchResult[0];
712
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
713
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
714
+ let value;
715
+ value = args.valueCallback ? args.valueCallback(key) : key;
716
+ value = options.valueCallback ? options.valueCallback(value) : value;
717
+ const rest = string.slice(matchedString.length);
718
+ return {
719
+ value,
720
+ rest
721
+ };
722
+ };
723
+ }
724
+ function findKey(object, predicate) {
725
+ for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
726
+ }
727
+ function findIndex(array, predicate) {
728
+ for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
729
+ }
730
+
731
+ //#endregion
732
+ //#region node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
733
+ function buildMatchPatternFn(args) {
734
+ return (string, options = {}) => {
735
+ const matchResult = string.match(args.matchPattern);
736
+ if (!matchResult) return null;
737
+ const matchedString = matchResult[0];
738
+ const parseResult = string.match(args.parsePattern);
739
+ if (!parseResult) return null;
740
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
741
+ value = options.valueCallback ? options.valueCallback(value) : value;
742
+ const rest = string.slice(matchedString.length);
743
+ return {
744
+ value,
745
+ rest
746
+ };
747
+ };
748
+ }
749
+
750
+ //#endregion
751
+ //#region node_modules/date-fns/locale/en-US/_lib/match.js
752
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
753
+ const parseOrdinalNumberPattern = /\d+/i;
754
+ const matchEraPatterns = {
755
+ narrow: /^(b|a)/i,
756
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
757
+ wide: /^(before christ|before common era|anno domini|common era)/i
758
+ };
759
+ const parseEraPatterns = { any: [/^b/i, /^(a|c)/i] };
760
+ const matchQuarterPatterns = {
761
+ narrow: /^[1234]/i,
762
+ abbreviated: /^q[1234]/i,
763
+ wide: /^[1234](th|st|nd|rd)? quarter/i
764
+ };
765
+ const parseQuarterPatterns = { any: [
766
+ /1/i,
767
+ /2/i,
768
+ /3/i,
769
+ /4/i
770
+ ] };
771
+ const matchMonthPatterns = {
772
+ narrow: /^[jfmasond]/i,
773
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
774
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
775
+ };
776
+ const parseMonthPatterns = {
777
+ narrow: [
778
+ /^j/i,
779
+ /^f/i,
780
+ /^m/i,
781
+ /^a/i,
782
+ /^m/i,
783
+ /^j/i,
784
+ /^j/i,
785
+ /^a/i,
786
+ /^s/i,
787
+ /^o/i,
788
+ /^n/i,
789
+ /^d/i
790
+ ],
791
+ any: [
792
+ /^ja/i,
793
+ /^f/i,
794
+ /^mar/i,
795
+ /^ap/i,
796
+ /^may/i,
797
+ /^jun/i,
798
+ /^jul/i,
799
+ /^au/i,
800
+ /^s/i,
801
+ /^o/i,
802
+ /^n/i,
803
+ /^d/i
804
+ ]
805
+ };
806
+ const matchDayPatterns = {
807
+ narrow: /^[smtwf]/i,
808
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
809
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
810
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
811
+ };
812
+ const parseDayPatterns = {
813
+ narrow: [
814
+ /^s/i,
815
+ /^m/i,
816
+ /^t/i,
817
+ /^w/i,
818
+ /^t/i,
819
+ /^f/i,
820
+ /^s/i
821
+ ],
822
+ any: [
823
+ /^su/i,
824
+ /^m/i,
825
+ /^tu/i,
826
+ /^w/i,
827
+ /^th/i,
828
+ /^f/i,
829
+ /^sa/i
830
+ ]
831
+ };
832
+ const matchDayPeriodPatterns = {
833
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
834
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
835
+ };
836
+ const parseDayPeriodPatterns = { any: {
837
+ am: /^a/i,
838
+ pm: /^p/i,
839
+ midnight: /^mi/i,
840
+ noon: /^no/i,
841
+ morning: /morning/i,
842
+ afternoon: /afternoon/i,
843
+ evening: /evening/i,
844
+ night: /night/i
845
+ } };
846
+ const match = {
847
+ ordinalNumber: buildMatchPatternFn({
848
+ matchPattern: matchOrdinalNumberPattern,
849
+ parsePattern: parseOrdinalNumberPattern,
850
+ valueCallback: (value) => parseInt(value, 10)
851
+ }),
852
+ era: buildMatchFn({
853
+ matchPatterns: matchEraPatterns,
854
+ defaultMatchWidth: "wide",
855
+ parsePatterns: parseEraPatterns,
856
+ defaultParseWidth: "any"
857
+ }),
858
+ quarter: buildMatchFn({
859
+ matchPatterns: matchQuarterPatterns,
860
+ defaultMatchWidth: "wide",
861
+ parsePatterns: parseQuarterPatterns,
862
+ defaultParseWidth: "any",
863
+ valueCallback: (index) => index + 1
864
+ }),
865
+ month: buildMatchFn({
866
+ matchPatterns: matchMonthPatterns,
867
+ defaultMatchWidth: "wide",
868
+ parsePatterns: parseMonthPatterns,
869
+ defaultParseWidth: "any"
870
+ }),
871
+ day: buildMatchFn({
872
+ matchPatterns: matchDayPatterns,
873
+ defaultMatchWidth: "wide",
874
+ parsePatterns: parseDayPatterns,
875
+ defaultParseWidth: "any"
876
+ }),
877
+ dayPeriod: buildMatchFn({
878
+ matchPatterns: matchDayPeriodPatterns,
879
+ defaultMatchWidth: "any",
880
+ parsePatterns: parseDayPeriodPatterns,
881
+ defaultParseWidth: "any"
882
+ })
883
+ };
884
+
885
+ //#endregion
886
+ //#region node_modules/date-fns/locale/en-US.js
887
+ /**
888
+ * @category Locales
889
+ * @summary English locale (United States).
890
+ * @language English
891
+ * @iso-639-2 eng
892
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
893
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
894
+ */
895
+ const enUS = {
896
+ code: "en-US",
897
+ formatDistance,
898
+ formatLong,
899
+ formatRelative,
900
+ localize,
901
+ match,
902
+ options: {
903
+ weekStartsOn: 0,
904
+ firstWeekContainsDate: 1
905
+ }
906
+ };
907
+
908
+ //#endregion
909
+ //#region node_modules/date-fns/_lib/defaultOptions.js
910
+ let defaultOptions = {};
911
+ function getDefaultOptions() {
912
+ return defaultOptions;
913
+ }
914
+
915
+ //#endregion
916
+ //#region node_modules/date-fns/startOfYear.js
917
+ /**
918
+ * The {@link startOfYear} function options.
919
+ */
920
+ /**
921
+ * @name startOfYear
922
+ * @category Year Helpers
923
+ * @summary Return the start of a year for the given date.
924
+ *
925
+ * @description
926
+ * Return the start of a year for the given date.
927
+ * The result will be in the local timezone.
928
+ *
929
+ * @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).
930
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
931
+ *
932
+ * @param date - The original date
933
+ * @param options - The options
934
+ *
935
+ * @returns The start of a year
936
+ *
937
+ * @example
938
+ * // The start of a year for 2 September 2014 11:55:00:
939
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
940
+ * //=> Wed Jan 01 2014 00:00:00
941
+ */
942
+ function startOfYear(date, options) {
943
+ const date_ = toDate(date, options?.in);
944
+ date_.setFullYear(date_.getFullYear(), 0, 1);
945
+ date_.setHours(0, 0, 0, 0);
946
+ return date_;
947
+ }
948
+
949
+ //#endregion
950
+ //#region node_modules/date-fns/getDayOfYear.js
951
+ /**
952
+ * The {@link getDayOfYear} function options.
953
+ */
954
+ /**
955
+ * @name getDayOfYear
956
+ * @category Day Helpers
957
+ * @summary Get the day of the year of the given date.
958
+ *
959
+ * @description
960
+ * Get the day of the year of the given date.
961
+ *
962
+ * @param date - The given date
963
+ * @param options - The options
964
+ *
965
+ * @returns The day of year
966
+ *
967
+ * @example
968
+ * // Which day of the year is 2 July 2014?
969
+ * const result = getDayOfYear(new Date(2014, 6, 2))
970
+ * //=> 183
971
+ */
972
+ function getDayOfYear(date, options) {
973
+ const _date = toDate(date, options?.in);
974
+ return differenceInCalendarDays(_date, startOfYear(_date)) + 1;
975
+ }
976
+
977
+ //#endregion
978
+ //#region node_modules/date-fns/startOfWeek.js
979
+ /**
980
+ * The {@link startOfWeek} function options.
981
+ */
982
+ /**
983
+ * @name startOfWeek
984
+ * @category Week Helpers
985
+ * @summary Return the start of a week for the given date.
986
+ *
987
+ * @description
988
+ * Return the start of a week for the given date.
989
+ * The result will be in the local timezone.
990
+ *
991
+ * @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).
992
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
993
+ *
994
+ * @param date - The original date
995
+ * @param options - An object with options
996
+ *
997
+ * @returns The start of a week
998
+ *
999
+ * @example
1000
+ * // The start of a week for 2 September 2014 11:55:00:
1001
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
1002
+ * //=> Sun Aug 31 2014 00:00:00
1003
+ *
1004
+ * @example
1005
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
1006
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
1007
+ * //=> Mon Sep 01 2014 00:00:00
1008
+ */
1009
+ function startOfWeek(date, options) {
1010
+ const defaultOptions = getDefaultOptions();
1011
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
1012
+ const _date = toDate(date, options?.in);
1013
+ const day = _date.getDay();
1014
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1015
+ _date.setDate(_date.getDate() - diff);
1016
+ _date.setHours(0, 0, 0, 0);
1017
+ return _date;
1018
+ }
1019
+
1020
+ //#endregion
1021
+ //#region node_modules/date-fns/startOfISOWeek.js
1022
+ /**
1023
+ * The {@link startOfISOWeek} function options.
1024
+ */
1025
+ /**
1026
+ * @name startOfISOWeek
1027
+ * @category ISO Week Helpers
1028
+ * @summary Return the start of an ISO week for the given date.
1029
+ *
1030
+ * @description
1031
+ * Return the start of an ISO week for the given date.
1032
+ * The result will be in the local timezone.
1033
+ *
1034
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1035
+ *
1036
+ * @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).
1037
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1038
+ *
1039
+ * @param date - The original date
1040
+ * @param options - An object with options
1041
+ *
1042
+ * @returns The start of an ISO week
1043
+ *
1044
+ * @example
1045
+ * // The start of an ISO week for 2 September 2014 11:55:00:
1046
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
1047
+ * //=> Mon Sep 01 2014 00:00:00
1048
+ */
1049
+ function startOfISOWeek(date, options) {
1050
+ return startOfWeek(date, {
1051
+ ...options,
1052
+ weekStartsOn: 1
1053
+ });
1054
+ }
1055
+
1056
+ //#endregion
1057
+ //#region node_modules/date-fns/getISOWeekYear.js
1058
+ /**
1059
+ * The {@link getISOWeekYear} function options.
1060
+ */
1061
+ /**
1062
+ * @name getISOWeekYear
1063
+ * @category ISO Week-Numbering Year Helpers
1064
+ * @summary Get the ISO week-numbering year of the given date.
1065
+ *
1066
+ * @description
1067
+ * Get the ISO week-numbering year of the given date,
1068
+ * which always starts 3 days before the year's first Thursday.
1069
+ *
1070
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1071
+ *
1072
+ * @param date - The given date
1073
+ *
1074
+ * @returns The ISO week-numbering year
1075
+ *
1076
+ * @example
1077
+ * // Which ISO-week numbering year is 2 January 2005?
1078
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
1079
+ * //=> 2004
1080
+ */
1081
+ function getISOWeekYear(date, options) {
1082
+ const _date = toDate(date, options?.in);
1083
+ const year = _date.getFullYear();
1084
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
1085
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
1086
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
1087
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
1088
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
1089
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
1090
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
1091
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
1092
+ if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
1093
+ else if (_date.getTime() >= startOfThisYear.getTime()) return year;
1094
+ else return year - 1;
1095
+ }
1096
+
1097
+ //#endregion
1098
+ //#region node_modules/date-fns/startOfISOWeekYear.js
1099
+ /**
1100
+ * The {@link startOfISOWeekYear} function options.
1101
+ */
1102
+ /**
1103
+ * @name startOfISOWeekYear
1104
+ * @category ISO Week-Numbering Year Helpers
1105
+ * @summary Return the start of an ISO week-numbering year for the given date.
1106
+ *
1107
+ * @description
1108
+ * Return the start of an ISO week-numbering year,
1109
+ * which always starts 3 days before the year's first Thursday.
1110
+ * The result will be in the local timezone.
1111
+ *
1112
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1113
+ *
1114
+ * @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).
1115
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1116
+ *
1117
+ * @param date - The original date
1118
+ * @param options - An object with options
1119
+ *
1120
+ * @returns The start of an ISO week-numbering year
1121
+ *
1122
+ * @example
1123
+ * // The start of an ISO week-numbering year for 2 July 2005:
1124
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
1125
+ * //=> Mon Jan 03 2005 00:00:00
1126
+ */
1127
+ function startOfISOWeekYear(date, options) {
1128
+ const year = getISOWeekYear(date, options);
1129
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
1130
+ fourthOfJanuary.setFullYear(year, 0, 4);
1131
+ fourthOfJanuary.setHours(0, 0, 0, 0);
1132
+ return startOfISOWeek(fourthOfJanuary);
1133
+ }
1134
+
1135
+ //#endregion
1136
+ //#region node_modules/date-fns/getISOWeek.js
1137
+ /**
1138
+ * The {@link getISOWeek} function options.
1139
+ */
1140
+ /**
1141
+ * @name getISOWeek
1142
+ * @category ISO Week Helpers
1143
+ * @summary Get the ISO week of the given date.
1144
+ *
1145
+ * @description
1146
+ * Get the ISO week of the given date.
1147
+ *
1148
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1149
+ *
1150
+ * @param date - The given date
1151
+ * @param options - The options
1152
+ *
1153
+ * @returns The ISO week
1154
+ *
1155
+ * @example
1156
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1157
+ * const result = getISOWeek(new Date(2005, 0, 2))
1158
+ * //=> 53
1159
+ */
1160
+ function getISOWeek(date, options) {
1161
+ const _date = toDate(date, options?.in);
1162
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1163
+ return Math.round(diff / millisecondsInWeek) + 1;
1164
+ }
1165
+
1166
+ //#endregion
1167
+ //#region node_modules/date-fns/getWeekYear.js
1168
+ /**
1169
+ * The {@link getWeekYear} function options.
1170
+ */
1171
+ /**
1172
+ * @name getWeekYear
1173
+ * @category Week-Numbering Year Helpers
1174
+ * @summary Get the local week-numbering year of the given date.
1175
+ *
1176
+ * @description
1177
+ * Get the local week-numbering year of the given date.
1178
+ * The exact calculation depends on the values of
1179
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1180
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1181
+ * the first week of the week-numbering year)
1182
+ *
1183
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1184
+ *
1185
+ * @param date - The given date
1186
+ * @param options - An object with options.
1187
+ *
1188
+ * @returns The local week-numbering year
1189
+ *
1190
+ * @example
1191
+ * // Which week numbering year is 26 December 2004 with the default settings?
1192
+ * const result = getWeekYear(new Date(2004, 11, 26))
1193
+ * //=> 2005
1194
+ *
1195
+ * @example
1196
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1197
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1198
+ * //=> 2004
1199
+ *
1200
+ * @example
1201
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1202
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1203
+ * //=> 2004
1204
+ */
1205
+ function getWeekYear(date, options) {
1206
+ const _date = toDate(date, options?.in);
1207
+ const year = _date.getFullYear();
1208
+ const defaultOptions = getDefaultOptions();
1209
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1210
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1211
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1212
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1213
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1214
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1215
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1216
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1217
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1218
+ if (+_date >= +startOfNextYear) return year + 1;
1219
+ else if (+_date >= +startOfThisYear) return year;
1220
+ else return year - 1;
1221
+ }
1222
+
1223
+ //#endregion
1224
+ //#region node_modules/date-fns/startOfWeekYear.js
1225
+ /**
1226
+ * The {@link startOfWeekYear} function options.
1227
+ */
1228
+ /**
1229
+ * @name startOfWeekYear
1230
+ * @category Week-Numbering Year Helpers
1231
+ * @summary Return the start of a local week-numbering year for the given date.
1232
+ *
1233
+ * @description
1234
+ * Return the start of a local week-numbering year.
1235
+ * The exact calculation depends on the values of
1236
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1237
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1238
+ * the first week of the week-numbering year)
1239
+ *
1240
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1241
+ *
1242
+ * @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).
1243
+ * @typeParam ResultDate - The result `Date` type.
1244
+ *
1245
+ * @param date - The original date
1246
+ * @param options - An object with options
1247
+ *
1248
+ * @returns The start of a week-numbering year
1249
+ *
1250
+ * @example
1251
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1252
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1253
+ * //=> Sun Dec 26 2004 00:00:00
1254
+ *
1255
+ * @example
1256
+ * // The start of a week-numbering year for 2 July 2005
1257
+ * // if Monday is the first day of week
1258
+ * // and 4 January is always in the first week of the year:
1259
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1260
+ * weekStartsOn: 1,
1261
+ * firstWeekContainsDate: 4
1262
+ * })
1263
+ * //=> Mon Jan 03 2005 00:00:00
1264
+ */
1265
+ function startOfWeekYear(date, options) {
1266
+ const defaultOptions = getDefaultOptions();
1267
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1268
+ const year = getWeekYear(date, options);
1269
+ const firstWeek = constructFrom(options?.in || date, 0);
1270
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1271
+ firstWeek.setHours(0, 0, 0, 0);
1272
+ return startOfWeek(firstWeek, options);
1273
+ }
1274
+
1275
+ //#endregion
1276
+ //#region node_modules/date-fns/getWeek.js
1277
+ /**
1278
+ * The {@link getWeek} function options.
1279
+ */
1280
+ /**
1281
+ * @name getWeek
1282
+ * @category Week Helpers
1283
+ * @summary Get the local week index of the given date.
1284
+ *
1285
+ * @description
1286
+ * Get the local week index of the given date.
1287
+ * The exact calculation depends on the values of
1288
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1289
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1290
+ * the first week of the week-numbering year)
1291
+ *
1292
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1293
+ *
1294
+ * @param date - The given date
1295
+ * @param options - An object with options
1296
+ *
1297
+ * @returns The week
1298
+ *
1299
+ * @example
1300
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1301
+ * const result = getWeek(new Date(2005, 0, 2))
1302
+ * //=> 2
1303
+ *
1304
+ * @example
1305
+ * // Which week of the local week numbering year is 2 January 2005,
1306
+ * // if Monday is the first day of the week,
1307
+ * // and the first week of the year always contains 4 January?
1308
+ * const result = getWeek(new Date(2005, 0, 2), {
1309
+ * weekStartsOn: 1,
1310
+ * firstWeekContainsDate: 4
1311
+ * })
1312
+ * //=> 53
1313
+ */
1314
+ function getWeek(date, options) {
1315
+ const _date = toDate(date, options?.in);
1316
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1317
+ return Math.round(diff / millisecondsInWeek) + 1;
1318
+ }
1319
+
1320
+ //#endregion
1321
+ //#region node_modules/date-fns/_lib/addLeadingZeros.js
1322
+ function addLeadingZeros(number, targetLength) {
1323
+ return (number < 0 ? "-" : "") + Math.abs(number).toString().padStart(targetLength, "0");
1324
+ }
1325
+
1326
+ //#endregion
1327
+ //#region node_modules/date-fns/_lib/format/lightFormatters.js
1328
+ const lightFormatters = {
1329
+ y(date, token) {
1330
+ const signedYear = date.getFullYear();
1331
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1332
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1333
+ },
1334
+ M(date, token) {
1335
+ const month = date.getMonth();
1336
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1337
+ },
1338
+ d(date, token) {
1339
+ return addLeadingZeros(date.getDate(), token.length);
1340
+ },
1341
+ a(date, token) {
1342
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1343
+ switch (token) {
1344
+ case "a":
1345
+ case "aa": return dayPeriodEnumValue.toUpperCase();
1346
+ case "aaa": return dayPeriodEnumValue;
1347
+ case "aaaaa": return dayPeriodEnumValue[0];
1348
+ default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1349
+ }
1350
+ },
1351
+ h(date, token) {
1352
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1353
+ },
1354
+ H(date, token) {
1355
+ return addLeadingZeros(date.getHours(), token.length);
1356
+ },
1357
+ m(date, token) {
1358
+ return addLeadingZeros(date.getMinutes(), token.length);
1359
+ },
1360
+ s(date, token) {
1361
+ return addLeadingZeros(date.getSeconds(), token.length);
1362
+ },
1363
+ S(date, token) {
1364
+ const numberOfDigits = token.length;
1365
+ const milliseconds = date.getMilliseconds();
1366
+ return addLeadingZeros(Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3)), token.length);
1367
+ }
1368
+ };
1369
+
1370
+ //#endregion
1371
+ //#region node_modules/date-fns/_lib/format/formatters.js
1372
+ const dayPeriodEnum = {
1373
+ am: "am",
1374
+ pm: "pm",
1375
+ midnight: "midnight",
1376
+ noon: "noon",
1377
+ morning: "morning",
1378
+ afternoon: "afternoon",
1379
+ evening: "evening",
1380
+ night: "night"
1381
+ };
1382
+ const formatters = {
1383
+ G: function(date, token, localize) {
1384
+ const era = date.getFullYear() > 0 ? 1 : 0;
1385
+ switch (token) {
1386
+ case "G":
1387
+ case "GG":
1388
+ case "GGG": return localize.era(era, { width: "abbreviated" });
1389
+ case "GGGGG": return localize.era(era, { width: "narrow" });
1390
+ default: return localize.era(era, { width: "wide" });
1391
+ }
1392
+ },
1393
+ y: function(date, token, localize) {
1394
+ if (token === "yo") {
1395
+ const signedYear = date.getFullYear();
1396
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1397
+ return localize.ordinalNumber(year, { unit: "year" });
1398
+ }
1399
+ return lightFormatters.y(date, token);
1400
+ },
1401
+ Y: function(date, token, localize, options) {
1402
+ const signedWeekYear = getWeekYear(date, options);
1403
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1404
+ if (token === "YY") return addLeadingZeros(weekYear % 100, 2);
1405
+ if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
1406
+ return addLeadingZeros(weekYear, token.length);
1407
+ },
1408
+ R: function(date, token) {
1409
+ return addLeadingZeros(getISOWeekYear(date), token.length);
1410
+ },
1411
+ u: function(date, token) {
1412
+ return addLeadingZeros(date.getFullYear(), token.length);
1413
+ },
1414
+ Q: function(date, token, localize) {
1415
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1416
+ switch (token) {
1417
+ case "Q": return String(quarter);
1418
+ case "QQ": return addLeadingZeros(quarter, 2);
1419
+ case "Qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1420
+ case "QQQ": return localize.quarter(quarter, {
1421
+ width: "abbreviated",
1422
+ context: "formatting"
1423
+ });
1424
+ case "QQQQQ": return localize.quarter(quarter, {
1425
+ width: "narrow",
1426
+ context: "formatting"
1427
+ });
1428
+ default: return localize.quarter(quarter, {
1429
+ width: "wide",
1430
+ context: "formatting"
1431
+ });
1432
+ }
1433
+ },
1434
+ q: function(date, token, localize) {
1435
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1436
+ switch (token) {
1437
+ case "q": return String(quarter);
1438
+ case "qq": return addLeadingZeros(quarter, 2);
1439
+ case "qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1440
+ case "qqq": return localize.quarter(quarter, {
1441
+ width: "abbreviated",
1442
+ context: "standalone"
1443
+ });
1444
+ case "qqqqq": return localize.quarter(quarter, {
1445
+ width: "narrow",
1446
+ context: "standalone"
1447
+ });
1448
+ default: return localize.quarter(quarter, {
1449
+ width: "wide",
1450
+ context: "standalone"
1451
+ });
1452
+ }
1453
+ },
1454
+ M: function(date, token, localize) {
1455
+ const month = date.getMonth();
1456
+ switch (token) {
1457
+ case "M":
1458
+ case "MM": return lightFormatters.M(date, token);
1459
+ case "Mo": return localize.ordinalNumber(month + 1, { unit: "month" });
1460
+ case "MMM": return localize.month(month, {
1461
+ width: "abbreviated",
1462
+ context: "formatting"
1463
+ });
1464
+ case "MMMMM": return localize.month(month, {
1465
+ width: "narrow",
1466
+ context: "formatting"
1467
+ });
1468
+ default: return localize.month(month, {
1469
+ width: "wide",
1470
+ context: "formatting"
1471
+ });
1472
+ }
1473
+ },
1474
+ L: function(date, token, localize) {
1475
+ const month = date.getMonth();
1476
+ switch (token) {
1477
+ case "L": return String(month + 1);
1478
+ case "LL": return addLeadingZeros(month + 1, 2);
1479
+ case "Lo": return localize.ordinalNumber(month + 1, { unit: "month" });
1480
+ case "LLL": return localize.month(month, {
1481
+ width: "abbreviated",
1482
+ context: "standalone"
1483
+ });
1484
+ case "LLLLL": return localize.month(month, {
1485
+ width: "narrow",
1486
+ context: "standalone"
1487
+ });
1488
+ default: return localize.month(month, {
1489
+ width: "wide",
1490
+ context: "standalone"
1491
+ });
1492
+ }
1493
+ },
1494
+ w: function(date, token, localize, options) {
1495
+ const week = getWeek(date, options);
1496
+ if (token === "wo") return localize.ordinalNumber(week, { unit: "week" });
1497
+ return addLeadingZeros(week, token.length);
1498
+ },
1499
+ I: function(date, token, localize) {
1500
+ const isoWeek = getISOWeek(date);
1501
+ if (token === "Io") return localize.ordinalNumber(isoWeek, { unit: "week" });
1502
+ return addLeadingZeros(isoWeek, token.length);
1503
+ },
1504
+ d: function(date, token, localize) {
1505
+ if (token === "do") return localize.ordinalNumber(date.getDate(), { unit: "date" });
1506
+ return lightFormatters.d(date, token);
1507
+ },
1508
+ D: function(date, token, localize) {
1509
+ const dayOfYear = getDayOfYear(date);
1510
+ if (token === "Do") return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
1511
+ return addLeadingZeros(dayOfYear, token.length);
1512
+ },
1513
+ E: function(date, token, localize) {
1514
+ const dayOfWeek = date.getDay();
1515
+ switch (token) {
1516
+ case "E":
1517
+ case "EE":
1518
+ case "EEE": return localize.day(dayOfWeek, {
1519
+ width: "abbreviated",
1520
+ context: "formatting"
1521
+ });
1522
+ case "EEEEE": return localize.day(dayOfWeek, {
1523
+ width: "narrow",
1524
+ context: "formatting"
1525
+ });
1526
+ case "EEEEEE": return localize.day(dayOfWeek, {
1527
+ width: "short",
1528
+ context: "formatting"
1529
+ });
1530
+ default: return localize.day(dayOfWeek, {
1531
+ width: "wide",
1532
+ context: "formatting"
1533
+ });
1534
+ }
1535
+ },
1536
+ e: function(date, token, localize, options) {
1537
+ const dayOfWeek = date.getDay();
1538
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1539
+ switch (token) {
1540
+ case "e": return String(localDayOfWeek);
1541
+ case "ee": return addLeadingZeros(localDayOfWeek, 2);
1542
+ case "eo": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1543
+ case "eee": return localize.day(dayOfWeek, {
1544
+ width: "abbreviated",
1545
+ context: "formatting"
1546
+ });
1547
+ case "eeeee": return localize.day(dayOfWeek, {
1548
+ width: "narrow",
1549
+ context: "formatting"
1550
+ });
1551
+ case "eeeeee": return localize.day(dayOfWeek, {
1552
+ width: "short",
1553
+ context: "formatting"
1554
+ });
1555
+ default: return localize.day(dayOfWeek, {
1556
+ width: "wide",
1557
+ context: "formatting"
1558
+ });
1559
+ }
1560
+ },
1561
+ c: function(date, token, localize, options) {
1562
+ const dayOfWeek = date.getDay();
1563
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1564
+ switch (token) {
1565
+ case "c": return String(localDayOfWeek);
1566
+ case "cc": return addLeadingZeros(localDayOfWeek, token.length);
1567
+ case "co": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1568
+ case "ccc": return localize.day(dayOfWeek, {
1569
+ width: "abbreviated",
1570
+ context: "standalone"
1571
+ });
1572
+ case "ccccc": return localize.day(dayOfWeek, {
1573
+ width: "narrow",
1574
+ context: "standalone"
1575
+ });
1576
+ case "cccccc": return localize.day(dayOfWeek, {
1577
+ width: "short",
1578
+ context: "standalone"
1579
+ });
1580
+ default: return localize.day(dayOfWeek, {
1581
+ width: "wide",
1582
+ context: "standalone"
1583
+ });
1584
+ }
1585
+ },
1586
+ i: function(date, token, localize) {
1587
+ const dayOfWeek = date.getDay();
1588
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1589
+ switch (token) {
1590
+ case "i": return String(isoDayOfWeek);
1591
+ case "ii": return addLeadingZeros(isoDayOfWeek, token.length);
1592
+ case "io": return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
1593
+ case "iii": return localize.day(dayOfWeek, {
1594
+ width: "abbreviated",
1595
+ context: "formatting"
1596
+ });
1597
+ case "iiiii": return localize.day(dayOfWeek, {
1598
+ width: "narrow",
1599
+ context: "formatting"
1600
+ });
1601
+ case "iiiiii": 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
+ a: function(date, token, localize) {
1612
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1613
+ switch (token) {
1614
+ case "a":
1615
+ case "aa": return localize.dayPeriod(dayPeriodEnumValue, {
1616
+ width: "abbreviated",
1617
+ context: "formatting"
1618
+ });
1619
+ case "aaa": return localize.dayPeriod(dayPeriodEnumValue, {
1620
+ width: "abbreviated",
1621
+ context: "formatting"
1622
+ }).toLowerCase();
1623
+ case "aaaaa": return localize.dayPeriod(dayPeriodEnumValue, {
1624
+ width: "narrow",
1625
+ context: "formatting"
1626
+ });
1627
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1628
+ width: "wide",
1629
+ context: "formatting"
1630
+ });
1631
+ }
1632
+ },
1633
+ b: function(date, token, localize) {
1634
+ const hours = date.getHours();
1635
+ let dayPeriodEnumValue;
1636
+ if (hours === 12) dayPeriodEnumValue = dayPeriodEnum.noon;
1637
+ else if (hours === 0) dayPeriodEnumValue = dayPeriodEnum.midnight;
1638
+ else dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1639
+ switch (token) {
1640
+ case "b":
1641
+ case "bb": return localize.dayPeriod(dayPeriodEnumValue, {
1642
+ width: "abbreviated",
1643
+ context: "formatting"
1644
+ });
1645
+ case "bbb": return localize.dayPeriod(dayPeriodEnumValue, {
1646
+ width: "abbreviated",
1647
+ context: "formatting"
1648
+ }).toLowerCase();
1649
+ case "bbbbb": return localize.dayPeriod(dayPeriodEnumValue, {
1650
+ width: "narrow",
1651
+ context: "formatting"
1652
+ });
1653
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1654
+ width: "wide",
1655
+ context: "formatting"
1656
+ });
1657
+ }
1658
+ },
1659
+ B: function(date, token, localize) {
1660
+ const hours = date.getHours();
1661
+ let dayPeriodEnumValue;
1662
+ if (hours >= 17) dayPeriodEnumValue = dayPeriodEnum.evening;
1663
+ else if (hours >= 12) dayPeriodEnumValue = dayPeriodEnum.afternoon;
1664
+ else if (hours >= 4) dayPeriodEnumValue = dayPeriodEnum.morning;
1665
+ else dayPeriodEnumValue = dayPeriodEnum.night;
1666
+ switch (token) {
1667
+ case "B":
1668
+ case "BB":
1669
+ case "BBB": return localize.dayPeriod(dayPeriodEnumValue, {
1670
+ width: "abbreviated",
1671
+ context: "formatting"
1672
+ });
1673
+ case "BBBBB": return localize.dayPeriod(dayPeriodEnumValue, {
1674
+ width: "narrow",
1675
+ context: "formatting"
1676
+ });
1677
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1678
+ width: "wide",
1679
+ context: "formatting"
1680
+ });
1681
+ }
1682
+ },
1683
+ h: function(date, token, localize) {
1684
+ if (token === "ho") {
1685
+ let hours = date.getHours() % 12;
1686
+ if (hours === 0) hours = 12;
1687
+ return localize.ordinalNumber(hours, { unit: "hour" });
1688
+ }
1689
+ return lightFormatters.h(date, token);
1690
+ },
1691
+ H: function(date, token, localize) {
1692
+ if (token === "Ho") return localize.ordinalNumber(date.getHours(), { unit: "hour" });
1693
+ return lightFormatters.H(date, token);
1694
+ },
1695
+ K: function(date, token, localize) {
1696
+ const hours = date.getHours() % 12;
1697
+ if (token === "Ko") return localize.ordinalNumber(hours, { unit: "hour" });
1698
+ return addLeadingZeros(hours, token.length);
1699
+ },
1700
+ k: function(date, token, localize) {
1701
+ let hours = date.getHours();
1702
+ if (hours === 0) hours = 24;
1703
+ if (token === "ko") return localize.ordinalNumber(hours, { unit: "hour" });
1704
+ return addLeadingZeros(hours, token.length);
1705
+ },
1706
+ m: function(date, token, localize) {
1707
+ if (token === "mo") return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
1708
+ return lightFormatters.m(date, token);
1709
+ },
1710
+ s: function(date, token, localize) {
1711
+ if (token === "so") return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
1712
+ return lightFormatters.s(date, token);
1713
+ },
1714
+ S: function(date, token) {
1715
+ return lightFormatters.S(date, token);
1716
+ },
1717
+ X: function(date, token, _localize) {
1718
+ const timezoneOffset = date.getTimezoneOffset();
1719
+ if (timezoneOffset === 0) return "Z";
1720
+ switch (token) {
1721
+ case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1722
+ case "XXXX":
1723
+ case "XX": return formatTimezone(timezoneOffset);
1724
+ default: return formatTimezone(timezoneOffset, ":");
1725
+ }
1726
+ },
1727
+ x: function(date, token, _localize) {
1728
+ const timezoneOffset = date.getTimezoneOffset();
1729
+ switch (token) {
1730
+ case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1731
+ case "xxxx":
1732
+ case "xx": return formatTimezone(timezoneOffset);
1733
+ default: return formatTimezone(timezoneOffset, ":");
1734
+ }
1735
+ },
1736
+ O: function(date, token, _localize) {
1737
+ const timezoneOffset = date.getTimezoneOffset();
1738
+ switch (token) {
1739
+ case "O":
1740
+ case "OO":
1741
+ case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1742
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1743
+ }
1744
+ },
1745
+ z: function(date, token, _localize) {
1746
+ const timezoneOffset = date.getTimezoneOffset();
1747
+ switch (token) {
1748
+ case "z":
1749
+ case "zz":
1750
+ case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1751
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1752
+ }
1753
+ },
1754
+ t: function(date, token, _localize) {
1755
+ return addLeadingZeros(Math.trunc(+date / 1e3), token.length);
1756
+ },
1757
+ T: function(date, token, _localize) {
1758
+ return addLeadingZeros(+date, token.length);
1759
+ }
1760
+ };
1761
+ function formatTimezoneShort(offset, delimiter = "") {
1762
+ const sign = offset > 0 ? "-" : "+";
1763
+ const absOffset = Math.abs(offset);
1764
+ const hours = Math.trunc(absOffset / 60);
1765
+ const minutes = absOffset % 60;
1766
+ if (minutes === 0) return sign + String(hours);
1767
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1768
+ }
1769
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1770
+ if (offset % 60 === 0) return (offset > 0 ? "-" : "+") + addLeadingZeros(Math.abs(offset) / 60, 2);
1771
+ return formatTimezone(offset, delimiter);
1772
+ }
1773
+ function formatTimezone(offset, delimiter = "") {
1774
+ const sign = offset > 0 ? "-" : "+";
1775
+ const absOffset = Math.abs(offset);
1776
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1777
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1778
+ return sign + hours + delimiter + minutes;
1779
+ }
1780
+
1781
+ //#endregion
1782
+ //#region node_modules/date-fns/_lib/format/longFormatters.js
1783
+ const dateLongFormatter = (pattern, formatLong) => {
1784
+ switch (pattern) {
1785
+ case "P": return formatLong.date({ width: "short" });
1786
+ case "PP": return formatLong.date({ width: "medium" });
1787
+ case "PPP": return formatLong.date({ width: "long" });
1788
+ default: return formatLong.date({ width: "full" });
1789
+ }
1790
+ };
1791
+ const timeLongFormatter = (pattern, formatLong) => {
1792
+ switch (pattern) {
1793
+ case "p": return formatLong.time({ width: "short" });
1794
+ case "pp": return formatLong.time({ width: "medium" });
1795
+ case "ppp": return formatLong.time({ width: "long" });
1796
+ default: return formatLong.time({ width: "full" });
1797
+ }
1798
+ };
1799
+ const dateTimeLongFormatter = (pattern, formatLong) => {
1800
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1801
+ const datePattern = matchResult[1];
1802
+ const timePattern = matchResult[2];
1803
+ if (!timePattern) return dateLongFormatter(pattern, formatLong);
1804
+ let dateTimeFormat;
1805
+ switch (datePattern) {
1806
+ case "P":
1807
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
1808
+ break;
1809
+ case "PP":
1810
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
1811
+ break;
1812
+ case "PPP":
1813
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
1814
+ break;
1815
+ default:
1816
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
1817
+ break;
1818
+ }
1819
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
1820
+ };
1821
+ const longFormatters = {
1822
+ p: timeLongFormatter,
1823
+ P: dateTimeLongFormatter
1824
+ };
1825
+
1826
+ //#endregion
1827
+ //#region node_modules/date-fns/_lib/protectedTokens.js
1828
+ const dayOfYearTokenRE = /^D+$/;
1829
+ const weekYearTokenRE = /^Y+$/;
1830
+ const throwTokens = [
1831
+ "D",
1832
+ "DD",
1833
+ "YY",
1834
+ "YYYY"
1835
+ ];
1836
+ function isProtectedDayOfYearToken(token) {
1837
+ return dayOfYearTokenRE.test(token);
1838
+ }
1839
+ function isProtectedWeekYearToken(token) {
1840
+ return weekYearTokenRE.test(token);
1841
+ }
1842
+ function warnOrThrowProtectedError(token, format, input) {
1843
+ const _message = message(token, format, input);
1844
+ console.warn(_message);
1845
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1846
+ }
1847
+ function message(token, format, input) {
1848
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1849
+ 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`;
1850
+ }
1851
+
1852
+ //#endregion
1853
+ //#region node_modules/date-fns/isDate.js
1854
+ /**
1855
+ * @name isDate
1856
+ * @category Common Helpers
1857
+ * @summary Is the given value a date?
1858
+ *
1859
+ * @description
1860
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
1861
+ *
1862
+ * @param value - The value to check
1863
+ *
1864
+ * @returns True if the given value is a date
1865
+ *
1866
+ * @example
1867
+ * // For a valid date:
1868
+ * const result = isDate(new Date())
1869
+ * //=> true
1870
+ *
1871
+ * @example
1872
+ * // For an invalid date:
1873
+ * const result = isDate(new Date(NaN))
1874
+ * //=> true
1875
+ *
1876
+ * @example
1877
+ * // For some value:
1878
+ * const result = isDate('2014-02-31')
1879
+ * //=> false
1880
+ *
1881
+ * @example
1882
+ * // For an object:
1883
+ * const result = isDate({})
1884
+ * //=> false
1885
+ */
1886
+ function isDate(value) {
1887
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
1888
+ }
1889
+
1890
+ //#endregion
1891
+ //#region node_modules/date-fns/isValid.js
1892
+ /**
1893
+ * @name isValid
1894
+ * @category Common Helpers
1895
+ * @summary Is the given date valid?
1896
+ *
1897
+ * @description
1898
+ * Returns false if argument is Invalid Date and true otherwise.
1899
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
1900
+ * Invalid Date is a Date, whose time value is NaN.
1901
+ *
1902
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
1903
+ *
1904
+ * @param date - The date to check
1905
+ *
1906
+ * @returns The date is valid
1907
+ *
1908
+ * @example
1909
+ * // For the valid date:
1910
+ * const result = isValid(new Date(2014, 1, 31))
1911
+ * //=> true
1912
+ *
1913
+ * @example
1914
+ * // For the value, convertible into a date:
1915
+ * const result = isValid(1393804800000)
1916
+ * //=> true
1917
+ *
1918
+ * @example
1919
+ * // For the invalid date:
1920
+ * const result = isValid(new Date(''))
1921
+ * //=> false
1922
+ */
1923
+ function isValid(date) {
1924
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
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 };