@sbb-esta/lyne-elements-experimental-dev 0.0.0 → 4.5.1-dev.1771859300

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 (249) hide show
  1. package/README.md +55 -0
  2. package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +86 -0
  3. package/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +54 -0
  4. package/autocomplete-grid/autocomplete-grid-button.js +4 -0
  5. package/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +25 -0
  6. package/autocomplete-grid/autocomplete-grid-cell.js +4 -0
  7. package/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +29 -0
  8. package/autocomplete-grid/autocomplete-grid-optgroup.js +4 -0
  9. package/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +41 -0
  10. package/autocomplete-grid/autocomplete-grid-option.js +5 -0
  11. package/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +28 -0
  12. package/autocomplete-grid/autocomplete-grid-row.js +4 -0
  13. package/autocomplete-grid/autocomplete-grid.js +4 -0
  14. package/autocomplete-grid.js +15 -0
  15. package/core/datetime/date-helper.js +191 -0
  16. package/core/datetime.js +5 -0
  17. package/core/timetable/access-leg-helper.js +91 -0
  18. package/core/timetable/timetable-helper.js +12 -0
  19. package/core/timetable/timetable-properties.js +1 -0
  20. package/core/timetable.js +8 -0
  21. package/custom-elements.json +8211 -0
  22. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts +39 -0
  23. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -0
  24. package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +141 -0
  25. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts +31 -0
  26. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.d.ts.map +1 -0
  27. package/development/autocomplete-grid/autocomplete-grid-button/autocomplete-grid-button.component.js +82 -0
  28. package/development/autocomplete-grid/autocomplete-grid-button.d.ts +5 -0
  29. package/development/autocomplete-grid/autocomplete-grid-button.d.ts.map +1 -0
  30. package/development/autocomplete-grid/autocomplete-grid-button.js +5 -0
  31. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts +19 -0
  32. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.d.ts.map +1 -0
  33. package/development/autocomplete-grid/autocomplete-grid-cell/autocomplete-grid-cell.component.js +40 -0
  34. package/development/autocomplete-grid/autocomplete-grid-cell.d.ts +5 -0
  35. package/development/autocomplete-grid/autocomplete-grid-cell.d.ts.map +1 -0
  36. package/development/autocomplete-grid/autocomplete-grid-cell.js +5 -0
  37. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts +19 -0
  38. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.d.ts.map +1 -0
  39. package/development/autocomplete-grid/autocomplete-grid-optgroup/autocomplete-grid-optgroup.component.js +40 -0
  40. package/development/autocomplete-grid/autocomplete-grid-optgroup.d.ts +5 -0
  41. package/development/autocomplete-grid/autocomplete-grid-optgroup.d.ts.map +1 -0
  42. package/development/autocomplete-grid/autocomplete-grid-optgroup.js +5 -0
  43. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts +26 -0
  44. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.d.ts.map +1 -0
  45. package/development/autocomplete-grid/autocomplete-grid-option/autocomplete-grid-option.component.js +134 -0
  46. package/development/autocomplete-grid/autocomplete-grid-option.d.ts +5 -0
  47. package/development/autocomplete-grid/autocomplete-grid-option.d.ts.map +1 -0
  48. package/development/autocomplete-grid/autocomplete-grid-option.js +6 -0
  49. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts +20 -0
  50. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.d.ts.map +1 -0
  51. package/development/autocomplete-grid/autocomplete-grid-row/autocomplete-grid-row.component.js +115 -0
  52. package/development/autocomplete-grid/autocomplete-grid-row.d.ts +5 -0
  53. package/development/autocomplete-grid/autocomplete-grid-row.d.ts.map +1 -0
  54. package/development/autocomplete-grid/autocomplete-grid-row.js +5 -0
  55. package/development/autocomplete-grid/autocomplete-grid.d.ts +5 -0
  56. package/development/autocomplete-grid/autocomplete-grid.d.ts.map +1 -0
  57. package/development/autocomplete-grid/autocomplete-grid.js +5 -0
  58. package/development/autocomplete-grid.d.ts +10 -0
  59. package/development/autocomplete-grid.d.ts.map +1 -0
  60. package/development/autocomplete-grid.js +16 -0
  61. package/development/core/datetime/date-helper.d.ts +27 -0
  62. package/development/core/datetime/date-helper.d.ts.map +1 -0
  63. package/development/core/datetime/date-helper.js +285 -0
  64. package/development/core/datetime.d.ts +5 -0
  65. package/development/core/datetime.d.ts.map +1 -0
  66. package/development/core/datetime.js +6 -0
  67. package/development/core/timetable/access-leg-helper.d.ts +26 -0
  68. package/development/core/timetable/access-leg-helper.d.ts.map +1 -0
  69. package/development/core/timetable/access-leg-helper.js +125 -0
  70. package/development/core/timetable/timetable-helper.d.ts +12 -0
  71. package/development/core/timetable/timetable-helper.d.ts.map +1 -0
  72. package/development/core/timetable/timetable-helper.js +20 -0
  73. package/development/core/timetable/timetable-properties.d.ts +308 -0
  74. package/development/core/timetable/timetable-properties.d.ts.map +1 -0
  75. package/development/core/timetable/timetable-properties.js +2 -0
  76. package/development/core/timetable.d.ts +7 -0
  77. package/development/core/timetable.d.ts.map +1 -0
  78. package/development/core/timetable.js +9 -0
  79. package/development/differenceInMinutes-B0dawX-5.js +26 -0
  80. package/development/format-BMkeaqaF.js +1433 -0
  81. package/development/isValid-BYRch7pV.js +53 -0
  82. package/development/journey-summary/journey-summary.component.d.ts +65 -0
  83. package/development/journey-summary/journey-summary.component.d.ts.map +1 -0
  84. package/development/journey-summary/journey-summary.component.js +294 -0
  85. package/development/journey-summary.d.ts +5 -0
  86. package/development/journey-summary.d.ts.map +1 -0
  87. package/development/journey-summary.js +5 -0
  88. package/development/pearl-chain/pearl-chain.component.d.ts +42 -0
  89. package/development/pearl-chain/pearl-chain.component.d.ts.map +1 -0
  90. package/development/pearl-chain/pearl-chain.component.js +639 -0
  91. package/development/pearl-chain-time/pearl-chain-time.component.d.ts +47 -0
  92. package/development/pearl-chain-time/pearl-chain-time.component.d.ts.map +1 -0
  93. package/development/pearl-chain-time/pearl-chain-time.component.js +312 -0
  94. package/development/pearl-chain-time.d.ts +5 -0
  95. package/development/pearl-chain-time.d.ts.map +1 -0
  96. package/development/pearl-chain-time.js +5 -0
  97. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts +16 -0
  98. package/development/pearl-chain-vertical/pearl-chain-vertical.component.d.ts.map +1 -0
  99. package/development/pearl-chain-vertical/pearl-chain-vertical.component.js +40 -0
  100. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts +34 -0
  101. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.d.ts.map +1 -0
  102. package/development/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +398 -0
  103. package/development/pearl-chain-vertical-item.d.ts +5 -0
  104. package/development/pearl-chain-vertical-item.d.ts.map +1 -0
  105. package/development/pearl-chain-vertical-item.js +5 -0
  106. package/development/pearl-chain-vertical.d.ts +5 -0
  107. package/development/pearl-chain-vertical.d.ts.map +1 -0
  108. package/development/pearl-chain-vertical.js +5 -0
  109. package/development/pearl-chain.d.ts +5 -0
  110. package/development/pearl-chain.d.ts.map +1 -0
  111. package/development/pearl-chain.js +5 -0
  112. package/development/seat-reservation/common/mapper/icon-mapper.d.ts +106 -0
  113. package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -0
  114. package/development/seat-reservation/common/mapper/icon-mapper.js +72 -0
  115. package/development/seat-reservation/common/mapper/mapper.d.ts +34 -0
  116. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -0
  117. package/development/seat-reservation/common/mapper/mapper.js +129 -0
  118. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +372 -0
  119. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -0
  120. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +31673 -0
  121. package/development/seat-reservation/common/mapper.d.ts +3 -0
  122. package/development/seat-reservation/common/mapper.d.ts.map +1 -0
  123. package/development/seat-reservation/common/mapper.js +10 -0
  124. package/development/seat-reservation/common/svgs.d.ts +24 -0
  125. package/development/seat-reservation/common/svgs.d.ts.map +1 -0
  126. package/development/seat-reservation/common/svgs.js +46 -0
  127. package/development/seat-reservation/common/translations/i18n.d.ts +28 -0
  128. package/development/seat-reservation/common/translations/i18n.d.ts.map +1 -0
  129. package/development/seat-reservation/common/translations/i18n.js +871 -0
  130. package/development/seat-reservation/common/translations.d.ts +2 -0
  131. package/development/seat-reservation/common/translations.d.ts.map +1 -0
  132. package/development/seat-reservation/common/translations.js +5 -0
  133. package/development/seat-reservation/common/types.d.ts +97 -0
  134. package/development/seat-reservation/common/types.d.ts.map +1 -0
  135. package/development/seat-reservation/common/types.js +2 -0
  136. package/development/seat-reservation/common.d.ts +8 -0
  137. package/development/seat-reservation/common.d.ts.map +1 -0
  138. package/development/seat-reservation/common.js +14 -0
  139. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +273 -0
  140. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -0
  141. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +1171 -0
  142. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +75 -0
  143. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -0
  144. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +832 -0
  145. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts +18 -0
  146. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.d.ts.map +1 -0
  147. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +112 -0
  148. package/development/seat-reservation/seat-reservation-area.d.ts +5 -0
  149. package/development/seat-reservation/seat-reservation-area.d.ts.map +1 -0
  150. package/development/seat-reservation/seat-reservation-area.js +5 -0
  151. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts +9 -0
  152. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.d.ts.map +1 -0
  153. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +303 -0
  154. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts +20 -0
  155. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.d.ts.map +1 -0
  156. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +167 -0
  157. package/development/seat-reservation/seat-reservation-graphic.d.ts +5 -0
  158. package/development/seat-reservation/seat-reservation-graphic.d.ts.map +1 -0
  159. package/development/seat-reservation/seat-reservation-graphic.js +5 -0
  160. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts +65 -0
  161. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.d.ts.map +1 -0
  162. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +798 -0
  163. package/development/seat-reservation/seat-reservation-navigation-coach.d.ts +5 -0
  164. package/development/seat-reservation/seat-reservation-navigation-coach.d.ts.map +1 -0
  165. package/development/seat-reservation/seat-reservation-navigation-coach.js +5 -0
  166. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts +21 -0
  167. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.d.ts.map +1 -0
  168. package/development/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +120 -0
  169. package/development/seat-reservation/seat-reservation-navigation-services.d.ts +5 -0
  170. package/development/seat-reservation/seat-reservation-navigation-services.d.ts.map +1 -0
  171. package/development/seat-reservation/seat-reservation-navigation-services.js +5 -0
  172. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +42 -0
  173. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -0
  174. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +462 -0
  175. package/development/seat-reservation/seat-reservation-place-control.d.ts +5 -0
  176. package/development/seat-reservation/seat-reservation-place-control.d.ts.map +1 -0
  177. package/development/seat-reservation/seat-reservation-place-control.js +5 -0
  178. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts +14 -0
  179. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.d.ts.map +1 -0
  180. package/development/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +34 -0
  181. package/development/seat-reservation/seat-reservation-scoped.d.ts +5 -0
  182. package/development/seat-reservation/seat-reservation-scoped.d.ts.map +1 -0
  183. package/development/seat-reservation/seat-reservation-scoped.js +5 -0
  184. package/development/seat-reservation/seat-reservation.d.ts +6 -0
  185. package/development/seat-reservation/seat-reservation.d.ts.map +1 -0
  186. package/development/seat-reservation/seat-reservation.js +7 -0
  187. package/development/seat-reservation.d.ts +12 -0
  188. package/development/seat-reservation.d.ts.map +1 -0
  189. package/development/seat-reservation.js +30 -0
  190. package/development/timetable-duration/timetable-duration.component.d.ts +22 -0
  191. package/development/timetable-duration/timetable-duration.component.d.ts.map +1 -0
  192. package/development/timetable-duration/timetable-duration.component.js +114 -0
  193. package/development/timetable-duration.d.ts +5 -0
  194. package/development/timetable-duration.d.ts.map +1 -0
  195. package/development/timetable-duration.js +5 -0
  196. package/development/timetable-row/timetable-row.component.d.ts +87 -0
  197. package/development/timetable-row/timetable-row.component.d.ts.map +1 -0
  198. package/development/timetable-row/timetable-row.component.js +787 -0
  199. package/development/timetable-row.d.ts +5 -0
  200. package/development/timetable-row.d.ts.map +1 -0
  201. package/development/timetable-row.js +12 -0
  202. package/development/toDate-BWb6Z1JD.js +24 -0
  203. package/differenceInMinutes-COvvdYsJ.js +23 -0
  204. package/format-CmKROkbc.js +1186 -0
  205. package/index.d.ts +44 -0
  206. package/index.js +43 -0
  207. package/isValid-m3_OsPaB.js +45 -0
  208. package/journey-summary/journey-summary.component.js +193 -0
  209. package/journey-summary.js +4 -0
  210. package/package.json +161 -1
  211. package/pearl-chain/pearl-chain.component.js +164 -0
  212. package/pearl-chain-time/pearl-chain-time.component.js +156 -0
  213. package/pearl-chain-time.js +4 -0
  214. package/pearl-chain-vertical/pearl-chain-vertical.component.js +24 -0
  215. package/pearl-chain-vertical-item/pearl-chain-vertical-item.component.js +76 -0
  216. package/pearl-chain-vertical-item.js +4 -0
  217. package/pearl-chain-vertical.js +4 -0
  218. package/pearl-chain.js +4 -0
  219. package/seat-reservation/common/mapper/icon-mapper.js +71 -0
  220. package/seat-reservation/common/mapper/mapper.js +89 -0
  221. package/seat-reservation/common/mapper/seat-reservation-sample-data.js +31668 -0
  222. package/seat-reservation/common/mapper.js +9 -0
  223. package/seat-reservation/common/svgs.js +243 -0
  224. package/seat-reservation/common/translations/i18n.js +861 -0
  225. package/seat-reservation/common/translations.js +4 -0
  226. package/seat-reservation/common/types.js +1 -0
  227. package/seat-reservation/common.js +13 -0
  228. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +756 -0
  229. package/seat-reservation/seat-reservation/seat-reservation.component.js +410 -0
  230. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +50 -0
  231. package/seat-reservation/seat-reservation-area.js +4 -0
  232. package/seat-reservation/seat-reservation-graphic/seat-reservation-assets.js +292 -0
  233. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +73 -0
  234. package/seat-reservation/seat-reservation-graphic.js +4 -0
  235. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +277 -0
  236. package/seat-reservation/seat-reservation-navigation-coach.js +4 -0
  237. package/seat-reservation/seat-reservation-navigation-services/seat-reservation-navigation-services.component.js +73 -0
  238. package/seat-reservation/seat-reservation-navigation-services.js +4 -0
  239. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +167 -0
  240. package/seat-reservation/seat-reservation-place-control.js +4 -0
  241. package/seat-reservation/seat-reservation-scoped/seat-reservation-scoped.component.js +20 -0
  242. package/seat-reservation/seat-reservation-scoped.js +4 -0
  243. package/seat-reservation/seat-reservation.js +6 -0
  244. package/seat-reservation.js +29 -0
  245. package/timetable-duration/timetable-duration.component.js +56 -0
  246. package/timetable-duration.js +4 -0
  247. package/timetable-row/timetable-row.component.js +426 -0
  248. package/timetable-row.js +11 -0
  249. package/toDate-Bw2KTWeq.js +15 -0
@@ -0,0 +1,1186 @@
1
+ import { d as q, i as C } from "./isValid-m3_OsPaB.js";
2
+ import { t as l, c as y, d as D } from "./toDate-Bw2KTWeq.js";
3
+ let N = {};
4
+ function O() {
5
+ return N;
6
+ }
7
+ function p(t, e) {
8
+ const n = O(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = l(t, e?.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
9
+ return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
10
+ }
11
+ function M(t, e) {
12
+ return p(t, { ...e, weekStartsOn: 1 });
13
+ }
14
+ function T(t, e) {
15
+ const n = l(t, e?.in), r = n.getFullYear(), a = y(n, 0);
16
+ a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
17
+ const o = M(a), s = y(n, 0);
18
+ s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
19
+ const c = M(s);
20
+ return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
21
+ }
22
+ function H(t, e) {
23
+ const n = T(t, e), r = y(t, 0);
24
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), M(r);
25
+ }
26
+ function Q(t, e) {
27
+ const n = l(t, e?.in);
28
+ return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
29
+ }
30
+ const X = {
31
+ lessThanXSeconds: {
32
+ one: "less than a second",
33
+ other: "less than {{count}} seconds"
34
+ },
35
+ xSeconds: {
36
+ one: "1 second",
37
+ other: "{{count}} seconds"
38
+ },
39
+ halfAMinute: "half a minute",
40
+ lessThanXMinutes: {
41
+ one: "less than a minute",
42
+ other: "less than {{count}} minutes"
43
+ },
44
+ xMinutes: {
45
+ one: "1 minute",
46
+ other: "{{count}} minutes"
47
+ },
48
+ aboutXHours: {
49
+ one: "about 1 hour",
50
+ other: "about {{count}} hours"
51
+ },
52
+ xHours: {
53
+ one: "1 hour",
54
+ other: "{{count}} hours"
55
+ },
56
+ xDays: {
57
+ one: "1 day",
58
+ other: "{{count}} days"
59
+ },
60
+ aboutXWeeks: {
61
+ one: "about 1 week",
62
+ other: "about {{count}} weeks"
63
+ },
64
+ xWeeks: {
65
+ one: "1 week",
66
+ other: "{{count}} weeks"
67
+ },
68
+ aboutXMonths: {
69
+ one: "about 1 month",
70
+ other: "about {{count}} months"
71
+ },
72
+ xMonths: {
73
+ one: "1 month",
74
+ other: "{{count}} months"
75
+ },
76
+ aboutXYears: {
77
+ one: "about 1 year",
78
+ other: "about {{count}} years"
79
+ },
80
+ xYears: {
81
+ one: "1 year",
82
+ other: "{{count}} years"
83
+ },
84
+ overXYears: {
85
+ one: "over 1 year",
86
+ other: "over {{count}} years"
87
+ },
88
+ almostXYears: {
89
+ one: "almost 1 year",
90
+ other: "almost {{count}} years"
91
+ }
92
+ }, L = (t, e, n) => {
93
+ let r;
94
+ const a = X[t];
95
+ return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
96
+ };
97
+ function k(t) {
98
+ return (e = {}) => {
99
+ const n = e.width ? String(e.width) : t.defaultWidth;
100
+ return t.formats[n] || t.formats[t.defaultWidth];
101
+ };
102
+ }
103
+ const G = {
104
+ full: "EEEE, MMMM do, y",
105
+ long: "MMMM do, y",
106
+ medium: "MMM d, y",
107
+ short: "MM/dd/yyyy"
108
+ }, _ = {
109
+ full: "h:mm:ss a zzzz",
110
+ long: "h:mm:ss a z",
111
+ medium: "h:mm:ss a",
112
+ short: "h:mm a"
113
+ }, B = {
114
+ full: "{{date}} 'at' {{time}}",
115
+ long: "{{date}} 'at' {{time}}",
116
+ medium: "{{date}}, {{time}}",
117
+ short: "{{date}}, {{time}}"
118
+ }, R = {
119
+ date: k({
120
+ formats: G,
121
+ defaultWidth: "full"
122
+ }),
123
+ time: k({
124
+ formats: _,
125
+ defaultWidth: "full"
126
+ }),
127
+ dateTime: k({
128
+ formats: B,
129
+ defaultWidth: "full"
130
+ })
131
+ }, A = {
132
+ lastWeek: "'last' eeee 'at' p",
133
+ yesterday: "'yesterday at' p",
134
+ today: "'today at' p",
135
+ tomorrow: "'tomorrow at' p",
136
+ nextWeek: "eeee 'at' p",
137
+ other: "P"
138
+ }, V = (t, e, n, r) => A[t];
139
+ function b(t) {
140
+ return (e, n) => {
141
+ const r = n?.context ? String(n.context) : "standalone";
142
+ let a;
143
+ if (r === "formatting" && t.formattingValues) {
144
+ const s = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : s;
145
+ a = t.formattingValues[c] || t.formattingValues[s];
146
+ } else {
147
+ const s = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
148
+ a = t.values[c] || t.values[s];
149
+ }
150
+ const o = t.argumentCallback ? t.argumentCallback(e) : e;
151
+ return a[o];
152
+ };
153
+ }
154
+ const j = {
155
+ narrow: ["B", "A"],
156
+ abbreviated: ["BC", "AD"],
157
+ wide: ["Before Christ", "Anno Domini"]
158
+ }, I = {
159
+ narrow: ["1", "2", "3", "4"],
160
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
161
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
162
+ }, J = {
163
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
164
+ abbreviated: [
165
+ "Jan",
166
+ "Feb",
167
+ "Mar",
168
+ "Apr",
169
+ "May",
170
+ "Jun",
171
+ "Jul",
172
+ "Aug",
173
+ "Sep",
174
+ "Oct",
175
+ "Nov",
176
+ "Dec"
177
+ ],
178
+ wide: [
179
+ "January",
180
+ "February",
181
+ "March",
182
+ "April",
183
+ "May",
184
+ "June",
185
+ "July",
186
+ "August",
187
+ "September",
188
+ "October",
189
+ "November",
190
+ "December"
191
+ ]
192
+ }, $ = {
193
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
194
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
195
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
196
+ wide: [
197
+ "Sunday",
198
+ "Monday",
199
+ "Tuesday",
200
+ "Wednesday",
201
+ "Thursday",
202
+ "Friday",
203
+ "Saturday"
204
+ ]
205
+ }, K = {
206
+ narrow: {
207
+ am: "a",
208
+ pm: "p",
209
+ midnight: "mi",
210
+ noon: "n",
211
+ morning: "morning",
212
+ afternoon: "afternoon",
213
+ evening: "evening",
214
+ night: "night"
215
+ },
216
+ abbreviated: {
217
+ am: "AM",
218
+ pm: "PM",
219
+ midnight: "midnight",
220
+ noon: "noon",
221
+ morning: "morning",
222
+ afternoon: "afternoon",
223
+ evening: "evening",
224
+ night: "night"
225
+ },
226
+ wide: {
227
+ am: "a.m.",
228
+ pm: "p.m.",
229
+ midnight: "midnight",
230
+ noon: "noon",
231
+ morning: "morning",
232
+ afternoon: "afternoon",
233
+ evening: "evening",
234
+ night: "night"
235
+ }
236
+ }, U = {
237
+ narrow: {
238
+ am: "a",
239
+ pm: "p",
240
+ midnight: "mi",
241
+ noon: "n",
242
+ morning: "in the morning",
243
+ afternoon: "in the afternoon",
244
+ evening: "in the evening",
245
+ night: "at night"
246
+ },
247
+ abbreviated: {
248
+ am: "AM",
249
+ pm: "PM",
250
+ midnight: "midnight",
251
+ noon: "noon",
252
+ morning: "in the morning",
253
+ afternoon: "in the afternoon",
254
+ evening: "in the evening",
255
+ night: "at night"
256
+ },
257
+ wide: {
258
+ am: "a.m.",
259
+ pm: "p.m.",
260
+ midnight: "midnight",
261
+ noon: "noon",
262
+ morning: "in the morning",
263
+ afternoon: "in the afternoon",
264
+ evening: "in the evening",
265
+ night: "at night"
266
+ }
267
+ }, z = (t, e) => {
268
+ const n = Number(t), r = n % 100;
269
+ if (r > 20 || r < 10)
270
+ switch (r % 10) {
271
+ case 1:
272
+ return n + "st";
273
+ case 2:
274
+ return n + "nd";
275
+ case 3:
276
+ return n + "rd";
277
+ }
278
+ return n + "th";
279
+ }, Z = {
280
+ ordinalNumber: z,
281
+ era: b({
282
+ values: j,
283
+ defaultWidth: "wide"
284
+ }),
285
+ quarter: b({
286
+ values: I,
287
+ defaultWidth: "wide",
288
+ argumentCallback: (t) => t - 1
289
+ }),
290
+ month: b({
291
+ values: J,
292
+ defaultWidth: "wide"
293
+ }),
294
+ day: b({
295
+ values: $,
296
+ defaultWidth: "wide"
297
+ }),
298
+ dayPeriod: b({
299
+ values: K,
300
+ defaultWidth: "wide",
301
+ formattingValues: U,
302
+ defaultFormattingWidth: "wide"
303
+ })
304
+ };
305
+ function P(t) {
306
+ return (e, n = {}) => {
307
+ const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
308
+ if (!o)
309
+ return null;
310
+ const s = o[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], h = Array.isArray(c) ? et(c, (u) => u.test(s)) : (
311
+ // [TODO] -- I challenge you to fix the type
312
+ tt(c, (u) => u.test(s))
313
+ );
314
+ let f;
315
+ f = t.valueCallback ? t.valueCallback(h) : h, f = n.valueCallback ? (
316
+ // [TODO] -- I challenge you to fix the type
317
+ n.valueCallback(f)
318
+ ) : f;
319
+ const d = e.slice(s.length);
320
+ return { value: f, rest: d };
321
+ };
322
+ }
323
+ function tt(t, e) {
324
+ for (const n in t)
325
+ if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
326
+ return n;
327
+ }
328
+ function et(t, e) {
329
+ for (let n = 0; n < t.length; n++)
330
+ if (e(t[n]))
331
+ return n;
332
+ }
333
+ function nt(t) {
334
+ return (e, n = {}) => {
335
+ const r = e.match(t.matchPattern);
336
+ if (!r) return null;
337
+ const a = r[0], o = e.match(t.parsePattern);
338
+ if (!o) return null;
339
+ let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
340
+ s = n.valueCallback ? n.valueCallback(s) : s;
341
+ const c = e.slice(a.length);
342
+ return { value: s, rest: c };
343
+ };
344
+ }
345
+ const rt = /^(\d+)(th|st|nd|rd)?/i, at = /\d+/i, ot = {
346
+ narrow: /^(b|a)/i,
347
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
348
+ wide: /^(before christ|before common era|anno domini|common era)/i
349
+ }, it = {
350
+ any: [/^b/i, /^(a|c)/i]
351
+ }, st = {
352
+ narrow: /^[1234]/i,
353
+ abbreviated: /^q[1234]/i,
354
+ wide: /^[1234](th|st|nd|rd)? quarter/i
355
+ }, ut = {
356
+ any: [/1/i, /2/i, /3/i, /4/i]
357
+ }, ct = {
358
+ narrow: /^[jfmasond]/i,
359
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
360
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
361
+ }, dt = {
362
+ narrow: [
363
+ /^j/i,
364
+ /^f/i,
365
+ /^m/i,
366
+ /^a/i,
367
+ /^m/i,
368
+ /^j/i,
369
+ /^j/i,
370
+ /^a/i,
371
+ /^s/i,
372
+ /^o/i,
373
+ /^n/i,
374
+ /^d/i
375
+ ],
376
+ any: [
377
+ /^ja/i,
378
+ /^f/i,
379
+ /^mar/i,
380
+ /^ap/i,
381
+ /^may/i,
382
+ /^jun/i,
383
+ /^jul/i,
384
+ /^au/i,
385
+ /^s/i,
386
+ /^o/i,
387
+ /^n/i,
388
+ /^d/i
389
+ ]
390
+ }, ht = {
391
+ narrow: /^[smtwf]/i,
392
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
393
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
394
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
395
+ }, ft = {
396
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
397
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
398
+ }, mt = {
399
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
400
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
401
+ }, lt = {
402
+ any: {
403
+ am: /^a/i,
404
+ pm: /^p/i,
405
+ midnight: /^mi/i,
406
+ noon: /^no/i,
407
+ morning: /morning/i,
408
+ afternoon: /afternoon/i,
409
+ evening: /evening/i,
410
+ night: /night/i
411
+ }
412
+ }, gt = {
413
+ ordinalNumber: nt({
414
+ matchPattern: rt,
415
+ parsePattern: at,
416
+ valueCallback: (t) => parseInt(t, 10)
417
+ }),
418
+ era: P({
419
+ matchPatterns: ot,
420
+ defaultMatchWidth: "wide",
421
+ parsePatterns: it,
422
+ defaultParseWidth: "any"
423
+ }),
424
+ quarter: P({
425
+ matchPatterns: st,
426
+ defaultMatchWidth: "wide",
427
+ parsePatterns: ut,
428
+ defaultParseWidth: "any",
429
+ valueCallback: (t) => t + 1
430
+ }),
431
+ month: P({
432
+ matchPatterns: ct,
433
+ defaultMatchWidth: "wide",
434
+ parsePatterns: dt,
435
+ defaultParseWidth: "any"
436
+ }),
437
+ day: P({
438
+ matchPatterns: ht,
439
+ defaultMatchWidth: "wide",
440
+ parsePatterns: ft,
441
+ defaultParseWidth: "any"
442
+ }),
443
+ dayPeriod: P({
444
+ matchPatterns: mt,
445
+ defaultMatchWidth: "any",
446
+ parsePatterns: lt,
447
+ defaultParseWidth: "any"
448
+ })
449
+ }, wt = {
450
+ code: "en-US",
451
+ formatDistance: L,
452
+ formatLong: R,
453
+ formatRelative: V,
454
+ localize: Z,
455
+ match: gt,
456
+ options: {
457
+ weekStartsOn: 0,
458
+ firstWeekContainsDate: 1
459
+ }
460
+ };
461
+ function yt(t, e) {
462
+ const n = l(t, e?.in);
463
+ return q(n, Q(n)) + 1;
464
+ }
465
+ function bt(t, e) {
466
+ const n = l(t, e?.in), r = +M(n) - +H(n);
467
+ return Math.round(r / D) + 1;
468
+ }
469
+ function E(t, e) {
470
+ const n = l(t, e?.in), r = n.getFullYear(), a = O(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = y(e?.in || t, 0);
471
+ s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
472
+ const c = p(s, e), h = y(e?.in || t, 0);
473
+ h.setFullYear(r, 0, o), h.setHours(0, 0, 0, 0);
474
+ const f = p(h, e);
475
+ return +n >= +c ? r + 1 : +n >= +f ? r : r - 1;
476
+ }
477
+ function Pt(t, e) {
478
+ const n = O(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = E(t, e), o = y(e?.in || t, 0);
479
+ return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), p(o, e);
480
+ }
481
+ function pt(t, e) {
482
+ const n = l(t, e?.in), r = +p(n, e) - +Pt(n, e);
483
+ return Math.round(r / D) + 1;
484
+ }
485
+ function i(t, e) {
486
+ const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
487
+ return n + r;
488
+ }
489
+ const m = {
490
+ // Year
491
+ y(t, e) {
492
+ const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
493
+ return i(e === "yy" ? r % 100 : r, e.length);
494
+ },
495
+ // Month
496
+ M(t, e) {
497
+ const n = t.getMonth();
498
+ return e === "M" ? String(n + 1) : i(n + 1, 2);
499
+ },
500
+ // Day of the month
501
+ d(t, e) {
502
+ return i(t.getDate(), e.length);
503
+ },
504
+ // AM or PM
505
+ a(t, e) {
506
+ const n = t.getHours() / 12 >= 1 ? "pm" : "am";
507
+ switch (e) {
508
+ case "a":
509
+ case "aa":
510
+ return n.toUpperCase();
511
+ case "aaa":
512
+ return n;
513
+ case "aaaaa":
514
+ return n[0];
515
+ default:
516
+ return n === "am" ? "a.m." : "p.m.";
517
+ }
518
+ },
519
+ // Hour [1-12]
520
+ h(t, e) {
521
+ return i(t.getHours() % 12 || 12, e.length);
522
+ },
523
+ // Hour [0-23]
524
+ H(t, e) {
525
+ return i(t.getHours(), e.length);
526
+ },
527
+ // Minute
528
+ m(t, e) {
529
+ return i(t.getMinutes(), e.length);
530
+ },
531
+ // Second
532
+ s(t, e) {
533
+ return i(t.getSeconds(), e.length);
534
+ },
535
+ // Fraction of second
536
+ S(t, e) {
537
+ const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
538
+ r * Math.pow(10, n - 3)
539
+ );
540
+ return i(a, e.length);
541
+ }
542
+ }, w = {
543
+ midnight: "midnight",
544
+ noon: "noon",
545
+ morning: "morning",
546
+ afternoon: "afternoon",
547
+ evening: "evening",
548
+ night: "night"
549
+ }, x = {
550
+ // Era
551
+ G: function(t, e, n) {
552
+ const r = t.getFullYear() > 0 ? 1 : 0;
553
+ switch (e) {
554
+ // AD, BC
555
+ case "G":
556
+ case "GG":
557
+ case "GGG":
558
+ return n.era(r, { width: "abbreviated" });
559
+ // A, B
560
+ case "GGGGG":
561
+ return n.era(r, { width: "narrow" });
562
+ default:
563
+ return n.era(r, { width: "wide" });
564
+ }
565
+ },
566
+ // Year
567
+ y: function(t, e, n) {
568
+ if (e === "yo") {
569
+ const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
570
+ return n.ordinalNumber(a, { unit: "year" });
571
+ }
572
+ return m.y(t, e);
573
+ },
574
+ // Local week-numbering year
575
+ Y: function(t, e, n, r) {
576
+ const a = E(t, r), o = a > 0 ? a : 1 - a;
577
+ if (e === "YY") {
578
+ const s = o % 100;
579
+ return i(s, 2);
580
+ }
581
+ return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : i(o, e.length);
582
+ },
583
+ // ISO week-numbering year
584
+ R: function(t, e) {
585
+ const n = T(t);
586
+ return i(n, e.length);
587
+ },
588
+ // Extended year. This is a single number designating the year of this calendar system.
589
+ // The main difference between `y` and `u` localizers are B.C. years:
590
+ // | Year | `y` | `u` |
591
+ // |------|-----|-----|
592
+ // | AC 1 | 1 | 1 |
593
+ // | BC 1 | 1 | 0 |
594
+ // | BC 2 | 2 | -1 |
595
+ // Also `yy` always returns the last two digits of a year,
596
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
597
+ u: function(t, e) {
598
+ const n = t.getFullYear();
599
+ return i(n, e.length);
600
+ },
601
+ // Quarter
602
+ Q: function(t, e, n) {
603
+ const r = Math.ceil((t.getMonth() + 1) / 3);
604
+ switch (e) {
605
+ // 1, 2, 3, 4
606
+ case "Q":
607
+ return String(r);
608
+ // 01, 02, 03, 04
609
+ case "QQ":
610
+ return i(r, 2);
611
+ // 1st, 2nd, 3rd, 4th
612
+ case "Qo":
613
+ return n.ordinalNumber(r, { unit: "quarter" });
614
+ // Q1, Q2, Q3, Q4
615
+ case "QQQ":
616
+ return n.quarter(r, {
617
+ width: "abbreviated",
618
+ context: "formatting"
619
+ });
620
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
621
+ case "QQQQQ":
622
+ return n.quarter(r, {
623
+ width: "narrow",
624
+ context: "formatting"
625
+ });
626
+ default:
627
+ return n.quarter(r, {
628
+ width: "wide",
629
+ context: "formatting"
630
+ });
631
+ }
632
+ },
633
+ // Stand-alone quarter
634
+ q: function(t, e, n) {
635
+ const r = Math.ceil((t.getMonth() + 1) / 3);
636
+ switch (e) {
637
+ // 1, 2, 3, 4
638
+ case "q":
639
+ return String(r);
640
+ // 01, 02, 03, 04
641
+ case "qq":
642
+ return i(r, 2);
643
+ // 1st, 2nd, 3rd, 4th
644
+ case "qo":
645
+ return n.ordinalNumber(r, { unit: "quarter" });
646
+ // Q1, Q2, Q3, Q4
647
+ case "qqq":
648
+ return n.quarter(r, {
649
+ width: "abbreviated",
650
+ context: "standalone"
651
+ });
652
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
653
+ case "qqqqq":
654
+ return n.quarter(r, {
655
+ width: "narrow",
656
+ context: "standalone"
657
+ });
658
+ default:
659
+ return n.quarter(r, {
660
+ width: "wide",
661
+ context: "standalone"
662
+ });
663
+ }
664
+ },
665
+ // Month
666
+ M: function(t, e, n) {
667
+ const r = t.getMonth();
668
+ switch (e) {
669
+ case "M":
670
+ case "MM":
671
+ return m.M(t, e);
672
+ // 1st, 2nd, ..., 12th
673
+ case "Mo":
674
+ return n.ordinalNumber(r + 1, { unit: "month" });
675
+ // Jan, Feb, ..., Dec
676
+ case "MMM":
677
+ return n.month(r, {
678
+ width: "abbreviated",
679
+ context: "formatting"
680
+ });
681
+ // J, F, ..., D
682
+ case "MMMMM":
683
+ return n.month(r, {
684
+ width: "narrow",
685
+ context: "formatting"
686
+ });
687
+ default:
688
+ return n.month(r, { width: "wide", context: "formatting" });
689
+ }
690
+ },
691
+ // Stand-alone month
692
+ L: function(t, e, n) {
693
+ const r = t.getMonth();
694
+ switch (e) {
695
+ // 1, 2, ..., 12
696
+ case "L":
697
+ return String(r + 1);
698
+ // 01, 02, ..., 12
699
+ case "LL":
700
+ return i(r + 1, 2);
701
+ // 1st, 2nd, ..., 12th
702
+ case "Lo":
703
+ return n.ordinalNumber(r + 1, { unit: "month" });
704
+ // Jan, Feb, ..., Dec
705
+ case "LLL":
706
+ return n.month(r, {
707
+ width: "abbreviated",
708
+ context: "standalone"
709
+ });
710
+ // J, F, ..., D
711
+ case "LLLLL":
712
+ return n.month(r, {
713
+ width: "narrow",
714
+ context: "standalone"
715
+ });
716
+ default:
717
+ return n.month(r, { width: "wide", context: "standalone" });
718
+ }
719
+ },
720
+ // Local week of year
721
+ w: function(t, e, n, r) {
722
+ const a = pt(t, r);
723
+ return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : i(a, e.length);
724
+ },
725
+ // ISO week of year
726
+ I: function(t, e, n) {
727
+ const r = bt(t);
728
+ return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : i(r, e.length);
729
+ },
730
+ // Day of the month
731
+ d: function(t, e, n) {
732
+ return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : m.d(t, e);
733
+ },
734
+ // Day of year
735
+ D: function(t, e, n) {
736
+ const r = yt(t);
737
+ return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : i(r, e.length);
738
+ },
739
+ // Day of week
740
+ E: function(t, e, n) {
741
+ const r = t.getDay();
742
+ switch (e) {
743
+ // Tue
744
+ case "E":
745
+ case "EE":
746
+ case "EEE":
747
+ return n.day(r, {
748
+ width: "abbreviated",
749
+ context: "formatting"
750
+ });
751
+ // T
752
+ case "EEEEE":
753
+ return n.day(r, {
754
+ width: "narrow",
755
+ context: "formatting"
756
+ });
757
+ // Tu
758
+ case "EEEEEE":
759
+ return n.day(r, {
760
+ width: "short",
761
+ context: "formatting"
762
+ });
763
+ default:
764
+ return n.day(r, {
765
+ width: "wide",
766
+ context: "formatting"
767
+ });
768
+ }
769
+ },
770
+ // Local day of week
771
+ e: function(t, e, n, r) {
772
+ const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
773
+ switch (e) {
774
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
775
+ case "e":
776
+ return String(o);
777
+ // Padded numerical value
778
+ case "ee":
779
+ return i(o, 2);
780
+ // 1st, 2nd, ..., 7th
781
+ case "eo":
782
+ return n.ordinalNumber(o, { unit: "day" });
783
+ case "eee":
784
+ return n.day(a, {
785
+ width: "abbreviated",
786
+ context: "formatting"
787
+ });
788
+ // T
789
+ case "eeeee":
790
+ return n.day(a, {
791
+ width: "narrow",
792
+ context: "formatting"
793
+ });
794
+ // Tu
795
+ case "eeeeee":
796
+ return n.day(a, {
797
+ width: "short",
798
+ context: "formatting"
799
+ });
800
+ default:
801
+ return n.day(a, {
802
+ width: "wide",
803
+ context: "formatting"
804
+ });
805
+ }
806
+ },
807
+ // Stand-alone local day of week
808
+ c: function(t, e, n, r) {
809
+ const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
810
+ switch (e) {
811
+ // Numerical value (same as in `e`)
812
+ case "c":
813
+ return String(o);
814
+ // Padded numerical value
815
+ case "cc":
816
+ return i(o, e.length);
817
+ // 1st, 2nd, ..., 7th
818
+ case "co":
819
+ return n.ordinalNumber(o, { unit: "day" });
820
+ case "ccc":
821
+ return n.day(a, {
822
+ width: "abbreviated",
823
+ context: "standalone"
824
+ });
825
+ // T
826
+ case "ccccc":
827
+ return n.day(a, {
828
+ width: "narrow",
829
+ context: "standalone"
830
+ });
831
+ // Tu
832
+ case "cccccc":
833
+ return n.day(a, {
834
+ width: "short",
835
+ context: "standalone"
836
+ });
837
+ default:
838
+ return n.day(a, {
839
+ width: "wide",
840
+ context: "standalone"
841
+ });
842
+ }
843
+ },
844
+ // ISO day of week
845
+ i: function(t, e, n) {
846
+ const r = t.getDay(), a = r === 0 ? 7 : r;
847
+ switch (e) {
848
+ // 2
849
+ case "i":
850
+ return String(a);
851
+ // 02
852
+ case "ii":
853
+ return i(a, e.length);
854
+ // 2nd
855
+ case "io":
856
+ return n.ordinalNumber(a, { unit: "day" });
857
+ // Tue
858
+ case "iii":
859
+ return n.day(r, {
860
+ width: "abbreviated",
861
+ context: "formatting"
862
+ });
863
+ // T
864
+ case "iiiii":
865
+ return n.day(r, {
866
+ width: "narrow",
867
+ context: "formatting"
868
+ });
869
+ // Tu
870
+ case "iiiiii":
871
+ return n.day(r, {
872
+ width: "short",
873
+ context: "formatting"
874
+ });
875
+ default:
876
+ return n.day(r, {
877
+ width: "wide",
878
+ context: "formatting"
879
+ });
880
+ }
881
+ },
882
+ // AM or PM
883
+ a: function(t, e, n) {
884
+ const a = t.getHours() / 12 >= 1 ? "pm" : "am";
885
+ switch (e) {
886
+ case "a":
887
+ case "aa":
888
+ return n.dayPeriod(a, {
889
+ width: "abbreviated",
890
+ context: "formatting"
891
+ });
892
+ case "aaa":
893
+ return n.dayPeriod(a, {
894
+ width: "abbreviated",
895
+ context: "formatting"
896
+ }).toLowerCase();
897
+ case "aaaaa":
898
+ return n.dayPeriod(a, {
899
+ width: "narrow",
900
+ context: "formatting"
901
+ });
902
+ default:
903
+ return n.dayPeriod(a, {
904
+ width: "wide",
905
+ context: "formatting"
906
+ });
907
+ }
908
+ },
909
+ // AM, PM, midnight, noon
910
+ b: function(t, e, n) {
911
+ const r = t.getHours();
912
+ let a;
913
+ switch (r === 12 ? a = w.noon : r === 0 ? a = w.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
914
+ case "b":
915
+ case "bb":
916
+ return n.dayPeriod(a, {
917
+ width: "abbreviated",
918
+ context: "formatting"
919
+ });
920
+ case "bbb":
921
+ return n.dayPeriod(a, {
922
+ width: "abbreviated",
923
+ context: "formatting"
924
+ }).toLowerCase();
925
+ case "bbbbb":
926
+ return n.dayPeriod(a, {
927
+ width: "narrow",
928
+ context: "formatting"
929
+ });
930
+ default:
931
+ return n.dayPeriod(a, {
932
+ width: "wide",
933
+ context: "formatting"
934
+ });
935
+ }
936
+ },
937
+ // in the morning, in the afternoon, in the evening, at night
938
+ B: function(t, e, n) {
939
+ const r = t.getHours();
940
+ let a;
941
+ switch (r >= 17 ? a = w.evening : r >= 12 ? a = w.afternoon : r >= 4 ? a = w.morning : a = w.night, e) {
942
+ case "B":
943
+ case "BB":
944
+ case "BBB":
945
+ return n.dayPeriod(a, {
946
+ width: "abbreviated",
947
+ context: "formatting"
948
+ });
949
+ case "BBBBB":
950
+ return n.dayPeriod(a, {
951
+ width: "narrow",
952
+ context: "formatting"
953
+ });
954
+ default:
955
+ return n.dayPeriod(a, {
956
+ width: "wide",
957
+ context: "formatting"
958
+ });
959
+ }
960
+ },
961
+ // Hour [1-12]
962
+ h: function(t, e, n) {
963
+ if (e === "ho") {
964
+ let r = t.getHours() % 12;
965
+ return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
966
+ }
967
+ return m.h(t, e);
968
+ },
969
+ // Hour [0-23]
970
+ H: function(t, e, n) {
971
+ return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : m.H(t, e);
972
+ },
973
+ // Hour [0-11]
974
+ K: function(t, e, n) {
975
+ const r = t.getHours() % 12;
976
+ return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
977
+ },
978
+ // Hour [1-24]
979
+ k: function(t, e, n) {
980
+ let r = t.getHours();
981
+ return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : i(r, e.length);
982
+ },
983
+ // Minute
984
+ m: function(t, e, n) {
985
+ return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : m.m(t, e);
986
+ },
987
+ // Second
988
+ s: function(t, e, n) {
989
+ return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : m.s(t, e);
990
+ },
991
+ // Fraction of second
992
+ S: function(t, e) {
993
+ return m.S(t, e);
994
+ },
995
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
996
+ X: function(t, e, n) {
997
+ const r = t.getTimezoneOffset();
998
+ if (r === 0)
999
+ return "Z";
1000
+ switch (e) {
1001
+ // Hours and optional minutes
1002
+ case "X":
1003
+ return S(r);
1004
+ // Hours, minutes and optional seconds without `:` delimiter
1005
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1006
+ // so this token always has the same output as `XX`
1007
+ case "XXXX":
1008
+ case "XX":
1009
+ return g(r);
1010
+ // Hours and minutes with `:` delimiter
1011
+ default:
1012
+ return g(r, ":");
1013
+ }
1014
+ },
1015
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1016
+ x: function(t, e, n) {
1017
+ const r = t.getTimezoneOffset();
1018
+ switch (e) {
1019
+ // Hours and optional minutes
1020
+ case "x":
1021
+ return S(r);
1022
+ // Hours, minutes and optional seconds without `:` delimiter
1023
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1024
+ // so this token always has the same output as `xx`
1025
+ case "xxxx":
1026
+ case "xx":
1027
+ return g(r);
1028
+ // Hours and minutes with `:` delimiter
1029
+ default:
1030
+ return g(r, ":");
1031
+ }
1032
+ },
1033
+ // Timezone (GMT)
1034
+ O: function(t, e, n) {
1035
+ const r = t.getTimezoneOffset();
1036
+ switch (e) {
1037
+ // Short
1038
+ case "O":
1039
+ case "OO":
1040
+ case "OOO":
1041
+ return "GMT" + W(r, ":");
1042
+ default:
1043
+ return "GMT" + g(r, ":");
1044
+ }
1045
+ },
1046
+ // Timezone (specific non-location)
1047
+ z: function(t, e, n) {
1048
+ const r = t.getTimezoneOffset();
1049
+ switch (e) {
1050
+ // Short
1051
+ case "z":
1052
+ case "zz":
1053
+ case "zzz":
1054
+ return "GMT" + W(r, ":");
1055
+ default:
1056
+ return "GMT" + g(r, ":");
1057
+ }
1058
+ },
1059
+ // Seconds timestamp
1060
+ t: function(t, e, n) {
1061
+ const r = Math.trunc(+t / 1e3);
1062
+ return i(r, e.length);
1063
+ },
1064
+ // Milliseconds timestamp
1065
+ T: function(t, e, n) {
1066
+ return i(+t, e.length);
1067
+ }
1068
+ };
1069
+ function W(t, e = "") {
1070
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
1071
+ return o === 0 ? n + String(a) : n + String(a) + e + i(o, 2);
1072
+ }
1073
+ function S(t, e) {
1074
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + i(Math.abs(t) / 60, 2) : g(t, e);
1075
+ }
1076
+ function g(t, e = "") {
1077
+ const n = t > 0 ? "-" : "+", r = Math.abs(t), a = i(Math.trunc(r / 60), 2), o = i(r % 60, 2);
1078
+ return n + a + e + o;
1079
+ }
1080
+ const Y = (t, e) => {
1081
+ switch (t) {
1082
+ case "P":
1083
+ return e.date({ width: "short" });
1084
+ case "PP":
1085
+ return e.date({ width: "medium" });
1086
+ case "PPP":
1087
+ return e.date({ width: "long" });
1088
+ default:
1089
+ return e.date({ width: "full" });
1090
+ }
1091
+ }, F = (t, e) => {
1092
+ switch (t) {
1093
+ case "p":
1094
+ return e.time({ width: "short" });
1095
+ case "pp":
1096
+ return e.time({ width: "medium" });
1097
+ case "ppp":
1098
+ return e.time({ width: "long" });
1099
+ default:
1100
+ return e.time({ width: "full" });
1101
+ }
1102
+ }, Mt = (t, e) => {
1103
+ const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1104
+ if (!a)
1105
+ return Y(t, e);
1106
+ let o;
1107
+ switch (r) {
1108
+ case "P":
1109
+ o = e.dateTime({ width: "short" });
1110
+ break;
1111
+ case "PP":
1112
+ o = e.dateTime({ width: "medium" });
1113
+ break;
1114
+ case "PPP":
1115
+ o = e.dateTime({ width: "long" });
1116
+ break;
1117
+ default:
1118
+ o = e.dateTime({ width: "full" });
1119
+ break;
1120
+ }
1121
+ return o.replace("{{date}}", Y(r, e)).replace("{{time}}", F(a, e));
1122
+ }, Ot = {
1123
+ p: F,
1124
+ P: Mt
1125
+ }, vt = /^D+$/, kt = /^Y+$/, xt = ["D", "DD", "YY", "YYYY"];
1126
+ function Wt(t) {
1127
+ return vt.test(t);
1128
+ }
1129
+ function St(t) {
1130
+ return kt.test(t);
1131
+ }
1132
+ function Yt(t, e, n) {
1133
+ const r = Dt(t, e, n);
1134
+ if (console.warn(r), xt.includes(t)) throw new RangeError(r);
1135
+ }
1136
+ function Dt(t, e, n) {
1137
+ const r = t[0] === "Y" ? "years" : "days of the month";
1138
+ return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1139
+ }
1140
+ const Tt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Et = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ft = /^'([^]*?)'?$/, qt = /''/g, Ct = /[a-zA-Z]/;
1141
+ function Xt(t, e, n) {
1142
+ const r = O(), a = r.locale ?? wt, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = l(t, n?.in);
1143
+ if (!C(c))
1144
+ throw new RangeError("Invalid time value");
1145
+ let h = e.match(Et).map((d) => {
1146
+ const u = d[0];
1147
+ if (u === "p" || u === "P") {
1148
+ const v = Ot[u];
1149
+ return v(d, a.formatLong);
1150
+ }
1151
+ return d;
1152
+ }).join("").match(Tt).map((d) => {
1153
+ if (d === "''")
1154
+ return { isToken: !1, value: "'" };
1155
+ const u = d[0];
1156
+ if (u === "'")
1157
+ return { isToken: !1, value: Nt(d) };
1158
+ if (x[u])
1159
+ return { isToken: !0, value: d };
1160
+ if (u.match(Ct))
1161
+ throw new RangeError(
1162
+ "Format string contains an unescaped latin alphabet character `" + u + "`"
1163
+ );
1164
+ return { isToken: !1, value: d };
1165
+ });
1166
+ a.localize.preprocessor && (h = a.localize.preprocessor(c, h));
1167
+ const f = {
1168
+ firstWeekContainsDate: o,
1169
+ weekStartsOn: s,
1170
+ locale: a
1171
+ };
1172
+ return h.map((d) => {
1173
+ if (!d.isToken) return d.value;
1174
+ const u = d.value;
1175
+ (St(u) || Wt(u)) && Yt(u, e, String(t));
1176
+ const v = x[u[0]];
1177
+ return v(c, u, a.localize, f);
1178
+ }).join("");
1179
+ }
1180
+ function Nt(t) {
1181
+ const e = t.match(Ft);
1182
+ return e ? e[1].replace(qt, "'") : t;
1183
+ }
1184
+ export {
1185
+ Xt as f
1186
+ };