@oslokommune/punkt-elements 16.7.3 → 16.7.4

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 (248) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/accordion-BB1JrONI.cjs +34 -0
  3. package/dist/accordion-nNH87Y60.js +130 -0
  4. package/dist/alert-BEEnTiCb.cjs +33 -0
  5. package/dist/alert-ePJuDtmm.js +171 -0
  6. package/dist/async-directive-B9P1Qa0k.cjs +1 -0
  7. package/dist/async-directive-CaQiqjyV.js +55 -0
  8. package/dist/backlink-Ba03LlbB.cjs +13 -0
  9. package/dist/backlink-CiwXrQYD.js +38 -0
  10. package/dist/booleanish-BmcOU-43.js +11 -0
  11. package/dist/booleanish-jJLlnr6-.cjs +1 -0
  12. package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
  13. package/dist/breadcrumbs-CpuVqWhF.js +76 -0
  14. package/dist/button-BIpd1xJh.js +95 -0
  15. package/dist/button-D-TOBaJB.cjs +27 -0
  16. package/dist/calendar-BzEtOJla.js +2031 -0
  17. package/dist/calendar-E5jJLt8D.cjs +90 -0
  18. package/dist/card-BYJu1MYm.js +339 -0
  19. package/dist/card-CUFhMVim.cjs +87 -0
  20. package/dist/checkbox-BARDb9iV.cjs +31 -0
  21. package/dist/checkbox-Cspxcvt_.js +111 -0
  22. package/dist/class-map-C8HuhNzZ.js +27 -0
  23. package/dist/class-map-CJ-msbHs.cjs +1 -0
  24. package/dist/classutils-DEL164Ur.js +7 -0
  25. package/dist/classutils-z8YsPlOf.cjs +1 -0
  26. package/dist/combobox-BcdLZRDU.js +984 -0
  27. package/dist/combobox-CGbFTWq_.cjs +135 -0
  28. package/dist/consent-DeB_5sWH.js +197 -0
  29. package/dist/consent-hwu7pp3S.cjs +11 -0
  30. package/dist/datepicker-DpmlsnH_.cjs +273 -0
  31. package/dist/datepicker-OVd8pmnZ.js +1125 -0
  32. package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
  33. package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
  34. package/dist/directive-3THFsVew.js +28 -0
  35. package/dist/directive-CJ2giQBZ.cjs +1 -0
  36. package/dist/directive-helpers-D1QSxY17.cjs +1 -0
  37. package/dist/directive-helpers-Dkv2gKgs.js +25 -0
  38. package/dist/element-DjtxO-1r.cjs +2 -0
  39. package/dist/element-cZ85T_aa.js +693 -0
  40. package/dist/element-with-slot-4J2o3SeU.js +166 -0
  41. package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
  42. package/dist/header-DWgPgGfS.cjs +304 -0
  43. package/dist/header-a6ztVNp3.js +782 -0
  44. package/dist/heading-BgSWIRii.cjs +1 -0
  45. package/dist/heading-DiQLPxdf.js +73 -0
  46. package/dist/helptext-CCBKKLus.js +65 -0
  47. package/dist/helptext-D-3QfZv5.cjs +24 -0
  48. package/dist/icon-Co72KtgF.js +86 -0
  49. package/dist/icon-Dr8sfT2X.cjs +1 -0
  50. package/dist/if-defined-Cjj8qN-Z.js +5 -0
  51. package/dist/if-defined-XKOD_t_V.cjs +1 -0
  52. package/dist/index.d.ts +1 -2
  53. package/dist/input-element-B1yxcfz4.cjs +1 -0
  54. package/dist/input-element-Bw1s6NlF.js +643 -0
  55. package/dist/input-wrapper-BRuVELpK.cjs +54 -0
  56. package/dist/input-wrapper-CDyHTR1V.js +164 -0
  57. package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
  58. package/dist/input-wrapper-YfTmpSSY.js +117 -0
  59. package/dist/link-CKAFMz9j.js +89 -0
  60. package/dist/link-CyTCpI0k.cjs +7 -0
  61. package/dist/linkcard-B0KOGaGj.js +55 -0
  62. package/dist/linkcard-BE4-FewK.cjs +13 -0
  63. package/dist/listbox-DCA2JoPV.cjs +106 -0
  64. package/dist/listbox-DuBgTFvH.js +397 -0
  65. package/dist/loader-6kFZUErT.js +66 -0
  66. package/dist/loader-CX2rsC01.cjs +16 -0
  67. package/dist/messagebox-Cwlg5sOr.js +110 -0
  68. package/dist/messagebox-Din9X53b.cjs +13 -0
  69. package/dist/modal-C_wtsh9m.js +209 -0
  70. package/dist/modal-DS_wUOIv.cjs +36 -0
  71. package/dist/pkt-accordion.cjs +1 -1
  72. package/dist/pkt-accordion.js +2 -7
  73. package/dist/pkt-alert.cjs +1 -1
  74. package/dist/pkt-alert.js +2 -5
  75. package/dist/pkt-backlink.cjs +1 -1
  76. package/dist/pkt-backlink.js +2 -5
  77. package/dist/pkt-breadcrumbs.cjs +1 -43
  78. package/dist/pkt-breadcrumbs.js +2 -81
  79. package/dist/pkt-button.cjs +1 -1
  80. package/dist/pkt-button.js +2 -5
  81. package/dist/pkt-calendar.cjs +1 -1
  82. package/dist/pkt-calendar.js +2 -5
  83. package/dist/pkt-card.cjs +1 -1
  84. package/dist/pkt-card.js +2 -5
  85. package/dist/pkt-checkbox.cjs +1 -1
  86. package/dist/pkt-checkbox.js +2 -5
  87. package/dist/pkt-combobox.cjs +1 -1
  88. package/dist/pkt-combobox.js +2 -5
  89. package/dist/pkt-consent.cjs +1 -1
  90. package/dist/pkt-consent.js +2 -5
  91. package/dist/pkt-datepicker.cjs +1 -1
  92. package/dist/pkt-datepicker.js +5 -9
  93. package/dist/pkt-header.cjs +1 -304
  94. package/dist/pkt-header.js +2 -861
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +2 -5
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +2 -5
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +2 -5
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +30 -66
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +2 -5
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +2 -5
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +2 -5
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +2 -5
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +2 -5
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +2 -5
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +2 -5
  117. package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
  118. package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +2 -5
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +2 -5
  123. package/dist/pkt-select.cjs +1 -1
  124. package/dist/pkt-select.js +2 -5
  125. package/dist/pkt-tabs.cjs +1 -1
  126. package/dist/pkt-tabs.js +2 -7
  127. package/dist/pkt-tag.cjs +1 -1
  128. package/dist/pkt-tag.js +2 -5
  129. package/dist/pkt-textarea.cjs +1 -1
  130. package/dist/pkt-textarea.js +2 -5
  131. package/dist/pkt-textinput.cjs +1 -1
  132. package/dist/pkt-textinput.js +2 -5
  133. package/dist/pkt-timepicker.cjs +1 -191
  134. package/dist/pkt-timepicker.js +2 -560
  135. package/dist/progressbar-CdXtmOBb.cjs +17 -0
  136. package/dist/progressbar-Dy9AiYQz.js +113 -0
  137. package/dist/radiobutton-GOnpUbCW.cjs +31 -0
  138. package/dist/radiobutton-V_KPbup_.js +84 -0
  139. package/dist/ref-BaJ0mBT_.cjs +1 -0
  140. package/dist/ref-RS8Uv6uC.js +30 -0
  141. package/dist/repeat-Cepr3469.js +57 -0
  142. package/dist/repeat-CqcDYBxr.cjs +1 -0
  143. package/dist/select-BSAFd8Wa.js +164 -0
  144. package/dist/select-C2i8sOk5.cjs +49 -0
  145. package/dist/tabs-D8nL9rWx.cjs +37 -0
  146. package/dist/tabs-Y7utmJi9.js +318 -0
  147. package/dist/tag-DLthw5b4.cjs +27 -0
  148. package/dist/tag-VwykmuQR.js +179 -0
  149. package/dist/textarea-D7aGOyDf.cjs +46 -0
  150. package/dist/textarea-DYOBhJrN.js +115 -0
  151. package/dist/textinput-BUgntXnM.js +124 -0
  152. package/dist/textinput-DFh8_9cx.cjs +70 -0
  153. package/dist/timepicker-BIfE7KKJ.cjs +191 -0
  154. package/dist/timepicker-DaSwn1FA.js +503 -0
  155. package/dist/utils-CUqCKGvp.js +7 -0
  156. package/dist/utils-CjAbIttF.cjs +1 -0
  157. package/package.json +6 -6
  158. package/src/components/alert/alert.test.ts +1 -1
  159. package/src/components/alert/alert.ts +6 -6
  160. package/src/components/datepicker/datepicker-utils.test.ts +16 -23
  161. package/dist/accordionitem-_9AiCIvd.cjs +0 -34
  162. package/dist/accordionitem-dCfSrxh5.js +0 -140
  163. package/dist/alert-BtOk8yRH.cjs +0 -33
  164. package/dist/alert-DlY2_grU.js +0 -117
  165. package/dist/async-directive-CMzWMlZ5.js +0 -65
  166. package/dist/async-directive-DoMuclel.cjs +0 -5
  167. package/dist/backlink-Ce5Vldop.js +0 -49
  168. package/dist/backlink-y3dwjKPC.cjs +0 -13
  169. package/dist/booleanish-BKVonob4.cjs +0 -1
  170. package/dist/booleanish-C9R0tdXH.js +0 -11
  171. package/dist/button-B_TXwNzt.cjs +0 -27
  172. package/dist/button-BiY-wlKF.js +0 -139
  173. package/dist/calendar-B2pji2zn.cjs +0 -90
  174. package/dist/calendar-DhjQDC4C.js +0 -2140
  175. package/dist/card-BwMNB5Bb.cjs +0 -87
  176. package/dist/card-CGlmcMSR.js +0 -233
  177. package/dist/checkbox-BsJZYA26.js +0 -147
  178. package/dist/checkbox-CTY8f_qn.cjs +0 -31
  179. package/dist/class-map-CEnykyO_.js +0 -34
  180. package/dist/class-map-CsENJXf1.cjs +0 -5
  181. package/dist/classutils-BwNK82ZQ.cjs +0 -1
  182. package/dist/classutils-RQs1k6D9.js +0 -7
  183. package/dist/combobox-DSB5WOxg.js +0 -815
  184. package/dist/combobox-DbICIgKG.cjs +0 -135
  185. package/dist/consent-DkOQpbsg.cjs +0 -11
  186. package/dist/consent-SNWV_mMU.js +0 -175
  187. package/dist/datepicker-BEWl9iz3.cjs +0 -273
  188. package/dist/datepicker-euHyzXnb.js +0 -1170
  189. package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
  190. package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
  191. package/dist/directive-C7oCP5Bh.cjs +0 -5
  192. package/dist/directive-helpers-BP2WOx60.cjs +0 -5
  193. package/dist/directive-helpers-rm-28gIj.js +0 -38
  194. package/dist/directive-oAbCiebi.js +0 -27
  195. package/dist/element-CPpT3rFQ.js +0 -638
  196. package/dist/element-gR_VtSiD.cjs +0 -27
  197. package/dist/element-with-slot-Dqk6-TRR.js +0 -240
  198. package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
  199. package/dist/heading-D2tVS6lS.js +0 -103
  200. package/dist/heading-DrzbgDb6.cjs +0 -1
  201. package/dist/helptext-BKtU4mas.js +0 -82
  202. package/dist/helptext-DcRC7wW2.cjs +0 -24
  203. package/dist/icon-CxQcIa5F.js +0 -105
  204. package/dist/icon-q81vqPK_.cjs +0 -9
  205. package/dist/if-defined-B0krMLad.js +0 -10
  206. package/dist/if-defined-BOW3ODSj.cjs +0 -5
  207. package/dist/input-element-8nLwuQS4.js +0 -837
  208. package/dist/input-element-DdVhUvva.cjs +0 -1
  209. package/dist/input-wrapper-Bs4CRNst.js +0 -181
  210. package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
  211. package/dist/input-wrapper-CDgenrYA.js +0 -6
  212. package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
  213. package/dist/link-C0rl-86s.cjs +0 -7
  214. package/dist/link-Cdqgl60z.js +0 -55
  215. package/dist/linkcard-Dimu7Rlx.cjs +0 -13
  216. package/dist/linkcard-Lbq_UhjZ.js +0 -56
  217. package/dist/listbox-Bia4_tvN.js +0 -440
  218. package/dist/listbox-La2GZQei.cjs +0 -106
  219. package/dist/loader-D1ugDXGV.cjs +0 -16
  220. package/dist/loader-DyN6RGC5.js +0 -95
  221. package/dist/messagebox-BGMVm2t9.js +0 -71
  222. package/dist/messagebox-M0yIgCz9.cjs +0 -13
  223. package/dist/modal-CMO1RtIi.cjs +0 -36
  224. package/dist/modal-DjPQDE-Z.js +0 -156
  225. package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
  226. package/dist/pkt-options-controller-B5YalfCb.js +0 -39
  227. package/dist/progressbar-BqlMzkM_.cjs +0 -21
  228. package/dist/progressbar-sbHDFC12.js +0 -162
  229. package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
  230. package/dist/radiobutton-D8Ai8ETa.js +0 -113
  231. package/dist/ref-Bg_Swj5w.js +0 -42
  232. package/dist/ref-CL-Xk9Xm.cjs +0 -5
  233. package/dist/repeat-BD8TKgJb.js +0 -61
  234. package/dist/repeat-Cfq8CDlf.cjs +0 -5
  235. package/dist/select-De-n8on9.js +0 -230
  236. package/dist/select-dTWibR6_.cjs +0 -49
  237. package/dist/state-C_1EOo3D.js +0 -12
  238. package/dist/state-Dg-53wQ8.cjs +0 -5
  239. package/dist/tabitem-B9-jeV97.js +0 -334
  240. package/dist/tabitem-BnhzqfW3.cjs +0 -65
  241. package/dist/tag-CbwO8yvD.cjs +0 -27
  242. package/dist/tag-D4FI5t3y.js +0 -117
  243. package/dist/textarea-BmLaKzsc.cjs +0 -50
  244. package/dist/textarea-CMiSJaYL.js +0 -133
  245. package/dist/textinput-em9y4yrL.cjs +0 -70
  246. package/dist/textinput-r8udK0IX.js +0 -152
  247. package/dist/utils-DznhwRXm.js +0 -8
  248. package/dist/utils-byXsEz1u.cjs +0 -1
@@ -0,0 +1,2031 @@
1
+ import { c as e, d as t, l as n, o as r, r as i, s as a, t as o } from "./element-cZ85T_aa.js";
2
+ import { t as s } from "./class-map-C8HuhNzZ.js";
3
+ import "./icon-Co72KtgF.js";
4
+ //#region ../../node_modules/date-fns/constants.js
5
+ var c = 365.2425, l = 6048e5, u = 864e5, d = 3600 * 24;
6
+ d * 7, d * c / 12 * 3;
7
+ var f = Symbol.for("constructDateFrom");
8
+ //#endregion
9
+ //#region ../../node_modules/date-fns/constructFrom.js
10
+ function p(e, t) {
11
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && f in e ? e[f](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
12
+ }
13
+ //#endregion
14
+ //#region ../../node_modules/date-fns/toDate.js
15
+ function m(e, t) {
16
+ return p(t || e, e);
17
+ }
18
+ //#endregion
19
+ //#region ../../node_modules/date-fns/addDays.js
20
+ function h(e, t, n) {
21
+ let r = m(e, n?.in);
22
+ return isNaN(t) ? p(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
23
+ }
24
+ //#endregion
25
+ //#region ../../node_modules/date-fns/_lib/defaultOptions.js
26
+ var ee = {};
27
+ function g() {
28
+ return ee;
29
+ }
30
+ //#endregion
31
+ //#region ../../node_modules/date-fns/startOfWeek.js
32
+ function _(e, t) {
33
+ let n = g(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = m(e, t?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
34
+ return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
35
+ }
36
+ //#endregion
37
+ //#region ../../node_modules/date-fns/startOfISOWeek.js
38
+ function v(e, t) {
39
+ return _(e, {
40
+ ...t,
41
+ weekStartsOn: 1
42
+ });
43
+ }
44
+ //#endregion
45
+ //#region ../../node_modules/date-fns/getISOWeekYear.js
46
+ function y(e, t) {
47
+ let n = m(e, t?.in), r = n.getFullYear(), i = p(n, 0);
48
+ i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
49
+ let a = v(i), o = p(n, 0);
50
+ o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
51
+ let s = v(o);
52
+ return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
53
+ }
54
+ //#endregion
55
+ //#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
56
+ function b(e) {
57
+ let t = m(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
58
+ return n.setUTCFullYear(t.getFullYear()), e - +n;
59
+ }
60
+ //#endregion
61
+ //#region ../../node_modules/date-fns/_lib/normalizeDates.js
62
+ function x(e, ...t) {
63
+ let n = p.bind(null, e || t.find((e) => typeof e == "object"));
64
+ return t.map(n);
65
+ }
66
+ //#endregion
67
+ //#region ../../node_modules/date-fns/startOfDay.js
68
+ function S(e, t) {
69
+ let n = m(e, t?.in);
70
+ return n.setHours(0, 0, 0, 0), n;
71
+ }
72
+ //#endregion
73
+ //#region ../../node_modules/date-fns/differenceInCalendarDays.js
74
+ function te(e, t, n) {
75
+ let [r, i] = x(n?.in, e, t), a = S(r), o = S(i), s = +a - b(a), c = +o - b(o);
76
+ return Math.round((s - c) / u);
77
+ }
78
+ //#endregion
79
+ //#region ../../node_modules/date-fns/startOfISOWeekYear.js
80
+ function ne(e, t) {
81
+ let n = y(e, t), r = p(t?.in || e, 0);
82
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), v(r);
83
+ }
84
+ //#endregion
85
+ //#region ../../node_modules/date-fns/isDate.js
86
+ function re(e) {
87
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
88
+ }
89
+ //#endregion
90
+ //#region ../../node_modules/date-fns/isValid.js
91
+ function ie(e) {
92
+ return !(!re(e) && typeof e != "number" || isNaN(+m(e)));
93
+ }
94
+ //#endregion
95
+ //#region ../../node_modules/date-fns/endOfDay.js
96
+ function ae(e, t) {
97
+ let n = m(e, t?.in);
98
+ return n.setHours(23, 59, 59, 999), n;
99
+ }
100
+ //#endregion
101
+ //#region ../../node_modules/date-fns/_lib/normalizeInterval.js
102
+ function oe(e, t) {
103
+ let [n, r] = x(e, t.start, t.end);
104
+ return {
105
+ start: n,
106
+ end: r
107
+ };
108
+ }
109
+ //#endregion
110
+ //#region ../../node_modules/date-fns/eachDayOfInterval.js
111
+ function C(e, t) {
112
+ let { start: n, end: r } = oe(t?.in, e), i = +n > +r, a = i ? +n : +r, o = i ? r : n;
113
+ o.setHours(0, 0, 0, 0);
114
+ let s = t?.step ?? 1;
115
+ if (!s) return [];
116
+ s < 0 && (s = -s, i = !i);
117
+ let c = [];
118
+ for (; +o <= a;) c.push(p(n, o)), o.setDate(o.getDate() + s), o.setHours(0, 0, 0, 0);
119
+ return i ? c.reverse() : c;
120
+ }
121
+ //#endregion
122
+ //#region ../../node_modules/date-fns/startOfYear.js
123
+ function se(e, t) {
124
+ let n = m(e, t?.in);
125
+ return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
126
+ }
127
+ //#endregion
128
+ //#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
129
+ var ce = {
130
+ lessThanXSeconds: {
131
+ one: "less than a second",
132
+ other: "less than {{count}} seconds"
133
+ },
134
+ xSeconds: {
135
+ one: "1 second",
136
+ other: "{{count}} seconds"
137
+ },
138
+ halfAMinute: "half a minute",
139
+ lessThanXMinutes: {
140
+ one: "less than a minute",
141
+ other: "less than {{count}} minutes"
142
+ },
143
+ xMinutes: {
144
+ one: "1 minute",
145
+ other: "{{count}} minutes"
146
+ },
147
+ aboutXHours: {
148
+ one: "about 1 hour",
149
+ other: "about {{count}} hours"
150
+ },
151
+ xHours: {
152
+ one: "1 hour",
153
+ other: "{{count}} hours"
154
+ },
155
+ xDays: {
156
+ one: "1 day",
157
+ other: "{{count}} days"
158
+ },
159
+ aboutXWeeks: {
160
+ one: "about 1 week",
161
+ other: "about {{count}} weeks"
162
+ },
163
+ xWeeks: {
164
+ one: "1 week",
165
+ other: "{{count}} weeks"
166
+ },
167
+ aboutXMonths: {
168
+ one: "about 1 month",
169
+ other: "about {{count}} months"
170
+ },
171
+ xMonths: {
172
+ one: "1 month",
173
+ other: "{{count}} months"
174
+ },
175
+ aboutXYears: {
176
+ one: "about 1 year",
177
+ other: "about {{count}} years"
178
+ },
179
+ xYears: {
180
+ one: "1 year",
181
+ other: "{{count}} years"
182
+ },
183
+ overXYears: {
184
+ one: "over 1 year",
185
+ other: "over {{count}} years"
186
+ },
187
+ almostXYears: {
188
+ one: "almost 1 year",
189
+ other: "almost {{count}} years"
190
+ }
191
+ }, le = (e, t, n) => {
192
+ let r, i = ce[e];
193
+ return r = typeof i == "string" ? i : t === 1 ? i.one : i.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
194
+ };
195
+ //#endregion
196
+ //#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
197
+ function w(e) {
198
+ return (t = {}) => {
199
+ let n = t.width ? String(t.width) : e.defaultWidth;
200
+ return e.formats[n] || e.formats[e.defaultWidth];
201
+ };
202
+ }
203
+ var ue = {
204
+ date: w({
205
+ formats: {
206
+ full: "EEEE, MMMM do, y",
207
+ long: "MMMM do, y",
208
+ medium: "MMM d, y",
209
+ short: "MM/dd/yyyy"
210
+ },
211
+ defaultWidth: "full"
212
+ }),
213
+ time: w({
214
+ formats: {
215
+ full: "h:mm:ss a zzzz",
216
+ long: "h:mm:ss a z",
217
+ medium: "h:mm:ss a",
218
+ short: "h:mm a"
219
+ },
220
+ defaultWidth: "full"
221
+ }),
222
+ dateTime: w({
223
+ formats: {
224
+ full: "{{date}} 'at' {{time}}",
225
+ long: "{{date}} 'at' {{time}}",
226
+ medium: "{{date}}, {{time}}",
227
+ short: "{{date}}, {{time}}"
228
+ },
229
+ defaultWidth: "full"
230
+ })
231
+ }, de = {
232
+ lastWeek: "'last' eeee 'at' p",
233
+ yesterday: "'yesterday at' p",
234
+ today: "'today at' p",
235
+ tomorrow: "'tomorrow at' p",
236
+ nextWeek: "eeee 'at' p",
237
+ other: "P"
238
+ }, fe = (e, t, n, r) => de[e];
239
+ //#endregion
240
+ //#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
241
+ function T(e) {
242
+ return (t, n) => {
243
+ let r = n?.context ? String(n.context) : "standalone", i;
244
+ if (r === "formatting" && e.formattingValues) {
245
+ let t = e.defaultFormattingWidth || e.defaultWidth, r = n?.width ? String(n.width) : t;
246
+ i = e.formattingValues[r] || e.formattingValues[t];
247
+ } else {
248
+ let t = e.defaultWidth, r = n?.width ? String(n.width) : e.defaultWidth;
249
+ i = e.values[r] || e.values[t];
250
+ }
251
+ let a = e.argumentCallback ? e.argumentCallback(t) : t;
252
+ return i[a];
253
+ };
254
+ }
255
+ var pe = {
256
+ ordinalNumber: (e, t) => {
257
+ let n = Number(e), r = n % 100;
258
+ if (r > 20 || r < 10) switch (r % 10) {
259
+ case 1: return n + "st";
260
+ case 2: return n + "nd";
261
+ case 3: return n + "rd";
262
+ }
263
+ return n + "th";
264
+ },
265
+ era: T({
266
+ values: {
267
+ narrow: ["B", "A"],
268
+ abbreviated: ["BC", "AD"],
269
+ wide: ["Before Christ", "Anno Domini"]
270
+ },
271
+ defaultWidth: "wide"
272
+ }),
273
+ quarter: T({
274
+ values: {
275
+ narrow: [
276
+ "1",
277
+ "2",
278
+ "3",
279
+ "4"
280
+ ],
281
+ abbreviated: [
282
+ "Q1",
283
+ "Q2",
284
+ "Q3",
285
+ "Q4"
286
+ ],
287
+ wide: [
288
+ "1st quarter",
289
+ "2nd quarter",
290
+ "3rd quarter",
291
+ "4th quarter"
292
+ ]
293
+ },
294
+ defaultWidth: "wide",
295
+ argumentCallback: (e) => e - 1
296
+ }),
297
+ month: T({
298
+ values: {
299
+ narrow: [
300
+ "J",
301
+ "F",
302
+ "M",
303
+ "A",
304
+ "M",
305
+ "J",
306
+ "J",
307
+ "A",
308
+ "S",
309
+ "O",
310
+ "N",
311
+ "D"
312
+ ],
313
+ abbreviated: [
314
+ "Jan",
315
+ "Feb",
316
+ "Mar",
317
+ "Apr",
318
+ "May",
319
+ "Jun",
320
+ "Jul",
321
+ "Aug",
322
+ "Sep",
323
+ "Oct",
324
+ "Nov",
325
+ "Dec"
326
+ ],
327
+ wide: [
328
+ "January",
329
+ "February",
330
+ "March",
331
+ "April",
332
+ "May",
333
+ "June",
334
+ "July",
335
+ "August",
336
+ "September",
337
+ "October",
338
+ "November",
339
+ "December"
340
+ ]
341
+ },
342
+ defaultWidth: "wide"
343
+ }),
344
+ day: T({
345
+ values: {
346
+ narrow: [
347
+ "S",
348
+ "M",
349
+ "T",
350
+ "W",
351
+ "T",
352
+ "F",
353
+ "S"
354
+ ],
355
+ short: [
356
+ "Su",
357
+ "Mo",
358
+ "Tu",
359
+ "We",
360
+ "Th",
361
+ "Fr",
362
+ "Sa"
363
+ ],
364
+ abbreviated: [
365
+ "Sun",
366
+ "Mon",
367
+ "Tue",
368
+ "Wed",
369
+ "Thu",
370
+ "Fri",
371
+ "Sat"
372
+ ],
373
+ wide: [
374
+ "Sunday",
375
+ "Monday",
376
+ "Tuesday",
377
+ "Wednesday",
378
+ "Thursday",
379
+ "Friday",
380
+ "Saturday"
381
+ ]
382
+ },
383
+ defaultWidth: "wide"
384
+ }),
385
+ dayPeriod: T({
386
+ values: {
387
+ narrow: {
388
+ am: "a",
389
+ pm: "p",
390
+ midnight: "mi",
391
+ noon: "n",
392
+ morning: "morning",
393
+ afternoon: "afternoon",
394
+ evening: "evening",
395
+ night: "night"
396
+ },
397
+ abbreviated: {
398
+ am: "AM",
399
+ pm: "PM",
400
+ midnight: "midnight",
401
+ noon: "noon",
402
+ morning: "morning",
403
+ afternoon: "afternoon",
404
+ evening: "evening",
405
+ night: "night"
406
+ },
407
+ wide: {
408
+ am: "a.m.",
409
+ pm: "p.m.",
410
+ midnight: "midnight",
411
+ noon: "noon",
412
+ morning: "morning",
413
+ afternoon: "afternoon",
414
+ evening: "evening",
415
+ night: "night"
416
+ }
417
+ },
418
+ defaultWidth: "wide",
419
+ formattingValues: {
420
+ narrow: {
421
+ am: "a",
422
+ pm: "p",
423
+ midnight: "mi",
424
+ noon: "n",
425
+ morning: "in the morning",
426
+ afternoon: "in the afternoon",
427
+ evening: "in the evening",
428
+ night: "at night"
429
+ },
430
+ abbreviated: {
431
+ am: "AM",
432
+ pm: "PM",
433
+ midnight: "midnight",
434
+ noon: "noon",
435
+ morning: "in the morning",
436
+ afternoon: "in the afternoon",
437
+ evening: "in the evening",
438
+ night: "at night"
439
+ },
440
+ wide: {
441
+ am: "a.m.",
442
+ pm: "p.m.",
443
+ midnight: "midnight",
444
+ noon: "noon",
445
+ morning: "in the morning",
446
+ afternoon: "in the afternoon",
447
+ evening: "in the evening",
448
+ night: "at night"
449
+ }
450
+ },
451
+ defaultFormattingWidth: "wide"
452
+ })
453
+ };
454
+ //#endregion
455
+ //#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
456
+ function E(e) {
457
+ return (t, n = {}) => {
458
+ let r = n.width, i = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
459
+ if (!a) return null;
460
+ let o = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? he(s, (e) => e.test(o)) : me(s, (e) => e.test(o)), l;
461
+ l = e.valueCallback ? e.valueCallback(c) : c, l = n.valueCallback ? n.valueCallback(l) : l;
462
+ let u = t.slice(o.length);
463
+ return {
464
+ value: l,
465
+ rest: u
466
+ };
467
+ };
468
+ }
469
+ function me(e, t) {
470
+ for (let n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n;
471
+ }
472
+ function he(e, t) {
473
+ for (let n = 0; n < e.length; n++) if (t(e[n])) return n;
474
+ }
475
+ //#endregion
476
+ //#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
477
+ function ge(e) {
478
+ return (t, n = {}) => {
479
+ let r = t.match(e.matchPattern);
480
+ if (!r) return null;
481
+ let i = r[0], a = t.match(e.parsePattern);
482
+ if (!a) return null;
483
+ let o = e.valueCallback ? e.valueCallback(a[0]) : a[0];
484
+ o = n.valueCallback ? n.valueCallback(o) : o;
485
+ let s = t.slice(i.length);
486
+ return {
487
+ value: o,
488
+ rest: s
489
+ };
490
+ };
491
+ }
492
+ //#endregion
493
+ //#region ../../node_modules/date-fns/locale/en-US.js
494
+ var _e = {
495
+ code: "en-US",
496
+ formatDistance: le,
497
+ formatLong: ue,
498
+ formatRelative: fe,
499
+ localize: pe,
500
+ match: {
501
+ ordinalNumber: ge({
502
+ matchPattern: /^(\d+)(th|st|nd|rd)?/i,
503
+ parsePattern: /\d+/i,
504
+ valueCallback: (e) => parseInt(e, 10)
505
+ }),
506
+ era: E({
507
+ matchPatterns: {
508
+ narrow: /^(b|a)/i,
509
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
510
+ wide: /^(before christ|before common era|anno domini|common era)/i
511
+ },
512
+ defaultMatchWidth: "wide",
513
+ parsePatterns: { any: [/^b/i, /^(a|c)/i] },
514
+ defaultParseWidth: "any"
515
+ }),
516
+ quarter: E({
517
+ matchPatterns: {
518
+ narrow: /^[1234]/i,
519
+ abbreviated: /^q[1234]/i,
520
+ wide: /^[1234](th|st|nd|rd)? quarter/i
521
+ },
522
+ defaultMatchWidth: "wide",
523
+ parsePatterns: { any: [
524
+ /1/i,
525
+ /2/i,
526
+ /3/i,
527
+ /4/i
528
+ ] },
529
+ defaultParseWidth: "any",
530
+ valueCallback: (e) => e + 1
531
+ }),
532
+ month: E({
533
+ matchPatterns: {
534
+ narrow: /^[jfmasond]/i,
535
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
536
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
537
+ },
538
+ defaultMatchWidth: "wide",
539
+ parsePatterns: {
540
+ narrow: [
541
+ /^j/i,
542
+ /^f/i,
543
+ /^m/i,
544
+ /^a/i,
545
+ /^m/i,
546
+ /^j/i,
547
+ /^j/i,
548
+ /^a/i,
549
+ /^s/i,
550
+ /^o/i,
551
+ /^n/i,
552
+ /^d/i
553
+ ],
554
+ any: [
555
+ /^ja/i,
556
+ /^f/i,
557
+ /^mar/i,
558
+ /^ap/i,
559
+ /^may/i,
560
+ /^jun/i,
561
+ /^jul/i,
562
+ /^au/i,
563
+ /^s/i,
564
+ /^o/i,
565
+ /^n/i,
566
+ /^d/i
567
+ ]
568
+ },
569
+ defaultParseWidth: "any"
570
+ }),
571
+ day: E({
572
+ matchPatterns: {
573
+ narrow: /^[smtwf]/i,
574
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
575
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
576
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
577
+ },
578
+ defaultMatchWidth: "wide",
579
+ parsePatterns: {
580
+ narrow: [
581
+ /^s/i,
582
+ /^m/i,
583
+ /^t/i,
584
+ /^w/i,
585
+ /^t/i,
586
+ /^f/i,
587
+ /^s/i
588
+ ],
589
+ any: [
590
+ /^su/i,
591
+ /^m/i,
592
+ /^tu/i,
593
+ /^w/i,
594
+ /^th/i,
595
+ /^f/i,
596
+ /^sa/i
597
+ ]
598
+ },
599
+ defaultParseWidth: "any"
600
+ }),
601
+ dayPeriod: E({
602
+ matchPatterns: {
603
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
604
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
605
+ },
606
+ defaultMatchWidth: "any",
607
+ parsePatterns: { any: {
608
+ am: /^a/i,
609
+ pm: /^p/i,
610
+ midnight: /^mi/i,
611
+ noon: /^no/i,
612
+ morning: /morning/i,
613
+ afternoon: /afternoon/i,
614
+ evening: /evening/i,
615
+ night: /night/i
616
+ } },
617
+ defaultParseWidth: "any"
618
+ })
619
+ },
620
+ options: {
621
+ weekStartsOn: 0,
622
+ firstWeekContainsDate: 1
623
+ }
624
+ };
625
+ //#endregion
626
+ //#region ../../node_modules/date-fns/getDayOfYear.js
627
+ function ve(e, t) {
628
+ let n = m(e, t?.in);
629
+ return te(n, se(n)) + 1;
630
+ }
631
+ //#endregion
632
+ //#region ../../node_modules/date-fns/getISOWeek.js
633
+ function ye(e, t) {
634
+ let n = m(e, t?.in), r = v(n) - +ne(n);
635
+ return Math.round(r / l) + 1;
636
+ }
637
+ //#endregion
638
+ //#region ../../node_modules/date-fns/getWeekYear.js
639
+ function be(e, t) {
640
+ let n = m(e, t?.in), r = n.getFullYear(), i = g(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = p(t?.in || e, 0);
641
+ o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
642
+ let s = _(o, t), c = p(t?.in || e, 0);
643
+ c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
644
+ let l = _(c, t);
645
+ return +n >= +s ? r + 1 : +n >= +l ? r : r - 1;
646
+ }
647
+ //#endregion
648
+ //#region ../../node_modules/date-fns/startOfWeekYear.js
649
+ function xe(e, t) {
650
+ let n = g(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = be(e, t), a = p(t?.in || e, 0);
651
+ return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), _(a, t);
652
+ }
653
+ //#endregion
654
+ //#region ../../node_modules/date-fns/getWeek.js
655
+ function D(e, t) {
656
+ let n = m(e, t?.in), r = _(n, t) - +xe(n, t);
657
+ return Math.round(r / l) + 1;
658
+ }
659
+ //#endregion
660
+ //#region ../../node_modules/date-fns/_lib/addLeadingZeros.js
661
+ function O(e, t) {
662
+ return (e < 0 ? "-" : "") + Math.abs(e).toString().padStart(t, "0");
663
+ }
664
+ //#endregion
665
+ //#region ../../node_modules/date-fns/_lib/format/lightFormatters.js
666
+ var k = {
667
+ y(e, t) {
668
+ let n = e.getFullYear(), r = n > 0 ? n : 1 - n;
669
+ return O(t === "yy" ? r % 100 : r, t.length);
670
+ },
671
+ M(e, t) {
672
+ let n = e.getMonth();
673
+ return t === "M" ? String(n + 1) : O(n + 1, 2);
674
+ },
675
+ d(e, t) {
676
+ return O(e.getDate(), t.length);
677
+ },
678
+ a(e, t) {
679
+ let n = e.getHours() / 12 >= 1 ? "pm" : "am";
680
+ switch (t) {
681
+ case "a":
682
+ case "aa": return n.toUpperCase();
683
+ case "aaa": return n;
684
+ case "aaaaa": return n[0];
685
+ default: return n === "am" ? "a.m." : "p.m.";
686
+ }
687
+ },
688
+ h(e, t) {
689
+ return O(e.getHours() % 12 || 12, t.length);
690
+ },
691
+ H(e, t) {
692
+ return O(e.getHours(), t.length);
693
+ },
694
+ m(e, t) {
695
+ return O(e.getMinutes(), t.length);
696
+ },
697
+ s(e, t) {
698
+ return O(e.getSeconds(), t.length);
699
+ },
700
+ S(e, t) {
701
+ let n = t.length, r = e.getMilliseconds();
702
+ return O(Math.trunc(r * 10 ** (n - 3)), t.length);
703
+ }
704
+ }, A = {
705
+ am: "am",
706
+ pm: "pm",
707
+ midnight: "midnight",
708
+ noon: "noon",
709
+ morning: "morning",
710
+ afternoon: "afternoon",
711
+ evening: "evening",
712
+ night: "night"
713
+ }, Se = {
714
+ G: function(e, t, n) {
715
+ let r = +(e.getFullYear() > 0);
716
+ switch (t) {
717
+ case "G":
718
+ case "GG":
719
+ case "GGG": return n.era(r, { width: "abbreviated" });
720
+ case "GGGGG": return n.era(r, { width: "narrow" });
721
+ default: return n.era(r, { width: "wide" });
722
+ }
723
+ },
724
+ y: function(e, t, n) {
725
+ if (t === "yo") {
726
+ let t = e.getFullYear(), r = t > 0 ? t : 1 - t;
727
+ return n.ordinalNumber(r, { unit: "year" });
728
+ }
729
+ return k.y(e, t);
730
+ },
731
+ Y: function(e, t, n, r) {
732
+ let i = be(e, r), a = i > 0 ? i : 1 - i;
733
+ return t === "YY" ? O(a % 100, 2) : t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : O(a, t.length);
734
+ },
735
+ R: function(e, t) {
736
+ return O(y(e), t.length);
737
+ },
738
+ u: function(e, t) {
739
+ return O(e.getFullYear(), t.length);
740
+ },
741
+ Q: function(e, t, n) {
742
+ let r = Math.ceil((e.getMonth() + 1) / 3);
743
+ switch (t) {
744
+ case "Q": return String(r);
745
+ case "QQ": return O(r, 2);
746
+ case "Qo": return n.ordinalNumber(r, { unit: "quarter" });
747
+ case "QQQ": return n.quarter(r, {
748
+ width: "abbreviated",
749
+ context: "formatting"
750
+ });
751
+ case "QQQQQ": return n.quarter(r, {
752
+ width: "narrow",
753
+ context: "formatting"
754
+ });
755
+ default: return n.quarter(r, {
756
+ width: "wide",
757
+ context: "formatting"
758
+ });
759
+ }
760
+ },
761
+ q: function(e, t, n) {
762
+ let r = Math.ceil((e.getMonth() + 1) / 3);
763
+ switch (t) {
764
+ case "q": return String(r);
765
+ case "qq": return O(r, 2);
766
+ case "qo": return n.ordinalNumber(r, { unit: "quarter" });
767
+ case "qqq": return n.quarter(r, {
768
+ width: "abbreviated",
769
+ context: "standalone"
770
+ });
771
+ case "qqqqq": return n.quarter(r, {
772
+ width: "narrow",
773
+ context: "standalone"
774
+ });
775
+ default: return n.quarter(r, {
776
+ width: "wide",
777
+ context: "standalone"
778
+ });
779
+ }
780
+ },
781
+ M: function(e, t, n) {
782
+ let r = e.getMonth();
783
+ switch (t) {
784
+ case "M":
785
+ case "MM": return k.M(e, t);
786
+ case "Mo": return n.ordinalNumber(r + 1, { unit: "month" });
787
+ case "MMM": return n.month(r, {
788
+ width: "abbreviated",
789
+ context: "formatting"
790
+ });
791
+ case "MMMMM": return n.month(r, {
792
+ width: "narrow",
793
+ context: "formatting"
794
+ });
795
+ default: return n.month(r, {
796
+ width: "wide",
797
+ context: "formatting"
798
+ });
799
+ }
800
+ },
801
+ L: function(e, t, n) {
802
+ let r = e.getMonth();
803
+ switch (t) {
804
+ case "L": return String(r + 1);
805
+ case "LL": return O(r + 1, 2);
806
+ case "Lo": return n.ordinalNumber(r + 1, { unit: "month" });
807
+ case "LLL": return n.month(r, {
808
+ width: "abbreviated",
809
+ context: "standalone"
810
+ });
811
+ case "LLLLL": return n.month(r, {
812
+ width: "narrow",
813
+ context: "standalone"
814
+ });
815
+ default: return n.month(r, {
816
+ width: "wide",
817
+ context: "standalone"
818
+ });
819
+ }
820
+ },
821
+ w: function(e, t, n, r) {
822
+ let i = D(e, r);
823
+ return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) : O(i, t.length);
824
+ },
825
+ I: function(e, t, n) {
826
+ let r = ye(e);
827
+ return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : O(r, t.length);
828
+ },
829
+ d: function(e, t, n) {
830
+ return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : k.d(e, t);
831
+ },
832
+ D: function(e, t, n) {
833
+ let r = ve(e);
834
+ return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : O(r, t.length);
835
+ },
836
+ E: function(e, t, n) {
837
+ let r = e.getDay();
838
+ switch (t) {
839
+ case "E":
840
+ case "EE":
841
+ case "EEE": return n.day(r, {
842
+ width: "abbreviated",
843
+ context: "formatting"
844
+ });
845
+ case "EEEEE": return n.day(r, {
846
+ width: "narrow",
847
+ context: "formatting"
848
+ });
849
+ case "EEEEEE": return n.day(r, {
850
+ width: "short",
851
+ context: "formatting"
852
+ });
853
+ default: return n.day(r, {
854
+ width: "wide",
855
+ context: "formatting"
856
+ });
857
+ }
858
+ },
859
+ e: function(e, t, n, r) {
860
+ let i = e.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
861
+ switch (t) {
862
+ case "e": return String(a);
863
+ case "ee": return O(a, 2);
864
+ case "eo": return n.ordinalNumber(a, { unit: "day" });
865
+ case "eee": return n.day(i, {
866
+ width: "abbreviated",
867
+ context: "formatting"
868
+ });
869
+ case "eeeee": return n.day(i, {
870
+ width: "narrow",
871
+ context: "formatting"
872
+ });
873
+ case "eeeeee": return n.day(i, {
874
+ width: "short",
875
+ context: "formatting"
876
+ });
877
+ default: return n.day(i, {
878
+ width: "wide",
879
+ context: "formatting"
880
+ });
881
+ }
882
+ },
883
+ c: function(e, t, n, r) {
884
+ let i = e.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
885
+ switch (t) {
886
+ case "c": return String(a);
887
+ case "cc": return O(a, t.length);
888
+ case "co": return n.ordinalNumber(a, { unit: "day" });
889
+ case "ccc": return n.day(i, {
890
+ width: "abbreviated",
891
+ context: "standalone"
892
+ });
893
+ case "ccccc": return n.day(i, {
894
+ width: "narrow",
895
+ context: "standalone"
896
+ });
897
+ case "cccccc": return n.day(i, {
898
+ width: "short",
899
+ context: "standalone"
900
+ });
901
+ default: return n.day(i, {
902
+ width: "wide",
903
+ context: "standalone"
904
+ });
905
+ }
906
+ },
907
+ i: function(e, t, n) {
908
+ let r = e.getDay(), i = r === 0 ? 7 : r;
909
+ switch (t) {
910
+ case "i": return String(i);
911
+ case "ii": return O(i, t.length);
912
+ case "io": return n.ordinalNumber(i, { unit: "day" });
913
+ case "iii": return n.day(r, {
914
+ width: "abbreviated",
915
+ context: "formatting"
916
+ });
917
+ case "iiiii": return n.day(r, {
918
+ width: "narrow",
919
+ context: "formatting"
920
+ });
921
+ case "iiiiii": return n.day(r, {
922
+ width: "short",
923
+ context: "formatting"
924
+ });
925
+ default: return n.day(r, {
926
+ width: "wide",
927
+ context: "formatting"
928
+ });
929
+ }
930
+ },
931
+ a: function(e, t, n) {
932
+ let r = e.getHours() / 12 >= 1 ? "pm" : "am";
933
+ switch (t) {
934
+ case "a":
935
+ case "aa": return n.dayPeriod(r, {
936
+ width: "abbreviated",
937
+ context: "formatting"
938
+ });
939
+ case "aaa": return n.dayPeriod(r, {
940
+ width: "abbreviated",
941
+ context: "formatting"
942
+ }).toLowerCase();
943
+ case "aaaaa": return n.dayPeriod(r, {
944
+ width: "narrow",
945
+ context: "formatting"
946
+ });
947
+ default: return n.dayPeriod(r, {
948
+ width: "wide",
949
+ context: "formatting"
950
+ });
951
+ }
952
+ },
953
+ b: function(e, t, n) {
954
+ let r = e.getHours(), i;
955
+ switch (i = r === 12 ? A.noon : r === 0 ? A.midnight : r / 12 >= 1 ? "pm" : "am", t) {
956
+ case "b":
957
+ case "bb": return n.dayPeriod(i, {
958
+ width: "abbreviated",
959
+ context: "formatting"
960
+ });
961
+ case "bbb": return n.dayPeriod(i, {
962
+ width: "abbreviated",
963
+ context: "formatting"
964
+ }).toLowerCase();
965
+ case "bbbbb": return n.dayPeriod(i, {
966
+ width: "narrow",
967
+ context: "formatting"
968
+ });
969
+ default: return n.dayPeriod(i, {
970
+ width: "wide",
971
+ context: "formatting"
972
+ });
973
+ }
974
+ },
975
+ B: function(e, t, n) {
976
+ let r = e.getHours(), i;
977
+ switch (i = r >= 17 ? A.evening : r >= 12 ? A.afternoon : r >= 4 ? A.morning : A.night, t) {
978
+ case "B":
979
+ case "BB":
980
+ case "BBB": return n.dayPeriod(i, {
981
+ width: "abbreviated",
982
+ context: "formatting"
983
+ });
984
+ case "BBBBB": return n.dayPeriod(i, {
985
+ width: "narrow",
986
+ context: "formatting"
987
+ });
988
+ default: return n.dayPeriod(i, {
989
+ width: "wide",
990
+ context: "formatting"
991
+ });
992
+ }
993
+ },
994
+ h: function(e, t, n) {
995
+ if (t === "ho") {
996
+ let t = e.getHours() % 12;
997
+ return t === 0 && (t = 12), n.ordinalNumber(t, { unit: "hour" });
998
+ }
999
+ return k.h(e, t);
1000
+ },
1001
+ H: function(e, t, n) {
1002
+ return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : k.H(e, t);
1003
+ },
1004
+ K: function(e, t, n) {
1005
+ let r = e.getHours() % 12;
1006
+ return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : O(r, t.length);
1007
+ },
1008
+ k: function(e, t, n) {
1009
+ let r = e.getHours();
1010
+ return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : O(r, t.length);
1011
+ },
1012
+ m: function(e, t, n) {
1013
+ return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : k.m(e, t);
1014
+ },
1015
+ s: function(e, t, n) {
1016
+ return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : k.s(e, t);
1017
+ },
1018
+ S: function(e, t) {
1019
+ return k.S(e, t);
1020
+ },
1021
+ X: function(e, t, n) {
1022
+ let r = e.getTimezoneOffset();
1023
+ if (r === 0) return "Z";
1024
+ switch (t) {
1025
+ case "X": return j(r);
1026
+ case "XXXX":
1027
+ case "XX": return M(r);
1028
+ default: return M(r, ":");
1029
+ }
1030
+ },
1031
+ x: function(e, t, n) {
1032
+ let r = e.getTimezoneOffset();
1033
+ switch (t) {
1034
+ case "x": return j(r);
1035
+ case "xxxx":
1036
+ case "xx": return M(r);
1037
+ default: return M(r, ":");
1038
+ }
1039
+ },
1040
+ O: function(e, t, n) {
1041
+ let r = e.getTimezoneOffset();
1042
+ switch (t) {
1043
+ case "O":
1044
+ case "OO":
1045
+ case "OOO": return "GMT" + Ce(r, ":");
1046
+ default: return "GMT" + M(r, ":");
1047
+ }
1048
+ },
1049
+ z: function(e, t, n) {
1050
+ let r = e.getTimezoneOffset();
1051
+ switch (t) {
1052
+ case "z":
1053
+ case "zz":
1054
+ case "zzz": return "GMT" + Ce(r, ":");
1055
+ default: return "GMT" + M(r, ":");
1056
+ }
1057
+ },
1058
+ t: function(e, t, n) {
1059
+ return O(Math.trunc(e / 1e3), t.length);
1060
+ },
1061
+ T: function(e, t, n) {
1062
+ return O(+e, t.length);
1063
+ }
1064
+ };
1065
+ function Ce(e, t = "") {
1066
+ let n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), a = r % 60;
1067
+ return a === 0 ? n + String(i) : n + String(i) + t + O(a, 2);
1068
+ }
1069
+ function j(e, t) {
1070
+ return e % 60 == 0 ? (e > 0 ? "-" : "+") + O(Math.abs(e) / 60, 2) : M(e, t);
1071
+ }
1072
+ function M(e, t = "") {
1073
+ let n = e > 0 ? "-" : "+", r = Math.abs(e), i = O(Math.trunc(r / 60), 2), a = O(r % 60, 2);
1074
+ return n + i + t + a;
1075
+ }
1076
+ //#endregion
1077
+ //#region ../../node_modules/date-fns/_lib/format/longFormatters.js
1078
+ var N = (e, t) => {
1079
+ switch (e) {
1080
+ case "P": return t.date({ width: "short" });
1081
+ case "PP": return t.date({ width: "medium" });
1082
+ case "PPP": return t.date({ width: "long" });
1083
+ default: return t.date({ width: "full" });
1084
+ }
1085
+ }, P = (e, t) => {
1086
+ switch (e) {
1087
+ case "p": return t.time({ width: "short" });
1088
+ case "pp": return t.time({ width: "medium" });
1089
+ case "ppp": return t.time({ width: "long" });
1090
+ default: return t.time({ width: "full" });
1091
+ }
1092
+ }, we = {
1093
+ p: P,
1094
+ P: (e, t) => {
1095
+ let n = e.match(/(P+)(p+)?/) || [], r = n[1], i = n[2];
1096
+ if (!i) return N(e, t);
1097
+ let a;
1098
+ switch (r) {
1099
+ case "P":
1100
+ a = t.dateTime({ width: "short" });
1101
+ break;
1102
+ case "PP":
1103
+ a = t.dateTime({ width: "medium" });
1104
+ break;
1105
+ case "PPP":
1106
+ a = t.dateTime({ width: "long" });
1107
+ break;
1108
+ default:
1109
+ a = t.dateTime({ width: "full" });
1110
+ break;
1111
+ }
1112
+ return a.replace("{{date}}", N(r, t)).replace("{{time}}", P(i, t));
1113
+ }
1114
+ }, Te = /^D+$/, Ee = /^Y+$/, De = [
1115
+ "D",
1116
+ "DD",
1117
+ "YY",
1118
+ "YYYY"
1119
+ ];
1120
+ function Oe(e) {
1121
+ return Te.test(e);
1122
+ }
1123
+ function ke(e) {
1124
+ return Ee.test(e);
1125
+ }
1126
+ function Ae(e, t, n) {
1127
+ let r = je(e, t, n);
1128
+ if (console.warn(r), De.includes(e)) throw RangeError(r);
1129
+ }
1130
+ function je(e, t, n) {
1131
+ let r = e[0] === "Y" ? "years" : "days of the month";
1132
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1133
+ }
1134
+ //#endregion
1135
+ //#region ../../node_modules/date-fns/format.js
1136
+ var Me = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ne = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Pe = /^'([^]*?)'?$/, Fe = /''/g, Ie = /[a-zA-Z]/;
1137
+ function Le(e, t, n) {
1138
+ let r = g(), i = n?.locale ?? r.locale ?? _e, a = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = m(e, n?.in);
1139
+ if (!ie(s)) throw RangeError("Invalid time value");
1140
+ let c = t.match(Ne).map((e) => {
1141
+ let t = e[0];
1142
+ if (t === "p" || t === "P") {
1143
+ let n = we[t];
1144
+ return n(e, i.formatLong);
1145
+ }
1146
+ return e;
1147
+ }).join("").match(Me).map((e) => {
1148
+ if (e === "''") return {
1149
+ isToken: !1,
1150
+ value: "'"
1151
+ };
1152
+ let t = e[0];
1153
+ if (t === "'") return {
1154
+ isToken: !1,
1155
+ value: Re(e)
1156
+ };
1157
+ if (Se[t]) return {
1158
+ isToken: !0,
1159
+ value: e
1160
+ };
1161
+ if (t.match(Ie)) throw RangeError("Format string contains an unescaped latin alphabet character `" + t + "`");
1162
+ return {
1163
+ isToken: !1,
1164
+ value: e
1165
+ };
1166
+ });
1167
+ i.localize.preprocessor && (c = i.localize.preprocessor(s, c));
1168
+ let l = {
1169
+ firstWeekContainsDate: a,
1170
+ weekStartsOn: o,
1171
+ locale: i
1172
+ };
1173
+ return c.map((r) => {
1174
+ if (!r.isToken) return r.value;
1175
+ let a = r.value;
1176
+ (!n?.useAdditionalWeekYearTokens && ke(a) || !n?.useAdditionalDayOfYearTokens && Oe(a)) && Ae(a, t, String(e));
1177
+ let o = Se[a[0]];
1178
+ return o(s, a, i.localize, l);
1179
+ }).join("");
1180
+ }
1181
+ function Re(e) {
1182
+ let t = e.match(Pe);
1183
+ return t ? t[1].replace(Fe, "'") : e;
1184
+ }
1185
+ //#endregion
1186
+ //#region ../../node_modules/date-fns/getISODay.js
1187
+ function ze(e, t) {
1188
+ let n = m(e, t?.in).getDay();
1189
+ return n === 0 ? 7 : n;
1190
+ }
1191
+ //#endregion
1192
+ //#region ../../node_modules/@date-fns/tz/tzName/index.js
1193
+ function Be(e, t, n = "long") {
1194
+ return new Intl.DateTimeFormat("en-US", {
1195
+ hour: "numeric",
1196
+ timeZone: e,
1197
+ timeZoneName: n
1198
+ }).format(t).split(/\s/g).slice(2).join(" ");
1199
+ }
1200
+ //#endregion
1201
+ //#region ../../node_modules/@date-fns/tz/tzOffset/index.js
1202
+ var Ve = {}, F = {};
1203
+ function I(e, t) {
1204
+ try {
1205
+ let n = (Ve[e] ||= new Intl.DateTimeFormat("en-US", {
1206
+ timeZone: e,
1207
+ timeZoneName: "longOffset"
1208
+ }).format)(t).split("GMT")[1];
1209
+ return n in F ? F[n] : Ue(n, n.split(":"));
1210
+ } catch {
1211
+ if (e in F) return F[e];
1212
+ let t = e?.match(He);
1213
+ return t ? Ue(e, t.slice(1)) : NaN;
1214
+ }
1215
+ }
1216
+ var He = /([+-]\d\d):?(\d\d)?/;
1217
+ function Ue(e, t) {
1218
+ let n = +(t[0] || 0), r = +(t[1] || 0), i = (t[2] || 0) / 60;
1219
+ return F[e] = n * 60 + r > 0 ? n * 60 + r + i : n * 60 - r - i;
1220
+ }
1221
+ //#endregion
1222
+ //#region ../../node_modules/@date-fns/tz/date/mini.js
1223
+ var L = class e extends Date {
1224
+ constructor(...e) {
1225
+ super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(I(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), Ke(this, NaN), R(this)) : this.setTime(Date.now());
1226
+ }
1227
+ static tz(t, ...n) {
1228
+ return n.length ? new e(...n, t) : new e(Date.now(), t);
1229
+ }
1230
+ withTimeZone(t) {
1231
+ return new e(+this, t);
1232
+ }
1233
+ getTimezoneOffset() {
1234
+ let e = -I(this.timeZone, this);
1235
+ return e > 0 ? Math.floor(e) : Math.ceil(e);
1236
+ }
1237
+ setTime(e) {
1238
+ return Date.prototype.setTime.apply(this, arguments), R(this), +this;
1239
+ }
1240
+ [Symbol.for("constructDateFrom")](t) {
1241
+ return new e(+new Date(t), this.timeZone);
1242
+ }
1243
+ }, We = /^(get|set)(?!UTC)/;
1244
+ Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
1245
+ if (!We.test(e)) return;
1246
+ let t = e.replace(We, "$1UTC");
1247
+ L.prototype[t] && (e.startsWith("get") ? L.prototype[e] = function() {
1248
+ return this.internal[t]();
1249
+ } : (L.prototype[e] = function() {
1250
+ return Date.prototype[t].apply(this.internal, arguments), Ge(this), +this;
1251
+ }, L.prototype[t] = function() {
1252
+ return Date.prototype[t].apply(this, arguments), R(this), +this;
1253
+ }));
1254
+ });
1255
+ function R(e) {
1256
+ e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-I(e.timeZone, e) * 60));
1257
+ }
1258
+ function Ge(e) {
1259
+ Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Ke(e);
1260
+ }
1261
+ function Ke(e) {
1262
+ let t = I(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
1263
+ r.setUTCHours(r.getUTCHours() - 1);
1264
+ let i = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = i - -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), o = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
1265
+ a && o && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
1266
+ let s = i - n;
1267
+ s && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + s);
1268
+ let c = /* @__PURE__ */ new Date(+e);
1269
+ c.setUTCSeconds(0);
1270
+ let l = i > 0 ? c.getSeconds() : (c.getSeconds() - 60) % 60, u = Math.round(-(I(e.timeZone, e) * 60)) % 60;
1271
+ (u || l) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + l));
1272
+ let d = I(e.timeZone, e), f = d > 0 ? Math.floor(d) : Math.ceil(d), p = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - f, m = f !== n, h = p - s;
1273
+ if (m && h) {
1274
+ Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + h);
1275
+ let t = I(e.timeZone, e), n = f - (t > 0 ? Math.floor(t) : Math.ceil(t));
1276
+ n && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + n), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + n));
1277
+ }
1278
+ }
1279
+ //#endregion
1280
+ //#region ../../node_modules/@date-fns/tz/date/index.js
1281
+ var qe = class e extends L {
1282
+ static tz(t, ...n) {
1283
+ return n.length ? new e(...n, t) : new e(Date.now(), t);
1284
+ }
1285
+ toISOString() {
1286
+ let [e, t, n] = this.tzComponents(), r = `${e}${t}:${n}`;
1287
+ return this.internal.toISOString().slice(0, -1) + r;
1288
+ }
1289
+ toString() {
1290
+ return `${this.toDateString()} ${this.toTimeString()}`;
1291
+ }
1292
+ toDateString() {
1293
+ let [e, t, n, r] = this.internal.toUTCString().split(" ");
1294
+ return `${e?.slice(0, -1)} ${n} ${t} ${r}`;
1295
+ }
1296
+ toTimeString() {
1297
+ let e = this.internal.toUTCString().split(" ")[4], [t, n, r] = this.tzComponents();
1298
+ return `${e} GMT${t}${n}${r} (${Be(this.timeZone, this)})`;
1299
+ }
1300
+ toLocaleString(e, t) {
1301
+ return Date.prototype.toLocaleString.call(this, e, {
1302
+ ...t,
1303
+ timeZone: t?.timeZone || this.timeZone
1304
+ });
1305
+ }
1306
+ toLocaleDateString(e, t) {
1307
+ return Date.prototype.toLocaleDateString.call(this, e, {
1308
+ ...t,
1309
+ timeZone: t?.timeZone || this.timeZone
1310
+ });
1311
+ }
1312
+ toLocaleTimeString(e, t) {
1313
+ return Date.prototype.toLocaleTimeString.call(this, e, {
1314
+ ...t,
1315
+ timeZone: t?.timeZone || this.timeZone
1316
+ });
1317
+ }
1318
+ tzComponents() {
1319
+ let e = this.getTimezoneOffset();
1320
+ return [
1321
+ e > 0 ? "-" : "+",
1322
+ String(Math.floor(Math.abs(e) / 60)).padStart(2, "0"),
1323
+ String(Math.abs(e) % 60).padStart(2, "0")
1324
+ ];
1325
+ }
1326
+ withTimeZone(t) {
1327
+ return new e(+this, t);
1328
+ }
1329
+ [Symbol.for("constructDateFrom")](t) {
1330
+ return new e(+new Date(t), this.timeZone);
1331
+ }
1332
+ };
1333
+ //#endregion
1334
+ //#region ../../shared-utils/date-utils.ts
1335
+ window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz;
1336
+ var Je = (e = window.pktTz) => {
1337
+ let t = new qe((/* @__PURE__ */ new Date()).toISOString(), e);
1338
+ return t.setHours(0, 0, 0, 0), isNaN(t.getTime()) ? /* @__PURE__ */ new Date() : new Date(t.getFullYear(), t.getMonth(), t.getDate());
1339
+ };
1340
+ function z(e) {
1341
+ if (!e || e === "") return /* @__PURE__ */ new Date();
1342
+ if (/^\d{4}-\d{2}-\d{2}$/.test(e)) {
1343
+ let [t, n, r] = e.split("-").map(Number);
1344
+ return new Date(t, n - 1, r);
1345
+ }
1346
+ if (/^\d{4}-\d{2}$/.test(e)) {
1347
+ let [t, n] = e.split("-").map(Number);
1348
+ return new Date(t, n - 1, 1);
1349
+ }
1350
+ return /^\d{4}$/.test(e) ? new Date(Number(e), 0, 1) : new Date(e);
1351
+ }
1352
+ var B = (e) => !e || isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, V = (e) => {
1353
+ if (!e) return null;
1354
+ let t = z(e);
1355
+ return isNaN(t.getTime()) ? null : t;
1356
+ }, Ye = (e, t) => {
1357
+ let n = H(e);
1358
+ return isNaN(n.getTime()) ? "" : Le(n, t);
1359
+ }, H = (e = "", t) => {
1360
+ let n = typeof e == "string" ? z(e) : e;
1361
+ return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : t ? t === "end" ? ae(n) : S(n) : n;
1362
+ }, U = (e, t, n = 1) => {
1363
+ if (typeof e != "number" || typeof t != "number" || typeof n != "number" || isNaN(e) || isNaN(t) || isNaN(n)) return /* @__PURE__ */ new Date();
1364
+ let r = new Date(e, t, n);
1365
+ return isNaN(r.getTime()) ? /* @__PURE__ */ new Date() : r;
1366
+ }, W = (e) => {
1367
+ let t;
1368
+ return t = new qe(e, window.pktTz), t.setHours(12, 0, 0, 0), t;
1369
+ }, G = null, K = void 0, Xe = (e) => {
1370
+ if (!e || isNaN(e.getTime())) return "";
1371
+ let t = typeof window < "u" ? window.pktTz : void 0;
1372
+ return (!G || K !== t) && (G = new Intl.DateTimeFormat("no", {
1373
+ dateStyle: "full",
1374
+ timeZone: t
1375
+ }), K = t), G.format(e);
1376
+ }, Ze = (e, t, n) => {
1377
+ if (!e || isNaN(e.getTime())) return !1;
1378
+ let r = t ? H(t) : null, i = n ? H(n) : null;
1379
+ return !(r && e < r || i && e > i);
1380
+ }, Qe = (e, t) => {
1381
+ if (!e || isNaN(e.getTime()) || !Array.isArray(t)) return !1;
1382
+ let n = B(e);
1383
+ return t.includes(n);
1384
+ }, $e = (e, t) => {
1385
+ if (!e || isNaN(e.getTime()) || !Array.isArray(t)) return !1;
1386
+ let n = e.getDay().toString();
1387
+ return t.includes(n);
1388
+ }, q = (e, t, n, r, i) => !(!e || isNaN(e.getTime()) || !Ze(e, t, n) || r && Qe(e, r) || i && $e(e, i)), et = (e, t, n, r, i) => e.filter((e) => {
1389
+ let a = V(e);
1390
+ return a && q(a, t, n, r, i);
1391
+ }), tt = (e) => e.slice().sort((e, t) => {
1392
+ let n = V(e), r = V(t);
1393
+ return !n || !r ? 0 : n.getTime() - r.getTime();
1394
+ }), nt = (e, t) => {
1395
+ let n = V(e), r = V(t);
1396
+ return !n || !r ? !1 : n <= r;
1397
+ }, rt = (e) => {
1398
+ if (!e) return [];
1399
+ if (Array.isArray(e)) return e.filter(Boolean);
1400
+ if (typeof e == "string" && e.trimStart().startsWith("[")) try {
1401
+ let t = JSON.parse(e);
1402
+ if (Array.isArray(t)) return t.filter(Boolean);
1403
+ } catch {}
1404
+ return String(e).split(",").map((e) => e.trim()).filter(Boolean);
1405
+ }, it = (e) => e.join(","), J = {
1406
+ csvToArray: (e) => rt(e),
1407
+ stringToDate: (e) => e ? z(e) : null,
1408
+ stringsToDate: (e) => {
1409
+ if (typeof e == "string") return e.split(",").map((e) => z(e));
1410
+ if (Array.isArray(e)) return e.map((e) => z(e));
1411
+ }
1412
+ }, Y = {
1413
+ name: "pkt-calendar",
1414
+ react: "PktCalendar",
1415
+ "css-class": "pkt-calendar",
1416
+ isElement: !0,
1417
+ isPureReact: !0,
1418
+ props: {
1419
+ id: {
1420
+ type: "string",
1421
+ name: "ID",
1422
+ description: "Unik identifikasjon for kalenderen"
1423
+ },
1424
+ currentmonth: {
1425
+ type: "date",
1426
+ name: "Gjeldende måned",
1427
+ converter: "stringToDate",
1428
+ description: "Måneden som vises i kalenderen"
1429
+ },
1430
+ selected: {
1431
+ type: "array",
1432
+ name: "Valgte datoer",
1433
+ converter: "csvToArray",
1434
+ reflect: !0,
1435
+ items: { type: "date" },
1436
+ description: "Liste over valgte datoer"
1437
+ },
1438
+ excludeweekdays: {
1439
+ type: "array",
1440
+ name: "Utelat ukedager",
1441
+ converter: "csvToArray",
1442
+ items: { type: "string" },
1443
+ description: "Liste over ukedager (1-7) som skal ekskluderes"
1444
+ },
1445
+ excludedates: {
1446
+ type: "array",
1447
+ name: "Utelat datoer",
1448
+ converter: "stringsToDate",
1449
+ items: { type: "date" },
1450
+ description: "Liste over spesifikke datoer som skal ekskluderes"
1451
+ },
1452
+ earliest: {
1453
+ type: "date",
1454
+ name: "Tidligst tillatte dato",
1455
+ converter: "stringToDate",
1456
+ default: null,
1457
+ description: "Tidligste dato som kan velges"
1458
+ },
1459
+ latest: {
1460
+ type: "date",
1461
+ name: "Senest tillatte dato",
1462
+ converter: "stringToDate",
1463
+ default: null,
1464
+ description: "Seneste dato som kan velges"
1465
+ },
1466
+ weeknumbers: {
1467
+ type: "boolean",
1468
+ name: "Vis ukenummer",
1469
+ reflect: !0,
1470
+ default: !1,
1471
+ description: "Vis ukenummer i kalenderen"
1472
+ },
1473
+ withcontrols: {
1474
+ type: "boolean",
1475
+ name: "Med velgere for måned/år",
1476
+ reflect: !0,
1477
+ default: !1,
1478
+ description: "Vis navigasjonskontroller for måned og år"
1479
+ },
1480
+ multiple: {
1481
+ type: "boolean",
1482
+ name: "Flervalg",
1483
+ reflect: !0,
1484
+ default: !1,
1485
+ description: "Tillat valg av flere datoer"
1486
+ },
1487
+ maxMultiple: {
1488
+ attribute: "max-multiple",
1489
+ type: "number",
1490
+ name: "Maks antall i flervalg",
1491
+ default: 4,
1492
+ description: "Maksimalt antall datoer som kan velges"
1493
+ },
1494
+ today: {
1495
+ type: "string",
1496
+ name: "Dagens dato (overstyring)",
1497
+ description: "ISO-datostreng som overstyrer dagens dato. Nyttig for snapshot-tester."
1498
+ },
1499
+ range: {
1500
+ type: "boolean",
1501
+ name: "Datotidsrom (fra og til)",
1502
+ reflect: !0,
1503
+ default: !1,
1504
+ description: "Tillat valg av datotidsrom"
1505
+ },
1506
+ dayStrings: {
1507
+ attribute: "day-strings",
1508
+ type: "array",
1509
+ name: "Korte dagsnavn",
1510
+ items: { type: "string" },
1511
+ description: "Korte dagsnavn for kalenderoverskriften"
1512
+ },
1513
+ dayStringsLong: {
1514
+ attribute: "day-strings-long",
1515
+ type: "array",
1516
+ name: "Fulle dagsnavn",
1517
+ items: { type: "string" },
1518
+ description: "Fulle dagsnavn for tilgjengelighetsetiketter"
1519
+ },
1520
+ monthStrings: {
1521
+ attribute: "month-strings",
1522
+ type: "array",
1523
+ name: "Månedsnavn",
1524
+ items: { type: "string" },
1525
+ description: "Månedsnavn for kalendernavigasjonen"
1526
+ },
1527
+ weekString: {
1528
+ attribute: "week-string",
1529
+ type: "string",
1530
+ name: "Ukenummer-etikett",
1531
+ description: "Etikett for ukenummerkolonnen"
1532
+ },
1533
+ prevMonthString: {
1534
+ attribute: "prev-month-string",
1535
+ type: "string",
1536
+ name: "Forrige måned-etikett",
1537
+ description: "Tilgjengelighetsetikett for forrige måned-knappen"
1538
+ },
1539
+ nextMonthString: {
1540
+ attribute: "next-month-string",
1541
+ type: "string",
1542
+ name: "Neste måned-etikett",
1543
+ description: "Tilgjengelighetsetikett for neste måned-knappen"
1544
+ }
1545
+ },
1546
+ events: {
1547
+ "date-selected": { description: "Returnerer en liste med valgte datoer i ISO-format" },
1548
+ close: { description: "Utløses når kalenderen ber om å lukkes (Escape-tast eller fokus forlater)" }
1549
+ }
1550
+ };
1551
+ //#endregion
1552
+ //#region ../../shared-utils/calendar/date-validation.ts
1553
+ function at(e, t) {
1554
+ let n = (t.excludedates ?? []).map((e) => typeof e == "string" ? e : B(e));
1555
+ return !q(e, t.earliest, t.latest, n, t.excludeweekdays ?? []);
1556
+ }
1557
+ function ot(e, t, n, r) {
1558
+ return !!(at(e, n) || !t && r.multiple && r.maxMultiple > 0 && r.selectedCount >= r.maxMultiple);
1559
+ }
1560
+ function st(e, t, n) {
1561
+ let r = U(e, t, 0);
1562
+ return !(n && H(n) > r);
1563
+ }
1564
+ function ct(e, t, n) {
1565
+ let r = U(t === 11 ? e + 1 : e, t === 11 ? 0 : t + 1, 1);
1566
+ return !(n && H(n) < r);
1567
+ }
1568
+ function lt(e, t) {
1569
+ let n = U(e, t, 1), r = U(e, t + 1, 0), i = (n.getDay() + 6) % 7, a = r.getDate();
1570
+ return {
1571
+ firstDayOfMonth: n,
1572
+ lastDayOfMonth: r,
1573
+ startingDay: i,
1574
+ numDays: a,
1575
+ numRows: Math.ceil((a + i) / 7),
1576
+ numDaysPrevMonth: U(e, t, 0).getDate(),
1577
+ initialWeek: D(n)
1578
+ };
1579
+ }
1580
+ function ut(e, t, n, r) {
1581
+ let { startingDay: i, numDays: a } = r;
1582
+ return e === 0 && t < i ? "prev-month" : n > a ? "next-month" : "current-month";
1583
+ }
1584
+ function dt(e, t, n, r) {
1585
+ let { startingDay: i, numDaysPrevMonth: a, numDays: o } = r;
1586
+ return e === "prev-month" ? a - (i - t - 1) : e === "next-month" ? n - o : n;
1587
+ }
1588
+ //#endregion
1589
+ //#region ../../shared-utils/calendar/selection-manager.ts
1590
+ function X(e) {
1591
+ return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((e) => z(e));
1592
+ }
1593
+ function ft(e, t) {
1594
+ let n = C({
1595
+ start: e,
1596
+ end: t
1597
+ }), r = {};
1598
+ if (Array.isArray(n) && n.length) for (let i = 0; i < n.length; i++) {
1599
+ let a = n[i], o = a > e && a < t;
1600
+ r[B(a)] = o;
1601
+ }
1602
+ return r;
1603
+ }
1604
+ function pt(e, t, n, r) {
1605
+ if (t.length !== 1) return !0;
1606
+ let i = C({
1607
+ start: t[0],
1608
+ end: e
1609
+ });
1610
+ if (!Array.isArray(i) || !i.length) return !0;
1611
+ for (let a = 0; a < i.length; a++) {
1612
+ for (let r of n ?? []) if (r > t[0] && r < e) return !1;
1613
+ if ((r ?? []).includes(ze(i[a]).toString())) return !1;
1614
+ }
1615
+ return !0;
1616
+ }
1617
+ function Z(e, t) {
1618
+ let n = B(e);
1619
+ return t.includes(n) ? t : [...t, n];
1620
+ }
1621
+ function Q(e, t) {
1622
+ let n = B(e), r = t.indexOf(n);
1623
+ if (r === -1) return t;
1624
+ if (t.length === 1) return [];
1625
+ let i = [...t];
1626
+ return i.splice(r, 1), i;
1627
+ }
1628
+ function mt(e, t, n) {
1629
+ let r = B(e);
1630
+ return t.includes(r) ? Q(e, t) : n > 0 && t.length >= n ? t : Z(e, t);
1631
+ }
1632
+ function ht(e, t, n) {
1633
+ let r = B(e), i = X(t);
1634
+ return t.includes(r) ? t.indexOf(r) === 0 ? [] : Q(e, t) : t.length > 1 || t.length === 1 && (!pt(e, i, n.excludedates, n.excludeweekdays) || i[0] > e) ? [r] : Z(e, t);
1635
+ }
1636
+ //#endregion
1637
+ //#region ../../shared-utils/calendar/keyboard-navigation.ts
1638
+ var gt = {
1639
+ ArrowLeft: -1,
1640
+ ArrowRight: 1,
1641
+ ArrowUp: -7,
1642
+ ArrowDown: 7
1643
+ };
1644
+ function _t(e) {
1645
+ let t = e.nodeName;
1646
+ return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !e.dataset?.date;
1647
+ }
1648
+ function vt(e, t, n) {
1649
+ let r = h(e, t);
1650
+ if (!r) return null;
1651
+ let i = n(`button[data-date="${B(r)}"]`);
1652
+ for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = h(r, t), i = n(`button[data-date="${B(r)}"]`), !i) return null;
1653
+ return r;
1654
+ }
1655
+ function yt(e) {
1656
+ return gt[e] ?? null;
1657
+ }
1658
+ //#endregion
1659
+ //#region src/components/calendar/calendar.ts
1660
+ var $ = class extends o {
1661
+ constructor(...e) {
1662
+ super(...e), this.selected = [], this.multiple = Y.props.multiple.default, this.maxMultiple = Y.props.maxMultiple.default, this.range = Y.props.range.default, this.earliest = Y.props.earliest.default, this.latest = Y.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = Y.props.weeknumbers.default, this.withcontrols = Y.props.withcontrols.default, this.currentmonth = null, this.today = null, this.dayStrings = this.strings.dates.daysShort, this.dayStringsLong = this.strings.dates.days, this.monthStrings = this.strings.dates.months, this.weekString = this.strings.dates.week, this.prevMonthString = this.strings.dates.prevMonth, this.nextMonthString = this.strings.dates.nextMonth, this._selected = [], this.inRange = {}, this.rangeHovered = null, this.year = 0, this.month = 0, this.week = 0, this.currentmonthtouched = !1, this.focusedDate = null, this.selectableDates = [], this.tabIndexSet = 0;
1663
+ }
1664
+ get todayDate() {
1665
+ return this.today ? z(this.today) : Je();
1666
+ }
1667
+ firstUpdated(e) {
1668
+ this.addEventListener("keydown", this.handleKeydown);
1669
+ }
1670
+ disconnectedCallback() {
1671
+ this.removeEventListener("keydown", this.handleKeydown), super.disconnectedCallback();
1672
+ }
1673
+ updated(e) {
1674
+ super.updated(e), e.has("selected") && this.convertSelected();
1675
+ }
1676
+ convertSelected() {
1677
+ typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = X(this.selected), this.range && this.selected.length === 2 && (this.inRange = ft(this._selected[0], this._selected[1])), this.setCurrentMonth();
1678
+ }
1679
+ setCurrentMonth() {
1680
+ if (this.currentmonth === null && !this.currentmonthtouched && (this.currentmonthtouched = !0), this.selected.length && this.selected[0] !== "") {
1681
+ let e = z(this.selected[this.selected.length - 1]);
1682
+ this.currentmonth = isNaN(e.getTime()) ? W(this.todayDate) : e;
1683
+ } else this.currentmonth === null && (this.currentmonth = W(this.todayDate));
1684
+ (!this.currentmonth || isNaN(this.currentmonth.getTime())) && (this.currentmonth = W(this.todayDate)), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
1685
+ }
1686
+ handleKeydown(e) {
1687
+ let t = yt(e.key);
1688
+ t !== null && this.handleArrowKey(e, t);
1689
+ }
1690
+ handleArrowKey(e, t) {
1691
+ let n = e.target;
1692
+ if (_t(n)) return;
1693
+ if (e.preventDefault(), !this.focusedDate) {
1694
+ this.focusOnCurrentDate();
1695
+ return;
1696
+ }
1697
+ let r = vt(this.focusedDate ? H(this.focusedDate) : U(this.year, this.month, 1), t, this.querySelector.bind(this));
1698
+ if (r) {
1699
+ let e = this.querySelector(`button[data-date="${B(r)}"]`);
1700
+ e instanceof HTMLButtonElement && !e.dataset.disabled && (this.focusedDate = B(r), e.focus());
1701
+ }
1702
+ }
1703
+ render() {
1704
+ return t`
1705
+ <div
1706
+ class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : ""}"
1707
+ @focusout=${this.closeEvent}
1708
+ @keydown=${(e) => {
1709
+ e.key === "Escape" && (e.preventDefault(), this.close());
1710
+ }}
1711
+ >
1712
+ <nav class="pkt-cal-month-nav">
1713
+ ${this.renderMonthNavButton("prev")}
1714
+ ${this.renderMonthNav()}
1715
+ ${this.renderMonthNavButton("next")}
1716
+ </nav>
1717
+ <table
1718
+ class="pkt-cal-days pkt-txt-12-medium pkt-calendar__body"
1719
+ role="grid"
1720
+ ?aria-multiselectable=${this.range || this.multiple}
1721
+ >
1722
+ <thead>
1723
+ ${this.renderDayNames()}
1724
+ </thead>
1725
+ <tbody>
1726
+ ${this.renderCalendarBody()}
1727
+ </tbody>
1728
+ </table>
1729
+ </div>
1730
+ `;
1731
+ }
1732
+ renderMonthNavButton(e) {
1733
+ let r = e === "prev", i = r ? this.isPrevMonthAllowed() : this.isNextMonthAllowed(), a = r ? this.prevMonthString : this.nextMonthString, o = r ? "chevron-thin-left" : "chevron-thin-right", s = r ? "pkt-calendar__prev-month" : "pkt-calendar__next-month", c = r ? () => this.prevMonth() : () => this.nextMonth();
1734
+ return t`<div>
1735
+ <button
1736
+ type="button"
1737
+ aria-label="${a}"
1738
+ @click=${() => i && c()}
1739
+ @keydown=${(e) => {
1740
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i && c());
1741
+ }}
1742
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${s} ${i ? "" : "pkt-invisible"}"
1743
+ .data-disabled=${i ? n : "disabled"}
1744
+ ?aria-disabled=${!i}
1745
+ tabindex=${i ? "0" : "-1"}
1746
+ >
1747
+ <pkt-icon class="pkt-btn__icon" name="${o}"></pkt-icon>
1748
+ <span class="pkt-btn__text">${a}</span>
1749
+ </button>
1750
+ </div>`;
1751
+ }
1752
+ renderDayNames() {
1753
+ let e = [];
1754
+ this.weeknumbers && e.push(t`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);
1755
+ for (let n = 0; n < this.dayStrings.length; n++) e.push(t`<th>
1756
+ <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[n]}">
1757
+ ${this.dayStrings[n]}
1758
+ </div>
1759
+ </th>`);
1760
+ return t`<tr class="pkt-cal-week-row">${e}</tr>`;
1761
+ }
1762
+ renderMonthNav() {
1763
+ return this.withcontrols ? t`<div class="pkt-cal-month-picker">
1764
+ <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
1765
+ <select
1766
+ aria-label="${this.strings.dates.month}"
1767
+ class="pkt-input pkt-input-compact"
1768
+ id="${this.id}-monthnav"
1769
+ @change=${(e) => {
1770
+ e.stopImmediatePropagation();
1771
+ let t = e.target;
1772
+ this.changeMonth(this.year, parseInt(t.value));
1773
+ }}
1774
+ >
1775
+ ${this.monthStrings.map((e, n) => t`<option value=${n} ?selected=${this.month === n}>${e}</option>`)}
1776
+ </select>
1777
+ <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
1778
+ <input
1779
+ aria-label="${this.strings.dates.year}"
1780
+ class="pkt-input pkt-cal-input-year pkt-input-compact"
1781
+ id="${this.id}-yearnav"
1782
+ type="number"
1783
+ size="4"
1784
+ placeholder="0000"
1785
+ @change=${(e) => {
1786
+ e.stopImmediatePropagation();
1787
+ let t = e.target;
1788
+ this.changeMonth(parseInt(t.value), this.month);
1789
+ }}
1790
+ .value=${this.year}
1791
+ />
1792
+ </div>` : t`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
1793
+ ${this.monthStrings[this.month]} ${this.year}
1794
+ </div>`;
1795
+ }
1796
+ getDayViewData(e, t) {
1797
+ let n = U(this.year, this.month, e), r = B(n), i = r === B(t), a = this.selected.includes(r), o = this.isDayDisabled(n, a), s = this.calculateTabIndex(r, o, e);
1798
+ return {
1799
+ currentDate: n,
1800
+ currentDateISO: r,
1801
+ isToday: i,
1802
+ isSelected: a,
1803
+ isDisabled: o,
1804
+ ariaLabel: Xe(n),
1805
+ tabindex: s
1806
+ };
1807
+ }
1808
+ getDateConstraints() {
1809
+ return {
1810
+ earliest: this.earliest,
1811
+ latest: this.latest,
1812
+ excludedates: this.excludedates,
1813
+ excludeweekdays: this.excludeweekdays
1814
+ };
1815
+ }
1816
+ isDayDisabled(e, t) {
1817
+ return ot(e, t, this.getDateConstraints(), {
1818
+ multiple: this.multiple,
1819
+ maxMultiple: this.maxMultiple,
1820
+ selectedCount: this.selected.length
1821
+ });
1822
+ }
1823
+ calculateTabIndex(e, t, n) {
1824
+ return this.focusedDate ? this.focusedDate === e && !t ? "0" : "-1" : !t && this.tabIndexSet === 0 ? (this.tabIndexSet = n, "0") : this.tabIndexSet === n ? "0" : "-1";
1825
+ }
1826
+ getDayCellClasses(e) {
1827
+ let { currentDateISO: t, isToday: n, isSelected: r } = e, i = this.range && (this.selected.length === 2 || this.rangeHovered !== null) && t === this.selected[0], a = this.range && this.selected.length === 2 && t === this.selected[1];
1828
+ return {
1829
+ "pkt-cal-today": n,
1830
+ "pkt-cal-selected": r,
1831
+ "pkt-cal-in-range": this.inRange[t],
1832
+ "pkt-cal-excluded": this.isExcluded(e.currentDate),
1833
+ "pkt-cal-in-range-first": i,
1834
+ "pkt-cal-in-range-last": a,
1835
+ "pkt-cal-range-hover": this.rangeHovered !== null && t === B(this.rangeHovered)
1836
+ };
1837
+ }
1838
+ getDayButtonClasses(e) {
1839
+ let { currentDateISO: t, isToday: n, isSelected: r, isDisabled: i } = e, a = this.range && (this.selected.length === 2 || this.rangeHovered !== null) && t === this.selected[0], o = this.range && this.selected.length === 2 && t === this.selected[1];
1840
+ return {
1841
+ "pkt-calendar__date": !0,
1842
+ "pkt-calendar__date--today": n,
1843
+ "pkt-calendar__date--selected": r,
1844
+ "pkt-calendar__date--disabled": i,
1845
+ "pkt-calendar__date--in-range": this.inRange[t],
1846
+ "pkt-calendar__date--in-range-hover": this.rangeHovered !== null && t === B(this.rangeHovered),
1847
+ "pkt-calendar__date--range-start": a,
1848
+ "pkt-calendar__date--range-end": o
1849
+ };
1850
+ }
1851
+ handleDayFocus(e, t) {
1852
+ this.range && !this.isExcluded(e) && this.handleRangeHover(e), this.focusedDate = t;
1853
+ }
1854
+ renderDayView(e, r) {
1855
+ let i = this.getDayViewData(e, r), { currentDate: a, currentDateISO: o, isSelected: c, isDisabled: l, ariaLabel: u, tabindex: d } = i;
1856
+ this.selectableDates.push({
1857
+ currentDateISO: o,
1858
+ isDisabled: l,
1859
+ tabindex: d
1860
+ });
1861
+ let f = this.getDayCellClasses(i), p = this.getDayButtonClasses(i);
1862
+ return t`<td class=${s(f)}>
1863
+ <button
1864
+ type="button"
1865
+ aria-pressed=${c ? "true" : "false"}
1866
+ ?disabled=${l}
1867
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${s(p)}"
1868
+ @mouseover=${() => this.range && !this.isExcluded(a) && this.handleRangeHover(a)}
1869
+ @focus=${() => this.handleDayFocus(a, o)}
1870
+ aria-label="${u}"
1871
+ tabindex=${d}
1872
+ data-disabled=${l ? "disabled" : n}
1873
+ data-date=${o}
1874
+ @keydown=${(e) => {
1875
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleDateSelect(a));
1876
+ }}
1877
+ @click=${(e) => {
1878
+ l || (e.preventDefault(), this.handleDateSelect(a));
1879
+ }}
1880
+ >
1881
+ <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
1882
+ </button>
1883
+ </td>`;
1884
+ }
1885
+ renderEmptyDayCell(e) {
1886
+ return t`<td class="pkt-cal-other">
1887
+ <div
1888
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
1889
+ data-disabled="disabled"
1890
+ >
1891
+ <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
1892
+ </div>
1893
+ </td>`;
1894
+ }
1895
+ renderWeekRow(e) {
1896
+ return t`<tr class="pkt-cal-week-row" role="row">${e}</tr>`;
1897
+ }
1898
+ renderCalendarBody() {
1899
+ let e = this.todayDate, n = lt(this.year, this.month);
1900
+ this.selectableDates = [], this.tabIndexSet = 0;
1901
+ let r = 1;
1902
+ this.week = n.initialWeek;
1903
+ let i = [];
1904
+ for (let a = 0; a < n.numRows; a++) {
1905
+ let o = [];
1906
+ this.weeknumbers && o.push(t`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
1907
+ for (let t = 0; t < 7; t++) {
1908
+ let i = ut(a, t, r, n);
1909
+ if (i === "current-month") o.push(this.renderDayView(r, e)), r++;
1910
+ else {
1911
+ let e = dt(i, t, r, n);
1912
+ o.push(this.renderEmptyDayCell(e)), i === "next-month" && r++;
1913
+ }
1914
+ }
1915
+ i.push(this.renderWeekRow(o));
1916
+ }
1917
+ return i;
1918
+ }
1919
+ isExcluded(e) {
1920
+ return at(e, this.getDateConstraints());
1921
+ }
1922
+ isPrevMonthAllowed() {
1923
+ return st(this.year, this.month, this.earliest);
1924
+ }
1925
+ prevMonth() {
1926
+ let e = this.month === 0 ? 11 : this.month - 1, t = this.month === 0 ? this.year - 1 : this.year;
1927
+ this.changeMonth(t, e);
1928
+ }
1929
+ isNextMonthAllowed() {
1930
+ return ct(this.year, this.month, this.latest);
1931
+ }
1932
+ nextMonth() {
1933
+ let e = this.month === 11 ? 0 : this.month + 1, t = this.month === 11 ? this.year + 1 : this.year;
1934
+ this.changeMonth(t, e);
1935
+ }
1936
+ changeMonth(e, t) {
1937
+ this.year = typeof e == "string" ? parseInt(e) : e, this.month = typeof t == "string" ? parseInt(t) : t, this.currentmonth = W(new Date(this.year, this.month, 1)), this.tabIndexSet = 0, this.focusedDate = null, this.selectableDates = [];
1938
+ }
1939
+ emptySelected() {
1940
+ this.selected = [], this._selected = [], this.inRange = {};
1941
+ }
1942
+ normalizeSelected() {
1943
+ return typeof this.selected == "string" ? this.selected.split(",") : this.selected;
1944
+ }
1945
+ addToSelected(e) {
1946
+ this.selected = Z(e, this.normalizeSelected()), this._selected = X(this.selected), this.range && this.selected.length === 2 && (this.convertSelected(), this.close());
1947
+ }
1948
+ removeFromSelected(e) {
1949
+ this.selected = Q(e, this.normalizeSelected()), this._selected = X(this.selected);
1950
+ }
1951
+ toggleSelected(e) {
1952
+ this.selected = mt(e, this.normalizeSelected(), this.maxMultiple), this._selected = X(this.selected);
1953
+ }
1954
+ isRangeAllowed(e) {
1955
+ return pt(e, this._selected, this.excludedates, this.excludeweekdays);
1956
+ }
1957
+ handleRangeSelect(e) {
1958
+ return this.selected = ht(e, this.normalizeSelected(), {
1959
+ excludedates: this.excludedates,
1960
+ excludeweekdays: this.excludeweekdays
1961
+ }), this._selected = X(this.selected), this.selected.length === 2 ? (this.convertSelected(), this.close()) : this.selected.length === 1 && (this.inRange = {}), Promise.resolve();
1962
+ }
1963
+ handleRangeHover(e) {
1964
+ if (!this.range || this._selected.length !== 1 || !this.isRangeAllowed(e) || this._selected[0] >= e) {
1965
+ this.rangeHovered = null;
1966
+ return;
1967
+ }
1968
+ this.rangeHovered = e, this.inRange = ft(this._selected[0], e);
1969
+ }
1970
+ handleDateSelect(e) {
1971
+ return e ? (this.range ? this.handleRangeSelect(e) : this.multiple ? this.toggleSelected(e) : (this.selected.includes(B(e)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(e)), this.close()), this.dispatchEvent(new CustomEvent("date-selected", {
1972
+ detail: this.selected,
1973
+ bubbles: !0,
1974
+ composed: !0
1975
+ })), Promise.resolve()) : Promise.resolve();
1976
+ }
1977
+ focusOnCurrentDate() {
1978
+ let e = B(W(this.todayDate)), t = this.querySelector(`button[data-date="${e}"]`);
1979
+ if (t instanceof HTMLButtonElement) {
1980
+ this.focusedDate = e, t.focus();
1981
+ return;
1982
+ }
1983
+ let n = this.selectableDates.find((e) => !e.isDisabled);
1984
+ if (n) {
1985
+ let e = this.querySelector(`button[data-date="${n.currentDateISO}"]`);
1986
+ e instanceof HTMLButtonElement && (this.focusedDate = n.currentDateISO, e.focus());
1987
+ }
1988
+ }
1989
+ closeEvent(e) {
1990
+ !this.contains(e.relatedTarget) && !e.target.classList.contains("pkt-invisible") && this.close();
1991
+ }
1992
+ close() {
1993
+ this.dispatchEvent(new CustomEvent("close", {
1994
+ detail: !0,
1995
+ bubbles: !0,
1996
+ composed: !0
1997
+ }));
1998
+ }
1999
+ };
2000
+ i([a({ converter: J.csvToArray })], $.prototype, "selected", void 0), i([a({ type: Boolean })], $.prototype, "multiple", void 0), i([a({
2001
+ type: Number,
2002
+ attribute: "max-multiple"
2003
+ })], $.prototype, "maxMultiple", void 0), i([a({ type: Boolean })], $.prototype, "range", void 0), i([a({ type: String })], $.prototype, "earliest", void 0), i([a({ type: String })], $.prototype, "latest", void 0), i([a({ converter: J.stringsToDate })], $.prototype, "excludedates", void 0), i([a({ converter: J.csvToArray })], $.prototype, "excludeweekdays", void 0), i([a({ type: Boolean })], $.prototype, "weeknumbers", void 0), i([a({ type: Boolean })], $.prototype, "withcontrols", void 0), i([a({ converter: J.stringToDate })], $.prototype, "currentmonth", void 0), i([a({ type: String })], $.prototype, "today", void 0), i([a({
2004
+ type: Array,
2005
+ attribute: "day-strings"
2006
+ })], $.prototype, "dayStrings", void 0), i([a({
2007
+ type: Array,
2008
+ attribute: "day-strings-long"
2009
+ })], $.prototype, "dayStringsLong", void 0), i([a({
2010
+ type: Array,
2011
+ attribute: "month-strings"
2012
+ })], $.prototype, "monthStrings", void 0), i([a({
2013
+ type: String,
2014
+ attribute: "week-string"
2015
+ })], $.prototype, "weekString", void 0), i([a({
2016
+ type: String,
2017
+ attribute: "prev-month-string"
2018
+ })], $.prototype, "prevMonthString", void 0), i([a({
2019
+ type: String,
2020
+ attribute: "next-month-string"
2021
+ })], $.prototype, "nextMonthString", void 0), i([a({ type: Array })], $.prototype, "_selected", void 0), i([r()], $.prototype, "inRange", void 0), i([a({ type: Date })], $.prototype, "rangeHovered", void 0), i([a({ type: Number })], $.prototype, "year", void 0), i([a({ type: Number })], $.prototype, "month", void 0), i([a({ type: Number })], $.prototype, "week", void 0), i([r()], $.prototype, "currentmonthtouched", void 0), i([r()], $.prototype, "focusedDate", void 0);
2022
+ try {
2023
+ e("pkt-calendar")($);
2024
+ } catch {
2025
+ console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert");
2026
+ }
2027
+ //#endregion
2028
+ //#region src/components/calendar/index.ts
2029
+ var bt = $;
2030
+ //#endregion
2031
+ export { rt as a, V as c, H as d, z as f, it as i, Ye as l, $ as n, et as o, tt as p, J as r, B as s, bt as t, nt as u };