@oslokommune/punkt-elements 14.5.4 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/{accordionitem-DB3tAjIZ.js → accordionitem-BbeS44TD.js} +1 -1
  3. package/dist/{accordionitem-DHYmPA-o.cjs → accordionitem-DUWhTUEI.cjs} +1 -1
  4. package/dist/{alert-DVCenNTM.cjs → alert-B9flMht5.cjs} +1 -1
  5. package/dist/{alert-Cc5FtxHN.js → alert-BpFxQviu.js} +2 -2
  6. package/dist/{button-Ju4zPhVx.cjs → button-BgCKV0zW.cjs} +1 -1
  7. package/dist/{button-DrTXtc-n.js → button-CKgpX5QA.js} +1 -1
  8. package/dist/{calendar-CTx8PD1L.js → calendar-BMarIeVp.js} +332 -325
  9. package/dist/calendar-C6xgAJ7Z.cjs +90 -0
  10. package/dist/{card-DvHL7pNu.cjs → card-DI3KodEc.cjs} +1 -1
  11. package/dist/{card-CTtmPB2n.js → card-h8ekgJRr.js} +2 -2
  12. package/dist/{checkbox-B-0FOdwi.cjs → checkbox-B2t7wfxe.cjs} +1 -1
  13. package/dist/{checkbox-CkAwPK_E.js → checkbox-BJ9pz3kV.js} +1 -1
  14. package/dist/{combobox-DNPfpTjW.js → combobox-BjAvk8Y-.js} +5 -5
  15. package/dist/{combobox-DvL3SKz2.cjs → combobox-HNN7GTzh.cjs} +1 -1
  16. package/dist/{consent-DJW7YEat.cjs → consent-C37tuFwZ.cjs} +1 -1
  17. package/dist/{consent-OdhmtIK-.js → consent-DAk2BJ7I.js} +1 -1
  18. package/dist/datepicker-2bneToiA.cjs +275 -0
  19. package/dist/datepicker-DvcH2QD9.js +1160 -0
  20. package/dist/{helptext-7fyVJK2C.cjs → helptext-BG1P_9j0.cjs} +1 -1
  21. package/dist/{helptext-CfR0SYe9.js → helptext-Cm6FLBVf.js} +1 -1
  22. package/dist/index.d.ts +10 -42
  23. package/dist/input-element-BBv4xjPb.cjs +1 -0
  24. package/dist/{input-element-DVZhYDJ_.js → input-element-CbjYtVou.js} +143 -147
  25. package/dist/{input-wrapper-DVUh5rxv.js → input-wrapper-Bwmva-69.js} +3 -3
  26. package/dist/{input-wrapper-Bta4FZe3.cjs → input-wrapper-CJqmwe3I.cjs} +1 -1
  27. package/dist/{link-40XAFlYS.js → link-BKnT-97D.js} +1 -1
  28. package/dist/{link-CBQ7uKqb.cjs → link-DRPFqqEn.cjs} +1 -1
  29. package/dist/{linkcard-D8hxLedl.cjs → linkcard-02fxYQ2g.cjs} +1 -1
  30. package/dist/{linkcard-Opb42K2k.js → linkcard-C2UENcqo.js} +1 -1
  31. package/dist/{loader-Bv1R6-AA.js → loader-BW-AWQiE.js} +1 -1
  32. package/dist/{loader-Dh_5sihO.cjs → loader-Cj4kUNRE.cjs} +1 -1
  33. package/dist/{messagebox-B9MCodIz.cjs → messagebox-CK0sSRep.cjs} +1 -1
  34. package/dist/{messagebox-DEXCTOrz.js → messagebox-DB8tEXrV.js} +1 -1
  35. package/dist/{modal-Bw61rVrQ.cjs → modal-BzVQSQy2.cjs} +1 -1
  36. package/dist/{modal-B4adxB6X.js → modal-ClYfWW2a.js} +1 -1
  37. package/dist/pkt-accordion.cjs +1 -1
  38. package/dist/pkt-accordion.js +2 -2
  39. package/dist/pkt-alert.cjs +1 -1
  40. package/dist/pkt-alert.js +1 -1
  41. package/dist/pkt-button.cjs +1 -1
  42. package/dist/pkt-button.js +1 -1
  43. package/dist/pkt-calendar.cjs +1 -1
  44. package/dist/pkt-calendar.js +1 -1
  45. package/dist/pkt-card.cjs +1 -1
  46. package/dist/pkt-card.js +1 -1
  47. package/dist/pkt-checkbox.cjs +1 -1
  48. package/dist/pkt-checkbox.js +1 -1
  49. package/dist/pkt-combobox.cjs +1 -1
  50. package/dist/pkt-combobox.js +1 -1
  51. package/dist/pkt-consent.cjs +1 -1
  52. package/dist/pkt-consent.js +1 -1
  53. package/dist/pkt-datepicker.cjs +1 -1
  54. package/dist/pkt-datepicker.js +2 -2
  55. package/dist/pkt-header.cjs +1 -1
  56. package/dist/pkt-header.js +4 -4
  57. package/dist/pkt-helptext.cjs +1 -1
  58. package/dist/pkt-helptext.js +1 -1
  59. package/dist/pkt-index.cjs +1 -1
  60. package/dist/pkt-index.js +22 -22
  61. package/dist/pkt-input-wrapper.cjs +1 -1
  62. package/dist/pkt-input-wrapper.js +1 -1
  63. package/dist/pkt-link.cjs +1 -1
  64. package/dist/pkt-link.js +1 -1
  65. package/dist/pkt-linkcard.cjs +1 -1
  66. package/dist/pkt-linkcard.js +1 -1
  67. package/dist/pkt-loader.cjs +1 -1
  68. package/dist/pkt-loader.js +1 -1
  69. package/dist/pkt-messagebox.cjs +1 -1
  70. package/dist/pkt-messagebox.js +1 -1
  71. package/dist/pkt-modal.cjs +1 -1
  72. package/dist/pkt-modal.js +1 -1
  73. package/dist/{pkt-options-controller-zn5cmMvL.js → pkt-options-controller-BcGywCmf.js} +1 -1
  74. package/dist/{pkt-options-controller-DjBCEHU4.cjs → pkt-options-controller-BnTmkl3g.cjs} +1 -1
  75. package/dist/pkt-radiobutton.cjs +1 -1
  76. package/dist/pkt-radiobutton.js +1 -1
  77. package/dist/pkt-select.cjs +1 -1
  78. package/dist/pkt-select.js +1 -1
  79. package/dist/pkt-slot-controller-D4nKlom5.cjs +1 -0
  80. package/dist/{pkt-slot-controller-BPGj-LC5.js → pkt-slot-controller-D7CrjM52.js} +27 -25
  81. package/dist/pkt-tabs.cjs +1 -1
  82. package/dist/pkt-tabs.js +2 -2
  83. package/dist/pkt-tag.cjs +1 -1
  84. package/dist/pkt-tag.js +1 -1
  85. package/dist/pkt-textarea.cjs +1 -1
  86. package/dist/pkt-textarea.js +1 -1
  87. package/dist/pkt-textinput.cjs +1 -1
  88. package/dist/pkt-textinput.js +1 -1
  89. package/dist/{radiobutton-oA20HijB.js → radiobutton-CvKKNFMd.js} +1 -1
  90. package/dist/{radiobutton-iHuLnuAn.cjs → radiobutton-DWoYQn8H.cjs} +1 -1
  91. package/dist/{select--wvwpJ0_.cjs → select-BQUp88lY.cjs} +1 -1
  92. package/dist/{select-DfsNb_Yi.js → select-CFkxir_l.js} +4 -4
  93. package/dist/{tabitem-CypTmORF.js → tabitem-C8-tZyc_.js} +1 -1
  94. package/dist/{tabitem-CtltSqDK.cjs → tabitem-DaYfUaxw.cjs} +1 -1
  95. package/dist/{tag-Cw3OQqLW.js → tag-DIJMJhyp.js} +1 -1
  96. package/dist/{tag-P9lfQZbM.cjs → tag-h0vD2Na0.cjs} +1 -1
  97. package/dist/{textarea-CM_bj81t.js → textarea-CMuiBUee.js} +3 -3
  98. package/dist/{textarea-DcEKhXia.cjs → textarea-DcCOfNlr.cjs} +1 -1
  99. package/dist/{textinput-AVll6Nh7.js → textinput-D30TCADP.js} +3 -3
  100. package/dist/{textinput-BzuYzKZ6.cjs → textinput-DR3aaHTH.cjs} +1 -1
  101. package/package.json +4 -4
  102. package/src/components/calendar/calendar.core.test.ts +1 -1
  103. package/src/components/calendar/calendar.selection.test.ts +1 -1
  104. package/src/components/calendar/calendar.ts +32 -22
  105. package/src/components/datepicker/datepicker-popup.test.ts +1 -1
  106. package/src/components/datepicker/datepicker-popup.ts +73 -30
  107. package/src/components/datepicker/datepicker-range.ts +5 -1
  108. package/src/components/datepicker/datepicker-types.ts +4 -54
  109. package/src/components/datepicker/datepicker-utils.ts +38 -517
  110. package/src/components/datepicker/datepicker.core.test.ts +12 -10
  111. package/src/components/datepicker/datepicker.selection.test.ts +8 -6
  112. package/src/components/datepicker/datepicker.ts +26 -7
  113. package/src/components/icon/icon.test.ts +8 -8
  114. package/dist/calendar-5Obd0ZT3.cjs +0 -90
  115. package/dist/datepicker-CTCaZuZU.cjs +0 -271
  116. package/dist/datepicker-t0W9fA1e.js +0 -1444
  117. package/dist/input-element-RBQVA8i0.cjs +0 -1
  118. package/dist/pkt-slot-controller-BzddBp7z.cjs +0 -1
  119. package/src/components/calendar/helpers/calendar-grid.ts +0 -93
  120. package/src/components/calendar/helpers/date-validation.ts +0 -86
  121. package/src/components/calendar/helpers/index.ts +0 -49
  122. package/src/components/calendar/helpers/keyboard-navigation.ts +0 -54
  123. package/src/components/calendar/helpers/selection-manager.ts +0 -184
@@ -1,39 +1,39 @@
1
- import { e as nt } from "./class-map-Dt2jXOlF.js";
2
- import { P as xt, x as D, E as rt, n as f, t as Ot } from "./element-BXsf_NlG.js";
3
- import { r as q } from "./state-DgnkjP0q.js";
1
+ import { e as rt } from "./class-map-Dt2jXOlF.js";
2
+ import { P as Pt, x as D, E as at, n as f, t as Nt } from "./element-BXsf_NlG.js";
3
+ import { r as Z } from "./state-DgnkjP0q.js";
4
4
  import "./icon-DBZvMard.js";
5
- const mt = 6048e5, Pt = 864e5, at = Symbol.for("constructDateFrom");
5
+ const yt = 6048e5, Ct = 864e5, st = Symbol.for("constructDateFrom");
6
6
  function k(t, e) {
7
- return typeof t == "function" ? t(e) : t && typeof t == "object" && at in t ? t[at](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
7
+ return typeof t == "function" ? t(e) : t && typeof t == "object" && st in t ? t[st](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
8
8
  }
9
9
  function b(t, e) {
10
10
  return k(e || t, t);
11
11
  }
12
- function st(t, e, n) {
12
+ function it(t, e, n) {
13
13
  const r = b(t, n == null ? void 0 : n.in);
14
14
  return isNaN(e) ? k(t, NaN) : (e && r.setDate(r.getDate() + e), r);
15
15
  }
16
- let Nt = {};
17
- function z() {
18
- return Nt;
16
+ let $t = {};
17
+ function B() {
18
+ return $t;
19
19
  }
20
20
  function R(t, e) {
21
21
  var o, c, d, g;
22
- const n = z(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.weekStartsOn) ?? 0, a = b(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
22
+ const n = B(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.weekStartsOn) ?? 0, a = b(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
23
23
  return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
24
24
  }
25
- function B(t, e) {
25
+ function q(t, e) {
26
26
  return R(t, { ...e, weekStartsOn: 1 });
27
27
  }
28
- function gt(t, e) {
28
+ function pt(t, e) {
29
29
  const n = b(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = k(n, 0);
30
30
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
31
- const s = B(a), i = k(n, 0);
31
+ const s = q(a), i = k(n, 0);
32
32
  i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
33
- const o = B(i);
33
+ const o = q(i);
34
34
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
35
35
  }
36
- function it(t) {
36
+ function ot(t) {
37
37
  const e = b(t), n = new Date(
38
38
  Date.UTC(
39
39
  e.getFullYear(),
@@ -47,7 +47,7 @@ function it(t) {
47
47
  );
48
48
  return n.setUTCFullYear(e.getFullYear()), +t - +n;
49
49
  }
50
- function yt(t, ...e) {
50
+ function wt(t, ...e) {
51
51
  const n = k.bind(
52
52
  null,
53
53
  e.find((r) => typeof r == "object")
@@ -58,34 +58,34 @@ function K(t, e) {
58
58
  const n = b(t, e == null ? void 0 : e.in);
59
59
  return n.setHours(0, 0, 0, 0), n;
60
60
  }
61
- function Ct(t, e, n) {
62
- const [r, a] = yt(
61
+ function Et(t, e, n) {
62
+ const [r, a] = wt(
63
63
  n == null ? void 0 : n.in,
64
64
  t,
65
65
  e
66
- ), s = K(r), i = K(a), o = +s - it(s), c = +i - it(i);
67
- return Math.round((o - c) / Pt);
66
+ ), s = K(r), i = K(a), o = +s - ot(s), c = +i - ot(i);
67
+ return Math.round((o - c) / Ct);
68
68
  }
69
- function $t(t, e) {
70
- const n = gt(t, e), r = k(t, 0);
71
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), B(r);
69
+ function _t(t, e) {
70
+ const n = pt(t, e), r = k(t, 0);
71
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), q(r);
72
72
  }
73
- function Et(t) {
73
+ function Wt(t) {
74
74
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
75
75
  }
76
- function Wt(t) {
77
- return !(!Et(t) && typeof t != "number" || isNaN(+b(t)));
76
+ function Yt(t) {
77
+ return !(!Wt(t) && typeof t != "number" || isNaN(+b(t)));
78
78
  }
79
- function _t(t, e) {
79
+ function Ft(t, e) {
80
80
  const n = b(t, e == null ? void 0 : e.in);
81
81
  return n.setHours(23, 59, 59, 999), n;
82
82
  }
83
- function Yt(t, e) {
84
- const [n, r] = yt(t, e.start, e.end);
83
+ function It(t, e) {
84
+ const [n, r] = wt(t, e.start, e.end);
85
85
  return { start: n, end: r };
86
86
  }
87
- function pt(t, e) {
88
- const { start: n, end: r } = Yt(e == null ? void 0 : e.in, t);
87
+ function bt(t, e) {
88
+ const { start: n, end: r } = It(e == null ? void 0 : e.in, t);
89
89
  let a = +n > +r;
90
90
  const s = a ? +n : +r, i = a ? r : n;
91
91
  i.setHours(0, 0, 0, 0);
@@ -95,11 +95,11 @@ function pt(t, e) {
95
95
  c.push(k(n, i)), i.setDate(i.getDate() + o), i.setHours(0, 0, 0, 0);
96
96
  return a ? c.reverse() : c;
97
97
  }
98
- function Ft(t, e) {
98
+ function Ht(t, e) {
99
99
  const n = b(t, e == null ? void 0 : e.in);
100
100
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
101
101
  }
102
- const It = {
102
+ const At = {
103
103
  lessThanXSeconds: {
104
104
  one: "less than a second",
105
105
  other: "less than {{count}} seconds"
@@ -161,53 +161,53 @@ const It = {
161
161
  one: "almost 1 year",
162
162
  other: "almost {{count}} years"
163
163
  }
164
- }, Ht = (t, e, n) => {
164
+ }, Rt = (t, e, n) => {
165
165
  let r;
166
- const a = It[t];
166
+ const a = At[t];
167
167
  return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
168
168
  };
169
- function G(t) {
169
+ function X(t) {
170
170
  return (e = {}) => {
171
171
  const n = e.width ? String(e.width) : t.defaultWidth;
172
172
  return t.formats[n] || t.formats[t.defaultWidth];
173
173
  };
174
174
  }
175
- const At = {
175
+ const Ut = {
176
176
  full: "EEEE, MMMM do, y",
177
177
  long: "MMMM do, y",
178
178
  medium: "MMM d, y",
179
179
  short: "MM/dd/yyyy"
180
- }, Rt = {
180
+ }, Lt = {
181
181
  full: "h:mm:ss a zzzz",
182
182
  long: "h:mm:ss a z",
183
183
  medium: "h:mm:ss a",
184
184
  short: "h:mm a"
185
- }, Ut = {
185
+ }, qt = {
186
186
  full: "{{date}} 'at' {{time}}",
187
187
  long: "{{date}} 'at' {{time}}",
188
188
  medium: "{{date}}, {{time}}",
189
189
  short: "{{date}}, {{time}}"
190
- }, Lt = {
191
- date: G({
192
- formats: At,
190
+ }, Bt = {
191
+ date: X({
192
+ formats: Ut,
193
193
  defaultWidth: "full"
194
194
  }),
195
- time: G({
196
- formats: Rt,
195
+ time: X({
196
+ formats: Lt,
197
197
  defaultWidth: "full"
198
198
  }),
199
- dateTime: G({
200
- formats: Ut,
199
+ dateTime: X({
200
+ formats: qt,
201
201
  defaultWidth: "full"
202
202
  })
203
- }, qt = {
203
+ }, zt = {
204
204
  lastWeek: "'last' eeee 'at' p",
205
205
  yesterday: "'yesterday at' p",
206
206
  today: "'today at' p",
207
207
  tomorrow: "'tomorrow at' p",
208
208
  nextWeek: "eeee 'at' p",
209
209
  other: "P"
210
- }, Bt = (t, e, n, r) => qt[t];
210
+ }, jt = (t, e, n, r) => zt[t];
211
211
  function F(t) {
212
212
  return (e, n) => {
213
213
  const r = n != null && n.context ? String(n.context) : "standalone";
@@ -223,15 +223,15 @@ function F(t) {
223
223
  return a[s];
224
224
  };
225
225
  }
226
- const zt = {
226
+ const Qt = {
227
227
  narrow: ["B", "A"],
228
228
  abbreviated: ["BC", "AD"],
229
229
  wide: ["Before Christ", "Anno Domini"]
230
- }, jt = {
230
+ }, Xt = {
231
231
  narrow: ["1", "2", "3", "4"],
232
232
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
233
233
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
234
- }, Qt = {
234
+ }, Gt = {
235
235
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
236
236
  abbreviated: [
237
237
  "Jan",
@@ -261,7 +261,7 @@ const zt = {
261
261
  "November",
262
262
  "December"
263
263
  ]
264
- }, Xt = {
264
+ }, Vt = {
265
265
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
266
266
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
267
267
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -274,7 +274,7 @@ const zt = {
274
274
  "Friday",
275
275
  "Saturday"
276
276
  ]
277
- }, Gt = {
277
+ }, Kt = {
278
278
  narrow: {
279
279
  am: "a",
280
280
  pm: "p",
@@ -305,7 +305,7 @@ const zt = {
305
305
  evening: "evening",
306
306
  night: "night"
307
307
  }
308
- }, Vt = {
308
+ }, Jt = {
309
309
  narrow: {
310
310
  am: "a",
311
311
  pm: "p",
@@ -336,7 +336,7 @@ const zt = {
336
336
  evening: "in the evening",
337
337
  night: "at night"
338
338
  }
339
- }, Kt = (t, e) => {
339
+ }, Zt = (t, e) => {
340
340
  const n = Number(t), r = n % 100;
341
341
  if (r > 20 || r < 10)
342
342
  switch (r % 10) {
@@ -348,29 +348,29 @@ const zt = {
348
348
  return n + "rd";
349
349
  }
350
350
  return n + "th";
351
- }, Jt = {
352
- ordinalNumber: Kt,
351
+ }, te = {
352
+ ordinalNumber: Zt,
353
353
  era: F({
354
- values: zt,
354
+ values: Qt,
355
355
  defaultWidth: "wide"
356
356
  }),
357
357
  quarter: F({
358
- values: jt,
358
+ values: Xt,
359
359
  defaultWidth: "wide",
360
360
  argumentCallback: (t) => t - 1
361
361
  }),
362
362
  month: F({
363
- values: Qt,
363
+ values: Gt,
364
364
  defaultWidth: "wide"
365
365
  }),
366
366
  day: F({
367
- values: Xt,
367
+ values: Vt,
368
368
  defaultWidth: "wide"
369
369
  }),
370
370
  dayPeriod: F({
371
- values: Gt,
371
+ values: Kt,
372
372
  defaultWidth: "wide",
373
- formattingValues: Vt,
373
+ formattingValues: Jt,
374
374
  defaultFormattingWidth: "wide"
375
375
  })
376
376
  };
@@ -379,9 +379,9 @@ function I(t) {
379
379
  const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = e.match(a);
380
380
  if (!s)
381
381
  return null;
382
- const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? te(o, (m) => m.test(i)) : (
382
+ const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? ne(o, (m) => m.test(i)) : (
383
383
  // [TODO] -- I challenge you to fix the type
384
- Zt(o, (m) => m.test(i))
384
+ ee(o, (m) => m.test(i))
385
385
  );
386
386
  let d;
387
387
  d = t.valueCallback ? t.valueCallback(c) : c, d = n.valueCallback ? (
@@ -392,17 +392,17 @@ function I(t) {
392
392
  return { value: d, rest: g };
393
393
  };
394
394
  }
395
- function Zt(t, e) {
395
+ function ee(t, e) {
396
396
  for (const n in t)
397
397
  if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
398
398
  return n;
399
399
  }
400
- function te(t, e) {
400
+ function ne(t, e) {
401
401
  for (let n = 0; n < t.length; n++)
402
402
  if (e(t[n]))
403
403
  return n;
404
404
  }
405
- function ee(t) {
405
+ function re(t) {
406
406
  return (e, n = {}) => {
407
407
  const r = e.match(t.matchPattern);
408
408
  if (!r) return null;
@@ -414,23 +414,23 @@ function ee(t) {
414
414
  return { value: i, rest: o };
415
415
  };
416
416
  }
417
- const ne = /^(\d+)(th|st|nd|rd)?/i, re = /\d+/i, ae = {
417
+ const ae = /^(\d+)(th|st|nd|rd)?/i, se = /\d+/i, ie = {
418
418
  narrow: /^(b|a)/i,
419
419
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
420
420
  wide: /^(before christ|before common era|anno domini|common era)/i
421
- }, se = {
421
+ }, oe = {
422
422
  any: [/^b/i, /^(a|c)/i]
423
- }, ie = {
423
+ }, ce = {
424
424
  narrow: /^[1234]/i,
425
425
  abbreviated: /^q[1234]/i,
426
426
  wide: /^[1234](th|st|nd|rd)? quarter/i
427
- }, oe = {
427
+ }, ue = {
428
428
  any: [/1/i, /2/i, /3/i, /4/i]
429
- }, ce = {
429
+ }, le = {
430
430
  narrow: /^[jfmasond]/i,
431
431
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
432
432
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
433
- }, ue = {
433
+ }, he = {
434
434
  narrow: [
435
435
  /^j/i,
436
436
  /^f/i,
@@ -459,18 +459,18 @@ const ne = /^(\d+)(th|st|nd|rd)?/i, re = /\d+/i, ae = {
459
459
  /^n/i,
460
460
  /^d/i
461
461
  ]
462
- }, le = {
462
+ }, de = {
463
463
  narrow: /^[smtwf]/i,
464
464
  short: /^(su|mo|tu|we|th|fr|sa)/i,
465
465
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
466
466
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
467
- }, he = {
467
+ }, fe = {
468
468
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
469
469
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
470
- }, de = {
470
+ }, me = {
471
471
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
472
472
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
473
- }, fe = {
473
+ }, ge = {
474
474
  any: {
475
475
  am: /^a/i,
476
476
  pm: /^p/i,
@@ -481,80 +481,80 @@ const ne = /^(\d+)(th|st|nd|rd)?/i, re = /\d+/i, ae = {
481
481
  evening: /evening/i,
482
482
  night: /night/i
483
483
  }
484
- }, me = {
485
- ordinalNumber: ee({
486
- matchPattern: ne,
487
- parsePattern: re,
484
+ }, ye = {
485
+ ordinalNumber: re({
486
+ matchPattern: ae,
487
+ parsePattern: se,
488
488
  valueCallback: (t) => parseInt(t, 10)
489
489
  }),
490
490
  era: I({
491
- matchPatterns: ae,
491
+ matchPatterns: ie,
492
492
  defaultMatchWidth: "wide",
493
- parsePatterns: se,
493
+ parsePatterns: oe,
494
494
  defaultParseWidth: "any"
495
495
  }),
496
496
  quarter: I({
497
- matchPatterns: ie,
497
+ matchPatterns: ce,
498
498
  defaultMatchWidth: "wide",
499
- parsePatterns: oe,
499
+ parsePatterns: ue,
500
500
  defaultParseWidth: "any",
501
501
  valueCallback: (t) => t + 1
502
502
  }),
503
503
  month: I({
504
- matchPatterns: ce,
504
+ matchPatterns: le,
505
505
  defaultMatchWidth: "wide",
506
- parsePatterns: ue,
506
+ parsePatterns: he,
507
507
  defaultParseWidth: "any"
508
508
  }),
509
509
  day: I({
510
- matchPatterns: le,
510
+ matchPatterns: de,
511
511
  defaultMatchWidth: "wide",
512
- parsePatterns: he,
512
+ parsePatterns: fe,
513
513
  defaultParseWidth: "any"
514
514
  }),
515
515
  dayPeriod: I({
516
- matchPatterns: de,
516
+ matchPatterns: me,
517
517
  defaultMatchWidth: "any",
518
- parsePatterns: fe,
518
+ parsePatterns: ge,
519
519
  defaultParseWidth: "any"
520
520
  })
521
- }, ge = {
521
+ }, pe = {
522
522
  code: "en-US",
523
- formatDistance: Ht,
524
- formatLong: Lt,
525
- formatRelative: Bt,
526
- localize: Jt,
527
- match: me,
523
+ formatDistance: Rt,
524
+ formatLong: Bt,
525
+ formatRelative: jt,
526
+ localize: te,
527
+ match: ye,
528
528
  options: {
529
529
  weekStartsOn: 0,
530
530
  firstWeekContainsDate: 1
531
531
  }
532
532
  };
533
- function ye(t, e) {
533
+ function we(t, e) {
534
534
  const n = b(t, e == null ? void 0 : e.in);
535
- return Ct(n, Ft(n)) + 1;
535
+ return Et(n, Ht(n)) + 1;
536
536
  }
537
- function pe(t, e) {
538
- const n = b(t, e == null ? void 0 : e.in), r = +B(n) - +$t(n);
539
- return Math.round(r / mt) + 1;
537
+ function be(t, e) {
538
+ const n = b(t, e == null ? void 0 : e.in), r = +q(n) - +_t(n);
539
+ return Math.round(r / yt) + 1;
540
540
  }
541
- function wt(t, e) {
541
+ function Dt(t, e) {
542
542
  var g, m, v, M;
543
- const n = b(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = z(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((m = (g = e == null ? void 0 : e.locale) == null ? void 0 : g.options) == null ? void 0 : m.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (v = a.locale) == null ? void 0 : v.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, i = k((e == null ? void 0 : e.in) || t, 0);
543
+ const n = b(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = B(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((m = (g = e == null ? void 0 : e.locale) == null ? void 0 : g.options) == null ? void 0 : m.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (v = a.locale) == null ? void 0 : v.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, i = k((e == null ? void 0 : e.in) || t, 0);
544
544
  i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
545
545
  const o = R(i, e), c = k((e == null ? void 0 : e.in) || t, 0);
546
546
  c.setFullYear(r, 0, s), c.setHours(0, 0, 0, 0);
547
547
  const d = R(c, e);
548
548
  return +n >= +o ? r + 1 : +n >= +d ? r : r - 1;
549
549
  }
550
- function we(t, e) {
550
+ function De(t, e) {
551
551
  var o, c, d, g;
552
- const n = z(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, a = wt(t, e), s = k((e == null ? void 0 : e.in) || t, 0);
552
+ const n = B(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((g = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, a = Dt(t, e), s = k((e == null ? void 0 : e.in) || t, 0);
553
553
  return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), R(s, e);
554
554
  }
555
- function bt(t, e) {
556
- const n = b(t, e == null ? void 0 : e.in), r = +R(n, e) - +we(n, e);
557
- return Math.round(r / mt) + 1;
555
+ function St(t, e) {
556
+ const n = b(t, e == null ? void 0 : e.in), r = +R(n, e) - +De(n, e);
557
+ return Math.round(r / yt) + 1;
558
558
  }
559
559
  function u(t, e) {
560
560
  const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
@@ -621,7 +621,7 @@ const T = {
621
621
  afternoon: "afternoon",
622
622
  evening: "evening",
623
623
  night: "night"
624
- }, ot = {
624
+ }, ct = {
625
625
  // Era
626
626
  G: function(t, e, n) {
627
627
  const r = t.getFullYear() > 0 ? 1 : 0;
@@ -650,7 +650,7 @@ const T = {
650
650
  },
651
651
  // Local week-numbering year
652
652
  Y: function(t, e, n, r) {
653
- const a = wt(t, r), s = a > 0 ? a : 1 - a;
653
+ const a = Dt(t, r), s = a > 0 ? a : 1 - a;
654
654
  if (e === "YY") {
655
655
  const i = s % 100;
656
656
  return u(i, 2);
@@ -659,7 +659,7 @@ const T = {
659
659
  },
660
660
  // ISO week-numbering year
661
661
  R: function(t, e) {
662
- const n = gt(t);
662
+ const n = pt(t);
663
663
  return u(n, e.length);
664
664
  },
665
665
  // Extended year. This is a single number designating the year of this calendar system.
@@ -804,12 +804,12 @@ const T = {
804
804
  },
805
805
  // Local week of year
806
806
  w: function(t, e, n, r) {
807
- const a = bt(t, r);
807
+ const a = St(t, r);
808
808
  return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : u(a, e.length);
809
809
  },
810
810
  // ISO week of year
811
811
  I: function(t, e, n) {
812
- const r = pe(t);
812
+ const r = be(t);
813
813
  return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : u(r, e.length);
814
814
  },
815
815
  // Day of the month
@@ -818,7 +818,7 @@ const T = {
818
818
  },
819
819
  // Day of year
820
820
  D: function(t, e, n) {
821
- const r = ye(t);
821
+ const r = we(t);
822
822
  return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, e.length);
823
823
  },
824
824
  // Day of week
@@ -1096,13 +1096,13 @@ const T = {
1096
1096
  switch (e) {
1097
1097
  // Hours and optional minutes
1098
1098
  case "X":
1099
- return ut(r);
1099
+ return lt(r);
1100
1100
  // Hours, minutes and optional seconds without `:` delimiter
1101
1101
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1102
1102
  // so this token always has the same output as `XX`
1103
1103
  case "XXXX":
1104
1104
  case "XX":
1105
- return P(r);
1105
+ return N(r);
1106
1106
  // Hours, minutes and optional seconds with `:` delimiter
1107
1107
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1108
1108
  // so this token always has the same output as `XXX`
@@ -1110,7 +1110,7 @@ const T = {
1110
1110
  case "XXX":
1111
1111
  // Hours and minutes with `:` delimiter
1112
1112
  default:
1113
- return P(r, ":");
1113
+ return N(r, ":");
1114
1114
  }
1115
1115
  },
1116
1116
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1119,13 +1119,13 @@ const T = {
1119
1119
  switch (e) {
1120
1120
  // Hours and optional minutes
1121
1121
  case "x":
1122
- return ut(r);
1122
+ return lt(r);
1123
1123
  // Hours, minutes and optional seconds without `:` delimiter
1124
1124
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1125
1125
  // so this token always has the same output as `xx`
1126
1126
  case "xxxx":
1127
1127
  case "xx":
1128
- return P(r);
1128
+ return N(r);
1129
1129
  // Hours, minutes and optional seconds with `:` delimiter
1130
1130
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1131
1131
  // so this token always has the same output as `xxx`
@@ -1133,7 +1133,7 @@ const T = {
1133
1133
  case "xxx":
1134
1134
  // Hours and minutes with `:` delimiter
1135
1135
  default:
1136
- return P(r, ":");
1136
+ return N(r, ":");
1137
1137
  }
1138
1138
  },
1139
1139
  // Timezone (GMT)
@@ -1144,11 +1144,11 @@ const T = {
1144
1144
  case "O":
1145
1145
  case "OO":
1146
1146
  case "OOO":
1147
- return "GMT" + ct(r, ":");
1147
+ return "GMT" + ut(r, ":");
1148
1148
  // Long
1149
1149
  case "OOOO":
1150
1150
  default:
1151
- return "GMT" + P(r, ":");
1151
+ return "GMT" + N(r, ":");
1152
1152
  }
1153
1153
  },
1154
1154
  // Timezone (specific non-location)
@@ -1159,11 +1159,11 @@ const T = {
1159
1159
  case "z":
1160
1160
  case "zz":
1161
1161
  case "zzz":
1162
- return "GMT" + ct(r, ":");
1162
+ return "GMT" + ut(r, ":");
1163
1163
  // Long
1164
1164
  case "zzzz":
1165
1165
  default:
1166
- return "GMT" + P(r, ":");
1166
+ return "GMT" + N(r, ":");
1167
1167
  }
1168
1168
  },
1169
1169
  // Seconds timestamp
@@ -1176,18 +1176,18 @@ const T = {
1176
1176
  return u(+t, e.length);
1177
1177
  }
1178
1178
  };
1179
- function ct(t, e = "") {
1179
+ function ut(t, e = "") {
1180
1180
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), s = r % 60;
1181
1181
  return s === 0 ? n + String(a) : n + String(a) + e + u(s, 2);
1182
1182
  }
1183
- function ut(t, e) {
1184
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) : P(t, e);
1183
+ function lt(t, e) {
1184
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) : N(t, e);
1185
1185
  }
1186
- function P(t, e = "") {
1186
+ function N(t, e = "") {
1187
1187
  const n = t > 0 ? "-" : "+", r = Math.abs(t), a = u(Math.trunc(r / 60), 2), s = u(r % 60, 2);
1188
1188
  return n + a + e + s;
1189
1189
  }
1190
- const lt = (t, e) => {
1190
+ const ht = (t, e) => {
1191
1191
  switch (t) {
1192
1192
  case "P":
1193
1193
  return e.date({ width: "short" });
@@ -1199,7 +1199,7 @@ const lt = (t, e) => {
1199
1199
  default:
1200
1200
  return e.date({ width: "full" });
1201
1201
  }
1202
- }, Dt = (t, e) => {
1202
+ }, kt = (t, e) => {
1203
1203
  switch (t) {
1204
1204
  case "p":
1205
1205
  return e.time({ width: "short" });
@@ -1211,10 +1211,10 @@ const lt = (t, e) => {
1211
1211
  default:
1212
1212
  return e.time({ width: "full" });
1213
1213
  }
1214
- }, be = (t, e) => {
1214
+ }, Se = (t, e) => {
1215
1215
  const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1216
1216
  if (!a)
1217
- return lt(t, e);
1217
+ return ht(t, e);
1218
1218
  let s;
1219
1219
  switch (r) {
1220
1220
  case "P":
@@ -1231,47 +1231,47 @@ const lt = (t, e) => {
1231
1231
  s = e.dateTime({ width: "full" });
1232
1232
  break;
1233
1233
  }
1234
- return s.replace("{{date}}", lt(r, e)).replace("{{time}}", Dt(a, e));
1235
- }, De = {
1236
- p: Dt,
1237
- P: be
1238
- }, Se = /^D+$/, ke = /^Y+$/, ve = ["D", "DD", "YY", "YYYY"];
1239
- function Me(t) {
1240
- return Se.test(t);
1234
+ return s.replace("{{date}}", ht(r, e)).replace("{{time}}", kt(a, e));
1235
+ }, ke = {
1236
+ p: kt,
1237
+ P: Se
1238
+ }, ve = /^D+$/, Me = /^Y+$/, Te = ["D", "DD", "YY", "YYYY"];
1239
+ function xe(t) {
1240
+ return ve.test(t);
1241
1241
  }
1242
- function Te(t) {
1243
- return ke.test(t);
1242
+ function Oe(t) {
1243
+ return Me.test(t);
1244
1244
  }
1245
- function xe(t, e, n) {
1246
- const r = Oe(t, e, n);
1247
- if (console.warn(r), ve.includes(t)) throw new RangeError(r);
1245
+ function Pe(t, e, n) {
1246
+ const r = Ne(t, e, n);
1247
+ if (console.warn(r), Te.includes(t)) throw new RangeError(r);
1248
1248
  }
1249
- function Oe(t, e, n) {
1249
+ function Ne(t, e, n) {
1250
1250
  const r = t[0] === "Y" ? "years" : "days of the month";
1251
1251
  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`;
1252
1252
  }
1253
- const Pe = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ne = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ce = /^'([^]*?)'?$/, $e = /''/g, Ee = /[a-zA-Z]/;
1254
- function We(t, e, n) {
1253
+ const Ce = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, $e = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ee = /^'([^]*?)'?$/, _e = /''/g, We = /[a-zA-Z]/;
1254
+ function Ye(t, e, n) {
1255
1255
  var g, m, v, M;
1256
- const r = z(), a = r.locale ?? ge, s = r.firstWeekContainsDate ?? ((m = (g = r.locale) == null ? void 0 : g.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, i = r.weekStartsOn ?? ((M = (v = r.locale) == null ? void 0 : v.options) == null ? void 0 : M.weekStartsOn) ?? 0, o = b(t, n == null ? void 0 : n.in);
1257
- if (!Wt(o))
1256
+ const r = B(), a = r.locale ?? pe, s = r.firstWeekContainsDate ?? ((m = (g = r.locale) == null ? void 0 : g.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, i = r.weekStartsOn ?? ((M = (v = r.locale) == null ? void 0 : v.options) == null ? void 0 : M.weekStartsOn) ?? 0, o = b(t, n == null ? void 0 : n.in);
1257
+ if (!Yt(o))
1258
1258
  throw new RangeError("Invalid time value");
1259
- let c = e.match(Ne).map((w) => {
1259
+ let c = e.match($e).map((w) => {
1260
1260
  const p = w[0];
1261
1261
  if (p === "p" || p === "P") {
1262
- const Y = De[p];
1262
+ const Y = ke[p];
1263
1263
  return Y(w, a.formatLong);
1264
1264
  }
1265
1265
  return w;
1266
- }).join("").match(Pe).map((w) => {
1266
+ }).join("").match(Ce).map((w) => {
1267
1267
  if (w === "''")
1268
1268
  return { isToken: !1, value: "'" };
1269
1269
  const p = w[0];
1270
1270
  if (p === "'")
1271
- return { isToken: !1, value: _e(w) };
1272
- if (ot[p])
1271
+ return { isToken: !1, value: Fe(w) };
1272
+ if (ct[p])
1273
1273
  return { isToken: !0, value: w };
1274
- if (p.match(Ee))
1274
+ if (p.match(We))
1275
1275
  throw new RangeError(
1276
1276
  "Format string contains an unescaped latin alphabet character `" + p + "`"
1277
1277
  );
@@ -1286,20 +1286,20 @@ function We(t, e, n) {
1286
1286
  return c.map((w) => {
1287
1287
  if (!w.isToken) return w.value;
1288
1288
  const p = w.value;
1289
- (Te(p) || Me(p)) && xe(p, e, String(t));
1290
- const Y = ot[p[0]];
1289
+ (Oe(p) || xe(p)) && Pe(p, e, String(t));
1290
+ const Y = ct[p[0]];
1291
1291
  return Y(o, p, a.localize, d);
1292
1292
  }).join("");
1293
1293
  }
1294
- function _e(t) {
1295
- const e = t.match(Ce);
1296
- return e ? e[1].replace($e, "'") : t;
1294
+ function Fe(t) {
1295
+ const e = t.match(Ee);
1296
+ return e ? e[1].replace(_e, "'") : t;
1297
1297
  }
1298
- function Ye(t, e) {
1298
+ function Ie(t, e) {
1299
1299
  const n = b(t, e == null ? void 0 : e.in).getDay();
1300
1300
  return n === 0 ? 7 : n;
1301
1301
  }
1302
- function Fe(t, e, n = "long") {
1302
+ function He(t, e, n = "long") {
1303
1303
  return new Intl.DateTimeFormat("en-US", {
1304
1304
  // Enforces engine to render the time. Without the option JavaScriptCore omits it.
1305
1305
  hour: "numeric",
@@ -1307,29 +1307,29 @@ function Fe(t, e, n = "long") {
1307
1307
  timeZoneName: n
1308
1308
  }).format(e).split(/\s/g).slice(2).join(" ");
1309
1309
  }
1310
- const V = {}, A = {};
1311
- function N(t, e) {
1310
+ const G = {}, A = {};
1311
+ function C(t, e) {
1312
1312
  try {
1313
- const r = (V[t] || (V[t] = new Intl.DateTimeFormat("en-US", {
1313
+ const r = (G[t] || (G[t] = new Intl.DateTimeFormat("en-US", {
1314
1314
  timeZone: t,
1315
1315
  timeZoneName: "longOffset"
1316
1316
  }).format))(e).split("GMT")[1];
1317
- return r in A ? A[r] : ht(r, r.split(":"));
1317
+ return r in A ? A[r] : dt(r, r.split(":"));
1318
1318
  } catch {
1319
1319
  if (t in A) return A[t];
1320
- const n = t == null ? void 0 : t.match(Ie);
1321
- return n ? ht(t, n.slice(1)) : NaN;
1320
+ const n = t == null ? void 0 : t.match(Ae);
1321
+ return n ? dt(t, n.slice(1)) : NaN;
1322
1322
  }
1323
1323
  }
1324
- const Ie = /([+-]\d\d):?(\d\d)?/;
1325
- function ht(t, e) {
1324
+ const Ae = /([+-]\d\d):?(\d\d)?/;
1325
+ function dt(t, e) {
1326
1326
  const n = +(e[0] || 0), r = +(e[1] || 0), a = +(e[2] || 0) / 60;
1327
1327
  return A[t] = n * 60 + r > 0 ? n * 60 + r + a : n * 60 - r - a;
1328
1328
  }
1329
1329
  class S extends Date {
1330
1330
  //#region static
1331
1331
  constructor(...e) {
1332
- super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(N(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)), St(this), J(this)) : this.setTime(Date.now());
1332
+ super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(C(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)), vt(this), J(this)) : this.setTime(Date.now());
1333
1333
  }
1334
1334
  static tz(e, ...n) {
1335
1335
  return n.length ? new S(...n, e) : new S(Date.now(), e);
@@ -1340,7 +1340,7 @@ class S extends Date {
1340
1340
  return new S(+this, e);
1341
1341
  }
1342
1342
  getTimezoneOffset() {
1343
- const e = -N(this.timeZone, this);
1343
+ const e = -C(this.timeZone, this);
1344
1344
  return e > 0 ? Math.floor(e) : Math.ceil(e);
1345
1345
  }
1346
1346
  //#endregion
@@ -1355,26 +1355,26 @@ class S extends Date {
1355
1355
  }
1356
1356
  //#endregion
1357
1357
  }
1358
- const dt = /^(get|set)(?!UTC)/;
1358
+ const ft = /^(get|set)(?!UTC)/;
1359
1359
  Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
1360
- if (!dt.test(t)) return;
1361
- const e = t.replace(dt, "$1UTC");
1360
+ if (!ft.test(t)) return;
1361
+ const e = t.replace(ft, "$1UTC");
1362
1362
  S.prototype[e] && (t.startsWith("get") ? S.prototype[t] = function() {
1363
1363
  return this.internal[e]();
1364
1364
  } : (S.prototype[t] = function() {
1365
- return Date.prototype[e].apply(this.internal, arguments), He(this), +this;
1365
+ return Date.prototype[e].apply(this.internal, arguments), Re(this), +this;
1366
1366
  }, S.prototype[e] = function() {
1367
1367
  return Date.prototype[e].apply(this, arguments), J(this), +this;
1368
1368
  }));
1369
1369
  });
1370
1370
  function J(t) {
1371
- t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() - Math.round(-N(t.timeZone, t) * 60));
1371
+ t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() - Math.round(-C(t.timeZone, t) * 60));
1372
1372
  }
1373
- function He(t) {
1374
- Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), St(t);
1373
+ function Re(t) {
1374
+ Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), vt(t);
1375
1375
  }
1376
- function St(t) {
1377
- const e = N(t.timeZone, t), n = e > 0 ? Math.floor(e) : Math.ceil(e), r = /* @__PURE__ */ new Date(+t);
1376
+ function vt(t) {
1377
+ const e = C(t.timeZone, t), n = e > 0 ? Math.floor(e) : Math.ceil(e), r = /* @__PURE__ */ new Date(+t);
1378
1378
  r.setUTCHours(r.getUTCHours() - 1);
1379
1379
  const a = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), i = a - s, o = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours();
1380
1380
  i && o && t.internal.setUTCMinutes(t.internal.getUTCMinutes() + i);
@@ -1382,13 +1382,13 @@ function St(t) {
1382
1382
  c && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + c);
1383
1383
  const d = /* @__PURE__ */ new Date(+t);
1384
1384
  d.setUTCSeconds(0);
1385
- const g = a > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, m = Math.round(-(N(t.timeZone, t) * 60)) % 60;
1385
+ const g = a > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, m = Math.round(-(C(t.timeZone, t) * 60)) % 60;
1386
1386
  (m || g) && (t.internal.setUTCSeconds(t.internal.getUTCSeconds() + m), Date.prototype.setUTCSeconds.call(t, Date.prototype.getUTCSeconds.call(t) + m + g));
1387
- const v = N(t.timeZone, t), M = v > 0 ? Math.floor(v) : Math.ceil(v), p = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - M, Y = M !== n, et = p - c;
1388
- if (Y && et) {
1389
- Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + et);
1390
- const Q = N(t.timeZone, t), Tt = Q > 0 ? Math.floor(Q) : Math.ceil(Q), X = M - Tt;
1391
- X && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + X), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + X));
1387
+ const v = C(t.timeZone, t), M = v > 0 ? Math.floor(v) : Math.ceil(v), p = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - M, Y = M !== n, nt = p - c;
1388
+ if (Y && nt) {
1389
+ Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + nt);
1390
+ const j = C(t.timeZone, t), Ot = j > 0 ? Math.floor(j) : Math.ceil(j), Q = M - Ot;
1391
+ Q && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + Q), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + Q));
1392
1392
  }
1393
1393
  }
1394
1394
  class x extends S {
@@ -1411,7 +1411,7 @@ class x extends S {
1411
1411
  }
1412
1412
  toTimeString() {
1413
1413
  const e = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
1414
- return `${e} GMT${n}${r}${a} (${Fe(this.timeZone, this)})`;
1414
+ return `${e} GMT${n}${r}${a} (${He(this.timeZone, this)})`;
1415
1415
  }
1416
1416
  toLocaleString(e, n) {
1417
1417
  return Date.prototype.toLocaleString.call(this, e, {
@@ -1448,11 +1448,11 @@ class x extends S {
1448
1448
  //#endregion
1449
1449
  }
1450
1450
  window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz;
1451
- const Ae = (t = window.pktTz) => {
1451
+ const Ue = (t = window.pktTz) => {
1452
1452
  const e = new x((/* @__PURE__ */ new Date()).toISOString(), t);
1453
1453
  return e.setHours(0, 0, 0, 0), isNaN(e.getTime()) ? /* @__PURE__ */ new Date() : new Date(e.getFullYear(), e.getMonth(), e.getDate());
1454
1454
  };
1455
- function $(t) {
1455
+ function O(t) {
1456
1456
  if (!t || t === "") return /* @__PURE__ */ new Date();
1457
1457
  if (/^\d{4}-\d{2}-\d{2}$/.test(t)) {
1458
1458
  const [e, n, r] = t.split("-").map(Number);
@@ -1471,15 +1471,15 @@ const y = (t) => {
1471
1471
  }, U = (t) => {
1472
1472
  if (!t)
1473
1473
  return null;
1474
- const e = $(t);
1474
+ const e = O(t);
1475
1475
  return isNaN(e.getTime()) ? null : e;
1476
- }, gn = (t, e) => {
1477
- const n = _(t);
1478
- return isNaN(n.getTime()) ? "" : We(n, e);
1479
- }, _ = (t = "", e) => {
1480
- const n = typeof t == "string" ? $(t) : t;
1481
- return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : e ? e === "end" ? _t(n) : K(n) : n;
1482
- }, C = (t, e, n = 1) => {
1476
+ }, pn = (t, e) => {
1477
+ const n = W(t);
1478
+ return isNaN(n.getTime()) ? "" : Ye(n, e);
1479
+ }, W = (t = "", e) => {
1480
+ const n = typeof t == "string" ? O(t) : t;
1481
+ return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : e ? e === "end" ? Ft(n) : K(n) : n;
1482
+ }, $ = (t, e, n = 1) => {
1483
1483
  if (typeof t != "number" || typeof e != "number" || typeof n != "number" || isNaN(t) || isNaN(e) || isNaN(n))
1484
1484
  return /* @__PURE__ */ new Date();
1485
1485
  const r = new Date(t, e, n);
@@ -1487,69 +1487,75 @@ const y = (t) => {
1487
1487
  }, H = (t) => {
1488
1488
  let e;
1489
1489
  return typeof t == "number" ? e = new x(t, window.pktTz) : e = new x(t, window.pktTz), e.setHours(12, 0, 0, 0), e;
1490
- }, Re = (t) => !t || isNaN(t.getTime()) ? "" : new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: window.pktTz }).format(t), Ue = (t, e, n) => {
1490
+ };
1491
+ let V = null, mt;
1492
+ const Le = (t) => {
1493
+ if (!t || isNaN(t.getTime())) return "";
1494
+ const e = typeof window < "u" ? window.pktTz : void 0;
1495
+ return (!V || mt !== e) && (V = new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: e }), mt = e), V.format(t);
1496
+ }, qe = (t, e, n) => {
1491
1497
  if (!t || isNaN(t.getTime())) return !1;
1492
- const r = e ? _(e) : null, a = n ? _(n) : null;
1498
+ const r = e ? W(e) : null, a = n ? W(n) : null;
1493
1499
  return !(r && t < r || a && t > a);
1494
- }, Le = (t, e) => {
1500
+ }, Be = (t, e) => {
1495
1501
  if (!t || isNaN(t.getTime()) || !Array.isArray(e)) return !1;
1496
1502
  const n = y(t);
1497
1503
  return e.includes(n);
1498
- }, qe = (t, e) => {
1504
+ }, ze = (t, e) => {
1499
1505
  if (!t || isNaN(t.getTime()) || !Array.isArray(e)) return !1;
1500
1506
  const n = t.getDay().toString();
1501
1507
  return e.includes(n);
1502
- }, kt = (t, e, n, r, a) => !(!t || isNaN(t.getTime()) || !Ue(t, e, n) || r && Le(t, r) || a && qe(t, a)), yn = (t, e, n, r, a) => t.filter((s) => {
1508
+ }, Mt = (t, e, n, r, a) => !(!t || isNaN(t.getTime()) || !qe(t, e, n) || r && Be(t, r) || a && ze(t, a)), wn = (t, e, n, r, a) => t.filter((s) => {
1503
1509
  const i = U(s);
1504
- return i && kt(i, e, n, r, a);
1505
- }), pn = (t) => t.slice().sort((e, n) => {
1510
+ return i && Mt(i, e, n, r, a);
1511
+ }), bn = (t) => t.slice().sort((e, n) => {
1506
1512
  const r = U(e), a = U(n);
1507
1513
  return !r || !a ? 0 : r.getTime() - a.getTime();
1508
- }), wn = (t, e) => {
1514
+ }), Dn = (t, e) => {
1509
1515
  const n = U(t), r = U(e);
1510
1516
  return !n || !r ? !1 : n <= r;
1511
- }, Be = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : String(t).split(",").map((e) => e.trim()).filter(Boolean) : [], bn = (t) => t.join(","), ze = (t) => Be(t), je = (t) => t ? $(t) : null, Qe = (t) => {
1517
+ }, je = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : String(t).split(",").map((e) => e.trim()).filter(Boolean) : [], Sn = (t) => t.join(","), Qe = (t) => je(t), Xe = (t) => t ? O(t) : null, Ge = (t) => {
1512
1518
  if (typeof t == "string")
1513
- return t.split(",").map((e) => $(e));
1519
+ return t.split(",").map((e) => O(e));
1514
1520
  if (Array.isArray(t))
1515
- return t.map((e) => $(e));
1516
- }, j = {
1517
- csvToArray: ze,
1518
- stringToDate: je,
1519
- stringsToDate: Qe
1520
- }, Xe = { earliest: { default: null }, latest: { default: null }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, maxMultiple: { default: 4 }, range: { default: !1 } }, O = {
1521
- props: Xe
1521
+ return t.map((e) => O(e));
1522
+ }, z = {
1523
+ csvToArray: Qe,
1524
+ stringToDate: Xe,
1525
+ stringsToDate: Ge
1526
+ }, Ve = { earliest: { default: null }, latest: { default: null }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, maxMultiple: { default: 4 }, range: { default: !1 } }, P = {
1527
+ props: Ve
1522
1528
  };
1523
- function vt(t, e) {
1524
- const n = e.excludedates.map(
1529
+ function Tt(t, e) {
1530
+ const n = (e.excludedates ?? []).map(
1525
1531
  (r) => typeof r == "string" ? r : y(r)
1526
1532
  );
1527
- return !kt(
1533
+ return !Mt(
1528
1534
  t,
1529
1535
  e.earliest,
1530
1536
  e.latest,
1531
1537
  n,
1532
- e.excludeweekdays
1538
+ e.excludeweekdays ?? []
1533
1539
  );
1534
1540
  }
1535
- function Ge(t, e, n, r) {
1536
- return !!(vt(t, n) || !e && r.multiple && r.maxMultiple > 0 && r.selectedCount >= r.maxMultiple);
1541
+ function Ke(t, e, n, r) {
1542
+ return !!(Tt(t, n) || !e && r.multiple && r.maxMultiple > 0 && r.selectedCount >= r.maxMultiple);
1537
1543
  }
1538
- function Ve(t, e, n) {
1539
- const r = C(t, e, 0);
1540
- return !(n && _(n) > r);
1544
+ function Je(t, e, n) {
1545
+ const r = $(t, e, 0);
1546
+ return !(n && W(n) > r);
1541
1547
  }
1542
- function Ke(t, e, n) {
1543
- const r = C(
1548
+ function Ze(t, e, n) {
1549
+ const r = $(
1544
1550
  e === 11 ? t + 1 : t,
1545
1551
  e === 11 ? 0 : e + 1,
1546
1552
  1
1547
1553
  );
1548
- return !(n && _(n) < r);
1554
+ return !(n && W(n) < r);
1549
1555
  }
1550
- const L = 7, Je = 6;
1551
- function Ze(t, e) {
1552
- const n = C(t, e, 1), r = C(t, e + 1, 0), a = (n.getDay() + Je) % L, s = r.getDate(), i = Math.ceil((s + a) / L), c = C(t, e, 0).getDate(), d = bt(n);
1556
+ const L = 7, tn = 6;
1557
+ function en(t, e) {
1558
+ const n = $(t, e, 1), r = $(t, e + 1, 0), a = (n.getDay() + tn) % L, s = r.getDate(), i = Math.ceil((s + a) / L), c = $(t, e, 0).getDate(), d = St(n);
1553
1559
  return {
1554
1560
  firstDayOfMonth: n,
1555
1561
  lastDayOfMonth: r,
@@ -1560,19 +1566,19 @@ function Ze(t, e) {
1560
1566
  initialWeek: d
1561
1567
  };
1562
1568
  }
1563
- function tn(t, e, n, r) {
1569
+ function nn(t, e, n, r) {
1564
1570
  const { startingDay: a, numDays: s } = r;
1565
1571
  return t === 0 && e < a ? "prev-month" : n > s ? "next-month" : "current-month";
1566
1572
  }
1567
- function en(t, e, n, r) {
1573
+ function rn(t, e, n, r) {
1568
1574
  const { startingDay: a, numDaysPrevMonth: s, numDays: i } = r;
1569
1575
  return t === "prev-month" ? s - (a - e - 1) : t === "next-month" ? n - i : n;
1570
1576
  }
1571
- function W(t) {
1572
- return typeof t == "string" && (t = t.split(",")), t.length === 1 && t[0] === "" ? [] : t.map((e) => $(e));
1577
+ function _(t) {
1578
+ return typeof t == "string" && (t = t.split(",")), t.length === 1 && t[0] === "" ? [] : t.map((e) => O(e));
1573
1579
  }
1574
- function ft(t, e) {
1575
- const n = pt({ start: t, end: e }), r = {};
1580
+ function gt(t, e) {
1581
+ const n = bt({ start: t, end: e }), r = {};
1576
1582
  if (Array.isArray(n) && n.length)
1577
1583
  for (let a = 0; a < n.length; a++) {
1578
1584
  const s = n[a], i = s > t && s < e;
@@ -1580,81 +1586,84 @@ function ft(t, e) {
1580
1586
  }
1581
1587
  return r;
1582
1588
  }
1583
- function Mt(t, e, n, r) {
1589
+ function xt(t, e, n, r) {
1584
1590
  if (e.length !== 1) return !0;
1585
- const a = pt({
1591
+ const a = bt({
1586
1592
  start: e[0],
1587
1593
  end: t
1588
1594
  });
1589
1595
  if (!Array.isArray(a) || !a.length) return !0;
1590
1596
  for (let s = 0; s < a.length; s++) {
1591
- for (const i of n)
1597
+ for (const i of n ?? [])
1592
1598
  if (i > e[0] && i < t)
1593
1599
  return !1;
1594
- if (r.includes(Ye(a[s]).toString()))
1600
+ if ((r ?? []).includes(Ie(a[s]).toString()))
1595
1601
  return !1;
1596
1602
  }
1597
1603
  return !0;
1598
1604
  }
1599
- function Z(t, e) {
1605
+ function tt(t, e) {
1600
1606
  const n = y(t);
1601
1607
  return e.includes(n) ? e : [...e, n];
1602
1608
  }
1603
- function tt(t, e) {
1609
+ function et(t, e) {
1604
1610
  const n = y(t), r = e.indexOf(n);
1605
1611
  if (r === -1) return e;
1606
1612
  if (e.length === 1) return [];
1607
1613
  const a = [...e];
1608
1614
  return a.splice(r, 1), a;
1609
1615
  }
1610
- function nn(t, e, n) {
1616
+ function an(t, e, n) {
1611
1617
  const r = y(t);
1612
- return e.includes(r) ? tt(t, e) : n > 0 && e.length >= n ? e : Z(t, e);
1618
+ return e.includes(r) ? et(t, e) : n > 0 && e.length >= n ? e : tt(t, e);
1613
1619
  }
1614
- function rn(t, e, n) {
1615
- const r = y(t), a = W(e);
1620
+ function sn(t, e, n) {
1621
+ const r = y(t), a = _(e);
1616
1622
  if (e.includes(r))
1617
- return e.indexOf(r) === 0 ? [] : tt(t, e);
1623
+ return e.indexOf(r) === 0 ? [] : et(t, e);
1618
1624
  if (e.length > 1)
1619
1625
  return [r];
1620
1626
  if (e.length === 1) {
1621
- if (!Mt(t, a, n.excludedates, n.excludeweekdays))
1627
+ if (!xt(t, a, n.excludedates, n.excludeweekdays))
1622
1628
  return [r];
1623
1629
  if (a[0] > t)
1624
1630
  return [r];
1625
1631
  }
1626
- return Z(t, e);
1632
+ return tt(t, e);
1627
1633
  }
1628
- const an = {
1634
+ const on = {
1629
1635
  ArrowLeft: -1,
1630
1636
  ArrowRight: 1,
1631
1637
  ArrowUp: -L,
1632
1638
  ArrowDown: L
1633
1639
  };
1634
- function sn(t) {
1640
+ function cn(t) {
1635
1641
  var n;
1636
1642
  const e = t.nodeName;
1637
1643
  return e === "INPUT" || e === "SELECT" || e === "BUTTON" && !((n = t.dataset) != null && n.date);
1638
1644
  }
1639
- function on(t, e, n) {
1640
- let r = st(t, e);
1645
+ function un(t, e, n) {
1646
+ let r = it(t, e);
1641
1647
  if (!r) return null;
1642
1648
  let a = n(`button[data-date="${y(r)}"]`);
1643
1649
  for (; a instanceof HTMLButtonElement && a.dataset.disabled; )
1644
- if (r = st(r, e), a = n(`button[data-date="${y(r)}"]`), !a) return null;
1650
+ if (r = it(r, e), a = n(`button[data-date="${y(r)}"]`), !a) return null;
1645
1651
  return r;
1646
1652
  }
1647
- function cn(t) {
1648
- return an[t] ?? null;
1653
+ function ln(t) {
1654
+ return on[t] ?? null;
1649
1655
  }
1650
- var un = Object.defineProperty, ln = Object.getOwnPropertyDescriptor, h = (t, e, n, r) => {
1651
- for (var a = r > 1 ? void 0 : r ? ln(e, n) : e, s = t.length - 1, i; s >= 0; s--)
1656
+ var hn = Object.defineProperty, dn = Object.getOwnPropertyDescriptor, h = (t, e, n, r) => {
1657
+ for (var a = r > 1 ? void 0 : r ? dn(e, n) : e, s = t.length - 1, i; s >= 0; s--)
1652
1658
  (i = t[s]) && (a = (r ? i(e, n, a) : i(a)) || a);
1653
- return r && a && un(e, n, a), a;
1659
+ return r && a && hn(e, n, a), a;
1654
1660
  };
1655
- let l = class extends xt {
1661
+ let l = class extends Pt {
1656
1662
  constructor() {
1657
- super(...arguments), this.selected = [], this.multiple = O.props.multiple.default, this.maxMultiple = O.props.maxMultiple.default, this.range = O.props.range.default, this.earliest = O.props.earliest.default, this.latest = O.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = O.props.weeknumbers.default, this.withcontrols = O.props.withcontrols.default, this.currentmonth = 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
+ super(...arguments), this.selected = [], this.multiple = P.props.multiple.default, this.maxMultiple = P.props.maxMultiple.default, this.range = P.props.range.default, this.earliest = P.props.earliest.default, this.latest = P.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = P.props.weeknumbers.default, this.withcontrols = P.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;
1664
+ }
1665
+ get todayDate() {
1666
+ return this.today ? O(this.today) : Ue();
1658
1667
  }
1659
1668
  /**
1660
1669
  * Lifecycle methods
@@ -1672,30 +1681,30 @@ let l = class extends xt {
1672
1681
  * Date and selection management
1673
1682
  */
1674
1683
  convertSelected() {
1675
- typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = W(this.selected), this.range && this.selected.length === 2 && (this.inRange = ft(this._selected[0], this._selected[1])), this.setCurrentMonth();
1684
+ typeof this.selected == "string" && (this.selected = this.selected.split(",")), this.selected.length === 1 && this.selected[0] === "" && (this.selected = []), this._selected = _(this.selected), this.range && this.selected.length === 2 && (this.inRange = gt(this._selected[0], this._selected[1])), this.setCurrentMonth();
1676
1685
  }
1677
1686
  setCurrentMonth() {
1678
1687
  if (this.currentmonth === null && !this.currentmonthtouched && (this.currentmonthtouched = !0), this.selected.length && this.selected[0] !== "") {
1679
- const t = $(this.selected[this.selected.length - 1]);
1680
- this.currentmonth = isNaN(t.getTime()) ? H(/* @__PURE__ */ new Date()) : t;
1681
- } else this.currentmonth === null && (this.currentmonth = H(/* @__PURE__ */ new Date()));
1682
- (!this.currentmonth || isNaN(this.currentmonth.getTime())) && (this.currentmonth = H(/* @__PURE__ */ new Date())), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
1688
+ const t = O(this.selected[this.selected.length - 1]);
1689
+ this.currentmonth = isNaN(t.getTime()) ? H(this.todayDate) : t;
1690
+ } else this.currentmonth === null && (this.currentmonth = H(this.todayDate));
1691
+ (!this.currentmonth || isNaN(this.currentmonth.getTime())) && (this.currentmonth = H(this.todayDate)), this.year = this.currentmonth.getFullYear(), this.month = this.currentmonth.getMonth();
1683
1692
  }
1684
1693
  /**
1685
1694
  * Keyboard navigation
1686
1695
  */
1687
1696
  handleKeydown(t) {
1688
- const e = cn(t.key);
1697
+ const e = ln(t.key);
1689
1698
  e !== null && this.handleArrowKey(t, e);
1690
1699
  }
1691
1700
  handleArrowKey(t, e) {
1692
1701
  const n = t.target;
1693
- if (sn(n)) return;
1702
+ if (cn(n)) return;
1694
1703
  if (t.preventDefault(), !this.focusedDate) {
1695
1704
  this.focusOnCurrentDate();
1696
1705
  return;
1697
1706
  }
1698
- const r = this.focusedDate ? _(this.focusedDate) : C(this.year, this.month, 1), a = on(r, e, this.querySelector.bind(this));
1707
+ const r = this.focusedDate ? W(this.focusedDate) : $(this.year, this.month, 1), a = un(r, e, this.querySelector.bind(this));
1699
1708
  if (a) {
1700
1709
  const s = this.querySelector(`button[data-date="${y(a)}"]`);
1701
1710
  s instanceof HTMLButtonElement && !s.dataset.disabled && (this.focusedDate = y(a), s.focus());
@@ -1743,8 +1752,8 @@ let l = class extends xt {
1743
1752
  @keydown=${(o) => {
1744
1753
  (o.key === "Enter" || o.key === " ") && (o.preventDefault(), n && i());
1745
1754
  }}
1746
- class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${s} ${n ? "" : "pkt-hide"}"
1747
- .data-disabled=${n ? rt : "disabled"}
1755
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${s} ${n ? "" : "pkt-invisible"}"
1756
+ .data-disabled=${n ? at : "disabled"}
1748
1757
  ?aria-disabled=${!n}
1749
1758
  tabindex=${n ? "0" : "-1"}
1750
1759
  >
@@ -1803,14 +1812,14 @@ let l = class extends xt {
1803
1812
  </div>`;
1804
1813
  }
1805
1814
  getDayViewData(t, e) {
1806
- const n = C(this.year, this.month, t), r = y(n), a = r === y(e), s = this.selected.includes(r), i = this.isDayDisabled(n, s), o = this.calculateTabIndex(r, i, t);
1815
+ const n = $(this.year, this.month, t), r = y(n), a = r === y(e), s = this.selected.includes(r), i = this.isDayDisabled(n, s), o = this.calculateTabIndex(r, i, t);
1807
1816
  return {
1808
1817
  currentDate: n,
1809
1818
  currentDateISO: r,
1810
1819
  isToday: a,
1811
1820
  isSelected: s,
1812
1821
  isDisabled: i,
1813
- ariaLabel: Re(n),
1822
+ ariaLabel: Le(n),
1814
1823
  tabindex: o
1815
1824
  };
1816
1825
  }
@@ -1823,7 +1832,7 @@ let l = class extends xt {
1823
1832
  };
1824
1833
  }
1825
1834
  isDayDisabled(t, e) {
1826
- return Ge(t, e, this.getDateConstraints(), {
1835
+ return Ke(t, e, this.getDateConstraints(), {
1827
1836
  multiple: this.multiple,
1828
1837
  maxMultiple: this.maxMultiple,
1829
1838
  selectedCount: this.selected.length
@@ -1864,17 +1873,17 @@ let l = class extends xt {
1864
1873
  const n = this.getDayViewData(t, e), { currentDate: r, currentDateISO: a, isSelected: s, isDisabled: i, ariaLabel: o, tabindex: c } = n;
1865
1874
  this.selectableDates.push({ currentDateISO: a, isDisabled: i, tabindex: c });
1866
1875
  const d = this.getDayCellClasses(n), g = this.getDayButtonClasses(n);
1867
- return D`<td class=${nt(d)}>
1876
+ return D`<td class=${rt(d)}>
1868
1877
  <button
1869
1878
  type="button"
1870
1879
  aria-pressed=${s ? "true" : "false"}
1871
1880
  ?disabled=${i}
1872
- class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${nt(g)}"
1881
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${rt(g)}"
1873
1882
  @mouseover=${() => this.range && !this.isExcluded(r) && this.handleRangeHover(r)}
1874
1883
  @focus=${() => this.handleDayFocus(r, a)}
1875
1884
  aria-label="${o}"
1876
1885
  tabindex=${c}
1877
- data-disabled=${i ? "disabled" : rt}
1886
+ data-disabled=${i ? "disabled" : at}
1878
1887
  data-date=${a}
1879
1888
  @keydown=${(m) => {
1880
1889
  (m.key === "Enter" || m.key === " ") && (m.preventDefault(), this.handleDateSelect(r));
@@ -1901,7 +1910,8 @@ let l = class extends xt {
1901
1910
  return D`<tr class="pkt-cal-week-row" role="row">${t}</tr>`;
1902
1911
  }
1903
1912
  renderCalendarBody() {
1904
- const t = Ae(), e = Ze(this.year, this.month);
1913
+ const t = this.todayDate, e = en(this.year, this.month);
1914
+ this.selectableDates = [], this.tabIndexSet = 0;
1905
1915
  let n = 1;
1906
1916
  this.week = e.initialWeek;
1907
1917
  const r = [];
@@ -1909,11 +1919,11 @@ let l = class extends xt {
1909
1919
  const s = [];
1910
1920
  this.weeknumbers && s.push(D`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
1911
1921
  for (let i = 0; i < L; i++) {
1912
- const o = tn(a, i, n, e);
1922
+ const o = nn(a, i, n, e);
1913
1923
  if (o === "current-month")
1914
1924
  s.push(this.renderDayView(n, t)), n++;
1915
1925
  else {
1916
- const c = en(o, i, n, e);
1926
+ const c = rn(o, i, n, e);
1917
1927
  s.push(this.renderEmptyDayCell(c)), o === "next-month" && n++;
1918
1928
  }
1919
1929
  }
@@ -1925,20 +1935,20 @@ let l = class extends xt {
1925
1935
  * Date validation
1926
1936
  */
1927
1937
  isExcluded(t) {
1928
- return vt(t, this.getDateConstraints());
1938
+ return Tt(t, this.getDateConstraints());
1929
1939
  }
1930
1940
  /**
1931
1941
  * Month navigation
1932
1942
  */
1933
1943
  isPrevMonthAllowed() {
1934
- return Ve(this.year, this.month, this.earliest);
1944
+ return Je(this.year, this.month, this.earliest);
1935
1945
  }
1936
1946
  prevMonth() {
1937
1947
  const t = this.month === 0 ? 11 : this.month - 1, e = this.month === 0 ? this.year - 1 : this.year;
1938
1948
  this.changeMonth(e, t);
1939
1949
  }
1940
1950
  isNextMonthAllowed() {
1941
- return Ke(this.year, this.month, this.latest);
1951
+ return Ze(this.year, this.month, this.latest);
1942
1952
  }
1943
1953
  nextMonth() {
1944
1954
  const t = this.month === 11 ? 0 : this.month + 1, e = this.month === 11 ? this.year + 1 : this.year;
@@ -1957,29 +1967,29 @@ let l = class extends xt {
1957
1967
  return typeof this.selected == "string" ? this.selected.split(",") : this.selected;
1958
1968
  }
1959
1969
  addToSelected(t) {
1960
- this.selected = Z(t, this.normalizeSelected()), this._selected = W(this.selected), this.range && this.selected.length === 2 && (this.convertSelected(), this.close());
1970
+ this.selected = tt(t, this.normalizeSelected()), this._selected = _(this.selected), this.range && this.selected.length === 2 && (this.convertSelected(), this.close());
1961
1971
  }
1962
1972
  removeFromSelected(t) {
1963
- this.selected = tt(t, this.normalizeSelected()), this._selected = W(this.selected);
1973
+ this.selected = et(t, this.normalizeSelected()), this._selected = _(this.selected);
1964
1974
  }
1965
1975
  toggleSelected(t) {
1966
- this.selected = nn(t, this.normalizeSelected(), this.maxMultiple), this._selected = W(this.selected);
1976
+ this.selected = an(t, this.normalizeSelected(), this.maxMultiple), this._selected = _(this.selected);
1967
1977
  }
1968
1978
  isRangeAllowed(t) {
1969
- return Mt(t, this._selected, this.excludedates, this.excludeweekdays);
1979
+ return xt(t, this._selected, this.excludedates, this.excludeweekdays);
1970
1980
  }
1971
1981
  handleRangeSelect(t) {
1972
- return this.selected = rn(t, this.normalizeSelected(), {
1982
+ return this.selected = sn(t, this.normalizeSelected(), {
1973
1983
  excludedates: this.excludedates,
1974
1984
  excludeweekdays: this.excludeweekdays
1975
- }), this._selected = W(this.selected), this.selected.length === 2 ? this.convertSelected() : this.selected.length === 1 && (this.inRange = {}), Promise.resolve();
1985
+ }), this._selected = _(this.selected), this.selected.length === 2 ? (this.convertSelected(), this.close()) : this.selected.length === 1 && (this.inRange = {}), Promise.resolve();
1976
1986
  }
1977
1987
  handleRangeHover(t) {
1978
1988
  if (!this.range || this._selected.length !== 1 || !this.isRangeAllowed(t) || this._selected[0] >= t) {
1979
1989
  this.rangeHovered = null;
1980
1990
  return;
1981
1991
  }
1982
- this.rangeHovered = t, this.inRange = ft(this._selected[0], t);
1992
+ this.rangeHovered = t, this.inRange = gt(this._selected[0], t);
1983
1993
  }
1984
1994
  handleDateSelect(t) {
1985
1995
  return t && (this.range ? this.handleRangeSelect(t) : this.multiple ? this.toggleSelected(t) : (this.selected.includes(y(t)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(t)), this.close()), this.dispatchEvent(
@@ -1994,7 +2004,7 @@ let l = class extends xt {
1994
2004
  * Focus management and event handlers
1995
2005
  */
1996
2006
  focusOnCurrentDate() {
1997
- const t = y(H(/* @__PURE__ */ new Date())), e = this.querySelector(`button[data-date="${t}"]`);
2007
+ const t = y(H(this.todayDate)), e = this.querySelector(`button[data-date="${t}"]`);
1998
2008
  if (e instanceof HTMLButtonElement) {
1999
2009
  this.focusedDate = t, e.focus();
2000
2010
  return;
@@ -2008,7 +2018,7 @@ let l = class extends xt {
2008
2018
  }
2009
2019
  }
2010
2020
  closeEvent(t) {
2011
- !this.contains(t.relatedTarget) && !t.target.classList.contains("pkt-hide") && this.close();
2021
+ !this.contains(t.relatedTarget) && !t.target.classList.contains("pkt-invisible") && this.close();
2012
2022
  }
2013
2023
  close() {
2014
2024
  this.dispatchEvent(
@@ -2021,13 +2031,13 @@ let l = class extends xt {
2021
2031
  }
2022
2032
  };
2023
2033
  h([
2024
- f({ converter: j.csvToArray })
2034
+ f({ converter: z.csvToArray })
2025
2035
  ], l.prototype, "selected", 2);
2026
2036
  h([
2027
2037
  f({ type: Boolean })
2028
2038
  ], l.prototype, "multiple", 2);
2029
2039
  h([
2030
- f({ type: Number })
2040
+ f({ type: Number, attribute: "max-multiple" })
2031
2041
  ], l.prototype, "maxMultiple", 2);
2032
2042
  h([
2033
2043
  f({ type: Boolean })
@@ -2039,10 +2049,10 @@ h([
2039
2049
  f({ type: String })
2040
2050
  ], l.prototype, "latest", 2);
2041
2051
  h([
2042
- f({ converter: j.stringsToDate })
2052
+ f({ converter: z.stringsToDate })
2043
2053
  ], l.prototype, "excludedates", 2);
2044
2054
  h([
2045
- f({ converter: j.csvToArray })
2055
+ f({ converter: z.csvToArray })
2046
2056
  ], l.prototype, "excludeweekdays", 2);
2047
2057
  h([
2048
2058
  f({ type: Boolean })
@@ -2051,31 +2061,34 @@ h([
2051
2061
  f({ type: Boolean })
2052
2062
  ], l.prototype, "withcontrols", 2);
2053
2063
  h([
2054
- f({ converter: j.stringToDate })
2064
+ f({ converter: z.stringToDate })
2055
2065
  ], l.prototype, "currentmonth", 2);
2056
2066
  h([
2057
- f({ type: Array })
2067
+ f({ type: String })
2068
+ ], l.prototype, "today", 2);
2069
+ h([
2070
+ f({ type: Array, attribute: "day-strings" })
2058
2071
  ], l.prototype, "dayStrings", 2);
2059
2072
  h([
2060
- f({ type: Array })
2073
+ f({ type: Array, attribute: "day-strings-long" })
2061
2074
  ], l.prototype, "dayStringsLong", 2);
2062
2075
  h([
2063
- f({ type: Array })
2076
+ f({ type: Array, attribute: "month-strings" })
2064
2077
  ], l.prototype, "monthStrings", 2);
2065
2078
  h([
2066
- f({ type: String })
2079
+ f({ type: String, attribute: "week-string" })
2067
2080
  ], l.prototype, "weekString", 2);
2068
2081
  h([
2069
- f({ type: String })
2082
+ f({ type: String, attribute: "prev-month-string" })
2070
2083
  ], l.prototype, "prevMonthString", 2);
2071
2084
  h([
2072
- f({ type: String })
2085
+ f({ type: String, attribute: "next-month-string" })
2073
2086
  ], l.prototype, "nextMonthString", 2);
2074
2087
  h([
2075
2088
  f({ type: Array })
2076
2089
  ], l.prototype, "_selected", 2);
2077
2090
  h([
2078
- q()
2091
+ Z()
2079
2092
  ], l.prototype, "inRange", 2);
2080
2093
  h([
2081
2094
  f({ type: Date })
@@ -2090,31 +2103,25 @@ h([
2090
2103
  f({ type: Number })
2091
2104
  ], l.prototype, "week", 2);
2092
2105
  h([
2093
- q()
2106
+ Z()
2094
2107
  ], l.prototype, "currentmonthtouched", 2);
2095
2108
  h([
2096
- q()
2109
+ Z()
2097
2110
  ], l.prototype, "focusedDate", 2);
2098
- h([
2099
- q()
2100
- ], l.prototype, "selectableDates", 2);
2101
- h([
2102
- q()
2103
- ], l.prototype, "tabIndexSet", 2);
2104
2111
  l = h([
2105
- Ot("pkt-calendar")
2112
+ Nt("pkt-calendar")
2106
2113
  ], l);
2107
2114
  export {
2108
2115
  l as P,
2109
- yn as a,
2116
+ wn as a,
2110
2117
  U as b,
2111
- bn as c,
2112
- y as d,
2113
- j as e,
2114
- gn as f,
2115
- wn as i,
2116
- _ as n,
2117
- $ as p,
2118
- pn as s,
2119
- Be as v
2118
+ y as c,
2119
+ Sn as d,
2120
+ z as e,
2121
+ pn as f,
2122
+ Dn as i,
2123
+ W as n,
2124
+ O as p,
2125
+ bn as s,
2126
+ je as v
2120
2127
  };