@abgov/ui-components-common 1.11.0 → 2.0.0-dev.2

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.
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- var S = Object.defineProperty;
2
- var g = (r) => {
3
- throw TypeError(r);
1
+ var Z = Object.defineProperty;
2
+ var q = (n) => {
3
+ throw TypeError(n);
4
4
  };
5
- var M = (r, t, e) => t in r ? S(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
6
- var l = (r, t, e) => M(r, typeof t != "symbol" ? t + "" : t, e), w = (r, t, e) => t.has(r) || g("Cannot " + e);
7
- var y = (r, t, e) => t.has(r) ? g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e);
8
- var _ = (r, t, e) => (w(r, t, "access private method"), e);
9
- class x {
5
+ var z = (n, t, e) => t in n ? Z(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
6
+ var w = (n, t, e) => z(n, typeof t != "symbol" ? t + "" : t, e), K = (n, t, e) => t.has(n) || q("Cannot " + e);
7
+ var R = (n, t, e) => t.has(n) ? q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e);
8
+ var V = (n, t, e) => (K(n, t, "access private method"), e);
9
+ class Oe {
10
10
  constructor(t) {
11
- l(this, "validators");
11
+ w(this, "validators");
12
12
  this.validators = t || {};
13
13
  }
14
14
  add(t, ...e) {
@@ -16,16 +16,16 @@ class x {
16
16
  }
17
17
  validate(t) {
18
18
  const e = {};
19
- return Object.entries(this.validators).forEach(([n, i]) => {
20
- const a = i.map((s) => s(t[n])).find((s) => !!s);
21
- a && (e[n] = a);
19
+ return Object.entries(this.validators).forEach(([r, a]) => {
20
+ const i = a.map((s) => s(t[r])).find((s) => !!s);
21
+ i && (e[r] = i);
22
22
  }), e;
23
23
  }
24
24
  }
25
- function I() {
25
+ function Pe() {
26
26
  return [
27
- c("Day is required"),
28
- h({
27
+ F("Day is required"),
28
+ A({
29
29
  min: 1,
30
30
  max: 31,
31
31
  minMsg: "Day must be between 1 and 31",
@@ -33,10 +33,10 @@ function I() {
33
33
  })
34
34
  ];
35
35
  }
36
- function L() {
36
+ function Se() {
37
37
  return [
38
- c("Month is required"),
39
- h({
38
+ F("Month is required"),
39
+ A({
40
40
  min: 0,
41
41
  max: 11,
42
42
  minMsg: "Month must be between Jan and Dec",
@@ -44,105 +44,105 @@ function L() {
44
44
  })
45
45
  ];
46
46
  }
47
- function U() {
48
- const r = (/* @__PURE__ */ new Date()).getFullYear();
47
+ function ve() {
48
+ const n = (/* @__PURE__ */ new Date()).getFullYear();
49
49
  return [
50
- c("Year is required"),
51
- h({
50
+ F("Year is required"),
51
+ A({
52
52
  min: 1900,
53
- max: r,
53
+ max: n,
54
54
  minMsg: "Year must be greater than 1900",
55
- maxMsg: `Year must be less than ${r}`
55
+ maxMsg: `Year must be less than ${n}`
56
56
  })
57
57
  ];
58
58
  }
59
- function c(r) {
60
- return (t) => (r = r || "Required", typeof t == "number" && !isNaN(t) || t ? "" : r);
59
+ function F(n) {
60
+ return (t) => (n = n || "Required", typeof t == "number" && !isNaN(t) || t ? "" : n);
61
61
  }
62
- function T(r) {
62
+ function xe(n) {
63
63
  const t = new RegExp(/^\+?[\d-() ]{10,18}$/);
64
- return m(t, r || "Invalid phone number");
64
+ return C(t, n || "Invalid phone number");
65
65
  }
66
- function q(r) {
66
+ function ke(n) {
67
67
  const t = new RegExp(
68
68
  /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
69
69
  );
70
- return m(t, r || "Invalid email address");
71
- }
72
- function Y() {
73
- return (r) => {
74
- if (!r) return "";
75
- const t = "121212121".split("").map((i) => parseInt(i)), e = r.replace(/\D/g, "");
76
- return e.length !== 9 ? "SIN must contain 9 numbers" : e.split("").map((i) => parseInt(i)).map((i, a) => {
77
- const s = i * t[a];
78
- return s < 10 ? s : `${s}`.split("").map((u) => parseInt(u)).reduce((u, f) => u + f, 0);
79
- }).reduce((i, a) => i + a, 0) % 10 === 0 ? "" : "Invalid SIN";
70
+ return C(t, n || "Invalid email address");
71
+ }
72
+ function Ne() {
73
+ return (n) => {
74
+ if (!n) return "";
75
+ const t = "121212121".split("").map((a) => parseInt(a)), e = n.replace(/\D/g, "");
76
+ return e.length !== 9 ? "SIN must contain 9 numbers" : e.split("").map((a) => parseInt(a)).map((a, i) => {
77
+ const s = a * t[i];
78
+ return s < 10 ? s : `${s}`.split("").map((o) => parseInt(o)).reduce((o, c) => o + c, 0);
79
+ }).reduce((a, i) => a + i, 0) % 10 === 0 ? "" : "Invalid SIN";
80
80
  };
81
81
  }
82
- function J() {
83
- return m(
82
+ function Ye() {
83
+ return C(
84
84
  /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
85
85
  "Invalid postal code"
86
86
  );
87
87
  }
88
- function m(r, t) {
89
- return (e) => !e || e.match(r) ? "" : t;
88
+ function C(n, t) {
89
+ return (e) => !e || e.match(n) ? "" : t;
90
90
  }
91
- function O({
92
- invalidMsg: r,
91
+ function Te({
92
+ invalidMsg: n,
93
93
  minMsg: t,
94
94
  maxMsg: e,
95
- min: n,
96
- max: i
95
+ min: r,
96
+ max: a
97
97
  } = {}) {
98
- return (a) => {
98
+ return (i) => {
99
99
  let s = /* @__PURE__ */ new Date(-1);
100
- return `${a || ""}`.length === 0 ? "" : (typeof a == "string" && (s = new Date(a)), typeof a == "number" && (s = new Date(a)), a.toDateString && (s = a), s.getDate() === -1 ? r || "Invalid date" : n && s < n ? t || `Must be after ${n}` : i && s > i ? e || `Must be before ${i}` : "");
100
+ return `${i || ""}`.length === 0 ? "" : (typeof i == "string" && (s = new Date(i)), typeof i == "number" && (s = new Date(i)), i.toDateString && (s = i), s.getDate() === -1 ? n || "Invalid date" : r && s < r ? t || `Must be after ${r}` : a && s > a ? e || `Must be before ${a}` : "");
101
101
  };
102
102
  }
103
- function h({
104
- invalidTypeMsg: r,
103
+ function A({
104
+ invalidTypeMsg: n,
105
105
  minMsg: t,
106
106
  maxMsg: e,
107
- min: n = -Number.MAX_VALUE,
108
- max: i = Number.MAX_VALUE
107
+ min: r = -Number.MAX_VALUE,
108
+ max: a = Number.MAX_VALUE
109
109
  } = {}) {
110
- return (a) => {
110
+ return (i) => {
111
111
  let s = Number.MAX_VALUE;
112
- return `${a ?? ""}`.length === 0 ? "" : (typeof a == "string" && (s = parseFloat(a)), typeof a == "number" && (s = a), isNaN(s) ? r || "Must be a numeric value" : s > i ? e || `Must be less than or equal to ${i}` : s < n ? t || `Must be greater than or equal to ${n}` : "");
112
+ return `${i ?? ""}`.length === 0 ? "" : (typeof i == "string" && (s = parseFloat(i)), typeof i == "number" && (s = i), isNaN(s) ? n || "Must be a numeric value" : s > a ? e || `Must be less than or equal to ${a}` : s < r ? t || `Must be greater than or equal to ${r}` : "");
113
113
  };
114
114
  }
115
- function X({
116
- invalidTypeMsg: r,
115
+ function We({
116
+ invalidTypeMsg: n,
117
117
  minMsg: t,
118
118
  maxMsg: e,
119
- min: n = -Number.MAX_VALUE,
120
- max: i = Number.MAX_VALUE
119
+ min: r = -Number.MAX_VALUE,
120
+ max: a = Number.MAX_VALUE
121
121
  }) {
122
- return (a) => `${a || ""}`.length === 0 ? "" : typeof a != "string" ? r || "Invalid type" : a.length > i ? e || `Must be less than ${i} characters` : a.length < n ? t || `Must be greater than ${n} characters` : "";
122
+ return (i) => `${i || ""}`.length === 0 ? "" : typeof i != "string" ? n || "Invalid type" : i.length > a ? e || `Must be less than ${a} characters` : i.length < r ? t || `Must be greater than ${r} characters` : "";
123
123
  }
124
- function v(r, t, e, n) {
125
- if (!r) {
124
+ function L(n, t, e, r) {
125
+ if (!n) {
126
126
  console.error("dispatch element is null");
127
127
  return;
128
128
  }
129
- r.dispatchEvent(
129
+ n.dispatchEvent(
130
130
  new CustomEvent(t, {
131
131
  composed: !0,
132
- bubbles: n == null ? void 0 : n.bubbles,
132
+ bubbles: r == null ? void 0 : r.bubbles,
133
133
  detail: e
134
134
  })
135
135
  );
136
136
  }
137
- function o(r, t, e, n) {
138
- if (!r) {
137
+ function M(n, t, e, r) {
138
+ if (!n) {
139
139
  console.error("dispatch element is null");
140
140
  return;
141
141
  }
142
- r.dispatchEvent(
142
+ n.dispatchEvent(
143
143
  new CustomEvent("msg", {
144
144
  composed: !0,
145
- bubbles: n == null ? void 0 : n.bubbles,
145
+ bubbles: r == null ? void 0 : r.bubbles,
146
146
  detail: {
147
147
  action: t,
148
148
  data: e
@@ -150,14 +150,14 @@ function o(r, t, e, n) {
150
150
  })
151
151
  );
152
152
  }
153
- var d, E, A;
154
- class j {
153
+ var N, tt, G;
154
+ class _e {
155
155
  constructor(t) {
156
- y(this, d);
157
- l(this, "state");
158
- l(this, "_formData");
159
- l(this, "_formRef");
160
- l(this, "_isCompleting", !1);
156
+ R(this, N);
157
+ w(this, "state");
158
+ w(this, "_formData");
159
+ w(this, "_formRef");
160
+ w(this, "_isCompleting", !1);
161
161
  this.type = t;
162
162
  }
163
163
  // Obtain reference to the form element
@@ -179,38 +179,38 @@ class j {
179
179
  }
180
180
  // Public method to allow for the initialization of the state
181
181
  initState(t, e) {
182
- o(this._formRef, "external::init:state", t), typeof t == "string" ? this.state = JSON.parse(t) : Array.isArray(t) || (this.state = t), e && setTimeout(e, 200);
182
+ M(this._formRef, "external::init:state", t), typeof t == "string" ? this.state = JSON.parse(t) : Array.isArray(t) || (this.state = t), e && setTimeout(e, 201);
183
183
  }
184
184
  updateListState(t) {
185
185
  const e = t.detail;
186
186
  Array.isArray(e.data) && (this.state = e.data);
187
187
  }
188
188
  updateObjectState(t) {
189
- var n, i;
189
+ var r, a;
190
190
  if (Array.isArray(this.state))
191
191
  return;
192
192
  const e = t.detail;
193
193
  e.type === "list" ? this.state = {
194
194
  ...this.state,
195
- form: { ...((n = this.state) == null ? void 0 : n.form) || {}, [e.id]: e.data }
195
+ form: { ...((r = this.state) == null ? void 0 : r.form) || {}, [e.id]: e.data }
196
196
  } : this.state = {
197
197
  ...this.state,
198
198
  ...e.data,
199
- form: { ...((i = this.state) == null ? void 0 : i.form) || {}, ...e.data.form },
199
+ form: { ...((a = this.state) == null ? void 0 : a.form) || {}, ...e.data.form },
200
200
  history: e.data.history
201
201
  };
202
202
  }
203
203
  getStateList() {
204
204
  return this.state ? Array.isArray(this.state) ? this.state.length === 0 ? [] : this.state.map((t) => Object.values(t.form).filter((e) => {
205
- var n;
206
- return ((n = e == null ? void 0 : e.data) == null ? void 0 : n.type) === "details";
205
+ var r;
206
+ return ((r = e == null ? void 0 : e.data) == null ? void 0 : r.type) === "details";
207
207
  }).map((e) => {
208
- var n;
209
- return e.data.type === "details" && ((n = e.data) == null ? void 0 : n.fieldsets) || {};
208
+ var r;
209
+ return e.data.type === "details" && ((r = e.data) == null ? void 0 : r.fieldsets) || {};
210
210
  }).reduce(
211
- (e, n) => {
212
- for (const [i, a] of Object.entries(n))
213
- e[i] = a.value;
211
+ (e, r) => {
212
+ for (const [a, i] of Object.entries(r))
213
+ e[a] = i.value;
214
214
  return e;
215
215
  },
216
216
  {}
@@ -244,8 +244,8 @@ class j {
244
244
  return console.error("getStateValue: unable to update the state of a multi form type"), "";
245
245
  if (!this.state)
246
246
  return console.error("getStateValue: state has not yet been set"), "";
247
- const n = this.state.form[t].data;
248
- return n.type !== "details" ? "" : n.fieldsets[e].value;
247
+ const r = this.state.form[t].data;
248
+ return r.type !== "details" ? "" : r.fieldsets[e].value;
249
249
  }
250
250
  // Public method to allow for the continuing to the next page
251
251
  continueTo(t) {
@@ -253,20 +253,20 @@ class j {
253
253
  console.error("continueTo [name] is undefined");
254
254
  return;
255
255
  }
256
- o(this._formRef, "external::continue", { next: t });
256
+ M(this._formRef, "external::continue", { next: t });
257
257
  }
258
258
  // Public method to perform validation and send the appropriate messages to the form elements
259
- validate(t, e, n, i) {
260
- var b;
261
- const { el: a, state: s, cancelled: u } = t.detail, f = (b = s == null ? void 0 : s[e]) == null ? void 0 : b.value;
262
- if (window.scrollTo({ top: 0, behavior: "smooth" }), u)
263
- return [!0, f];
264
- for (const V of n) {
265
- const p = V(f);
266
- if (_(this, d, A).call(this, a, e, p, i), p)
259
+ validate(t, e, r, a) {
260
+ var f;
261
+ const { el: i, state: s, cancelled: o } = t.detail, c = (f = s == null ? void 0 : s[e]) == null ? void 0 : f.value;
262
+ if (window.scrollTo({ top: 0, behavior: "smooth" }), o)
263
+ return [!0, c];
264
+ for (const h of r) {
265
+ const g = h(c);
266
+ if (V(this, N, G).call(this, i, e, g, a), g)
267
267
  return [!1, ""];
268
268
  }
269
- return [!0, f];
269
+ return [!0, c];
270
270
  }
271
271
  /**
272
272
  * Validates a group of fields ensuring that at least `minPassCount` of the items within the group
@@ -277,20 +277,20 @@ class j {
277
277
  * @param {FieldValidator[]} validators - An array of validator functions to apply to the fields.
278
278
  * @return {[number, Record<string, boolean>]} - Returns back the number of fields that passed and a record of the fields and their pass status.
279
279
  */
280
- validateGroup(t, e, n) {
281
- let i = 0;
282
- const a = {};
280
+ validateGroup(t, e, r) {
281
+ let a = 0;
282
+ const i = {};
283
283
  for (const s of e) {
284
- const [u] = this.validate(t, s, n, { grouped: !0 });
285
- u && (a[s] = !0, i++);
284
+ const [o] = this.validate(t, s, r, { grouped: !0 });
285
+ o && (i[s] = !0, a++);
286
286
  }
287
- return [i, a];
287
+ return [a, i];
288
288
  }
289
289
  edit(t) {
290
- o(this._formRef, "external::alter:state", { index: t, operation: "edit" });
290
+ M(this._formRef, "external::alter:state", { index: t, operation: "edit" });
291
291
  }
292
292
  remove(t) {
293
- o(this._formRef, "external::alter:state", {
293
+ M(this._formRef, "external::alter:state", {
294
294
  index: t,
295
295
  operation: "remove"
296
296
  });
@@ -320,7 +320,7 @@ class j {
320
320
  console.warn("complete: completion already in progress");
321
321
  return;
322
322
  }
323
- this._isCompleting = !0, o(this._formRef, "fieldset::submit", null, { bubbles: !0 }), this._isCompleting = !1;
323
+ this._isCompleting = !0, M(this._formRef, "fieldset::submit", null, { bubbles: !0 }), this._isCompleting = !1;
324
324
  }
325
325
  /**
326
326
  * Completes a subform and returns control to the parent form.
@@ -349,17 +349,17 @@ class j {
349
349
  }
350
350
  const t = this._formRef;
351
351
  this._isCompleting = !0;
352
- const e = (n) => {
353
- t.removeEventListener("_stateChange", e), v(t, "_complete", {}, { bubbles: !0 }), this._isCompleting = !1;
352
+ const e = (r) => {
353
+ t.removeEventListener("_stateChange", e), L(t, "_complete", {}, { bubbles: !0 }), this._isCompleting = !1;
354
354
  };
355
- t.addEventListener("_stateChange", e), v(t, "_continue", null, { bubbles: !0 });
355
+ t.addEventListener("_stateChange", e), L(t, "_continue", null, { bubbles: !0 });
356
356
  }
357
357
  // removes any data collected that doesn't correspond with the final history path
358
358
  clean(t) {
359
- return t.history.reduce((e, n) => (e[n] = t.form[n], e), {});
359
+ return t.history.reduce((e, r) => (e[r] = t.form[r], e), {});
360
360
  }
361
361
  }
362
- d = new WeakSet(), E = function(t) {
362
+ N = new WeakSet(), tt = function(t) {
363
363
  var e;
364
364
  Array.isArray(t.data) && (Array.isArray(this.state) || (this.state = {
365
365
  ...this.state,
@@ -369,7 +369,7 @@ d = new WeakSet(), E = function(t) {
369
369
  }
370
370
  }));
371
371
  }, // Private method to dispatch the error message to the form element
372
- A = function(t, e, n, i) {
372
+ G = function(t, e, r, a) {
373
373
  t.dispatchEvent(
374
374
  new CustomEvent("msg", {
375
375
  composed: !0,
@@ -377,60 +377,1489 @@ A = function(t, e, n, i) {
377
377
  action: "external::set:error",
378
378
  data: {
379
379
  name: e,
380
- msg: n,
381
- grouped: i == null ? void 0 : i.grouped
380
+ msg: r,
381
+ grouped: a == null ? void 0 : a.grouped
382
382
  }
383
383
  }
384
384
  })
385
385
  );
386
386
  };
387
- const R = ["basic", "success", "failure"];
388
- function C(r, t) {
387
+ const et = ["basic", "success", "failure"];
388
+ function nt(n, t) {
389
389
  const e = crypto.randomUUID();
390
- return t = { uuid: e, type: "basic", ...t || {} }, !t.duration && t.type && R.includes(t.type) && (t.duration = "short"), o(
390
+ return t = { uuid: e, type: "basic", ...t || {} }, !t.duration && t.type && et.includes(t.type) && (t.duration = "short"), M(
391
391
  document.body,
392
392
  "goa:temp-notification",
393
- { message: r, ...t },
393
+ { message: n, ...t },
394
394
  { bubbles: !0 }
395
395
  ), e;
396
396
  }
397
- function N(r) {
398
- o(
397
+ function rt(n) {
398
+ M(
399
399
  document.body,
400
400
  "goa:temp-notification:dismiss",
401
- r,
401
+ n,
402
402
  { bubbles: !0 }
403
403
  );
404
404
  }
405
- function D(r, t) {
406
- o(
405
+ function at(n, t) {
406
+ M(
407
407
  document.body,
408
408
  "goa:temp-notification:progress",
409
- { uuid: r, progress: t },
409
+ { uuid: n, progress: t },
410
410
  { bubbles: !0 }
411
411
  );
412
412
  }
413
- const G = {
414
- show: C,
415
- dismiss: N,
416
- setProgress: D
413
+ const Ee = {
414
+ show: nt,
415
+ dismiss: rt,
416
+ setProgress: at
417
+ };
418
+ class it {
419
+ constructor() {
420
+ w(this, "done");
421
+ this.done = /* @__PURE__ */ new Set();
422
+ }
423
+ when(t) {
424
+ return t ? this : new st();
425
+ }
426
+ do(t, e) {
427
+ this.done.has(t) || (this.done.add(t), e());
428
+ }
429
+ }
430
+ class st extends it {
431
+ do(t, e) {
432
+ }
433
+ }
434
+ function d(n) {
435
+ const t = Object.prototype.toString.call(n);
436
+ return n instanceof Date || typeof n == "object" && t === "[object Date]" ? new n.constructor(+n) : typeof n == "number" || t === "[object Number]" || typeof n == "string" || t === "[object String]" ? new Date(n) : /* @__PURE__ */ new Date(NaN);
437
+ }
438
+ function y(n, t) {
439
+ return n instanceof Date ? new n.constructor(t) : new Date(t);
440
+ }
441
+ function ot(n, t) {
442
+ const e = d(n);
443
+ return isNaN(t) ? y(n, NaN) : (t && e.setDate(e.getDate() + t), e);
444
+ }
445
+ function ut(n, t) {
446
+ const e = d(n);
447
+ if (isNaN(t)) return y(n, NaN);
448
+ if (!t)
449
+ return e;
450
+ const r = e.getDate(), a = y(n, e.getTime());
451
+ a.setMonth(e.getMonth() + t + 1, 0);
452
+ const i = a.getDate();
453
+ return r >= i ? a : (e.setFullYear(
454
+ a.getFullYear(),
455
+ a.getMonth(),
456
+ r
457
+ ), e);
458
+ }
459
+ const Q = 6048e5, ct = 864e5;
460
+ let dt = {};
461
+ function W() {
462
+ return dt;
463
+ }
464
+ function k(n, t) {
465
+ var o, c, f, h;
466
+ const e = W(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((h = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : h.weekStartsOn) ?? 0, a = d(n), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
467
+ return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
468
+ }
469
+ function Y(n) {
470
+ return k(n, { weekStartsOn: 1 });
471
+ }
472
+ function B(n) {
473
+ const t = d(n), e = t.getFullYear(), r = y(n, 0);
474
+ r.setFullYear(e + 1, 0, 4), r.setHours(0, 0, 0, 0);
475
+ const a = Y(r), i = y(n, 0);
476
+ i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0);
477
+ const s = Y(i);
478
+ return t.getTime() >= a.getTime() ? e + 1 : t.getTime() >= s.getTime() ? e : e - 1;
479
+ }
480
+ function T(n) {
481
+ const t = d(n);
482
+ return t.setHours(0, 0, 0, 0), t;
483
+ }
484
+ function H(n) {
485
+ const t = d(n), e = new Date(
486
+ Date.UTC(
487
+ t.getFullYear(),
488
+ t.getMonth(),
489
+ t.getDate(),
490
+ t.getHours(),
491
+ t.getMinutes(),
492
+ t.getSeconds(),
493
+ t.getMilliseconds()
494
+ )
495
+ );
496
+ return e.setUTCFullYear(t.getFullYear()), +n - +e;
497
+ }
498
+ function ft(n, t) {
499
+ const e = T(n), r = T(t), a = +e - H(e), i = +r - H(r);
500
+ return Math.round((a - i) / ct);
501
+ }
502
+ function ht(n) {
503
+ const t = B(n), e = y(n, 0);
504
+ return e.setFullYear(t, 0, 4), e.setHours(0, 0, 0, 0), Y(e);
505
+ }
506
+ function lt(n, t) {
507
+ const e = T(n), r = T(t);
508
+ return +e == +r;
509
+ }
510
+ function mt(n) {
511
+ return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
512
+ }
513
+ function gt(n) {
514
+ if (!mt(n) && typeof n != "number")
515
+ return !1;
516
+ const t = d(n);
517
+ return !isNaN(Number(t));
518
+ }
519
+ function yt(n) {
520
+ const t = d(n), e = y(n, 0);
521
+ return e.setFullYear(t.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
522
+ }
523
+ const bt = {
524
+ lessThanXSeconds: {
525
+ one: "less than a second",
526
+ other: "less than {{count}} seconds"
527
+ },
528
+ xSeconds: {
529
+ one: "1 second",
530
+ other: "{{count}} seconds"
531
+ },
532
+ halfAMinute: "half a minute",
533
+ lessThanXMinutes: {
534
+ one: "less than a minute",
535
+ other: "less than {{count}} minutes"
536
+ },
537
+ xMinutes: {
538
+ one: "1 minute",
539
+ other: "{{count}} minutes"
540
+ },
541
+ aboutXHours: {
542
+ one: "about 1 hour",
543
+ other: "about {{count}} hours"
544
+ },
545
+ xHours: {
546
+ one: "1 hour",
547
+ other: "{{count}} hours"
548
+ },
549
+ xDays: {
550
+ one: "1 day",
551
+ other: "{{count}} days"
552
+ },
553
+ aboutXWeeks: {
554
+ one: "about 1 week",
555
+ other: "about {{count}} weeks"
556
+ },
557
+ xWeeks: {
558
+ one: "1 week",
559
+ other: "{{count}} weeks"
560
+ },
561
+ aboutXMonths: {
562
+ one: "about 1 month",
563
+ other: "about {{count}} months"
564
+ },
565
+ xMonths: {
566
+ one: "1 month",
567
+ other: "{{count}} months"
568
+ },
569
+ aboutXYears: {
570
+ one: "about 1 year",
571
+ other: "about {{count}} years"
572
+ },
573
+ xYears: {
574
+ one: "1 year",
575
+ other: "{{count}} years"
576
+ },
577
+ overXYears: {
578
+ one: "over 1 year",
579
+ other: "over {{count}} years"
580
+ },
581
+ almostXYears: {
582
+ one: "almost 1 year",
583
+ other: "almost {{count}} years"
584
+ }
585
+ }, wt = (n, t, e) => {
586
+ let r;
587
+ const a = bt[n];
588
+ return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
589
+ };
590
+ function E(n) {
591
+ return (t = {}) => {
592
+ const e = t.width ? String(t.width) : n.defaultWidth;
593
+ return n.formats[e] || n.formats[n.defaultWidth];
594
+ };
595
+ }
596
+ const pt = {
597
+ full: "EEEE, MMMM do, y",
598
+ long: "MMMM do, y",
599
+ medium: "MMM d, y",
600
+ short: "MM/dd/yyyy"
601
+ }, Mt = {
602
+ full: "h:mm:ss a zzzz",
603
+ long: "h:mm:ss a z",
604
+ medium: "h:mm:ss a",
605
+ short: "h:mm a"
606
+ }, Dt = {
607
+ full: "{{date}} 'at' {{time}}",
608
+ long: "{{date}} 'at' {{time}}",
609
+ medium: "{{date}}, {{time}}",
610
+ short: "{{date}}, {{time}}"
611
+ }, Ot = {
612
+ date: E({
613
+ formats: pt,
614
+ defaultWidth: "full"
615
+ }),
616
+ time: E({
617
+ formats: Mt,
618
+ defaultWidth: "full"
619
+ }),
620
+ dateTime: E({
621
+ formats: Dt,
622
+ defaultWidth: "full"
623
+ })
624
+ }, Pt = {
625
+ lastWeek: "'last' eeee 'at' p",
626
+ yesterday: "'yesterday at' p",
627
+ today: "'today at' p",
628
+ tomorrow: "'tomorrow at' p",
629
+ nextWeek: "eeee 'at' p",
630
+ other: "P"
631
+ }, St = (n, t, e, r) => Pt[n];
632
+ function v(n) {
633
+ return (t, e) => {
634
+ const r = e != null && e.context ? String(e.context) : "standalone";
635
+ let a;
636
+ if (r === "formatting" && n.formattingValues) {
637
+ const s = n.defaultFormattingWidth || n.defaultWidth, o = e != null && e.width ? String(e.width) : s;
638
+ a = n.formattingValues[o] || n.formattingValues[s];
639
+ } else {
640
+ const s = n.defaultWidth, o = e != null && e.width ? String(e.width) : n.defaultWidth;
641
+ a = n.values[o] || n.values[s];
642
+ }
643
+ const i = n.argumentCallback ? n.argumentCallback(t) : t;
644
+ return a[i];
645
+ };
646
+ }
647
+ const vt = {
648
+ narrow: ["B", "A"],
649
+ abbreviated: ["BC", "AD"],
650
+ wide: ["Before Christ", "Anno Domini"]
651
+ }, xt = {
652
+ narrow: ["1", "2", "3", "4"],
653
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
654
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
655
+ }, kt = {
656
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
657
+ abbreviated: [
658
+ "Jan",
659
+ "Feb",
660
+ "Mar",
661
+ "Apr",
662
+ "May",
663
+ "Jun",
664
+ "Jul",
665
+ "Aug",
666
+ "Sep",
667
+ "Oct",
668
+ "Nov",
669
+ "Dec"
670
+ ],
671
+ wide: [
672
+ "January",
673
+ "February",
674
+ "March",
675
+ "April",
676
+ "May",
677
+ "June",
678
+ "July",
679
+ "August",
680
+ "September",
681
+ "October",
682
+ "November",
683
+ "December"
684
+ ]
685
+ }, Nt = {
686
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
687
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
688
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
689
+ wide: [
690
+ "Sunday",
691
+ "Monday",
692
+ "Tuesday",
693
+ "Wednesday",
694
+ "Thursday",
695
+ "Friday",
696
+ "Saturday"
697
+ ]
698
+ }, Yt = {
699
+ narrow: {
700
+ am: "a",
701
+ pm: "p",
702
+ midnight: "mi",
703
+ noon: "n",
704
+ morning: "morning",
705
+ afternoon: "afternoon",
706
+ evening: "evening",
707
+ night: "night"
708
+ },
709
+ abbreviated: {
710
+ am: "AM",
711
+ pm: "PM",
712
+ midnight: "midnight",
713
+ noon: "noon",
714
+ morning: "morning",
715
+ afternoon: "afternoon",
716
+ evening: "evening",
717
+ night: "night"
718
+ },
719
+ wide: {
720
+ am: "a.m.",
721
+ pm: "p.m.",
722
+ midnight: "midnight",
723
+ noon: "noon",
724
+ morning: "morning",
725
+ afternoon: "afternoon",
726
+ evening: "evening",
727
+ night: "night"
728
+ }
729
+ }, Tt = {
730
+ narrow: {
731
+ am: "a",
732
+ pm: "p",
733
+ midnight: "mi",
734
+ noon: "n",
735
+ morning: "in the morning",
736
+ afternoon: "in the afternoon",
737
+ evening: "in the evening",
738
+ night: "at night"
739
+ },
740
+ abbreviated: {
741
+ am: "AM",
742
+ pm: "PM",
743
+ midnight: "midnight",
744
+ noon: "noon",
745
+ morning: "in the morning",
746
+ afternoon: "in the afternoon",
747
+ evening: "in the evening",
748
+ night: "at night"
749
+ },
750
+ wide: {
751
+ am: "a.m.",
752
+ pm: "p.m.",
753
+ midnight: "midnight",
754
+ noon: "noon",
755
+ morning: "in the morning",
756
+ afternoon: "in the afternoon",
757
+ evening: "in the evening",
758
+ night: "at night"
759
+ }
760
+ }, Wt = (n, t) => {
761
+ const e = Number(n), r = e % 100;
762
+ if (r > 20 || r < 10)
763
+ switch (r % 10) {
764
+ case 1:
765
+ return e + "st";
766
+ case 2:
767
+ return e + "nd";
768
+ case 3:
769
+ return e + "rd";
770
+ }
771
+ return e + "th";
772
+ }, _t = {
773
+ ordinalNumber: Wt,
774
+ era: v({
775
+ values: vt,
776
+ defaultWidth: "wide"
777
+ }),
778
+ quarter: v({
779
+ values: xt,
780
+ defaultWidth: "wide",
781
+ argumentCallback: (n) => n - 1
782
+ }),
783
+ month: v({
784
+ values: kt,
785
+ defaultWidth: "wide"
786
+ }),
787
+ day: v({
788
+ values: Nt,
789
+ defaultWidth: "wide"
790
+ }),
791
+ dayPeriod: v({
792
+ values: Yt,
793
+ defaultWidth: "wide",
794
+ formattingValues: Tt,
795
+ defaultFormattingWidth: "wide"
796
+ })
797
+ };
798
+ function x(n) {
799
+ return (t, e = {}) => {
800
+ const r = e.width, a = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], i = t.match(a);
801
+ if (!i)
802
+ return null;
803
+ const s = i[0], o = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], c = Array.isArray(o) ? Ft(o, (g) => g.test(s)) : (
804
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
805
+ Et(o, (g) => g.test(s))
806
+ );
807
+ let f;
808
+ f = n.valueCallback ? n.valueCallback(c) : c, f = e.valueCallback ? (
809
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
810
+ e.valueCallback(f)
811
+ ) : f;
812
+ const h = t.slice(s.length);
813
+ return { value: f, rest: h };
814
+ };
815
+ }
816
+ function Et(n, t) {
817
+ for (const e in n)
818
+ if (Object.prototype.hasOwnProperty.call(n, e) && t(n[e]))
819
+ return e;
820
+ }
821
+ function Ft(n, t) {
822
+ for (let e = 0; e < n.length; e++)
823
+ if (t(n[e]))
824
+ return e;
825
+ }
826
+ function Ct(n) {
827
+ return (t, e = {}) => {
828
+ const r = t.match(n.matchPattern);
829
+ if (!r) return null;
830
+ const a = r[0], i = t.match(n.parsePattern);
831
+ if (!i) return null;
832
+ let s = n.valueCallback ? n.valueCallback(i[0]) : i[0];
833
+ s = e.valueCallback ? e.valueCallback(s) : s;
834
+ const o = t.slice(a.length);
835
+ return { value: s, rest: o };
836
+ };
837
+ }
838
+ const At = /^(\d+)(th|st|nd|rd)?/i, qt = /\d+/i, Rt = {
839
+ narrow: /^(b|a)/i,
840
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
841
+ wide: /^(before christ|before common era|anno domini|common era)/i
842
+ }, Vt = {
843
+ any: [/^b/i, /^(a|c)/i]
844
+ }, Lt = {
845
+ narrow: /^[1234]/i,
846
+ abbreviated: /^q[1234]/i,
847
+ wide: /^[1234](th|st|nd|rd)? quarter/i
848
+ }, Ht = {
849
+ any: [/1/i, /2/i, /3/i, /4/i]
850
+ }, It = {
851
+ narrow: /^[jfmasond]/i,
852
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
853
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
854
+ }, Xt = {
855
+ narrow: [
856
+ /^j/i,
857
+ /^f/i,
858
+ /^m/i,
859
+ /^a/i,
860
+ /^m/i,
861
+ /^j/i,
862
+ /^j/i,
863
+ /^a/i,
864
+ /^s/i,
865
+ /^o/i,
866
+ /^n/i,
867
+ /^d/i
868
+ ],
869
+ any: [
870
+ /^ja/i,
871
+ /^f/i,
872
+ /^mar/i,
873
+ /^ap/i,
874
+ /^may/i,
875
+ /^jun/i,
876
+ /^jul/i,
877
+ /^au/i,
878
+ /^s/i,
879
+ /^o/i,
880
+ /^n/i,
881
+ /^d/i
882
+ ]
883
+ }, jt = {
884
+ narrow: /^[smtwf]/i,
885
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
886
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
887
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
888
+ }, $t = {
889
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
890
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
891
+ }, Gt = {
892
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
893
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
894
+ }, Qt = {
895
+ any: {
896
+ am: /^a/i,
897
+ pm: /^p/i,
898
+ midnight: /^mi/i,
899
+ noon: /^no/i,
900
+ morning: /morning/i,
901
+ afternoon: /afternoon/i,
902
+ evening: /evening/i,
903
+ night: /night/i
904
+ }
905
+ }, Bt = {
906
+ ordinalNumber: Ct({
907
+ matchPattern: At,
908
+ parsePattern: qt,
909
+ valueCallback: (n) => parseInt(n, 10)
910
+ }),
911
+ era: x({
912
+ matchPatterns: Rt,
913
+ defaultMatchWidth: "wide",
914
+ parsePatterns: Vt,
915
+ defaultParseWidth: "any"
916
+ }),
917
+ quarter: x({
918
+ matchPatterns: Lt,
919
+ defaultMatchWidth: "wide",
920
+ parsePatterns: Ht,
921
+ defaultParseWidth: "any",
922
+ valueCallback: (n) => n + 1
923
+ }),
924
+ month: x({
925
+ matchPatterns: It,
926
+ defaultMatchWidth: "wide",
927
+ parsePatterns: Xt,
928
+ defaultParseWidth: "any"
929
+ }),
930
+ day: x({
931
+ matchPatterns: jt,
932
+ defaultMatchWidth: "wide",
933
+ parsePatterns: $t,
934
+ defaultParseWidth: "any"
935
+ }),
936
+ dayPeriod: x({
937
+ matchPatterns: Gt,
938
+ defaultMatchWidth: "any",
939
+ parsePatterns: Qt,
940
+ defaultParseWidth: "any"
941
+ })
942
+ }, Jt = {
943
+ code: "en-US",
944
+ formatDistance: wt,
945
+ formatLong: Ot,
946
+ formatRelative: St,
947
+ localize: _t,
948
+ match: Bt,
949
+ options: {
950
+ weekStartsOn: 0,
951
+ firstWeekContainsDate: 1
952
+ }
417
953
  };
954
+ function Ut(n) {
955
+ const t = d(n);
956
+ return ft(t, yt(t)) + 1;
957
+ }
958
+ function Zt(n) {
959
+ const t = d(n), e = +Y(t) - +ht(t);
960
+ return Math.round(e / Q) + 1;
961
+ }
962
+ function J(n, t) {
963
+ var h, g, P, S;
964
+ const e = d(n), r = e.getFullYear(), a = W(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((g = (h = t == null ? void 0 : t.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((S = (P = a.locale) == null ? void 0 : P.options) == null ? void 0 : S.firstWeekContainsDate) ?? 1, s = y(n, 0);
965
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
966
+ const o = k(s, t), c = y(n, 0);
967
+ c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
968
+ const f = k(c, t);
969
+ return e.getTime() >= o.getTime() ? r + 1 : e.getTime() >= f.getTime() ? r : r - 1;
970
+ }
971
+ function zt(n, t) {
972
+ var o, c, f, h;
973
+ const e = W(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((h = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, a = J(n, t), i = y(n, 0);
974
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), k(i, t);
975
+ }
976
+ function Kt(n, t) {
977
+ const e = d(n), r = +k(e, t) - +zt(e, t);
978
+ return Math.round(r / Q) + 1;
979
+ }
980
+ function u(n, t) {
981
+ const e = n < 0 ? "-" : "", r = Math.abs(n).toString().padStart(t, "0");
982
+ return e + r;
983
+ }
984
+ const p = {
985
+ // Year
986
+ y(n, t) {
987
+ const e = n.getFullYear(), r = e > 0 ? e : 1 - e;
988
+ return u(t === "yy" ? r % 100 : r, t.length);
989
+ },
990
+ // Month
991
+ M(n, t) {
992
+ const e = n.getMonth();
993
+ return t === "M" ? String(e + 1) : u(e + 1, 2);
994
+ },
995
+ // Day of the month
996
+ d(n, t) {
997
+ return u(n.getDate(), t.length);
998
+ },
999
+ // AM or PM
1000
+ a(n, t) {
1001
+ const e = n.getHours() / 12 >= 1 ? "pm" : "am";
1002
+ switch (t) {
1003
+ case "a":
1004
+ case "aa":
1005
+ return e.toUpperCase();
1006
+ case "aaa":
1007
+ return e;
1008
+ case "aaaaa":
1009
+ return e[0];
1010
+ case "aaaa":
1011
+ default:
1012
+ return e === "am" ? "a.m." : "p.m.";
1013
+ }
1014
+ },
1015
+ // Hour [1-12]
1016
+ h(n, t) {
1017
+ return u(n.getHours() % 12 || 12, t.length);
1018
+ },
1019
+ // Hour [0-23]
1020
+ H(n, t) {
1021
+ return u(n.getHours(), t.length);
1022
+ },
1023
+ // Minute
1024
+ m(n, t) {
1025
+ return u(n.getMinutes(), t.length);
1026
+ },
1027
+ // Second
1028
+ s(n, t) {
1029
+ return u(n.getSeconds(), t.length);
1030
+ },
1031
+ // Fraction of second
1032
+ S(n, t) {
1033
+ const e = t.length, r = n.getMilliseconds(), a = Math.trunc(
1034
+ r * Math.pow(10, e - 3)
1035
+ );
1036
+ return u(a, t.length);
1037
+ }
1038
+ }, O = {
1039
+ midnight: "midnight",
1040
+ noon: "noon",
1041
+ morning: "morning",
1042
+ afternoon: "afternoon",
1043
+ evening: "evening",
1044
+ night: "night"
1045
+ }, I = {
1046
+ // Era
1047
+ G: function(n, t, e) {
1048
+ const r = n.getFullYear() > 0 ? 1 : 0;
1049
+ switch (t) {
1050
+ // AD, BC
1051
+ case "G":
1052
+ case "GG":
1053
+ case "GGG":
1054
+ return e.era(r, { width: "abbreviated" });
1055
+ // A, B
1056
+ case "GGGGG":
1057
+ return e.era(r, { width: "narrow" });
1058
+ // Anno Domini, Before Christ
1059
+ case "GGGG":
1060
+ default:
1061
+ return e.era(r, { width: "wide" });
1062
+ }
1063
+ },
1064
+ // Year
1065
+ y: function(n, t, e) {
1066
+ if (t === "yo") {
1067
+ const r = n.getFullYear(), a = r > 0 ? r : 1 - r;
1068
+ return e.ordinalNumber(a, { unit: "year" });
1069
+ }
1070
+ return p.y(n, t);
1071
+ },
1072
+ // Local week-numbering year
1073
+ Y: function(n, t, e, r) {
1074
+ const a = J(n, r), i = a > 0 ? a : 1 - a;
1075
+ if (t === "YY") {
1076
+ const s = i % 100;
1077
+ return u(s, 2);
1078
+ }
1079
+ return t === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : u(i, t.length);
1080
+ },
1081
+ // ISO week-numbering year
1082
+ R: function(n, t) {
1083
+ const e = B(n);
1084
+ return u(e, t.length);
1085
+ },
1086
+ // Extended year. This is a single number designating the year of this calendar system.
1087
+ // The main difference between `y` and `u` localizers are B.C. years:
1088
+ // | Year | `y` | `u` |
1089
+ // |------|-----|-----|
1090
+ // | AC 1 | 1 | 1 |
1091
+ // | BC 1 | 1 | 0 |
1092
+ // | BC 2 | 2 | -1 |
1093
+ // Also `yy` always returns the last two digits of a year,
1094
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1095
+ u: function(n, t) {
1096
+ const e = n.getFullYear();
1097
+ return u(e, t.length);
1098
+ },
1099
+ // Quarter
1100
+ Q: function(n, t, e) {
1101
+ const r = Math.ceil((n.getMonth() + 1) / 3);
1102
+ switch (t) {
1103
+ // 1, 2, 3, 4
1104
+ case "Q":
1105
+ return String(r);
1106
+ // 01, 02, 03, 04
1107
+ case "QQ":
1108
+ return u(r, 2);
1109
+ // 1st, 2nd, 3rd, 4th
1110
+ case "Qo":
1111
+ return e.ordinalNumber(r, { unit: "quarter" });
1112
+ // Q1, Q2, Q3, Q4
1113
+ case "QQQ":
1114
+ return e.quarter(r, {
1115
+ width: "abbreviated",
1116
+ context: "formatting"
1117
+ });
1118
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1119
+ case "QQQQQ":
1120
+ return e.quarter(r, {
1121
+ width: "narrow",
1122
+ context: "formatting"
1123
+ });
1124
+ // 1st quarter, 2nd quarter, ...
1125
+ case "QQQQ":
1126
+ default:
1127
+ return e.quarter(r, {
1128
+ width: "wide",
1129
+ context: "formatting"
1130
+ });
1131
+ }
1132
+ },
1133
+ // Stand-alone quarter
1134
+ q: function(n, t, e) {
1135
+ const r = Math.ceil((n.getMonth() + 1) / 3);
1136
+ switch (t) {
1137
+ // 1, 2, 3, 4
1138
+ case "q":
1139
+ return String(r);
1140
+ // 01, 02, 03, 04
1141
+ case "qq":
1142
+ return u(r, 2);
1143
+ // 1st, 2nd, 3rd, 4th
1144
+ case "qo":
1145
+ return e.ordinalNumber(r, { unit: "quarter" });
1146
+ // Q1, Q2, Q3, Q4
1147
+ case "qqq":
1148
+ return e.quarter(r, {
1149
+ width: "abbreviated",
1150
+ context: "standalone"
1151
+ });
1152
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1153
+ case "qqqqq":
1154
+ return e.quarter(r, {
1155
+ width: "narrow",
1156
+ context: "standalone"
1157
+ });
1158
+ // 1st quarter, 2nd quarter, ...
1159
+ case "qqqq":
1160
+ default:
1161
+ return e.quarter(r, {
1162
+ width: "wide",
1163
+ context: "standalone"
1164
+ });
1165
+ }
1166
+ },
1167
+ // Month
1168
+ M: function(n, t, e) {
1169
+ const r = n.getMonth();
1170
+ switch (t) {
1171
+ case "M":
1172
+ case "MM":
1173
+ return p.M(n, t);
1174
+ // 1st, 2nd, ..., 12th
1175
+ case "Mo":
1176
+ return e.ordinalNumber(r + 1, { unit: "month" });
1177
+ // Jan, Feb, ..., Dec
1178
+ case "MMM":
1179
+ return e.month(r, {
1180
+ width: "abbreviated",
1181
+ context: "formatting"
1182
+ });
1183
+ // J, F, ..., D
1184
+ case "MMMMM":
1185
+ return e.month(r, {
1186
+ width: "narrow",
1187
+ context: "formatting"
1188
+ });
1189
+ // January, February, ..., December
1190
+ case "MMMM":
1191
+ default:
1192
+ return e.month(r, { width: "wide", context: "formatting" });
1193
+ }
1194
+ },
1195
+ // Stand-alone month
1196
+ L: function(n, t, e) {
1197
+ const r = n.getMonth();
1198
+ switch (t) {
1199
+ // 1, 2, ..., 12
1200
+ case "L":
1201
+ return String(r + 1);
1202
+ // 01, 02, ..., 12
1203
+ case "LL":
1204
+ return u(r + 1, 2);
1205
+ // 1st, 2nd, ..., 12th
1206
+ case "Lo":
1207
+ return e.ordinalNumber(r + 1, { unit: "month" });
1208
+ // Jan, Feb, ..., Dec
1209
+ case "LLL":
1210
+ return e.month(r, {
1211
+ width: "abbreviated",
1212
+ context: "standalone"
1213
+ });
1214
+ // J, F, ..., D
1215
+ case "LLLLL":
1216
+ return e.month(r, {
1217
+ width: "narrow",
1218
+ context: "standalone"
1219
+ });
1220
+ // January, February, ..., December
1221
+ case "LLLL":
1222
+ default:
1223
+ return e.month(r, { width: "wide", context: "standalone" });
1224
+ }
1225
+ },
1226
+ // Local week of year
1227
+ w: function(n, t, e, r) {
1228
+ const a = Kt(n, r);
1229
+ return t === "wo" ? e.ordinalNumber(a, { unit: "week" }) : u(a, t.length);
1230
+ },
1231
+ // ISO week of year
1232
+ I: function(n, t, e) {
1233
+ const r = Zt(n);
1234
+ return t === "Io" ? e.ordinalNumber(r, { unit: "week" }) : u(r, t.length);
1235
+ },
1236
+ // Day of the month
1237
+ d: function(n, t, e) {
1238
+ return t === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : p.d(n, t);
1239
+ },
1240
+ // Day of year
1241
+ D: function(n, t, e) {
1242
+ const r = Ut(n);
1243
+ return t === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, t.length);
1244
+ },
1245
+ // Day of week
1246
+ E: function(n, t, e) {
1247
+ const r = n.getDay();
1248
+ switch (t) {
1249
+ // Tue
1250
+ case "E":
1251
+ case "EE":
1252
+ case "EEE":
1253
+ return e.day(r, {
1254
+ width: "abbreviated",
1255
+ context: "formatting"
1256
+ });
1257
+ // T
1258
+ case "EEEEE":
1259
+ return e.day(r, {
1260
+ width: "narrow",
1261
+ context: "formatting"
1262
+ });
1263
+ // Tu
1264
+ case "EEEEEE":
1265
+ return e.day(r, {
1266
+ width: "short",
1267
+ context: "formatting"
1268
+ });
1269
+ // Tuesday
1270
+ case "EEEE":
1271
+ default:
1272
+ return e.day(r, {
1273
+ width: "wide",
1274
+ context: "formatting"
1275
+ });
1276
+ }
1277
+ },
1278
+ // Local day of week
1279
+ e: function(n, t, e, r) {
1280
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
1281
+ switch (t) {
1282
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1283
+ case "e":
1284
+ return String(i);
1285
+ // Padded numerical value
1286
+ case "ee":
1287
+ return u(i, 2);
1288
+ // 1st, 2nd, ..., 7th
1289
+ case "eo":
1290
+ return e.ordinalNumber(i, { unit: "day" });
1291
+ case "eee":
1292
+ return e.day(a, {
1293
+ width: "abbreviated",
1294
+ context: "formatting"
1295
+ });
1296
+ // T
1297
+ case "eeeee":
1298
+ return e.day(a, {
1299
+ width: "narrow",
1300
+ context: "formatting"
1301
+ });
1302
+ // Tu
1303
+ case "eeeeee":
1304
+ return e.day(a, {
1305
+ width: "short",
1306
+ context: "formatting"
1307
+ });
1308
+ // Tuesday
1309
+ case "eeee":
1310
+ default:
1311
+ return e.day(a, {
1312
+ width: "wide",
1313
+ context: "formatting"
1314
+ });
1315
+ }
1316
+ },
1317
+ // Stand-alone local day of week
1318
+ c: function(n, t, e, r) {
1319
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
1320
+ switch (t) {
1321
+ // Numerical value (same as in `e`)
1322
+ case "c":
1323
+ return String(i);
1324
+ // Padded numerical value
1325
+ case "cc":
1326
+ return u(i, t.length);
1327
+ // 1st, 2nd, ..., 7th
1328
+ case "co":
1329
+ return e.ordinalNumber(i, { unit: "day" });
1330
+ case "ccc":
1331
+ return e.day(a, {
1332
+ width: "abbreviated",
1333
+ context: "standalone"
1334
+ });
1335
+ // T
1336
+ case "ccccc":
1337
+ return e.day(a, {
1338
+ width: "narrow",
1339
+ context: "standalone"
1340
+ });
1341
+ // Tu
1342
+ case "cccccc":
1343
+ return e.day(a, {
1344
+ width: "short",
1345
+ context: "standalone"
1346
+ });
1347
+ // Tuesday
1348
+ case "cccc":
1349
+ default:
1350
+ return e.day(a, {
1351
+ width: "wide",
1352
+ context: "standalone"
1353
+ });
1354
+ }
1355
+ },
1356
+ // ISO day of week
1357
+ i: function(n, t, e) {
1358
+ const r = n.getDay(), a = r === 0 ? 7 : r;
1359
+ switch (t) {
1360
+ // 2
1361
+ case "i":
1362
+ return String(a);
1363
+ // 02
1364
+ case "ii":
1365
+ return u(a, t.length);
1366
+ // 2nd
1367
+ case "io":
1368
+ return e.ordinalNumber(a, { unit: "day" });
1369
+ // Tue
1370
+ case "iii":
1371
+ return e.day(r, {
1372
+ width: "abbreviated",
1373
+ context: "formatting"
1374
+ });
1375
+ // T
1376
+ case "iiiii":
1377
+ return e.day(r, {
1378
+ width: "narrow",
1379
+ context: "formatting"
1380
+ });
1381
+ // Tu
1382
+ case "iiiiii":
1383
+ return e.day(r, {
1384
+ width: "short",
1385
+ context: "formatting"
1386
+ });
1387
+ // Tuesday
1388
+ case "iiii":
1389
+ default:
1390
+ return e.day(r, {
1391
+ width: "wide",
1392
+ context: "formatting"
1393
+ });
1394
+ }
1395
+ },
1396
+ // AM or PM
1397
+ a: function(n, t, e) {
1398
+ const a = n.getHours() / 12 >= 1 ? "pm" : "am";
1399
+ switch (t) {
1400
+ case "a":
1401
+ case "aa":
1402
+ return e.dayPeriod(a, {
1403
+ width: "abbreviated",
1404
+ context: "formatting"
1405
+ });
1406
+ case "aaa":
1407
+ return e.dayPeriod(a, {
1408
+ width: "abbreviated",
1409
+ context: "formatting"
1410
+ }).toLowerCase();
1411
+ case "aaaaa":
1412
+ return e.dayPeriod(a, {
1413
+ width: "narrow",
1414
+ context: "formatting"
1415
+ });
1416
+ case "aaaa":
1417
+ default:
1418
+ return e.dayPeriod(a, {
1419
+ width: "wide",
1420
+ context: "formatting"
1421
+ });
1422
+ }
1423
+ },
1424
+ // AM, PM, midnight, noon
1425
+ b: function(n, t, e) {
1426
+ const r = n.getHours();
1427
+ let a;
1428
+ switch (r === 12 ? a = O.noon : r === 0 ? a = O.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1429
+ case "b":
1430
+ case "bb":
1431
+ return e.dayPeriod(a, {
1432
+ width: "abbreviated",
1433
+ context: "formatting"
1434
+ });
1435
+ case "bbb":
1436
+ return e.dayPeriod(a, {
1437
+ width: "abbreviated",
1438
+ context: "formatting"
1439
+ }).toLowerCase();
1440
+ case "bbbbb":
1441
+ return e.dayPeriod(a, {
1442
+ width: "narrow",
1443
+ context: "formatting"
1444
+ });
1445
+ case "bbbb":
1446
+ default:
1447
+ return e.dayPeriod(a, {
1448
+ width: "wide",
1449
+ context: "formatting"
1450
+ });
1451
+ }
1452
+ },
1453
+ // in the morning, in the afternoon, in the evening, at night
1454
+ B: function(n, t, e) {
1455
+ const r = n.getHours();
1456
+ let a;
1457
+ switch (r >= 17 ? a = O.evening : r >= 12 ? a = O.afternoon : r >= 4 ? a = O.morning : a = O.night, t) {
1458
+ case "B":
1459
+ case "BB":
1460
+ case "BBB":
1461
+ return e.dayPeriod(a, {
1462
+ width: "abbreviated",
1463
+ context: "formatting"
1464
+ });
1465
+ case "BBBBB":
1466
+ return e.dayPeriod(a, {
1467
+ width: "narrow",
1468
+ context: "formatting"
1469
+ });
1470
+ case "BBBB":
1471
+ default:
1472
+ return e.dayPeriod(a, {
1473
+ width: "wide",
1474
+ context: "formatting"
1475
+ });
1476
+ }
1477
+ },
1478
+ // Hour [1-12]
1479
+ h: function(n, t, e) {
1480
+ if (t === "ho") {
1481
+ let r = n.getHours() % 12;
1482
+ return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
1483
+ }
1484
+ return p.h(n, t);
1485
+ },
1486
+ // Hour [0-23]
1487
+ H: function(n, t, e) {
1488
+ return t === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : p.H(n, t);
1489
+ },
1490
+ // Hour [0-11]
1491
+ K: function(n, t, e) {
1492
+ const r = n.getHours() % 12;
1493
+ return t === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
1494
+ },
1495
+ // Hour [1-24]
1496
+ k: function(n, t, e) {
1497
+ let r = n.getHours();
1498
+ return r === 0 && (r = 24), t === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
1499
+ },
1500
+ // Minute
1501
+ m: function(n, t, e) {
1502
+ return t === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : p.m(n, t);
1503
+ },
1504
+ // Second
1505
+ s: function(n, t, e) {
1506
+ return t === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : p.s(n, t);
1507
+ },
1508
+ // Fraction of second
1509
+ S: function(n, t) {
1510
+ return p.S(n, t);
1511
+ },
1512
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1513
+ X: function(n, t, e) {
1514
+ const r = n.getTimezoneOffset();
1515
+ if (r === 0)
1516
+ return "Z";
1517
+ switch (t) {
1518
+ // Hours and optional minutes
1519
+ case "X":
1520
+ return j(r);
1521
+ // Hours, minutes and optional seconds without `:` delimiter
1522
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1523
+ // so this token always has the same output as `XX`
1524
+ case "XXXX":
1525
+ case "XX":
1526
+ return D(r);
1527
+ // Hours, minutes and optional seconds with `:` delimiter
1528
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1529
+ // so this token always has the same output as `XXX`
1530
+ case "XXXXX":
1531
+ case "XXX":
1532
+ // Hours and minutes with `:` delimiter
1533
+ default:
1534
+ return D(r, ":");
1535
+ }
1536
+ },
1537
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1538
+ x: function(n, t, e) {
1539
+ const r = n.getTimezoneOffset();
1540
+ switch (t) {
1541
+ // Hours and optional minutes
1542
+ case "x":
1543
+ return j(r);
1544
+ // Hours, minutes and optional seconds without `:` delimiter
1545
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1546
+ // so this token always has the same output as `xx`
1547
+ case "xxxx":
1548
+ case "xx":
1549
+ return D(r);
1550
+ // Hours, minutes and optional seconds with `:` delimiter
1551
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1552
+ // so this token always has the same output as `xxx`
1553
+ case "xxxxx":
1554
+ case "xxx":
1555
+ // Hours and minutes with `:` delimiter
1556
+ default:
1557
+ return D(r, ":");
1558
+ }
1559
+ },
1560
+ // Timezone (GMT)
1561
+ O: function(n, t, e) {
1562
+ const r = n.getTimezoneOffset();
1563
+ switch (t) {
1564
+ // Short
1565
+ case "O":
1566
+ case "OO":
1567
+ case "OOO":
1568
+ return "GMT" + X(r, ":");
1569
+ // Long
1570
+ case "OOOO":
1571
+ default:
1572
+ return "GMT" + D(r, ":");
1573
+ }
1574
+ },
1575
+ // Timezone (specific non-location)
1576
+ z: function(n, t, e) {
1577
+ const r = n.getTimezoneOffset();
1578
+ switch (t) {
1579
+ // Short
1580
+ case "z":
1581
+ case "zz":
1582
+ case "zzz":
1583
+ return "GMT" + X(r, ":");
1584
+ // Long
1585
+ case "zzzz":
1586
+ default:
1587
+ return "GMT" + D(r, ":");
1588
+ }
1589
+ },
1590
+ // Seconds timestamp
1591
+ t: function(n, t, e) {
1592
+ const r = Math.trunc(n.getTime() / 1e3);
1593
+ return u(r, t.length);
1594
+ },
1595
+ // Milliseconds timestamp
1596
+ T: function(n, t, e) {
1597
+ const r = n.getTime();
1598
+ return u(r, t.length);
1599
+ }
1600
+ };
1601
+ function X(n, t = "") {
1602
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = Math.trunc(r / 60), i = r % 60;
1603
+ return i === 0 ? e + String(a) : e + String(a) + t + u(i, 2);
1604
+ }
1605
+ function j(n, t) {
1606
+ return n % 60 === 0 ? (n > 0 ? "-" : "+") + u(Math.abs(n) / 60, 2) : D(n, t);
1607
+ }
1608
+ function D(n, t = "") {
1609
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = u(Math.trunc(r / 60), 2), i = u(r % 60, 2);
1610
+ return e + a + t + i;
1611
+ }
1612
+ const $ = (n, t) => {
1613
+ switch (n) {
1614
+ case "P":
1615
+ return t.date({ width: "short" });
1616
+ case "PP":
1617
+ return t.date({ width: "medium" });
1618
+ case "PPP":
1619
+ return t.date({ width: "long" });
1620
+ case "PPPP":
1621
+ default:
1622
+ return t.date({ width: "full" });
1623
+ }
1624
+ }, U = (n, t) => {
1625
+ switch (n) {
1626
+ case "p":
1627
+ return t.time({ width: "short" });
1628
+ case "pp":
1629
+ return t.time({ width: "medium" });
1630
+ case "ppp":
1631
+ return t.time({ width: "long" });
1632
+ case "pppp":
1633
+ default:
1634
+ return t.time({ width: "full" });
1635
+ }
1636
+ }, te = (n, t) => {
1637
+ const e = n.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
1638
+ if (!a)
1639
+ return $(n, t);
1640
+ let i;
1641
+ switch (r) {
1642
+ case "P":
1643
+ i = t.dateTime({ width: "short" });
1644
+ break;
1645
+ case "PP":
1646
+ i = t.dateTime({ width: "medium" });
1647
+ break;
1648
+ case "PPP":
1649
+ i = t.dateTime({ width: "long" });
1650
+ break;
1651
+ case "PPPP":
1652
+ default:
1653
+ i = t.dateTime({ width: "full" });
1654
+ break;
1655
+ }
1656
+ return i.replace("{{date}}", $(r, t)).replace("{{time}}", U(a, t));
1657
+ }, ee = {
1658
+ p: U,
1659
+ P: te
1660
+ }, ne = /^D+$/, re = /^Y+$/, ae = ["D", "DD", "YY", "YYYY"];
1661
+ function ie(n) {
1662
+ return ne.test(n);
1663
+ }
1664
+ function se(n) {
1665
+ return re.test(n);
1666
+ }
1667
+ function oe(n, t, e) {
1668
+ const r = ue(n, t, e);
1669
+ if (console.warn(r), ae.includes(n)) throw new RangeError(r);
1670
+ }
1671
+ function ue(n, t, e) {
1672
+ const r = n[0] === "Y" ? "years" : "days of the month";
1673
+ return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1674
+ }
1675
+ const ce = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, de = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, fe = /^'([^]*?)'?$/, he = /''/g, le = /[a-zA-Z]/;
1676
+ function me(n, t, e) {
1677
+ var h, g, P, S;
1678
+ const r = W(), a = r.locale ?? Jt, i = r.firstWeekContainsDate ?? ((g = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, s = r.weekStartsOn ?? ((S = (P = r.locale) == null ? void 0 : P.options) == null ? void 0 : S.weekStartsOn) ?? 0, o = d(n);
1679
+ if (!gt(o))
1680
+ throw new RangeError("Invalid time value");
1681
+ let c = t.match(de).map((m) => {
1682
+ const l = m[0];
1683
+ if (l === "p" || l === "P") {
1684
+ const _ = ee[l];
1685
+ return _(m, a.formatLong);
1686
+ }
1687
+ return m;
1688
+ }).join("").match(ce).map((m) => {
1689
+ if (m === "''")
1690
+ return { isToken: !1, value: "'" };
1691
+ const l = m[0];
1692
+ if (l === "'")
1693
+ return { isToken: !1, value: ge(m) };
1694
+ if (I[l])
1695
+ return { isToken: !0, value: m };
1696
+ if (l.match(le))
1697
+ throw new RangeError(
1698
+ "Format string contains an unescaped latin alphabet character `" + l + "`"
1699
+ );
1700
+ return { isToken: !1, value: m };
1701
+ });
1702
+ a.localize.preprocessor && (c = a.localize.preprocessor(o, c));
1703
+ const f = {
1704
+ firstWeekContainsDate: i,
1705
+ weekStartsOn: s,
1706
+ locale: a
1707
+ };
1708
+ return c.map((m) => {
1709
+ if (!m.isToken) return m.value;
1710
+ const l = m.value;
1711
+ (se(l) || ie(l)) && oe(l, t, String(n));
1712
+ const _ = I[l[0]];
1713
+ return _(o, l, a.localize, f);
1714
+ }).join("");
1715
+ }
1716
+ function ge(n) {
1717
+ const t = n.match(fe);
1718
+ return t ? t[1].replace(he, "'") : n;
1719
+ }
1720
+ function ye(n) {
1721
+ const t = d(n), e = t.getFullYear(), r = t.getMonth(), a = y(n, 0);
1722
+ return a.setFullYear(e, r + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
1723
+ }
1724
+ function be(n) {
1725
+ const t = d(n), e = t.getMonth();
1726
+ return t.setFullYear(t.getFullYear(), e + 1, 0), t.setHours(0, 0, 0, 0), t;
1727
+ }
1728
+ function we(n, t) {
1729
+ const e = d(n), r = d(t);
1730
+ return e.getTime() > r.getTime();
1731
+ }
1732
+ function pe(n, t) {
1733
+ const e = d(n), r = d(t);
1734
+ return +e < +r;
1735
+ }
1736
+ function Me(n, t) {
1737
+ const e = d(n), r = d(t);
1738
+ return e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth();
1739
+ }
1740
+ class b {
1741
+ constructor(t) {
1742
+ w(this, "_dateNums");
1743
+ t || t === 0 ? this._dateNums = b.parse(t) : this._dateNums = b.parse(/* @__PURE__ */ new Date());
1744
+ }
1745
+ static parse(t) {
1746
+ return typeof t == "string" ? (t = t.split("T")[0], t.split("-").map((e) => +e)) : t instanceof Date ? [t.getFullYear(), t.getMonth() + 1, t.getDate()] : t === 0 ? [0, 0, 0] : [t.year, t.month, t.day];
1747
+ }
1748
+ static init() {
1749
+ return new b(0);
1750
+ }
1751
+ // Used internally to get the date value for the date_fns
1752
+ get date() {
1753
+ return new Date(
1754
+ this._dateNums[0],
1755
+ this._dateNums[1] - 1,
1756
+ this._dateNums[2]
1757
+ );
1758
+ }
1759
+ get year() {
1760
+ return this._dateNums[0];
1761
+ }
1762
+ get month() {
1763
+ return this._dateNums[1];
1764
+ }
1765
+ get day() {
1766
+ return this._dateNums[2];
1767
+ }
1768
+ get dayOfWeek() {
1769
+ return this.date.getDay();
1770
+ }
1771
+ get daysInMonth() {
1772
+ return ye(this.date);
1773
+ }
1774
+ get firstDayOfMonth() {
1775
+ return new b({ year: this.year, month: this.month, day: 1 });
1776
+ }
1777
+ get lastDayOfMonth() {
1778
+ return new b(be(this.date));
1779
+ }
1780
+ get previousDay() {
1781
+ return this.clone().addDays(-1);
1782
+ }
1783
+ get nextDay() {
1784
+ return this.clone().addDays(1);
1785
+ }
1786
+ get previousWeek() {
1787
+ return this.clone().addDays(-7);
1788
+ }
1789
+ get nextWeek() {
1790
+ return this.clone().addDays(7);
1791
+ }
1792
+ get previousMonth() {
1793
+ return this.clone().addMonths(-1);
1794
+ }
1795
+ get nextMonth() {
1796
+ return this.clone().addMonths(1);
1797
+ }
1798
+ clone() {
1799
+ return new b(this.toString());
1800
+ }
1801
+ setYear(t) {
1802
+ this._dateNums[0] = t;
1803
+ }
1804
+ setMonth(t) {
1805
+ this._dateNums[1] = t;
1806
+ }
1807
+ setDay(t) {
1808
+ return this._dateNums[2] = t, this;
1809
+ }
1810
+ addYears(t) {
1811
+ return this._dateNums[0] += t, this;
1812
+ }
1813
+ addMonths(t) {
1814
+ return this._dateNums = b.parse(ut(this.date, t)), this;
1815
+ }
1816
+ addDays(t) {
1817
+ return this._dateNums = b.parse(ot(this.date, t)), this;
1818
+ }
1819
+ isSameDay(t) {
1820
+ return lt(this.date, t.date);
1821
+ }
1822
+ isSameMonth(t) {
1823
+ return Me(this.date, t.date);
1824
+ }
1825
+ isBefore(t) {
1826
+ return pe(this.date, t.date);
1827
+ }
1828
+ isAfter(t) {
1829
+ return we(this.date, t.date);
1830
+ }
1831
+ isZero() {
1832
+ return this._dateNums[0] === 0 && this._dateNums[1] === 0 && this._dateNums[2] === 0;
1833
+ }
1834
+ isValid() {
1835
+ const t = new Date(this.toString());
1836
+ return !(isNaN(t.getTime()) || this.toString() !== t.toISOString().split("T")[0]);
1837
+ }
1838
+ format(t) {
1839
+ return this.isZero() ? "" : me(this.date, t);
1840
+ }
1841
+ toString() {
1842
+ return this.isZero() ? "" : this._dateNums.map((t) => `${t}`.length < 2 ? `0${t}` : `${t}`).join("-");
1843
+ }
1844
+ }
418
1845
  export {
419
- x as FormValidator,
420
- j as PublicFormController,
421
- Y as SINValidator,
422
- G as TemporaryNotification,
423
- I as birthDayValidator,
424
- L as birthMonthValidator,
425
- U as birthYearValidator,
426
- O as dateValidator,
427
- v as dispatch,
428
- q as emailValidator,
429
- X as lengthValidator,
430
- h as numericValidator,
431
- T as phoneNumberValidator,
432
- J as postalCodeValidator,
433
- m as regexValidator,
434
- o as relay,
435
- c as requiredValidator
1846
+ b as CalendarDate,
1847
+ Oe as FormValidator,
1848
+ it as Once,
1849
+ _e as PublicFormController,
1850
+ Ne as SINValidator,
1851
+ Ee as TemporaryNotification,
1852
+ Pe as birthDayValidator,
1853
+ Se as birthMonthValidator,
1854
+ ve as birthYearValidator,
1855
+ Te as dateValidator,
1856
+ L as dispatch,
1857
+ ke as emailValidator,
1858
+ We as lengthValidator,
1859
+ A as numericValidator,
1860
+ xe as phoneNumberValidator,
1861
+ Ye as postalCodeValidator,
1862
+ C as regexValidator,
1863
+ M as relay,
1864
+ F as requiredValidator
436
1865
  };