@still-forest/canopy 0.39.3 → 0.40.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.
@@ -1,3212 +0,0 @@
1
- import { j as S } from "./jsx-runtime-B0GD0xBr.js";
2
- import { F as He } from "./Layout-CvVv48kM.js";
3
- import { a as Dn, c as T } from "./index-CRiPKpXj.js";
4
- import * as j from "react";
5
- import h, { forwardRef as yt, createElement as qe, createContext as On, useContext as Cn, useCallback as U, useRef as Se, useLayoutEffect as Nn, useState as $e, useEffect as xn, useMemo as Fe } from "react";
6
- function Je(e, t) {
7
- if (typeof e == "function")
8
- return e(t);
9
- e != null && (e.current = t);
10
- }
11
- function gt(...e) {
12
- return (t) => {
13
- let n = !1;
14
- const o = e.map((r) => {
15
- const s = Je(r, t);
16
- return !n && typeof s == "function" && (n = !0), s;
17
- });
18
- if (n)
19
- return () => {
20
- for (let r = 0; r < o.length; r++) {
21
- const s = o[r];
22
- typeof s == "function" ? s() : Je(e[r], null);
23
- }
24
- };
25
- };
26
- }
27
- function ta(...e) {
28
- return j.useCallback(gt(...e), e);
29
- }
30
- // @__NO_SIDE_EFFECTS__
31
- function Wn(e) {
32
- const t = /* @__PURE__ */ _n(e), n = j.forwardRef((o, r) => {
33
- const { children: s, ...i } = o, a = j.Children.toArray(s), c = a.find(Tn);
34
- if (c) {
35
- const l = c.props.children, d = a.map((u) => u === c ? j.Children.count(l) > 1 ? j.Children.only(null) : j.isValidElement(l) ? l.props.children : null : u);
36
- return /* @__PURE__ */ S.jsx(t, { ...i, ref: r, children: j.isValidElement(l) ? j.cloneElement(l, void 0, d) : null });
37
- }
38
- return /* @__PURE__ */ S.jsx(t, { ...i, ref: r, children: s });
39
- });
40
- return n.displayName = `${e}.Slot`, n;
41
- }
42
- var Sn = /* @__PURE__ */ Wn("Slot");
43
- // @__NO_SIDE_EFFECTS__
44
- function _n(e) {
45
- const t = j.forwardRef((n, o) => {
46
- const { children: r, ...s } = n;
47
- if (j.isValidElement(r)) {
48
- const i = Pn(r), a = En(s, r.props);
49
- return r.type !== j.Fragment && (a.ref = o ? gt(o, i) : i), j.cloneElement(r, a);
50
- }
51
- return j.Children.count(r) > 1 ? j.Children.only(null) : null;
52
- });
53
- return t.displayName = `${e}.SlotClone`, t;
54
- }
55
- var bt = Symbol("radix.slottable");
56
- // @__NO_SIDE_EFFECTS__
57
- function na(e) {
58
- const t = ({ children: n }) => /* @__PURE__ */ S.jsx(S.Fragment, { children: n });
59
- return t.displayName = `${e}.Slottable`, t.__radixId = bt, t;
60
- }
61
- function Tn(e) {
62
- return j.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === bt;
63
- }
64
- function En(e, t) {
65
- const n = { ...t };
66
- for (const o in t) {
67
- const r = e[o], s = t[o];
68
- /^on[A-Z]/.test(o) ? r && s ? n[o] = (...a) => {
69
- const c = s(...a);
70
- return r(...a), c;
71
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...s } : o === "className" && (n[o] = [r, s].filter(Boolean).join(" "));
72
- }
73
- return { ...e, ...n };
74
- }
75
- function Pn(e) {
76
- let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
77
- return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
78
- }
79
- /**
80
- * @license lucide-react v0.544.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */
85
- const Yn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Fn = (e) => e.replace(
86
- /^([A-Z])|[\s-_]+(\w)/g,
87
- (t, n, o) => o ? o.toUpperCase() : n.toLowerCase()
88
- ), et = (e) => {
89
- const t = Fn(e);
90
- return t.charAt(0).toUpperCase() + t.slice(1);
91
- }, pt = (...e) => e.filter((t, n, o) => !!t && t.trim() !== "" && o.indexOf(t) === n).join(" ").trim(), Bn = (e) => {
92
- for (const t in e)
93
- if (t.startsWith("aria-") || t === "role" || t === "title")
94
- return !0;
95
- };
96
- /**
97
- * @license lucide-react v0.544.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */
102
- var jn = {
103
- xmlns: "http://www.w3.org/2000/svg",
104
- width: 24,
105
- height: 24,
106
- viewBox: "0 0 24 24",
107
- fill: "none",
108
- stroke: "currentColor",
109
- strokeWidth: 2,
110
- strokeLinecap: "round",
111
- strokeLinejoin: "round"
112
- };
113
- /**
114
- * @license lucide-react v0.544.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */
119
- const In = yt(
120
- ({
121
- color: e = "currentColor",
122
- size: t = 24,
123
- strokeWidth: n = 2,
124
- absoluteStrokeWidth: o,
125
- className: r = "",
126
- children: s,
127
- iconNode: i,
128
- ...a
129
- }, c) => qe(
130
- "svg",
131
- {
132
- ref: c,
133
- ...jn,
134
- width: t,
135
- height: t,
136
- stroke: e,
137
- strokeWidth: o ? Number(n) * 24 / Number(t) : n,
138
- className: pt("lucide", r),
139
- ...!s && !Bn(a) && { "aria-hidden": "true" },
140
- ...a
141
- },
142
- [
143
- ...i.map(([l, d]) => qe(l, d)),
144
- ...Array.isArray(s) ? s : [s]
145
- ]
146
- )
147
- );
148
- /**
149
- * @license lucide-react v0.544.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */
154
- const wt = (e, t) => {
155
- const n = yt(
156
- ({ className: o, ...r }, s) => qe(In, {
157
- ref: s,
158
- iconNode: t,
159
- className: pt(
160
- `lucide-${Yn(et(e))}`,
161
- `lucide-${e}`,
162
- o
163
- ),
164
- ...r
165
- })
166
- );
167
- return n.displayName = et(e), n;
168
- };
169
- /**
170
- * @license lucide-react v0.544.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */
175
- const An = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], vt = wt("chevron-left", An);
176
- /**
177
- * @license lucide-react v0.544.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */
182
- const Hn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Mt = wt("chevron-right", Hn), tt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, nt = Dn, qn = (e, t) => (n) => {
183
- var o;
184
- if (t?.variants == null) return nt(e, n?.class, n?.className);
185
- const { variants: r, defaultVariants: s } = t, i = Object.keys(r).map((l) => {
186
- const d = n?.[l], u = s?.[l];
187
- if (d === null) return null;
188
- const f = tt(d) || tt(u);
189
- return r[l][f];
190
- }), a = n && Object.entries(n).reduce((l, d) => {
191
- let [u, f] = d;
192
- return f === void 0 || (l[u] = f), l;
193
- }, {}), c = t == null || (o = t.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((l, d) => {
194
- let { class: u, className: f, ...m } = d;
195
- return Object.entries(m).every((p) => {
196
- let [b, w] = p;
197
- return Array.isArray(w) ? w.includes({
198
- ...s,
199
- ...a
200
- }[b]) : {
201
- ...s,
202
- ...a
203
- }[b] === w;
204
- }) ? [
205
- ...l,
206
- u,
207
- f
208
- ] : l;
209
- }, []);
210
- return nt(e, i, c, n?.class, n?.className);
211
- }, Re = qn(
212
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
213
- {
214
- variants: {
215
- variant: {
216
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
217
- destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
218
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
219
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
220
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
221
- link: "text-primary underline-offset-4 hover:underline",
222
- unstyled: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 justify-start"
223
- },
224
- size: {
225
- default: "h-9 px-4 py-2 has-[>svg]:px-3 text-sm",
226
- xs: "h-7 px-3 py-1.5 has-[>svg]:px-2 text-xs",
227
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5 text-sm",
228
- md: "h-9 px-4 py-2 has-[>svg]:px-3 text-sm",
229
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4 text-base",
230
- xl: "h-11 px-8 py-3 has-[>svg]:px-5 text-lg",
231
- icon: "size-9 text-sm",
232
- unstyled: "h-auto p-0 text-sm"
233
- }
234
- },
235
- defaultVariants: {
236
- variant: "default",
237
- size: "default"
238
- }
239
- }
240
- );
241
- function De({
242
- className: e,
243
- variant: t,
244
- size: n,
245
- asChild: o = !1,
246
- ...r
247
- }) {
248
- const s = o ? Sn : "button";
249
- return /* @__PURE__ */ S.jsx(s, { className: T(Re({ variant: t, size: n, className: e })), "data-slot": "button", ...r });
250
- }
251
- const $n = ({
252
- label: e,
253
- children: t,
254
- onClick: n,
255
- variant: o = "default",
256
- size: r = "default",
257
- icon: s,
258
- disabled: i = !1,
259
- className: a = "",
260
- type: c = "button",
261
- asChild: l = !1,
262
- full: d = !1,
263
- fit: u = !1,
264
- ...f
265
- }) => {
266
- const m = () => o === "primary" ? "default" : o === "subtle" ? "secondary" : o, p = () => o === "unstyled" ? "unstyled" : r === "default" ? "md" : r;
267
- return /* @__PURE__ */ S.jsx(
268
- De,
269
- {
270
- asChild: l,
271
- className: T(a, u && "w-fit", d && "w-full", o === "unstyled" && "justify-start"),
272
- disabled: i,
273
- onClick: n,
274
- size: p(),
275
- type: c,
276
- variant: m(),
277
- ...f,
278
- children: s && t ? /* @__PURE__ */ S.jsxs(He, { align: "center", gap: "2", children: [
279
- /* @__PURE__ */ S.jsx("span", { children: s }, "icon"),
280
- /* @__PURE__ */ S.jsx("span", { children: t }, "children")
281
- ] }) : s && e ? /* @__PURE__ */ S.jsxs(He, { align: "center", gap: "2", children: [
282
- /* @__PURE__ */ S.jsx("span", { children: s }, "icon"),
283
- /* @__PURE__ */ S.jsx("span", { children: e }, "label")
284
- ] }) : s ? /* @__PURE__ */ S.jsx("span", { children: s }, "icon") : t || e
285
- }
286
- );
287
- }, Rn = ({ children: e, className: t = "" }) => /* @__PURE__ */ S.jsx(He, { className: t, children: e });
288
- Rn.Button = ({ children: e, className: t, ...n }) => /* @__PURE__ */ S.jsx($n, { className: T("not-first:-ml-1 not-last:rounded-r-none not-first:rounded-l-none", t), ...n, children: e });
289
- const kt = 6048e5, Gn = 864e5, ot = Symbol.for("constructDateFrom");
290
- function I(e, t) {
291
- return typeof e == "function" ? e(t) : e && typeof e == "object" && ot in e ? e[ot](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
292
- }
293
- function P(e, t) {
294
- return I(t || e, e);
295
- }
296
- function Dt(e, t, n) {
297
- const o = P(e, n?.in);
298
- return isNaN(t) ? I(e, NaN) : (t && o.setDate(o.getDate() + t), o);
299
- }
300
- function Ot(e, t, n) {
301
- const o = P(e, n?.in);
302
- if (isNaN(t)) return I(e, NaN);
303
- if (!t)
304
- return o;
305
- const r = o.getDate(), s = I(e, o.getTime());
306
- s.setMonth(o.getMonth() + t + 1, 0);
307
- const i = s.getDate();
308
- return r >= i ? s : (o.setFullYear(
309
- s.getFullYear(),
310
- s.getMonth(),
311
- r
312
- ), o);
313
- }
314
- let Zn = {};
315
- function Ne() {
316
- return Zn;
317
- }
318
- function ge(e, t) {
319
- const n = Ne(), o = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, r = P(e, t?.in), s = r.getDay(), i = (s < o ? 7 : 0) + s - o;
320
- return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
321
- }
322
- function Oe(e, t) {
323
- return ge(e, { ...t, weekStartsOn: 1 });
324
- }
325
- function Ct(e, t) {
326
- const n = P(e, t?.in), o = n.getFullYear(), r = I(n, 0);
327
- r.setFullYear(o + 1, 0, 4), r.setHours(0, 0, 0, 0);
328
- const s = Oe(r), i = I(n, 0);
329
- i.setFullYear(o, 0, 4), i.setHours(0, 0, 0, 0);
330
- const a = Oe(i);
331
- return n.getTime() >= s.getTime() ? o + 1 : n.getTime() >= a.getTime() ? o : o - 1;
332
- }
333
- function rt(e) {
334
- const t = P(e), n = new Date(
335
- Date.UTC(
336
- t.getFullYear(),
337
- t.getMonth(),
338
- t.getDate(),
339
- t.getHours(),
340
- t.getMinutes(),
341
- t.getSeconds(),
342
- t.getMilliseconds()
343
- )
344
- );
345
- return n.setUTCFullYear(t.getFullYear()), +e - +n;
346
- }
347
- function be(e, ...t) {
348
- const n = I.bind(
349
- null,
350
- t.find((o) => typeof o == "object")
351
- );
352
- return t.map(n);
353
- }
354
- function Ce(e, t) {
355
- const n = P(e, t?.in);
356
- return n.setHours(0, 0, 0, 0), n;
357
- }
358
- function ce(e, t, n) {
359
- const [o, r] = be(
360
- n?.in,
361
- e,
362
- t
363
- ), s = Ce(o), i = Ce(r), a = +s - rt(s), c = +i - rt(i);
364
- return Math.round((a - c) / Gn);
365
- }
366
- function zn(e, t) {
367
- const n = Ct(e, t), o = I(e, 0);
368
- return o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0), Oe(o);
369
- }
370
- function Ln(e, t, n) {
371
- return Dt(e, t * 7, n);
372
- }
373
- function Vn(e, t, n) {
374
- return Ot(e, t * 12, n);
375
- }
376
- function Qn(e, t) {
377
- let n, o = t?.in;
378
- return e.forEach((r) => {
379
- !o && typeof r == "object" && (o = I.bind(null, r));
380
- const s = P(r, o);
381
- (!n || n < s || isNaN(+s)) && (n = s);
382
- }), I(o, n || NaN);
383
- }
384
- function Un(e, t) {
385
- let n, o = t?.in;
386
- return e.forEach((r) => {
387
- !o && typeof r == "object" && (o = I.bind(null, r));
388
- const s = P(r, o);
389
- (!n || n > s || isNaN(+s)) && (n = s);
390
- }), I(o, n || NaN);
391
- }
392
- function Xn(e, t, n) {
393
- const [o, r] = be(
394
- n?.in,
395
- e,
396
- t
397
- );
398
- return +Ce(o) == +Ce(r);
399
- }
400
- function Nt(e) {
401
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
402
- }
403
- function Kn(e) {
404
- return !(!Nt(e) && typeof e != "number" || isNaN(+P(e)));
405
- }
406
- function Jn(e, t, n) {
407
- const [o, r] = be(
408
- n?.in,
409
- e,
410
- t
411
- ), s = o.getFullYear() - r.getFullYear(), i = o.getMonth() - r.getMonth();
412
- return s * 12 + i;
413
- }
414
- function eo(e, t) {
415
- const n = P(e, t?.in), o = n.getMonth();
416
- return n.setFullYear(n.getFullYear(), o + 1, 0), n.setHours(23, 59, 59, 999), n;
417
- }
418
- function to(e, t) {
419
- const [n, o] = be(e, t.start, t.end);
420
- return { start: n, end: o };
421
- }
422
- function no(e, t) {
423
- const { start: n, end: o } = to(t?.in, e);
424
- let r = +n > +o;
425
- const s = r ? +n : +o, i = r ? o : n;
426
- i.setHours(0, 0, 0, 0), i.setDate(1);
427
- let a = 1;
428
- const c = [];
429
- for (; +i <= s; )
430
- c.push(I(n, i)), i.setMonth(i.getMonth() + a);
431
- return r ? c.reverse() : c;
432
- }
433
- function oo(e, t) {
434
- const n = P(e, t?.in);
435
- return n.setDate(1), n.setHours(0, 0, 0, 0), n;
436
- }
437
- function ro(e, t) {
438
- const n = P(e, t?.in), o = n.getFullYear();
439
- return n.setFullYear(o + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
440
- }
441
- function xt(e, t) {
442
- const n = P(e, t?.in);
443
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
444
- }
445
- function Wt(e, t) {
446
- const n = Ne(), o = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, r = P(e, t?.in), s = r.getDay(), i = (s < o ? -7 : 0) + 6 - (s - o);
447
- return r.setDate(r.getDate() + i), r.setHours(23, 59, 59, 999), r;
448
- }
449
- function so(e, t) {
450
- return Wt(e, { ...t, weekStartsOn: 1 });
451
- }
452
- const ao = {
453
- lessThanXSeconds: {
454
- one: "less than a second",
455
- other: "less than {{count}} seconds"
456
- },
457
- xSeconds: {
458
- one: "1 second",
459
- other: "{{count}} seconds"
460
- },
461
- halfAMinute: "half a minute",
462
- lessThanXMinutes: {
463
- one: "less than a minute",
464
- other: "less than {{count}} minutes"
465
- },
466
- xMinutes: {
467
- one: "1 minute",
468
- other: "{{count}} minutes"
469
- },
470
- aboutXHours: {
471
- one: "about 1 hour",
472
- other: "about {{count}} hours"
473
- },
474
- xHours: {
475
- one: "1 hour",
476
- other: "{{count}} hours"
477
- },
478
- xDays: {
479
- one: "1 day",
480
- other: "{{count}} days"
481
- },
482
- aboutXWeeks: {
483
- one: "about 1 week",
484
- other: "about {{count}} weeks"
485
- },
486
- xWeeks: {
487
- one: "1 week",
488
- other: "{{count}} weeks"
489
- },
490
- aboutXMonths: {
491
- one: "about 1 month",
492
- other: "about {{count}} months"
493
- },
494
- xMonths: {
495
- one: "1 month",
496
- other: "{{count}} months"
497
- },
498
- aboutXYears: {
499
- one: "about 1 year",
500
- other: "about {{count}} years"
501
- },
502
- xYears: {
503
- one: "1 year",
504
- other: "{{count}} years"
505
- },
506
- overXYears: {
507
- one: "over 1 year",
508
- other: "over {{count}} years"
509
- },
510
- almostXYears: {
511
- one: "almost 1 year",
512
- other: "almost {{count}} years"
513
- }
514
- }, io = (e, t, n) => {
515
- let o;
516
- const r = ao[e];
517
- return typeof r == "string" ? o = r : t === 1 ? o = r.one : o = r.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + o : o + " ago" : o;
518
- };
519
- function Be(e) {
520
- return (t = {}) => {
521
- const n = t.width ? String(t.width) : e.defaultWidth;
522
- return e.formats[n] || e.formats[e.defaultWidth];
523
- };
524
- }
525
- const co = {
526
- full: "EEEE, MMMM do, y",
527
- long: "MMMM do, y",
528
- medium: "MMM d, y",
529
- short: "MM/dd/yyyy"
530
- }, uo = {
531
- full: "h:mm:ss a zzzz",
532
- long: "h:mm:ss a z",
533
- medium: "h:mm:ss a",
534
- short: "h:mm a"
535
- }, lo = {
536
- full: "{{date}} 'at' {{time}}",
537
- long: "{{date}} 'at' {{time}}",
538
- medium: "{{date}}, {{time}}",
539
- short: "{{date}}, {{time}}"
540
- }, fo = {
541
- date: Be({
542
- formats: co,
543
- defaultWidth: "full"
544
- }),
545
- time: Be({
546
- formats: uo,
547
- defaultWidth: "full"
548
- }),
549
- dateTime: Be({
550
- formats: lo,
551
- defaultWidth: "full"
552
- })
553
- }, ho = {
554
- lastWeek: "'last' eeee 'at' p",
555
- yesterday: "'yesterday at' p",
556
- today: "'today at' p",
557
- tomorrow: "'tomorrow at' p",
558
- nextWeek: "eeee 'at' p",
559
- other: "P"
560
- }, mo = (e, t, n, o) => ho[e];
561
- function ve(e) {
562
- return (t, n) => {
563
- const o = n?.context ? String(n.context) : "standalone";
564
- let r;
565
- if (o === "formatting" && e.formattingValues) {
566
- const i = e.defaultFormattingWidth || e.defaultWidth, a = n?.width ? String(n.width) : i;
567
- r = e.formattingValues[a] || e.formattingValues[i];
568
- } else {
569
- const i = e.defaultWidth, a = n?.width ? String(n.width) : e.defaultWidth;
570
- r = e.values[a] || e.values[i];
571
- }
572
- const s = e.argumentCallback ? e.argumentCallback(t) : t;
573
- return r[s];
574
- };
575
- }
576
- const yo = {
577
- narrow: ["B", "A"],
578
- abbreviated: ["BC", "AD"],
579
- wide: ["Before Christ", "Anno Domini"]
580
- }, go = {
581
- narrow: ["1", "2", "3", "4"],
582
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
583
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
584
- }, bo = {
585
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
586
- abbreviated: [
587
- "Jan",
588
- "Feb",
589
- "Mar",
590
- "Apr",
591
- "May",
592
- "Jun",
593
- "Jul",
594
- "Aug",
595
- "Sep",
596
- "Oct",
597
- "Nov",
598
- "Dec"
599
- ],
600
- wide: [
601
- "January",
602
- "February",
603
- "March",
604
- "April",
605
- "May",
606
- "June",
607
- "July",
608
- "August",
609
- "September",
610
- "October",
611
- "November",
612
- "December"
613
- ]
614
- }, po = {
615
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
616
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
617
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
618
- wide: [
619
- "Sunday",
620
- "Monday",
621
- "Tuesday",
622
- "Wednesday",
623
- "Thursday",
624
- "Friday",
625
- "Saturday"
626
- ]
627
- }, wo = {
628
- narrow: {
629
- am: "a",
630
- pm: "p",
631
- midnight: "mi",
632
- noon: "n",
633
- morning: "morning",
634
- afternoon: "afternoon",
635
- evening: "evening",
636
- night: "night"
637
- },
638
- abbreviated: {
639
- am: "AM",
640
- pm: "PM",
641
- midnight: "midnight",
642
- noon: "noon",
643
- morning: "morning",
644
- afternoon: "afternoon",
645
- evening: "evening",
646
- night: "night"
647
- },
648
- wide: {
649
- am: "a.m.",
650
- pm: "p.m.",
651
- midnight: "midnight",
652
- noon: "noon",
653
- morning: "morning",
654
- afternoon: "afternoon",
655
- evening: "evening",
656
- night: "night"
657
- }
658
- }, vo = {
659
- narrow: {
660
- am: "a",
661
- pm: "p",
662
- midnight: "mi",
663
- noon: "n",
664
- morning: "in the morning",
665
- afternoon: "in the afternoon",
666
- evening: "in the evening",
667
- night: "at night"
668
- },
669
- abbreviated: {
670
- am: "AM",
671
- pm: "PM",
672
- midnight: "midnight",
673
- noon: "noon",
674
- morning: "in the morning",
675
- afternoon: "in the afternoon",
676
- evening: "in the evening",
677
- night: "at night"
678
- },
679
- wide: {
680
- am: "a.m.",
681
- pm: "p.m.",
682
- midnight: "midnight",
683
- noon: "noon",
684
- morning: "in the morning",
685
- afternoon: "in the afternoon",
686
- evening: "in the evening",
687
- night: "at night"
688
- }
689
- }, Mo = (e, t) => {
690
- const n = Number(e), o = n % 100;
691
- if (o > 20 || o < 10)
692
- switch (o % 10) {
693
- case 1:
694
- return n + "st";
695
- case 2:
696
- return n + "nd";
697
- case 3:
698
- return n + "rd";
699
- }
700
- return n + "th";
701
- }, ko = {
702
- ordinalNumber: Mo,
703
- era: ve({
704
- values: yo,
705
- defaultWidth: "wide"
706
- }),
707
- quarter: ve({
708
- values: go,
709
- defaultWidth: "wide",
710
- argumentCallback: (e) => e - 1
711
- }),
712
- month: ve({
713
- values: bo,
714
- defaultWidth: "wide"
715
- }),
716
- day: ve({
717
- values: po,
718
- defaultWidth: "wide"
719
- }),
720
- dayPeriod: ve({
721
- values: wo,
722
- defaultWidth: "wide",
723
- formattingValues: vo,
724
- defaultFormattingWidth: "wide"
725
- })
726
- };
727
- function Me(e) {
728
- return (t, n = {}) => {
729
- const o = n.width, r = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth], s = t.match(r);
730
- if (!s)
731
- return null;
732
- const i = s[0], a = o && e.parsePatterns[o] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(a) ? Oo(a, (u) => u.test(i)) : (
733
- // [TODO] -- I challenge you to fix the type
734
- Do(a, (u) => u.test(i))
735
- );
736
- let l;
737
- l = e.valueCallback ? e.valueCallback(c) : c, l = n.valueCallback ? (
738
- // [TODO] -- I challenge you to fix the type
739
- n.valueCallback(l)
740
- ) : l;
741
- const d = t.slice(i.length);
742
- return { value: l, rest: d };
743
- };
744
- }
745
- function Do(e, t) {
746
- for (const n in e)
747
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
748
- return n;
749
- }
750
- function Oo(e, t) {
751
- for (let n = 0; n < e.length; n++)
752
- if (t(e[n]))
753
- return n;
754
- }
755
- function Co(e) {
756
- return (t, n = {}) => {
757
- const o = t.match(e.matchPattern);
758
- if (!o) return null;
759
- const r = o[0], s = t.match(e.parsePattern);
760
- if (!s) return null;
761
- let i = e.valueCallback ? e.valueCallback(s[0]) : s[0];
762
- i = n.valueCallback ? n.valueCallback(i) : i;
763
- const a = t.slice(r.length);
764
- return { value: i, rest: a };
765
- };
766
- }
767
- const No = /^(\d+)(th|st|nd|rd)?/i, xo = /\d+/i, Wo = {
768
- narrow: /^(b|a)/i,
769
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
770
- wide: /^(before christ|before common era|anno domini|common era)/i
771
- }, So = {
772
- any: [/^b/i, /^(a|c)/i]
773
- }, _o = {
774
- narrow: /^[1234]/i,
775
- abbreviated: /^q[1234]/i,
776
- wide: /^[1234](th|st|nd|rd)? quarter/i
777
- }, To = {
778
- any: [/1/i, /2/i, /3/i, /4/i]
779
- }, Eo = {
780
- narrow: /^[jfmasond]/i,
781
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
782
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
783
- }, Po = {
784
- narrow: [
785
- /^j/i,
786
- /^f/i,
787
- /^m/i,
788
- /^a/i,
789
- /^m/i,
790
- /^j/i,
791
- /^j/i,
792
- /^a/i,
793
- /^s/i,
794
- /^o/i,
795
- /^n/i,
796
- /^d/i
797
- ],
798
- any: [
799
- /^ja/i,
800
- /^f/i,
801
- /^mar/i,
802
- /^ap/i,
803
- /^may/i,
804
- /^jun/i,
805
- /^jul/i,
806
- /^au/i,
807
- /^s/i,
808
- /^o/i,
809
- /^n/i,
810
- /^d/i
811
- ]
812
- }, Yo = {
813
- narrow: /^[smtwf]/i,
814
- short: /^(su|mo|tu|we|th|fr|sa)/i,
815
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
816
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
817
- }, Fo = {
818
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
819
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
820
- }, Bo = {
821
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
822
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
823
- }, jo = {
824
- any: {
825
- am: /^a/i,
826
- pm: /^p/i,
827
- midnight: /^mi/i,
828
- noon: /^no/i,
829
- morning: /morning/i,
830
- afternoon: /afternoon/i,
831
- evening: /evening/i,
832
- night: /night/i
833
- }
834
- }, Io = {
835
- ordinalNumber: Co({
836
- matchPattern: No,
837
- parsePattern: xo,
838
- valueCallback: (e) => parseInt(e, 10)
839
- }),
840
- era: Me({
841
- matchPatterns: Wo,
842
- defaultMatchWidth: "wide",
843
- parsePatterns: So,
844
- defaultParseWidth: "any"
845
- }),
846
- quarter: Me({
847
- matchPatterns: _o,
848
- defaultMatchWidth: "wide",
849
- parsePatterns: To,
850
- defaultParseWidth: "any",
851
- valueCallback: (e) => e + 1
852
- }),
853
- month: Me({
854
- matchPatterns: Eo,
855
- defaultMatchWidth: "wide",
856
- parsePatterns: Po,
857
- defaultParseWidth: "any"
858
- }),
859
- day: Me({
860
- matchPatterns: Yo,
861
- defaultMatchWidth: "wide",
862
- parsePatterns: Fo,
863
- defaultParseWidth: "any"
864
- }),
865
- dayPeriod: Me({
866
- matchPatterns: Bo,
867
- defaultMatchWidth: "any",
868
- parsePatterns: jo,
869
- defaultParseWidth: "any"
870
- })
871
- }, Ze = {
872
- code: "en-US",
873
- formatDistance: io,
874
- formatLong: fo,
875
- formatRelative: mo,
876
- localize: ko,
877
- match: Io,
878
- options: {
879
- weekStartsOn: 0,
880
- firstWeekContainsDate: 1
881
- }
882
- };
883
- function Ao(e, t) {
884
- const n = P(e, t?.in);
885
- return ce(n, xt(n)) + 1;
886
- }
887
- function St(e, t) {
888
- const n = P(e, t?.in), o = +Oe(n) - +zn(n);
889
- return Math.round(o / kt) + 1;
890
- }
891
- function _t(e, t) {
892
- const n = P(e, t?.in), o = n.getFullYear(), r = Ne(), s = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = I(t?.in || e, 0);
893
- i.setFullYear(o + 1, 0, s), i.setHours(0, 0, 0, 0);
894
- const a = ge(i, t), c = I(t?.in || e, 0);
895
- c.setFullYear(o, 0, s), c.setHours(0, 0, 0, 0);
896
- const l = ge(c, t);
897
- return +n >= +a ? o + 1 : +n >= +l ? o : o - 1;
898
- }
899
- function Ho(e, t) {
900
- const n = Ne(), o = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, r = _t(e, t), s = I(t?.in || e, 0);
901
- return s.setFullYear(r, 0, o), s.setHours(0, 0, 0, 0), ge(s, t);
902
- }
903
- function Tt(e, t) {
904
- const n = P(e, t?.in), o = +ge(n, t) - +Ho(n, t);
905
- return Math.round(o / kt) + 1;
906
- }
907
- function E(e, t) {
908
- const n = e < 0 ? "-" : "", o = Math.abs(e).toString().padStart(t, "0");
909
- return n + o;
910
- }
911
- const ie = {
912
- // Year
913
- y(e, t) {
914
- const n = e.getFullYear(), o = n > 0 ? n : 1 - n;
915
- return E(t === "yy" ? o % 100 : o, t.length);
916
- },
917
- // Month
918
- M(e, t) {
919
- const n = e.getMonth();
920
- return t === "M" ? String(n + 1) : E(n + 1, 2);
921
- },
922
- // Day of the month
923
- d(e, t) {
924
- return E(e.getDate(), t.length);
925
- },
926
- // AM or PM
927
- a(e, t) {
928
- const n = e.getHours() / 12 >= 1 ? "pm" : "am";
929
- switch (t) {
930
- case "a":
931
- case "aa":
932
- return n.toUpperCase();
933
- case "aaa":
934
- return n;
935
- case "aaaaa":
936
- return n[0];
937
- case "aaaa":
938
- default:
939
- return n === "am" ? "a.m." : "p.m.";
940
- }
941
- },
942
- // Hour [1-12]
943
- h(e, t) {
944
- return E(e.getHours() % 12 || 12, t.length);
945
- },
946
- // Hour [0-23]
947
- H(e, t) {
948
- return E(e.getHours(), t.length);
949
- },
950
- // Minute
951
- m(e, t) {
952
- return E(e.getMinutes(), t.length);
953
- },
954
- // Second
955
- s(e, t) {
956
- return E(e.getSeconds(), t.length);
957
- },
958
- // Fraction of second
959
- S(e, t) {
960
- const n = t.length, o = e.getMilliseconds(), r = Math.trunc(
961
- o * Math.pow(10, n - 3)
962
- );
963
- return E(r, t.length);
964
- }
965
- }, ye = {
966
- midnight: "midnight",
967
- noon: "noon",
968
- morning: "morning",
969
- afternoon: "afternoon",
970
- evening: "evening",
971
- night: "night"
972
- }, st = {
973
- // Era
974
- G: function(e, t, n) {
975
- const o = e.getFullYear() > 0 ? 1 : 0;
976
- switch (t) {
977
- // AD, BC
978
- case "G":
979
- case "GG":
980
- case "GGG":
981
- return n.era(o, { width: "abbreviated" });
982
- // A, B
983
- case "GGGGG":
984
- return n.era(o, { width: "narrow" });
985
- // Anno Domini, Before Christ
986
- case "GGGG":
987
- default:
988
- return n.era(o, { width: "wide" });
989
- }
990
- },
991
- // Year
992
- y: function(e, t, n) {
993
- if (t === "yo") {
994
- const o = e.getFullYear(), r = o > 0 ? o : 1 - o;
995
- return n.ordinalNumber(r, { unit: "year" });
996
- }
997
- return ie.y(e, t);
998
- },
999
- // Local week-numbering year
1000
- Y: function(e, t, n, o) {
1001
- const r = _t(e, o), s = r > 0 ? r : 1 - r;
1002
- if (t === "YY") {
1003
- const i = s % 100;
1004
- return E(i, 2);
1005
- }
1006
- return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : E(s, t.length);
1007
- },
1008
- // ISO week-numbering year
1009
- R: function(e, t) {
1010
- const n = Ct(e);
1011
- return E(n, t.length);
1012
- },
1013
- // Extended year. This is a single number designating the year of this calendar system.
1014
- // The main difference between `y` and `u` localizers are B.C. years:
1015
- // | Year | `y` | `u` |
1016
- // |------|-----|-----|
1017
- // | AC 1 | 1 | 1 |
1018
- // | BC 1 | 1 | 0 |
1019
- // | BC 2 | 2 | -1 |
1020
- // Also `yy` always returns the last two digits of a year,
1021
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1022
- u: function(e, t) {
1023
- const n = e.getFullYear();
1024
- return E(n, t.length);
1025
- },
1026
- // Quarter
1027
- Q: function(e, t, n) {
1028
- const o = Math.ceil((e.getMonth() + 1) / 3);
1029
- switch (t) {
1030
- // 1, 2, 3, 4
1031
- case "Q":
1032
- return String(o);
1033
- // 01, 02, 03, 04
1034
- case "QQ":
1035
- return E(o, 2);
1036
- // 1st, 2nd, 3rd, 4th
1037
- case "Qo":
1038
- return n.ordinalNumber(o, { unit: "quarter" });
1039
- // Q1, Q2, Q3, Q4
1040
- case "QQQ":
1041
- return n.quarter(o, {
1042
- width: "abbreviated",
1043
- context: "formatting"
1044
- });
1045
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1046
- case "QQQQQ":
1047
- return n.quarter(o, {
1048
- width: "narrow",
1049
- context: "formatting"
1050
- });
1051
- // 1st quarter, 2nd quarter, ...
1052
- case "QQQQ":
1053
- default:
1054
- return n.quarter(o, {
1055
- width: "wide",
1056
- context: "formatting"
1057
- });
1058
- }
1059
- },
1060
- // Stand-alone quarter
1061
- q: function(e, t, n) {
1062
- const o = Math.ceil((e.getMonth() + 1) / 3);
1063
- switch (t) {
1064
- // 1, 2, 3, 4
1065
- case "q":
1066
- return String(o);
1067
- // 01, 02, 03, 04
1068
- case "qq":
1069
- return E(o, 2);
1070
- // 1st, 2nd, 3rd, 4th
1071
- case "qo":
1072
- return n.ordinalNumber(o, { unit: "quarter" });
1073
- // Q1, Q2, Q3, Q4
1074
- case "qqq":
1075
- return n.quarter(o, {
1076
- width: "abbreviated",
1077
- context: "standalone"
1078
- });
1079
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1080
- case "qqqqq":
1081
- return n.quarter(o, {
1082
- width: "narrow",
1083
- context: "standalone"
1084
- });
1085
- // 1st quarter, 2nd quarter, ...
1086
- case "qqqq":
1087
- default:
1088
- return n.quarter(o, {
1089
- width: "wide",
1090
- context: "standalone"
1091
- });
1092
- }
1093
- },
1094
- // Month
1095
- M: function(e, t, n) {
1096
- const o = e.getMonth();
1097
- switch (t) {
1098
- case "M":
1099
- case "MM":
1100
- return ie.M(e, t);
1101
- // 1st, 2nd, ..., 12th
1102
- case "Mo":
1103
- return n.ordinalNumber(o + 1, { unit: "month" });
1104
- // Jan, Feb, ..., Dec
1105
- case "MMM":
1106
- return n.month(o, {
1107
- width: "abbreviated",
1108
- context: "formatting"
1109
- });
1110
- // J, F, ..., D
1111
- case "MMMMM":
1112
- return n.month(o, {
1113
- width: "narrow",
1114
- context: "formatting"
1115
- });
1116
- // January, February, ..., December
1117
- case "MMMM":
1118
- default:
1119
- return n.month(o, { width: "wide", context: "formatting" });
1120
- }
1121
- },
1122
- // Stand-alone month
1123
- L: function(e, t, n) {
1124
- const o = e.getMonth();
1125
- switch (t) {
1126
- // 1, 2, ..., 12
1127
- case "L":
1128
- return String(o + 1);
1129
- // 01, 02, ..., 12
1130
- case "LL":
1131
- return E(o + 1, 2);
1132
- // 1st, 2nd, ..., 12th
1133
- case "Lo":
1134
- return n.ordinalNumber(o + 1, { unit: "month" });
1135
- // Jan, Feb, ..., Dec
1136
- case "LLL":
1137
- return n.month(o, {
1138
- width: "abbreviated",
1139
- context: "standalone"
1140
- });
1141
- // J, F, ..., D
1142
- case "LLLLL":
1143
- return n.month(o, {
1144
- width: "narrow",
1145
- context: "standalone"
1146
- });
1147
- // January, February, ..., December
1148
- case "LLLL":
1149
- default:
1150
- return n.month(o, { width: "wide", context: "standalone" });
1151
- }
1152
- },
1153
- // Local week of year
1154
- w: function(e, t, n, o) {
1155
- const r = Tt(e, o);
1156
- return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : E(r, t.length);
1157
- },
1158
- // ISO week of year
1159
- I: function(e, t, n) {
1160
- const o = St(e);
1161
- return t === "Io" ? n.ordinalNumber(o, { unit: "week" }) : E(o, t.length);
1162
- },
1163
- // Day of the month
1164
- d: function(e, t, n) {
1165
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : ie.d(e, t);
1166
- },
1167
- // Day of year
1168
- D: function(e, t, n) {
1169
- const o = Ao(e);
1170
- return t === "Do" ? n.ordinalNumber(o, { unit: "dayOfYear" }) : E(o, t.length);
1171
- },
1172
- // Day of week
1173
- E: function(e, t, n) {
1174
- const o = e.getDay();
1175
- switch (t) {
1176
- // Tue
1177
- case "E":
1178
- case "EE":
1179
- case "EEE":
1180
- return n.day(o, {
1181
- width: "abbreviated",
1182
- context: "formatting"
1183
- });
1184
- // T
1185
- case "EEEEE":
1186
- return n.day(o, {
1187
- width: "narrow",
1188
- context: "formatting"
1189
- });
1190
- // Tu
1191
- case "EEEEEE":
1192
- return n.day(o, {
1193
- width: "short",
1194
- context: "formatting"
1195
- });
1196
- // Tuesday
1197
- case "EEEE":
1198
- default:
1199
- return n.day(o, {
1200
- width: "wide",
1201
- context: "formatting"
1202
- });
1203
- }
1204
- },
1205
- // Local day of week
1206
- e: function(e, t, n, o) {
1207
- const r = e.getDay(), s = (r - o.weekStartsOn + 8) % 7 || 7;
1208
- switch (t) {
1209
- // Numerical value (Nth day of week with current locale or weekStartsOn)
1210
- case "e":
1211
- return String(s);
1212
- // Padded numerical value
1213
- case "ee":
1214
- return E(s, 2);
1215
- // 1st, 2nd, ..., 7th
1216
- case "eo":
1217
- return n.ordinalNumber(s, { unit: "day" });
1218
- case "eee":
1219
- return n.day(r, {
1220
- width: "abbreviated",
1221
- context: "formatting"
1222
- });
1223
- // T
1224
- case "eeeee":
1225
- return n.day(r, {
1226
- width: "narrow",
1227
- context: "formatting"
1228
- });
1229
- // Tu
1230
- case "eeeeee":
1231
- return n.day(r, {
1232
- width: "short",
1233
- context: "formatting"
1234
- });
1235
- // Tuesday
1236
- case "eeee":
1237
- default:
1238
- return n.day(r, {
1239
- width: "wide",
1240
- context: "formatting"
1241
- });
1242
- }
1243
- },
1244
- // Stand-alone local day of week
1245
- c: function(e, t, n, o) {
1246
- const r = e.getDay(), s = (r - o.weekStartsOn + 8) % 7 || 7;
1247
- switch (t) {
1248
- // Numerical value (same as in `e`)
1249
- case "c":
1250
- return String(s);
1251
- // Padded numerical value
1252
- case "cc":
1253
- return E(s, t.length);
1254
- // 1st, 2nd, ..., 7th
1255
- case "co":
1256
- return n.ordinalNumber(s, { unit: "day" });
1257
- case "ccc":
1258
- return n.day(r, {
1259
- width: "abbreviated",
1260
- context: "standalone"
1261
- });
1262
- // T
1263
- case "ccccc":
1264
- return n.day(r, {
1265
- width: "narrow",
1266
- context: "standalone"
1267
- });
1268
- // Tu
1269
- case "cccccc":
1270
- return n.day(r, {
1271
- width: "short",
1272
- context: "standalone"
1273
- });
1274
- // Tuesday
1275
- case "cccc":
1276
- default:
1277
- return n.day(r, {
1278
- width: "wide",
1279
- context: "standalone"
1280
- });
1281
- }
1282
- },
1283
- // ISO day of week
1284
- i: function(e, t, n) {
1285
- const o = e.getDay(), r = o === 0 ? 7 : o;
1286
- switch (t) {
1287
- // 2
1288
- case "i":
1289
- return String(r);
1290
- // 02
1291
- case "ii":
1292
- return E(r, t.length);
1293
- // 2nd
1294
- case "io":
1295
- return n.ordinalNumber(r, { unit: "day" });
1296
- // Tue
1297
- case "iii":
1298
- return n.day(o, {
1299
- width: "abbreviated",
1300
- context: "formatting"
1301
- });
1302
- // T
1303
- case "iiiii":
1304
- return n.day(o, {
1305
- width: "narrow",
1306
- context: "formatting"
1307
- });
1308
- // Tu
1309
- case "iiiiii":
1310
- return n.day(o, {
1311
- width: "short",
1312
- context: "formatting"
1313
- });
1314
- // Tuesday
1315
- case "iiii":
1316
- default:
1317
- return n.day(o, {
1318
- width: "wide",
1319
- context: "formatting"
1320
- });
1321
- }
1322
- },
1323
- // AM or PM
1324
- a: function(e, t, n) {
1325
- const r = e.getHours() / 12 >= 1 ? "pm" : "am";
1326
- switch (t) {
1327
- case "a":
1328
- case "aa":
1329
- return n.dayPeriod(r, {
1330
- width: "abbreviated",
1331
- context: "formatting"
1332
- });
1333
- case "aaa":
1334
- return n.dayPeriod(r, {
1335
- width: "abbreviated",
1336
- context: "formatting"
1337
- }).toLowerCase();
1338
- case "aaaaa":
1339
- return n.dayPeriod(r, {
1340
- width: "narrow",
1341
- context: "formatting"
1342
- });
1343
- case "aaaa":
1344
- default:
1345
- return n.dayPeriod(r, {
1346
- width: "wide",
1347
- context: "formatting"
1348
- });
1349
- }
1350
- },
1351
- // AM, PM, midnight, noon
1352
- b: function(e, t, n) {
1353
- const o = e.getHours();
1354
- let r;
1355
- switch (o === 12 ? r = ye.noon : o === 0 ? r = ye.midnight : r = o / 12 >= 1 ? "pm" : "am", t) {
1356
- case "b":
1357
- case "bb":
1358
- return n.dayPeriod(r, {
1359
- width: "abbreviated",
1360
- context: "formatting"
1361
- });
1362
- case "bbb":
1363
- return n.dayPeriod(r, {
1364
- width: "abbreviated",
1365
- context: "formatting"
1366
- }).toLowerCase();
1367
- case "bbbbb":
1368
- return n.dayPeriod(r, {
1369
- width: "narrow",
1370
- context: "formatting"
1371
- });
1372
- case "bbbb":
1373
- default:
1374
- return n.dayPeriod(r, {
1375
- width: "wide",
1376
- context: "formatting"
1377
- });
1378
- }
1379
- },
1380
- // in the morning, in the afternoon, in the evening, at night
1381
- B: function(e, t, n) {
1382
- const o = e.getHours();
1383
- let r;
1384
- switch (o >= 17 ? r = ye.evening : o >= 12 ? r = ye.afternoon : o >= 4 ? r = ye.morning : r = ye.night, t) {
1385
- case "B":
1386
- case "BB":
1387
- case "BBB":
1388
- return n.dayPeriod(r, {
1389
- width: "abbreviated",
1390
- context: "formatting"
1391
- });
1392
- case "BBBBB":
1393
- return n.dayPeriod(r, {
1394
- width: "narrow",
1395
- context: "formatting"
1396
- });
1397
- case "BBBB":
1398
- default:
1399
- return n.dayPeriod(r, {
1400
- width: "wide",
1401
- context: "formatting"
1402
- });
1403
- }
1404
- },
1405
- // Hour [1-12]
1406
- h: function(e, t, n) {
1407
- if (t === "ho") {
1408
- let o = e.getHours() % 12;
1409
- return o === 0 && (o = 12), n.ordinalNumber(o, { unit: "hour" });
1410
- }
1411
- return ie.h(e, t);
1412
- },
1413
- // Hour [0-23]
1414
- H: function(e, t, n) {
1415
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : ie.H(e, t);
1416
- },
1417
- // Hour [0-11]
1418
- K: function(e, t, n) {
1419
- const o = e.getHours() % 12;
1420
- return t === "Ko" ? n.ordinalNumber(o, { unit: "hour" }) : E(o, t.length);
1421
- },
1422
- // Hour [1-24]
1423
- k: function(e, t, n) {
1424
- let o = e.getHours();
1425
- return o === 0 && (o = 24), t === "ko" ? n.ordinalNumber(o, { unit: "hour" }) : E(o, t.length);
1426
- },
1427
- // Minute
1428
- m: function(e, t, n) {
1429
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : ie.m(e, t);
1430
- },
1431
- // Second
1432
- s: function(e, t, n) {
1433
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : ie.s(e, t);
1434
- },
1435
- // Fraction of second
1436
- S: function(e, t) {
1437
- return ie.S(e, t);
1438
- },
1439
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1440
- X: function(e, t, n) {
1441
- const o = e.getTimezoneOffset();
1442
- if (o === 0)
1443
- return "Z";
1444
- switch (t) {
1445
- // Hours and optional minutes
1446
- case "X":
1447
- return it(o);
1448
- // Hours, minutes and optional seconds without `:` delimiter
1449
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1450
- // so this token always has the same output as `XX`
1451
- case "XXXX":
1452
- case "XX":
1453
- return le(o);
1454
- // Hours, minutes and optional seconds with `:` delimiter
1455
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1456
- // so this token always has the same output as `XXX`
1457
- case "XXXXX":
1458
- case "XXX":
1459
- // Hours and minutes with `:` delimiter
1460
- default:
1461
- return le(o, ":");
1462
- }
1463
- },
1464
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1465
- x: function(e, t, n) {
1466
- const o = e.getTimezoneOffset();
1467
- switch (t) {
1468
- // Hours and optional minutes
1469
- case "x":
1470
- return it(o);
1471
- // Hours, minutes and optional seconds without `:` delimiter
1472
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1473
- // so this token always has the same output as `xx`
1474
- case "xxxx":
1475
- case "xx":
1476
- return le(o);
1477
- // Hours, minutes and optional seconds with `:` delimiter
1478
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1479
- // so this token always has the same output as `xxx`
1480
- case "xxxxx":
1481
- case "xxx":
1482
- // Hours and minutes with `:` delimiter
1483
- default:
1484
- return le(o, ":");
1485
- }
1486
- },
1487
- // Timezone (GMT)
1488
- O: function(e, t, n) {
1489
- const o = e.getTimezoneOffset();
1490
- switch (t) {
1491
- // Short
1492
- case "O":
1493
- case "OO":
1494
- case "OOO":
1495
- return "GMT" + at(o, ":");
1496
- // Long
1497
- case "OOOO":
1498
- default:
1499
- return "GMT" + le(o, ":");
1500
- }
1501
- },
1502
- // Timezone (specific non-location)
1503
- z: function(e, t, n) {
1504
- const o = e.getTimezoneOffset();
1505
- switch (t) {
1506
- // Short
1507
- case "z":
1508
- case "zz":
1509
- case "zzz":
1510
- return "GMT" + at(o, ":");
1511
- // Long
1512
- case "zzzz":
1513
- default:
1514
- return "GMT" + le(o, ":");
1515
- }
1516
- },
1517
- // Seconds timestamp
1518
- t: function(e, t, n) {
1519
- const o = Math.trunc(+e / 1e3);
1520
- return E(o, t.length);
1521
- },
1522
- // Milliseconds timestamp
1523
- T: function(e, t, n) {
1524
- return E(+e, t.length);
1525
- }
1526
- };
1527
- function at(e, t = "") {
1528
- const n = e > 0 ? "-" : "+", o = Math.abs(e), r = Math.trunc(o / 60), s = o % 60;
1529
- return s === 0 ? n + String(r) : n + String(r) + t + E(s, 2);
1530
- }
1531
- function it(e, t) {
1532
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + E(Math.abs(e) / 60, 2) : le(e, t);
1533
- }
1534
- function le(e, t = "") {
1535
- const n = e > 0 ? "-" : "+", o = Math.abs(e), r = E(Math.trunc(o / 60), 2), s = E(o % 60, 2);
1536
- return n + r + t + s;
1537
- }
1538
- const ct = (e, t) => {
1539
- switch (e) {
1540
- case "P":
1541
- return t.date({ width: "short" });
1542
- case "PP":
1543
- return t.date({ width: "medium" });
1544
- case "PPP":
1545
- return t.date({ width: "long" });
1546
- case "PPPP":
1547
- default:
1548
- return t.date({ width: "full" });
1549
- }
1550
- }, Et = (e, t) => {
1551
- switch (e) {
1552
- case "p":
1553
- return t.time({ width: "short" });
1554
- case "pp":
1555
- return t.time({ width: "medium" });
1556
- case "ppp":
1557
- return t.time({ width: "long" });
1558
- case "pppp":
1559
- default:
1560
- return t.time({ width: "full" });
1561
- }
1562
- }, qo = (e, t) => {
1563
- const n = e.match(/(P+)(p+)?/) || [], o = n[1], r = n[2];
1564
- if (!r)
1565
- return ct(e, t);
1566
- let s;
1567
- switch (o) {
1568
- case "P":
1569
- s = t.dateTime({ width: "short" });
1570
- break;
1571
- case "PP":
1572
- s = t.dateTime({ width: "medium" });
1573
- break;
1574
- case "PPP":
1575
- s = t.dateTime({ width: "long" });
1576
- break;
1577
- case "PPPP":
1578
- default:
1579
- s = t.dateTime({ width: "full" });
1580
- break;
1581
- }
1582
- return s.replace("{{date}}", ct(o, t)).replace("{{time}}", Et(r, t));
1583
- }, $o = {
1584
- p: Et,
1585
- P: qo
1586
- }, Ro = /^D+$/, Go = /^Y+$/, Zo = ["D", "DD", "YY", "YYYY"];
1587
- function zo(e) {
1588
- return Ro.test(e);
1589
- }
1590
- function Lo(e) {
1591
- return Go.test(e);
1592
- }
1593
- function Vo(e, t, n) {
1594
- const o = Qo(e, t, n);
1595
- if (console.warn(o), Zo.includes(e)) throw new RangeError(o);
1596
- }
1597
- function Qo(e, t, n) {
1598
- const o = e[0] === "Y" ? "years" : "days of the month";
1599
- return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1600
- }
1601
- const Uo = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Xo = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ko = /^'([^]*?)'?$/, Jo = /''/g, er = /[a-zA-Z]/;
1602
- function tr(e, t, n) {
1603
- const o = Ne(), r = n?.locale ?? o.locale ?? Ze, s = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, a = P(e, n?.in);
1604
- if (!Kn(a))
1605
- throw new RangeError("Invalid time value");
1606
- let c = t.match(Xo).map((d) => {
1607
- const u = d[0];
1608
- if (u === "p" || u === "P") {
1609
- const f = $o[u];
1610
- return f(d, r.formatLong);
1611
- }
1612
- return d;
1613
- }).join("").match(Uo).map((d) => {
1614
- if (d === "''")
1615
- return { isToken: !1, value: "'" };
1616
- const u = d[0];
1617
- if (u === "'")
1618
- return { isToken: !1, value: nr(d) };
1619
- if (st[u])
1620
- return { isToken: !0, value: d };
1621
- if (u.match(er))
1622
- throw new RangeError(
1623
- "Format string contains an unescaped latin alphabet character `" + u + "`"
1624
- );
1625
- return { isToken: !1, value: d };
1626
- });
1627
- r.localize.preprocessor && (c = r.localize.preprocessor(a, c));
1628
- const l = {
1629
- firstWeekContainsDate: s,
1630
- weekStartsOn: i,
1631
- locale: r
1632
- };
1633
- return c.map((d) => {
1634
- if (!d.isToken) return d.value;
1635
- const u = d.value;
1636
- (!n?.useAdditionalWeekYearTokens && Lo(u) || !n?.useAdditionalDayOfYearTokens && zo(u)) && Vo(u, t, String(e));
1637
- const f = st[u[0]];
1638
- return f(a, u, r.localize, l);
1639
- }).join("");
1640
- }
1641
- function nr(e) {
1642
- const t = e.match(Ko);
1643
- return t ? t[1].replace(Jo, "'") : e;
1644
- }
1645
- function or(e, t) {
1646
- const n = P(e, t?.in), o = n.getFullYear(), r = n.getMonth(), s = I(n, 0);
1647
- return s.setFullYear(o, r + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
1648
- }
1649
- function rr(e, t) {
1650
- return P(e, t?.in).getMonth();
1651
- }
1652
- function sr(e, t) {
1653
- return P(e, t?.in).getFullYear();
1654
- }
1655
- function ar(e, t) {
1656
- return +P(e) > +P(t);
1657
- }
1658
- function ir(e, t) {
1659
- return +P(e) < +P(t);
1660
- }
1661
- function cr(e, t, n) {
1662
- const [o, r] = be(
1663
- n?.in,
1664
- e,
1665
- t
1666
- );
1667
- return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth();
1668
- }
1669
- function ur(e, t, n) {
1670
- const [o, r] = be(
1671
- n?.in,
1672
- e,
1673
- t
1674
- );
1675
- return o.getFullYear() === r.getFullYear();
1676
- }
1677
- function lr(e, t, n) {
1678
- const o = P(e, n?.in), r = o.getFullYear(), s = o.getDate(), i = I(e, 0);
1679
- i.setFullYear(r, t, 15), i.setHours(0, 0, 0, 0);
1680
- const a = or(i);
1681
- return o.setMonth(t, Math.min(s, a)), o;
1682
- }
1683
- function dr(e, t, n) {
1684
- const o = P(e, n?.in);
1685
- return isNaN(+o) ? I(e, NaN) : (o.setFullYear(t), o);
1686
- }
1687
- function fr(e, t, n = "long") {
1688
- return new Intl.DateTimeFormat("en-US", {
1689
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
1690
- hour: "numeric",
1691
- timeZone: e,
1692
- timeZoneName: n
1693
- }).format(t).split(/\s/g).slice(2).join(" ");
1694
- }
1695
- const hr = {}, ke = {};
1696
- function de(e, t) {
1697
- try {
1698
- const o = (hr[e] ||= new Intl.DateTimeFormat("en-US", {
1699
- timeZone: e,
1700
- timeZoneName: "longOffset"
1701
- }).format)(t).split("GMT")[1];
1702
- return o in ke ? ke[o] : ut(o, o.split(":"));
1703
- } catch {
1704
- if (e in ke) return ke[e];
1705
- const n = e?.match(mr);
1706
- return n ? ut(e, n.slice(1)) : NaN;
1707
- }
1708
- }
1709
- const mr = /([+-]\d\d):?(\d\d)?/;
1710
- function ut(e, t) {
1711
- const n = +(t[0] || 0), o = +(t[1] || 0), r = +(t[2] || 0) / 60;
1712
- return ke[e] = n * 60 + o > 0 ? n * 60 + o + r : n * 60 - o - r;
1713
- }
1714
- class ee extends Date {
1715
- //#region static
1716
- constructor(...t) {
1717
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(de(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Pt(this), Ge(this)) : this.setTime(Date.now());
1718
- }
1719
- static tz(t, ...n) {
1720
- return n.length ? new ee(...n, t) : new ee(Date.now(), t);
1721
- }
1722
- //#endregion
1723
- //#region time zone
1724
- withTimeZone(t) {
1725
- return new ee(+this, t);
1726
- }
1727
- getTimezoneOffset() {
1728
- const t = -de(this.timeZone, this);
1729
- return t > 0 ? Math.floor(t) : Math.ceil(t);
1730
- }
1731
- //#endregion
1732
- //#region time
1733
- setTime(t) {
1734
- return Date.prototype.setTime.apply(this, arguments), Ge(this), +this;
1735
- }
1736
- //#endregion
1737
- //#region date-fns integration
1738
- [Symbol.for("constructDateFrom")](t) {
1739
- return new ee(+new Date(t), this.timeZone);
1740
- }
1741
- //#endregion
1742
- }
1743
- const lt = /^(get|set)(?!UTC)/;
1744
- Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
1745
- if (!lt.test(e)) return;
1746
- const t = e.replace(lt, "$1UTC");
1747
- ee.prototype[t] && (e.startsWith("get") ? ee.prototype[e] = function() {
1748
- return this.internal[t]();
1749
- } : (ee.prototype[e] = function() {
1750
- return Date.prototype[t].apply(this.internal, arguments), yr(this), +this;
1751
- }, ee.prototype[t] = function() {
1752
- return Date.prototype[t].apply(this, arguments), Ge(this), +this;
1753
- }));
1754
- });
1755
- function Ge(e) {
1756
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-de(e.timeZone, e) * 60));
1757
- }
1758
- function yr(e) {
1759
- Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Pt(e);
1760
- }
1761
- function Pt(e) {
1762
- const t = de(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), o = /* @__PURE__ */ new Date(+e);
1763
- o.setUTCHours(o.getUTCHours() - 1);
1764
- const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+o)).getTimezoneOffset(), i = r - s, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
1765
- i && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
1766
- const c = r - n;
1767
- c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
1768
- const l = /* @__PURE__ */ new Date(+e);
1769
- l.setUTCSeconds(0);
1770
- const d = r > 0 ? l.getSeconds() : (l.getSeconds() - 60) % 60, u = Math.round(-(de(e.timeZone, e) * 60)) % 60;
1771
- (u || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + d));
1772
- const f = de(e.timeZone, e), m = f > 0 ? Math.floor(f) : Math.ceil(f), b = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - m, w = m !== n, O = b - c;
1773
- if (w && O) {
1774
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + O);
1775
- const x = de(e.timeZone, e), v = x > 0 ? Math.floor(x) : Math.ceil(x), _ = m - v;
1776
- _ && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + _), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + _));
1777
- }
1778
- }
1779
- class $ extends ee {
1780
- //#region static
1781
- static tz(t, ...n) {
1782
- return n.length ? new $(...n, t) : new $(Date.now(), t);
1783
- }
1784
- //#endregion
1785
- //#region representation
1786
- toISOString() {
1787
- const [t, n, o] = this.tzComponents(), r = `${t}${n}:${o}`;
1788
- return this.internal.toISOString().slice(0, -1) + r;
1789
- }
1790
- toString() {
1791
- return `${this.toDateString()} ${this.toTimeString()}`;
1792
- }
1793
- toDateString() {
1794
- const [t, n, o, r] = this.internal.toUTCString().split(" ");
1795
- return `${t?.slice(0, -1)} ${o} ${n} ${r}`;
1796
- }
1797
- toTimeString() {
1798
- const t = this.internal.toUTCString().split(" ")[4], [n, o, r] = this.tzComponents();
1799
- return `${t} GMT${n}${o}${r} (${fr(this.timeZone, this)})`;
1800
- }
1801
- toLocaleString(t, n) {
1802
- return Date.prototype.toLocaleString.call(this, t, {
1803
- ...n,
1804
- timeZone: n?.timeZone || this.timeZone
1805
- });
1806
- }
1807
- toLocaleDateString(t, n) {
1808
- return Date.prototype.toLocaleDateString.call(this, t, {
1809
- ...n,
1810
- timeZone: n?.timeZone || this.timeZone
1811
- });
1812
- }
1813
- toLocaleTimeString(t, n) {
1814
- return Date.prototype.toLocaleTimeString.call(this, t, {
1815
- ...n,
1816
- timeZone: n?.timeZone || this.timeZone
1817
- });
1818
- }
1819
- //#endregion
1820
- //#region private
1821
- tzComponents() {
1822
- const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", o = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), r = String(Math.abs(t) % 60).padStart(2, "0");
1823
- return [n, o, r];
1824
- }
1825
- //#endregion
1826
- withTimeZone(t) {
1827
- return new $(+this, t);
1828
- }
1829
- //#region date-fns integration
1830
- [Symbol.for("constructDateFrom")](t) {
1831
- return new $(+new Date(t), this.timeZone);
1832
- }
1833
- //#endregion
1834
- }
1835
- const dt = 5, gr = 4;
1836
- function br(e, t) {
1837
- const n = t.startOfMonth(e), o = n.getDay() > 0 ? n.getDay() : 7, r = t.addDays(e, -o + 1), s = t.addDays(r, dt * 7 - 1);
1838
- return t.getMonth(e) === t.getMonth(s) ? dt : gr;
1839
- }
1840
- function Yt(e, t) {
1841
- const n = t.startOfMonth(e), o = n.getDay();
1842
- return o === 1 ? n : o === 0 ? t.addDays(n, -1 * 6) : t.addDays(n, -1 * (o - 1));
1843
- }
1844
- function pr(e, t) {
1845
- const n = Yt(e, t), o = br(e, t);
1846
- return t.addDays(n, o * 7 - 1);
1847
- }
1848
- class Q {
1849
- /**
1850
- * Creates an instance of `DateLib`.
1851
- *
1852
- * @param options Configuration options for the date library.
1853
- * @param overrides Custom overrides for the date library functions.
1854
- */
1855
- constructor(t, n) {
1856
- this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? $.tz(this.options.timeZone) : new this.Date(), this.newDate = (o, r, s) => this.overrides?.newDate ? this.overrides.newDate(o, r, s) : this.options.timeZone ? new $(o, r, s, this.options.timeZone) : new Date(o, r, s), this.addDays = (o, r) => this.overrides?.addDays ? this.overrides.addDays(o, r) : Dt(o, r), this.addMonths = (o, r) => this.overrides?.addMonths ? this.overrides.addMonths(o, r) : Ot(o, r), this.addWeeks = (o, r) => this.overrides?.addWeeks ? this.overrides.addWeeks(o, r) : Ln(o, r), this.addYears = (o, r) => this.overrides?.addYears ? this.overrides.addYears(o, r) : Vn(o, r), this.differenceInCalendarDays = (o, r) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(o, r) : ce(o, r), this.differenceInCalendarMonths = (o, r) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(o, r) : Jn(o, r), this.eachMonthOfInterval = (o) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(o) : no(o), this.endOfBroadcastWeek = (o) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(o) : pr(o, this), this.endOfISOWeek = (o) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(o) : so(o), this.endOfMonth = (o) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(o) : eo(o), this.endOfWeek = (o, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(o, r) : Wt(o, this.options), this.endOfYear = (o) => this.overrides?.endOfYear ? this.overrides.endOfYear(o) : ro(o), this.format = (o, r, s) => {
1857
- const i = this.overrides?.format ? this.overrides.format(o, r, this.options) : tr(o, r, this.options);
1858
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
1859
- }, this.getISOWeek = (o) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(o) : St(o), this.getMonth = (o, r) => this.overrides?.getMonth ? this.overrides.getMonth(o, this.options) : rr(o, this.options), this.getYear = (o, r) => this.overrides?.getYear ? this.overrides.getYear(o, this.options) : sr(o, this.options), this.getWeek = (o, r) => this.overrides?.getWeek ? this.overrides.getWeek(o, this.options) : Tt(o, this.options), this.isAfter = (o, r) => this.overrides?.isAfter ? this.overrides.isAfter(o, r) : ar(o, r), this.isBefore = (o, r) => this.overrides?.isBefore ? this.overrides.isBefore(o, r) : ir(o, r), this.isDate = (o) => this.overrides?.isDate ? this.overrides.isDate(o) : Nt(o), this.isSameDay = (o, r) => this.overrides?.isSameDay ? this.overrides.isSameDay(o, r) : Xn(o, r), this.isSameMonth = (o, r) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(o, r) : cr(o, r), this.isSameYear = (o, r) => this.overrides?.isSameYear ? this.overrides.isSameYear(o, r) : ur(o, r), this.max = (o) => this.overrides?.max ? this.overrides.max(o) : Qn(o), this.min = (o) => this.overrides?.min ? this.overrides.min(o) : Un(o), this.setMonth = (o, r) => this.overrides?.setMonth ? this.overrides.setMonth(o, r) : lr(o, r), this.setYear = (o, r) => this.overrides?.setYear ? this.overrides.setYear(o, r) : dr(o, r), this.startOfBroadcastWeek = (o, r) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(o, this) : Yt(o, this), this.startOfDay = (o) => this.overrides?.startOfDay ? this.overrides.startOfDay(o) : Ce(o), this.startOfISOWeek = (o) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(o) : Oe(o), this.startOfMonth = (o) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(o) : oo(o), this.startOfWeek = (o, r) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(o, this.options) : ge(o, this.options), this.startOfYear = (o) => this.overrides?.startOfYear ? this.overrides.startOfYear(o) : xt(o), this.options = { locale: Ze, ...t }, this.overrides = n;
1860
- }
1861
- /**
1862
- * Generates a mapping of Arabic digits (0-9) to the target numbering system
1863
- * digits.
1864
- *
1865
- * @since 9.5.0
1866
- * @returns A record mapping Arabic digits to the target numerals.
1867
- */
1868
- getDigitMap() {
1869
- const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
1870
- numberingSystem: t
1871
- }), o = {};
1872
- for (let r = 0; r < 10; r++)
1873
- o[r.toString()] = n.format(r);
1874
- return o;
1875
- }
1876
- /**
1877
- * Replaces Arabic digits in a string with the target numbering system digits.
1878
- *
1879
- * @since 9.5.0
1880
- * @param input The string containing Arabic digits.
1881
- * @returns The string with digits replaced.
1882
- */
1883
- replaceDigits(t) {
1884
- const n = this.getDigitMap();
1885
- return t.replace(/\d/g, (o) => n[o] || o);
1886
- }
1887
- /**
1888
- * Formats a number using the configured numbering system.
1889
- *
1890
- * @since 9.5.0
1891
- * @param value The number to format.
1892
- * @returns The formatted number as a string.
1893
- */
1894
- formatNumber(t) {
1895
- return this.replaceDigits(t.toString());
1896
- }
1897
- /**
1898
- * Returns the preferred ordering for month and year labels for the current
1899
- * locale.
1900
- */
1901
- getMonthYearOrder() {
1902
- const t = this.options.locale?.code;
1903
- return t && Q.yearFirstLocales.has(t) ? "year-first" : "month-first";
1904
- }
1905
- /**
1906
- * Formats the month/year pair respecting locale conventions.
1907
- *
1908
- * @since 9.11.0
1909
- */
1910
- formatMonthYear(t) {
1911
- const { locale: n, timeZone: o, numerals: r } = this.options, s = n?.code;
1912
- if (s && Q.yearFirstLocales.has(s))
1913
- try {
1914
- return new Intl.DateTimeFormat(s, {
1915
- month: "long",
1916
- year: "numeric",
1917
- timeZone: o,
1918
- numberingSystem: r
1919
- }).format(t);
1920
- } catch {
1921
- }
1922
- const i = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
1923
- return this.format(t, i);
1924
- }
1925
- }
1926
- Q.yearFirstLocales = /* @__PURE__ */ new Set([
1927
- "eu",
1928
- "hu",
1929
- "ja",
1930
- "ja-Hira",
1931
- "ja-JP",
1932
- "ko",
1933
- "ko-KR",
1934
- "lt",
1935
- "lt-LT",
1936
- "lv",
1937
- "lv-LV",
1938
- "mn",
1939
- "mn-MN",
1940
- "zh",
1941
- "zh-CN",
1942
- "zh-HK",
1943
- "zh-TW"
1944
- ]);
1945
- const te = new Q();
1946
- class Ft {
1947
- constructor(t, n, o = te) {
1948
- this.date = t, this.displayMonth = n, this.outside = !!(n && !o.isSameMonth(t, n)), this.dateLib = o;
1949
- }
1950
- /**
1951
- * Checks if this day is equal to another `CalendarDay`, considering both the
1952
- * date and the displayed month.
1953
- *
1954
- * @param day The `CalendarDay` to compare with.
1955
- * @returns `true` if the days are equal, otherwise `false`.
1956
- */
1957
- isEqualTo(t) {
1958
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
1959
- }
1960
- }
1961
- class wr {
1962
- constructor(t, n) {
1963
- this.date = t, this.weeks = n;
1964
- }
1965
- }
1966
- class vr {
1967
- constructor(t, n) {
1968
- this.days = n, this.weekNumber = t;
1969
- }
1970
- }
1971
- function Mr(e) {
1972
- return h.createElement("button", { ...e });
1973
- }
1974
- function kr(e) {
1975
- return h.createElement("span", { ...e });
1976
- }
1977
- function Dr(e) {
1978
- const { size: t = 24, orientation: n = "left", className: o } = e;
1979
- return (
1980
- // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
1981
- h.createElement(
1982
- "svg",
1983
- { className: o, width: t, height: t, viewBox: "0 0 24 24" },
1984
- n === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
1985
- n === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
1986
- n === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
1987
- n === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
1988
- )
1989
- );
1990
- }
1991
- function Or(e) {
1992
- const { day: t, modifiers: n, ...o } = e;
1993
- return h.createElement("td", { ...o });
1994
- }
1995
- function Cr(e) {
1996
- const { day: t, modifiers: n, ...o } = e, r = h.useRef(null);
1997
- return h.useEffect(() => {
1998
- n.focused && r.current?.focus();
1999
- }, [n.focused]), h.createElement("button", { ref: r, ...o });
2000
- }
2001
- var g;
2002
- (function(e) {
2003
- e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
2004
- })(g || (g = {}));
2005
- var B;
2006
- (function(e) {
2007
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
2008
- })(B || (B = {}));
2009
- var K;
2010
- (function(e) {
2011
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
2012
- })(K || (K = {}));
2013
- var V;
2014
- (function(e) {
2015
- e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
2016
- })(V || (V = {}));
2017
- function Nr(e) {
2018
- const { options: t, className: n, components: o, classNames: r, ...s } = e, i = [r[g.Dropdown], n].join(" "), a = t?.find(({ value: c }) => c === s.value);
2019
- return h.createElement(
2020
- "span",
2021
- { "data-disabled": s.disabled, className: r[g.DropdownRoot] },
2022
- h.createElement(o.Select, { className: i, ...s }, t?.map(({ value: c, label: l, disabled: d }) => h.createElement(o.Option, { key: c, value: c, disabled: d }, l))),
2023
- h.createElement(
2024
- "span",
2025
- { className: r[g.CaptionLabel], "aria-hidden": !0 },
2026
- a?.label,
2027
- h.createElement(o.Chevron, { orientation: "down", size: 18, className: r[g.Chevron] })
2028
- )
2029
- );
2030
- }
2031
- function xr(e) {
2032
- return h.createElement("div", { ...e });
2033
- }
2034
- function Wr(e) {
2035
- return h.createElement("div", { ...e });
2036
- }
2037
- function Sr(e) {
2038
- const { calendarMonth: t, displayIndex: n, ...o } = e;
2039
- return h.createElement("div", { ...o }, e.children);
2040
- }
2041
- function _r(e) {
2042
- const { calendarMonth: t, displayIndex: n, ...o } = e;
2043
- return h.createElement("div", { ...o });
2044
- }
2045
- function Tr(e) {
2046
- return h.createElement("table", { ...e });
2047
- }
2048
- function Er(e) {
2049
- return h.createElement("div", { ...e });
2050
- }
2051
- const Bt = On(void 0);
2052
- function fe() {
2053
- const e = Cn(Bt);
2054
- if (e === void 0)
2055
- throw new Error("useDayPicker() must be used within a custom component.");
2056
- return e;
2057
- }
2058
- function Pr(e) {
2059
- const { components: t } = fe();
2060
- return h.createElement(t.Dropdown, { ...e });
2061
- }
2062
- function Yr(e) {
2063
- const { onPreviousClick: t, onNextClick: n, previousMonth: o, nextMonth: r, ...s } = e, { components: i, classNames: a, labels: { labelPrevious: c, labelNext: l } } = fe(), d = U((f) => {
2064
- r && n?.(f);
2065
- }, [r, n]), u = U((f) => {
2066
- o && t?.(f);
2067
- }, [o, t]);
2068
- return h.createElement(
2069
- "nav",
2070
- { ...s },
2071
- h.createElement(
2072
- i.PreviousMonthButton,
2073
- { type: "button", className: a[g.PreviousMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": c(o), onClick: u },
2074
- h.createElement(i.Chevron, { disabled: o ? void 0 : !0, className: a[g.Chevron], orientation: "left" })
2075
- ),
2076
- h.createElement(
2077
- i.NextMonthButton,
2078
- { type: "button", className: a[g.NextMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": l(r), onClick: d },
2079
- h.createElement(i.Chevron, { disabled: r ? void 0 : !0, orientation: "right", className: a[g.Chevron] })
2080
- )
2081
- );
2082
- }
2083
- function Fr(e) {
2084
- const { components: t } = fe();
2085
- return h.createElement(t.Button, { ...e });
2086
- }
2087
- function Br(e) {
2088
- return h.createElement("option", { ...e });
2089
- }
2090
- function jr(e) {
2091
- const { components: t } = fe();
2092
- return h.createElement(t.Button, { ...e });
2093
- }
2094
- function Ir(e) {
2095
- const { rootRef: t, ...n } = e;
2096
- return h.createElement("div", { ...n, ref: t });
2097
- }
2098
- function Ar(e) {
2099
- return h.createElement("select", { ...e });
2100
- }
2101
- function Hr(e) {
2102
- const { week: t, ...n } = e;
2103
- return h.createElement("tr", { ...n });
2104
- }
2105
- function qr(e) {
2106
- return h.createElement("th", { ...e });
2107
- }
2108
- function $r(e) {
2109
- return h.createElement(
2110
- "thead",
2111
- { "aria-hidden": !0 },
2112
- h.createElement("tr", { ...e })
2113
- );
2114
- }
2115
- function Rr(e) {
2116
- const { week: t, ...n } = e;
2117
- return h.createElement("th", { ...n });
2118
- }
2119
- function Gr(e) {
2120
- return h.createElement("th", { ...e });
2121
- }
2122
- function Zr(e) {
2123
- return h.createElement("tbody", { ...e });
2124
- }
2125
- function zr(e) {
2126
- const { components: t } = fe();
2127
- return h.createElement(t.Dropdown, { ...e });
2128
- }
2129
- const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2130
- __proto__: null,
2131
- Button: Mr,
2132
- CaptionLabel: kr,
2133
- Chevron: Dr,
2134
- Day: Or,
2135
- DayButton: Cr,
2136
- Dropdown: Nr,
2137
- DropdownNav: xr,
2138
- Footer: Wr,
2139
- Month: Sr,
2140
- MonthCaption: _r,
2141
- MonthGrid: Tr,
2142
- Months: Er,
2143
- MonthsDropdown: Pr,
2144
- Nav: Yr,
2145
- NextMonthButton: Fr,
2146
- Option: Br,
2147
- PreviousMonthButton: jr,
2148
- Root: Ir,
2149
- Select: Ar,
2150
- Week: Hr,
2151
- WeekNumber: Rr,
2152
- WeekNumberHeader: Gr,
2153
- Weekday: qr,
2154
- Weekdays: $r,
2155
- Weeks: Zr,
2156
- YearsDropdown: zr
2157
- }, Symbol.toStringTag, { value: "Module" }));
2158
- function oe(e, t, n = !1, o = te) {
2159
- let { from: r, to: s } = e;
2160
- const { differenceInCalendarDays: i, isSameDay: a } = o;
2161
- return r && s ? (i(s, r) < 0 && ([r, s] = [s, r]), i(t, r) >= (n ? 1 : 0) && i(s, t) >= (n ? 1 : 0)) : !n && s ? a(s, t) : !n && r ? a(r, t) : !1;
2162
- }
2163
- function jt(e) {
2164
- return !!(e && typeof e == "object" && "before" in e && "after" in e);
2165
- }
2166
- function ze(e) {
2167
- return !!(e && typeof e == "object" && "from" in e);
2168
- }
2169
- function It(e) {
2170
- return !!(e && typeof e == "object" && "after" in e);
2171
- }
2172
- function At(e) {
2173
- return !!(e && typeof e == "object" && "before" in e);
2174
- }
2175
- function Ht(e) {
2176
- return !!(e && typeof e == "object" && "dayOfWeek" in e);
2177
- }
2178
- function qt(e, t) {
2179
- return Array.isArray(e) && e.every(t.isDate);
2180
- }
2181
- function re(e, t, n = te) {
2182
- const o = Array.isArray(t) ? t : [t], { isSameDay: r, differenceInCalendarDays: s, isAfter: i } = n;
2183
- return o.some((a) => {
2184
- if (typeof a == "boolean")
2185
- return a;
2186
- if (n.isDate(a))
2187
- return r(e, a);
2188
- if (qt(a, n))
2189
- return a.includes(e);
2190
- if (ze(a))
2191
- return oe(a, e, !1, n);
2192
- if (Ht(a))
2193
- return Array.isArray(a.dayOfWeek) ? a.dayOfWeek.includes(e.getDay()) : a.dayOfWeek === e.getDay();
2194
- if (jt(a)) {
2195
- const c = s(a.before, e), l = s(a.after, e), d = c > 0, u = l < 0;
2196
- return i(a.before, a.after) ? u && d : d || u;
2197
- }
2198
- return It(a) ? s(e, a.after) > 0 : At(a) ? s(a.before, e) > 0 : typeof a == "function" ? a(e) : !1;
2199
- });
2200
- }
2201
- function Vr(e, t, n, o, r) {
2202
- const { disabled: s, hidden: i, modifiers: a, showOutsideDays: c, broadcastCalendar: l, today: d } = t, { isSameDay: u, isSameMonth: f, startOfMonth: m, isBefore: p, endOfMonth: b, isAfter: w } = r, O = n && m(n), x = o && b(o), v = {
2203
- [B.focused]: [],
2204
- [B.outside]: [],
2205
- [B.disabled]: [],
2206
- [B.hidden]: [],
2207
- [B.today]: []
2208
- }, _ = {};
2209
- for (const y of e) {
2210
- const { date: k, displayMonth: M } = y, N = !!(M && !f(k, M)), A = !!(O && p(k, O)), H = !!(x && w(k, x)), q = !!(s && re(k, s, r)), G = !!(i && re(k, i, r)) || A || H || // Broadcast calendar will show outside days as default
2211
- !l && !c && N || l && c === !1 && N, ne = u(k, d ?? r.today());
2212
- N && v.outside.push(y), q && v.disabled.push(y), G && v.hidden.push(y), ne && v.today.push(y), a && Object.keys(a).forEach((se) => {
2213
- const ae = a?.[se];
2214
- ae && re(k, ae, r) && (_[se] ? _[se].push(y) : _[se] = [y]);
2215
- });
2216
- }
2217
- return (y) => {
2218
- const k = {
2219
- [B.focused]: !1,
2220
- [B.disabled]: !1,
2221
- [B.hidden]: !1,
2222
- [B.outside]: !1,
2223
- [B.today]: !1
2224
- }, M = {};
2225
- for (const N in v) {
2226
- const A = v[N];
2227
- k[N] = A.some((H) => H === y);
2228
- }
2229
- for (const N in _)
2230
- M[N] = _[N].some((A) => A === y);
2231
- return {
2232
- ...k,
2233
- // custom modifiers should override all the previous ones
2234
- ...M
2235
- };
2236
- };
2237
- }
2238
- function Qr(e, t, n = {}) {
2239
- return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [s]) => (n[s] ? r.push(n[s]) : t[B[s]] ? r.push(t[B[s]]) : t[K[s]] && r.push(t[K[s]]), r), [t[g.Day]]);
2240
- }
2241
- function Ur(e) {
2242
- return {
2243
- ...Lr,
2244
- ...e
2245
- };
2246
- }
2247
- function Xr(e) {
2248
- const t = {
2249
- "data-mode": e.mode ?? void 0,
2250
- "data-required": "required" in e ? e.required : void 0,
2251
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
2252
- "data-week-numbers": e.showWeekNumber || void 0,
2253
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
2254
- "data-nav-layout": e.navLayout || void 0
2255
- };
2256
- return Object.entries(e).forEach(([n, o]) => {
2257
- n.startsWith("data-") && (t[n] = o);
2258
- }), t;
2259
- }
2260
- function Kr() {
2261
- const e = {};
2262
- for (const t in g)
2263
- e[g[t]] = `rdp-${g[t]}`;
2264
- for (const t in B)
2265
- e[B[t]] = `rdp-${B[t]}`;
2266
- for (const t in K)
2267
- e[K[t]] = `rdp-${K[t]}`;
2268
- for (const t in V)
2269
- e[V[t]] = `rdp-${V[t]}`;
2270
- return e;
2271
- }
2272
- function $t(e, t, n) {
2273
- return (n ?? new Q(t)).formatMonthYear(e);
2274
- }
2275
- const Jr = $t;
2276
- function es(e, t, n) {
2277
- return (n ?? new Q(t)).format(e, "d");
2278
- }
2279
- function ts(e, t = te) {
2280
- return t.format(e, "LLLL");
2281
- }
2282
- function ns(e, t, n) {
2283
- return (n ?? new Q(t)).format(e, "cccccc");
2284
- }
2285
- function os(e, t = te) {
2286
- return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
2287
- }
2288
- function rs() {
2289
- return "";
2290
- }
2291
- function Rt(e, t = te) {
2292
- return t.format(e, "yyyy");
2293
- }
2294
- const ss = Rt, as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2295
- __proto__: null,
2296
- formatCaption: $t,
2297
- formatDay: es,
2298
- formatMonthCaption: Jr,
2299
- formatMonthDropdown: ts,
2300
- formatWeekNumber: os,
2301
- formatWeekNumberHeader: rs,
2302
- formatWeekdayName: ns,
2303
- formatYearCaption: ss,
2304
- formatYearDropdown: Rt
2305
- }, Symbol.toStringTag, { value: "Module" }));
2306
- function is(e) {
2307
- return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
2308
- ...as,
2309
- ...e
2310
- };
2311
- }
2312
- function cs(e, t, n, o, r) {
2313
- const { startOfMonth: s, startOfYear: i, endOfYear: a, eachMonthOfInterval: c, getMonth: l } = r;
2314
- return c({
2315
- start: i(e),
2316
- end: a(e)
2317
- }).map((f) => {
2318
- const m = o.formatMonthDropdown(f, r), p = l(f), b = t && f < s(t) || n && f > s(n) || !1;
2319
- return { value: p, label: m, disabled: b };
2320
- });
2321
- }
2322
- function us(e, t = {}, n = {}) {
2323
- let o = { ...t?.[g.Day] };
2324
- return Object.entries(e).filter(([, r]) => r === !0).forEach(([r]) => {
2325
- o = {
2326
- ...o,
2327
- ...n?.[r]
2328
- };
2329
- }), o;
2330
- }
2331
- function ls(e, t, n) {
2332
- const o = e.today(), r = t ? e.startOfISOWeek(o) : e.startOfWeek(o), s = [];
2333
- for (let i = 0; i < 7; i++) {
2334
- const a = e.addDays(r, i);
2335
- s.push(a);
2336
- }
2337
- return s;
2338
- }
2339
- function ds(e, t, n, o, r = !1) {
2340
- if (!e || !t)
2341
- return;
2342
- const { startOfYear: s, endOfYear: i, addYears: a, getYear: c, isBefore: l, isSameYear: d } = o, u = s(e), f = i(t), m = [];
2343
- let p = u;
2344
- for (; l(p, f) || d(p, f); )
2345
- m.push(p), p = a(p, 1);
2346
- return r && m.reverse(), m.map((b) => {
2347
- const w = n.formatYearDropdown(b, o);
2348
- return {
2349
- value: c(b),
2350
- label: w,
2351
- disabled: !1
2352
- };
2353
- });
2354
- }
2355
- function Gt(e, t, n, o) {
2356
- let r = (o ?? new Q(n)).format(e, "PPPP");
2357
- return t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r;
2358
- }
2359
- const fs = Gt;
2360
- function Zt(e, t, n) {
2361
- return (n ?? new Q(t)).formatMonthYear(e);
2362
- }
2363
- const hs = Zt;
2364
- function ms(e, t, n, o) {
2365
- let r = (o ?? new Q(n)).format(e, "PPPP");
2366
- return t?.today && (r = `Today, ${r}`), r;
2367
- }
2368
- function ys(e) {
2369
- return "Choose the Month";
2370
- }
2371
- function gs() {
2372
- return "";
2373
- }
2374
- function zt(e) {
2375
- return "Go to the Next Month";
2376
- }
2377
- function Lt(e) {
2378
- return "Go to the Previous Month";
2379
- }
2380
- function bs(e, t, n) {
2381
- return (n ?? new Q(t)).format(e, "cccc");
2382
- }
2383
- function ps(e, t) {
2384
- return `Week ${e}`;
2385
- }
2386
- function ws(e) {
2387
- return "Week Number";
2388
- }
2389
- function vs(e) {
2390
- return "Choose the Year";
2391
- }
2392
- const Ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2393
- __proto__: null,
2394
- labelCaption: hs,
2395
- labelDay: fs,
2396
- labelDayButton: Gt,
2397
- labelGrid: Zt,
2398
- labelGridcell: ms,
2399
- labelMonthDropdown: ys,
2400
- labelNav: gs,
2401
- labelNext: zt,
2402
- labelPrevious: Lt,
2403
- labelWeekNumber: ps,
2404
- labelWeekNumberHeader: ws,
2405
- labelWeekday: bs,
2406
- labelYearDropdown: vs
2407
- }, Symbol.toStringTag, { value: "Module" })), xe = (e) => e instanceof HTMLElement ? e : null, je = (e) => [
2408
- ...e.querySelectorAll("[data-animated-month]") ?? []
2409
- ], ks = (e) => xe(e.querySelector("[data-animated-month]")), Ie = (e) => xe(e.querySelector("[data-animated-caption]")), Ae = (e) => xe(e.querySelector("[data-animated-weeks]")), Ds = (e) => xe(e.querySelector("[data-animated-nav]")), Os = (e) => xe(e.querySelector("[data-animated-weekdays]"));
2410
- function Cs(e, t, { classNames: n, months: o, focused: r, dateLib: s }) {
2411
- const i = Se(null), a = Se(o), c = Se(!1);
2412
- Nn(() => {
2413
- const l = a.current;
2414
- if (a.current = o, !t || !e.current || // safety check because the ref can be set to anything by consumers
2415
- !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
2416
- o.length === 0 || l.length === 0 || o.length !== l.length)
2417
- return;
2418
- const d = s.isSameMonth(o[0].date, l[0].date), u = s.isAfter(o[0].date, l[0].date), f = u ? n[V.caption_after_enter] : n[V.caption_before_enter], m = u ? n[V.weeks_after_enter] : n[V.weeks_before_enter], p = i.current, b = e.current.cloneNode(!0);
2419
- if (b instanceof HTMLElement ? (je(b).forEach((v) => {
2420
- if (!(v instanceof HTMLElement))
2421
- return;
2422
- const _ = ks(v);
2423
- _ && v.contains(_) && v.removeChild(_);
2424
- const y = Ie(v);
2425
- y && y.classList.remove(f);
2426
- const k = Ae(v);
2427
- k && k.classList.remove(m);
2428
- }), i.current = b) : i.current = null, c.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
2429
- r)
2430
- return;
2431
- const w = p instanceof HTMLElement ? je(p) : [], O = je(e.current);
2432
- if (O?.every((x) => x instanceof HTMLElement) && w && w.every((x) => x instanceof HTMLElement)) {
2433
- c.current = !0, e.current.style.isolation = "isolate";
2434
- const x = Ds(e.current);
2435
- x && (x.style.zIndex = "1"), O.forEach((v, _) => {
2436
- const y = w[_];
2437
- if (!y)
2438
- return;
2439
- v.style.position = "relative", v.style.overflow = "hidden";
2440
- const k = Ie(v);
2441
- k && k.classList.add(f);
2442
- const M = Ae(v);
2443
- M && M.classList.add(m);
2444
- const N = () => {
2445
- c.current = !1, e.current && (e.current.style.isolation = ""), x && (x.style.zIndex = ""), k && k.classList.remove(f), M && M.classList.remove(m), v.style.position = "", v.style.overflow = "", v.contains(y) && v.removeChild(y);
2446
- };
2447
- y.style.pointerEvents = "none", y.style.position = "absolute", y.style.overflow = "hidden", y.setAttribute("aria-hidden", "true");
2448
- const A = Os(y);
2449
- A && (A.style.opacity = "0");
2450
- const H = Ie(y);
2451
- H && (H.classList.add(u ? n[V.caption_before_exit] : n[V.caption_after_exit]), H.addEventListener("animationend", N));
2452
- const q = Ae(y);
2453
- q && q.classList.add(u ? n[V.weeks_before_exit] : n[V.weeks_after_exit]), v.insertBefore(y, v.firstChild);
2454
- });
2455
- }
2456
- });
2457
- }
2458
- function Ns(e, t, n, o) {
2459
- const r = e[0], s = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } = n ?? {}, { addDays: l, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: f, endOfISOWeek: m, endOfMonth: p, endOfWeek: b, isAfter: w, startOfBroadcastWeek: O, startOfISOWeek: x, startOfWeek: v } = o, _ = c ? O(r, o) : i ? x(r) : v(r), y = c ? f(s) : i ? m(p(s)) : b(p(s)), k = d(y, _), M = u(s, r) + 1, N = [];
2460
- for (let q = 0; q <= k; q++) {
2461
- const G = l(_, q);
2462
- if (t && w(G, t))
2463
- break;
2464
- N.push(G);
2465
- }
2466
- const H = (c ? 35 : 42) * M;
2467
- if (a && N.length < H) {
2468
- const q = H - N.length;
2469
- for (let G = 0; G < q; G++) {
2470
- const ne = l(N[N.length - 1], 1);
2471
- N.push(ne);
2472
- }
2473
- }
2474
- return N;
2475
- }
2476
- function xs(e) {
2477
- const t = [];
2478
- return e.reduce((n, o) => {
2479
- const r = o.weeks.reduce((s, i) => s.concat(i.days.slice()), t.slice());
2480
- return n.concat(r.slice());
2481
- }, t.slice());
2482
- }
2483
- function Ws(e, t, n, o) {
2484
- const { numberOfMonths: r = 1 } = n, s = [];
2485
- for (let i = 0; i < r; i++) {
2486
- const a = o.addMonths(e, i);
2487
- if (t && a > t)
2488
- break;
2489
- s.push(a);
2490
- }
2491
- return s;
2492
- }
2493
- function ft(e, t, n, o) {
2494
- const { month: r, defaultMonth: s, today: i = o.today(), numberOfMonths: a = 1 } = e;
2495
- let c = r || s || i;
2496
- const { differenceInCalendarMonths: l, addMonths: d, startOfMonth: u } = o;
2497
- if (n && l(n, c) < a - 1) {
2498
- const f = -1 * (a - 1);
2499
- c = d(n, f);
2500
- }
2501
- return t && l(c, t) < 0 && (c = t), u(c);
2502
- }
2503
- function Ss(e, t, n, o) {
2504
- const { addDays: r, endOfBroadcastWeek: s, endOfISOWeek: i, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: f, startOfWeek: m } = o, p = e.reduce((b, w) => {
2505
- const O = n.broadcastCalendar ? u(w, o) : n.ISOWeek ? f(w) : m(w), x = n.broadcastCalendar ? s(w) : n.ISOWeek ? i(a(w)) : c(a(w)), v = t.filter((M) => M >= O && M <= x), _ = n.broadcastCalendar ? 35 : 42;
2506
- if (n.fixedWeeks && v.length < _) {
2507
- const M = t.filter((N) => {
2508
- const A = _ - v.length;
2509
- return N > x && N <= r(x, A);
2510
- });
2511
- v.push(...M);
2512
- }
2513
- const y = v.reduce((M, N) => {
2514
- const A = n.ISOWeek ? l(N) : d(N), H = M.find((G) => G.weekNumber === A), q = new Ft(N, w, o);
2515
- return H ? H.days.push(q) : M.push(new vr(A, [q])), M;
2516
- }, []), k = new wr(w, y);
2517
- return b.push(k), b;
2518
- }, []);
2519
- return n.reverseMonths ? p.reverse() : p;
2520
- }
2521
- function _s(e, t) {
2522
- let { startMonth: n, endMonth: o } = e;
2523
- const { startOfYear: r, startOfDay: s, startOfMonth: i, endOfMonth: a, addYears: c, endOfYear: l, newDate: d, today: u } = t, { fromYear: f, toYear: m, fromMonth: p, toMonth: b } = e;
2524
- !n && p && (n = p), !n && f && (n = t.newDate(f, 0, 1)), !o && b && (o = b), !o && m && (o = d(m, 11, 31));
2525
- const w = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
2526
- return n ? n = i(n) : f ? n = d(f, 0, 1) : !n && w && (n = r(c(e.today ?? u(), -100))), o ? o = a(o) : m ? o = d(m, 11, 31) : !o && w && (o = l(e.today ?? u())), [
2527
- n && s(n),
2528
- o && s(o)
2529
- ];
2530
- }
2531
- function Ts(e, t, n, o) {
2532
- if (n.disableNavigation)
2533
- return;
2534
- const { pagedNavigation: r, numberOfMonths: s = 1 } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = o, l = r ? s : 1, d = i(e);
2535
- if (!t)
2536
- return a(d, l);
2537
- if (!(c(t, e) < s))
2538
- return a(d, l);
2539
- }
2540
- function Es(e, t, n, o) {
2541
- if (n.disableNavigation)
2542
- return;
2543
- const { pagedNavigation: r, numberOfMonths: s } = n, { startOfMonth: i, addMonths: a, differenceInCalendarMonths: c } = o, l = r ? s ?? 1 : 1, d = i(e);
2544
- if (!t)
2545
- return a(d, -l);
2546
- if (!(c(d, t) <= 0))
2547
- return a(d, -l);
2548
- }
2549
- function Ps(e) {
2550
- const t = [];
2551
- return e.reduce((n, o) => n.concat(o.weeks.slice()), t.slice());
2552
- }
2553
- function _e(e, t) {
2554
- const [n, o] = $e(e);
2555
- return [t === void 0 ? n : t, o];
2556
- }
2557
- function Ys(e, t) {
2558
- const [n, o] = _s(e, t), { startOfMonth: r, endOfMonth: s } = t, i = ft(e, n, o, t), [a, c] = _e(
2559
- i,
2560
- // initialMonth is always computed from props.month if provided
2561
- e.month ? i : void 0
2562
- );
2563
- xn(() => {
2564
- const k = ft(e, n, o, t);
2565
- c(k);
2566
- }, [e.timeZone]);
2567
- const l = Ws(a, o, e, t), d = Ns(l, e.endMonth ? s(e.endMonth) : void 0, e, t), u = Ss(l, d, e, t), f = Ps(u), m = xs(u), p = Es(a, n, e, t), b = Ts(a, o, e, t), { disableNavigation: w, onMonthChange: O } = e, x = (k) => f.some((M) => M.days.some((N) => N.isEqualTo(k))), v = (k) => {
2568
- if (w)
2569
- return;
2570
- let M = r(k);
2571
- n && M < r(n) && (M = r(n)), o && M > r(o) && (M = r(o)), c(M), O?.(M);
2572
- };
2573
- return {
2574
- months: u,
2575
- weeks: f,
2576
- days: m,
2577
- navStart: n,
2578
- navEnd: o,
2579
- previousMonth: p,
2580
- nextMonth: b,
2581
- goToMonth: v,
2582
- goToDay: (k) => {
2583
- x(k) || v(k.date);
2584
- }
2585
- };
2586
- }
2587
- var J;
2588
- (function(e) {
2589
- e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
2590
- })(J || (J = {}));
2591
- function ht(e) {
2592
- return !e[B.disabled] && !e[B.hidden] && !e[B.outside];
2593
- }
2594
- function Fs(e, t, n, o) {
2595
- let r, s = -1;
2596
- for (const i of e) {
2597
- const a = t(i);
2598
- ht(a) && (a[B.focused] && s < J.FocusedModifier ? (r = i, s = J.FocusedModifier) : o?.isEqualTo(i) && s < J.LastFocused ? (r = i, s = J.LastFocused) : n(i.date) && s < J.Selected ? (r = i, s = J.Selected) : a[B.today] && s < J.Today && (r = i, s = J.Today));
2599
- }
2600
- return r || (r = e.find((i) => ht(t(i)))), r;
2601
- }
2602
- function Bs(e, t, n, o, r, s, i) {
2603
- const { ISOWeek: a, broadcastCalendar: c } = s, { addDays: l, addMonths: d, addWeeks: u, addYears: f, endOfBroadcastWeek: m, endOfISOWeek: p, endOfWeek: b, max: w, min: O, startOfBroadcastWeek: x, startOfISOWeek: v, startOfWeek: _ } = i;
2604
- let k = {
2605
- day: l,
2606
- week: u,
2607
- month: d,
2608
- year: f,
2609
- startOfWeek: (M) => c ? x(M, i) : a ? v(M) : _(M),
2610
- endOfWeek: (M) => c ? m(M) : a ? p(M) : b(M)
2611
- }[e](n, t === "after" ? 1 : -1);
2612
- return t === "before" && o ? k = w([o, k]) : t === "after" && r && (k = O([r, k])), k;
2613
- }
2614
- function Vt(e, t, n, o, r, s, i, a = 0) {
2615
- if (a > 365)
2616
- return;
2617
- const c = Bs(e, t, n.date, o, r, s, i), l = !!(s.disabled && re(c, s.disabled, i)), d = !!(s.hidden && re(c, s.hidden, i)), u = c, f = new Ft(c, u, i);
2618
- return !l && !d ? f : Vt(e, t, f, o, r, s, i, a + 1);
2619
- }
2620
- function js(e, t, n, o, r) {
2621
- const { autoFocus: s } = e, [i, a] = $e(), c = Fs(t.days, n, o || (() => !1), i), [l, d] = $e(s ? c : void 0);
2622
- return {
2623
- isFocusTarget: (b) => !!c?.isEqualTo(b),
2624
- setFocused: d,
2625
- focused: l,
2626
- blur: () => {
2627
- a(l), d(void 0);
2628
- },
2629
- moveFocus: (b, w) => {
2630
- if (!l)
2631
- return;
2632
- const O = Vt(b, w, l, t.navStart, t.navEnd, e, r);
2633
- O && (t.goToDay(O), d(O));
2634
- }
2635
- };
2636
- }
2637
- function Is(e, t) {
2638
- const { selected: n, required: o, onSelect: r } = e, [s, i] = _e(n, r ? n : void 0), a = r ? n : s, { isSameDay: c } = t, l = (m) => a?.some((p) => c(p, m)) ?? !1, { min: d, max: u } = e;
2639
- return {
2640
- selected: a,
2641
- select: (m, p, b) => {
2642
- let w = [...a ?? []];
2643
- if (l(m)) {
2644
- if (a?.length === d || o && a?.length === 1)
2645
- return;
2646
- w = a?.filter((O) => !c(O, m));
2647
- } else
2648
- a?.length === u ? w = [m] : w = [...w, m];
2649
- return r || i(w), r?.(w, m, p, b), w;
2650
- },
2651
- isSelected: l
2652
- };
2653
- }
2654
- function As(e, t, n = 0, o = 0, r = !1, s = te) {
2655
- const { from: i, to: a } = t || {}, { isSameDay: c, isAfter: l, isBefore: d } = s;
2656
- let u;
2657
- if (!i && !a)
2658
- u = { from: e, to: n > 0 ? void 0 : e };
2659
- else if (i && !a)
2660
- c(i, e) ? n === 0 ? u = { from: i, to: e } : r ? u = { from: i, to: void 0 } : u = void 0 : d(e, i) ? u = { from: e, to: i } : u = { from: i, to: e };
2661
- else if (i && a)
2662
- if (c(i, e) && c(a, e))
2663
- r ? u = { from: i, to: a } : u = void 0;
2664
- else if (c(i, e))
2665
- u = { from: i, to: n > 0 ? void 0 : e };
2666
- else if (c(a, e))
2667
- u = { from: e, to: n > 0 ? void 0 : e };
2668
- else if (d(e, i))
2669
- u = { from: e, to: a };
2670
- else if (l(e, i))
2671
- u = { from: i, to: e };
2672
- else if (l(e, a))
2673
- u = { from: i, to: e };
2674
- else
2675
- throw new Error("Invalid range");
2676
- if (u?.from && u?.to) {
2677
- const f = s.differenceInCalendarDays(u.to, u.from);
2678
- o > 0 && f > o ? u = { from: e, to: void 0 } : n > 1 && f < n && (u = { from: e, to: void 0 });
2679
- }
2680
- return u;
2681
- }
2682
- function Hs(e, t, n = te) {
2683
- const o = Array.isArray(t) ? t : [t];
2684
- let r = e.from;
2685
- const s = n.differenceInCalendarDays(e.to, e.from), i = Math.min(s, 6);
2686
- for (let a = 0; a <= i; a++) {
2687
- if (o.includes(r.getDay()))
2688
- return !0;
2689
- r = n.addDays(r, 1);
2690
- }
2691
- return !1;
2692
- }
2693
- function mt(e, t, n = te) {
2694
- return oe(e, t.from, !1, n) || oe(e, t.to, !1, n) || oe(t, e.from, !1, n) || oe(t, e.to, !1, n);
2695
- }
2696
- function qs(e, t, n = te) {
2697
- const o = Array.isArray(t) ? t : [t];
2698
- if (o.filter((a) => typeof a != "function").some((a) => typeof a == "boolean" ? a : n.isDate(a) ? oe(e, a, !1, n) : qt(a, n) ? a.some((c) => oe(e, c, !1, n)) : ze(a) ? a.from && a.to ? mt(e, { from: a.from, to: a.to }, n) : !1 : Ht(a) ? Hs(e, a.dayOfWeek, n) : jt(a) ? n.isAfter(a.before, a.after) ? mt(e, {
2699
- from: n.addDays(a.after, 1),
2700
- to: n.addDays(a.before, -1)
2701
- }, n) : re(e.from, a, n) || re(e.to, a, n) : It(a) || At(a) ? re(e.from, a, n) || re(e.to, a, n) : !1))
2702
- return !0;
2703
- const i = o.filter((a) => typeof a == "function");
2704
- if (i.length) {
2705
- let a = e.from;
2706
- const c = n.differenceInCalendarDays(e.to, e.from);
2707
- for (let l = 0; l <= c; l++) {
2708
- if (i.some((d) => d(a)))
2709
- return !0;
2710
- a = n.addDays(a, 1);
2711
- }
2712
- }
2713
- return !1;
2714
- }
2715
- function $s(e, t) {
2716
- const { disabled: n, excludeDisabled: o, selected: r, required: s, onSelect: i } = e, [a, c] = _e(r, i ? r : void 0), l = i ? r : a;
2717
- return {
2718
- selected: l,
2719
- select: (f, m, p) => {
2720
- const { min: b, max: w } = e, O = f ? As(f, l, b, w, s, t) : void 0;
2721
- return o && n && O?.from && O.to && qs({ from: O.from, to: O.to }, n, t) && (O.from = f, O.to = void 0), i || c(O), i?.(O, f, m, p), O;
2722
- },
2723
- isSelected: (f) => l && oe(l, f, !1, t)
2724
- };
2725
- }
2726
- function Rs(e, t) {
2727
- const { selected: n, required: o, onSelect: r } = e, [s, i] = _e(n, r ? n : void 0), a = r ? n : s, { isSameDay: c } = t;
2728
- return {
2729
- selected: a,
2730
- select: (u, f, m) => {
2731
- let p = u;
2732
- return !o && a && a && c(u, a) && (p = void 0), r || i(p), r?.(p, u, f, m), p;
2733
- },
2734
- isSelected: (u) => a ? c(a, u) : !1
2735
- };
2736
- }
2737
- function Gs(e, t) {
2738
- const n = Rs(e, t), o = Is(e, t), r = $s(e, t);
2739
- switch (e.mode) {
2740
- case "single":
2741
- return n;
2742
- case "multiple":
2743
- return o;
2744
- case "range":
2745
- return r;
2746
- default:
2747
- return;
2748
- }
2749
- }
2750
- function Zs(e) {
2751
- let t = e;
2752
- t.timeZone && (t = {
2753
- ...e
2754
- }, t.today && (t.today = new $(t.today, t.timeZone)), t.month && (t.month = new $(t.month, t.timeZone)), t.defaultMonth && (t.defaultMonth = new $(t.defaultMonth, t.timeZone)), t.startMonth && (t.startMonth = new $(t.startMonth, t.timeZone)), t.endMonth && (t.endMonth = new $(t.endMonth, t.timeZone)), t.mode === "single" && t.selected ? t.selected = new $(t.selected, t.timeZone) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((C) => new $(C, t.timeZone)) : t.mode === "range" && t.selected && (t.selected = {
2755
- from: t.selected.from ? new $(t.selected.from, t.timeZone) : void 0,
2756
- to: t.selected.to ? new $(t.selected.to, t.timeZone) : void 0
2757
- }));
2758
- const { components: n, formatters: o, labels: r, dateLib: s, locale: i, classNames: a } = Fe(() => {
2759
- const C = { ...Ze, ...t.locale };
2760
- return {
2761
- dateLib: new Q({
2762
- locale: C,
2763
- weekStartsOn: t.broadcastCalendar ? 1 : t.weekStartsOn,
2764
- firstWeekContainsDate: t.firstWeekContainsDate,
2765
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
2766
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
2767
- timeZone: t.timeZone,
2768
- numerals: t.numerals
2769
- }, t.dateLib),
2770
- components: Ur(t.components),
2771
- formatters: is(t.formatters),
2772
- labels: { ...Ms, ...t.labels },
2773
- locale: C,
2774
- classNames: { ...Kr(), ...t.classNames }
2775
- };
2776
- }, [
2777
- t.locale,
2778
- t.broadcastCalendar,
2779
- t.weekStartsOn,
2780
- t.firstWeekContainsDate,
2781
- t.useAdditionalWeekYearTokens,
2782
- t.useAdditionalDayOfYearTokens,
2783
- t.timeZone,
2784
- t.numerals,
2785
- t.dateLib,
2786
- t.components,
2787
- t.formatters,
2788
- t.labels,
2789
- t.classNames
2790
- ]), { captionLayout: c, mode: l, navLayout: d, numberOfMonths: u = 1, onDayBlur: f, onDayClick: m, onDayFocus: p, onDayKeyDown: b, onDayMouseEnter: w, onDayMouseLeave: O, onNextClick: x, onPrevClick: v, showWeekNumber: _, styles: y } = t, { formatCaption: k, formatDay: M, formatMonthDropdown: N, formatWeekNumber: A, formatWeekNumberHeader: H, formatWeekdayName: q, formatYearDropdown: G } = o, ne = Ys(t, s), { days: se, months: ae, navStart: he, navEnd: pe, previousMonth: Z, nextMonth: z, goToMonth: X } = ne, we = Vr(se, t, he, pe, s), { isSelected: R, select: ue, selected: me } = Gs(t, s) ?? {}, { blur: Le, focused: Ve, isFocusTarget: Qt, moveFocus: Qe, setFocused: We } = js(t, ne, we, R ?? (() => !1), s), { labelDayButton: Ut, labelGridcell: Xt, labelGrid: Kt, labelMonthDropdown: Jt, labelNav: Ue, labelPrevious: en, labelNext: tn, labelWeekday: nn, labelWeekNumber: on, labelWeekNumberHeader: rn, labelYearDropdown: sn } = r, an = Fe(() => ls(s, t.ISOWeek), [s, t.ISOWeek]), Xe = l !== void 0 || m !== void 0, Te = U(() => {
2791
- Z && (X(Z), v?.(Z));
2792
- }, [Z, X, v]), Ee = U(() => {
2793
- z && (X(z), x?.(z));
2794
- }, [X, z, x]), cn = U((C, F) => (D) => {
2795
- D.preventDefault(), D.stopPropagation(), We(C), ue?.(C.date, F, D), m?.(C.date, F, D);
2796
- }, [ue, m, We]), un = U((C, F) => (D) => {
2797
- We(C), p?.(C.date, F, D);
2798
- }, [p, We]), ln = U((C, F) => (D) => {
2799
- Le(), f?.(C.date, F, D);
2800
- }, [Le, f]), dn = U((C, F) => (D) => {
2801
- const Y = {
2802
- ArrowLeft: [
2803
- D.shiftKey ? "month" : "day",
2804
- t.dir === "rtl" ? "after" : "before"
2805
- ],
2806
- ArrowRight: [
2807
- D.shiftKey ? "month" : "day",
2808
- t.dir === "rtl" ? "before" : "after"
2809
- ],
2810
- ArrowDown: [D.shiftKey ? "year" : "week", "after"],
2811
- ArrowUp: [D.shiftKey ? "year" : "week", "before"],
2812
- PageUp: [D.shiftKey ? "year" : "month", "before"],
2813
- PageDown: [D.shiftKey ? "year" : "month", "after"],
2814
- Home: ["startOfWeek", "before"],
2815
- End: ["endOfWeek", "after"]
2816
- };
2817
- if (Y[D.key]) {
2818
- D.preventDefault(), D.stopPropagation();
2819
- const [L, W] = Y[D.key];
2820
- Qe(L, W);
2821
- }
2822
- b?.(C.date, F, D);
2823
- }, [Qe, b, t.dir]), fn = U((C, F) => (D) => {
2824
- w?.(C.date, F, D);
2825
- }, [w]), hn = U((C, F) => (D) => {
2826
- O?.(C.date, F, D);
2827
- }, [O]), mn = U((C) => (F) => {
2828
- const D = Number(F.target.value), Y = s.setMonth(s.startOfMonth(C), D);
2829
- X(Y);
2830
- }, [s, X]), yn = U((C) => (F) => {
2831
- const D = Number(F.target.value), Y = s.setYear(s.startOfMonth(C), D);
2832
- X(Y);
2833
- }, [s, X]), { className: gn, style: bn } = Fe(() => ({
2834
- className: [a[g.Root], t.className].filter(Boolean).join(" "),
2835
- style: { ...y?.[g.Root], ...t.style }
2836
- }), [a, t.className, t.style, y]), pn = Xr(t), Ke = Se(null);
2837
- Cs(Ke, !!t.animate, {
2838
- classNames: a,
2839
- months: ae,
2840
- focused: Ve,
2841
- dateLib: s
2842
- });
2843
- const wn = {
2844
- dayPickerProps: t,
2845
- selected: me,
2846
- select: ue,
2847
- isSelected: R,
2848
- months: ae,
2849
- nextMonth: z,
2850
- previousMonth: Z,
2851
- goToMonth: X,
2852
- getModifiers: we,
2853
- components: n,
2854
- classNames: a,
2855
- styles: y,
2856
- labels: r,
2857
- formatters: o
2858
- };
2859
- return h.createElement(
2860
- Bt.Provider,
2861
- { value: wn },
2862
- h.createElement(
2863
- n.Root,
2864
- { rootRef: t.animate ? Ke : void 0, className: gn, style: bn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...pn },
2865
- h.createElement(
2866
- n.Months,
2867
- { className: a[g.Months], style: y?.[g.Months] },
2868
- !t.hideNavigation && !d && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[g.Nav], style: y?.[g.Nav], "aria-label": Ue(), onPreviousClick: Te, onNextClick: Ee, previousMonth: Z, nextMonth: z }),
2869
- ae.map((C, F) => h.createElement(
2870
- n.Month,
2871
- {
2872
- "data-animated-month": t.animate ? "true" : void 0,
2873
- className: a[g.Month],
2874
- style: y?.[g.Month],
2875
- // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
2876
- key: F,
2877
- displayIndex: F,
2878
- calendarMonth: C
2879
- },
2880
- d === "around" && !t.hideNavigation && F === 0 && h.createElement(
2881
- n.PreviousMonthButton,
2882
- { type: "button", className: a[g.PreviousMonthButton], tabIndex: Z ? void 0 : -1, "aria-disabled": Z ? void 0 : !0, "aria-label": en(Z), onClick: Te, "data-animated-button": t.animate ? "true" : void 0 },
2883
- h.createElement(n.Chevron, { disabled: Z ? void 0 : !0, className: a[g.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
2884
- ),
2885
- h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: a[g.MonthCaption], style: y?.[g.MonthCaption], calendarMonth: C, displayIndex: F }, c?.startsWith("dropdown") ? h.createElement(
2886
- n.DropdownNav,
2887
- { className: a[g.Dropdowns], style: y?.[g.Dropdowns] },
2888
- (() => {
2889
- const D = c === "dropdown" || c === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: a[g.MonthsDropdown], "aria-label": Jt(), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: mn(C.date), options: cs(C.date, he, pe, o, s), style: y?.[g.Dropdown], value: s.getMonth(C.date) }) : h.createElement("span", { key: "month" }, N(C.date, s)), Y = c === "dropdown" || c === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: a[g.YearsDropdown], "aria-label": sn(s.options), classNames: a, components: n, disabled: !!t.disableNavigation, onChange: yn(C.date), options: ds(he, pe, o, s, !!t.reverseYears), style: y?.[g.Dropdown], value: s.getYear(C.date) }) : h.createElement("span", { key: "year" }, G(C.date, s));
2890
- return s.getMonthYearOrder() === "year-first" ? [Y, D] : [D, Y];
2891
- })(),
2892
- h.createElement("span", { role: "status", "aria-live": "polite", style: {
2893
- border: 0,
2894
- clip: "rect(0 0 0 0)",
2895
- height: "1px",
2896
- margin: "-1px",
2897
- overflow: "hidden",
2898
- padding: 0,
2899
- position: "absolute",
2900
- width: "1px",
2901
- whiteSpace: "nowrap",
2902
- wordWrap: "normal"
2903
- } }, k(C.date, s.options, s))
2904
- ) : (
2905
- // biome-ignore lint/a11y/useSemanticElements: breaking change
2906
- h.createElement(n.CaptionLabel, { className: a[g.CaptionLabel], role: "status", "aria-live": "polite" }, k(C.date, s.options, s))
2907
- )),
2908
- d === "around" && !t.hideNavigation && F === u - 1 && h.createElement(
2909
- n.NextMonthButton,
2910
- { type: "button", className: a[g.NextMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label": tn(z), onClick: Ee, "data-animated-button": t.animate ? "true" : void 0 },
2911
- h.createElement(n.Chevron, { disabled: z ? void 0 : !0, className: a[g.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
2912
- ),
2913
- F === u - 1 && d === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: a[g.Nav], style: y?.[g.Nav], "aria-label": Ue(), onPreviousClick: Te, onNextClick: Ee, previousMonth: Z, nextMonth: z }),
2914
- h.createElement(
2915
- n.MonthGrid,
2916
- { role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": Kt(C.date, s.options, s) || void 0, className: a[g.MonthGrid], style: y?.[g.MonthGrid] },
2917
- !t.hideWeekdays && h.createElement(
2918
- n.Weekdays,
2919
- { "data-animated-weekdays": t.animate ? "true" : void 0, className: a[g.Weekdays], style: y?.[g.Weekdays] },
2920
- _ && h.createElement(n.WeekNumberHeader, { "aria-label": rn(s.options), className: a[g.WeekNumberHeader], style: y?.[g.WeekNumberHeader], scope: "col" }, H()),
2921
- an.map((D) => h.createElement(n.Weekday, { "aria-label": nn(D, s.options, s), className: a[g.Weekday], key: String(D), style: y?.[g.Weekday], scope: "col" }, q(D, s.options, s)))
2922
- ),
2923
- h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: a[g.Weeks], style: y?.[g.Weeks] }, C.weeks.map((D) => h.createElement(
2924
- n.Week,
2925
- { className: a[g.Week], key: D.weekNumber, style: y?.[g.Week], week: D },
2926
- _ && // biome-ignore lint/a11y/useSemanticElements: react component
2927
- h.createElement(n.WeekNumber, { week: D, style: y?.[g.WeekNumber], "aria-label": on(D.weekNumber, {
2928
- locale: i
2929
- }), className: a[g.WeekNumber], scope: "row", role: "rowheader" }, A(D.weekNumber, s)),
2930
- D.days.map((Y) => {
2931
- const { date: L } = Y, W = we(Y);
2932
- if (W[B.focused] = !W.hidden && !!Ve?.isEqualTo(Y), W[K.selected] = R?.(L) || W.selected, ze(me)) {
2933
- const { from: Pe, to: Ye } = me;
2934
- W[K.range_start] = !!(Pe && Ye && s.isSameDay(L, Pe)), W[K.range_end] = !!(Pe && Ye && s.isSameDay(L, Ye)), W[K.range_middle] = oe(me, L, !0, s);
2935
- }
2936
- const vn = us(W, y, t.modifiersStyles), Mn = Qr(W, a, t.modifiersClassNames), kn = !Xe && !W.hidden ? Xt(L, W, s.options, s) : void 0;
2937
- return (
2938
- // biome-ignore lint/a11y/useSemanticElements: react component
2939
- h.createElement(n.Day, { key: `${s.format(L, "yyyy-MM-dd")}_${s.format(Y.displayMonth, "yyyy-MM")}`, day: Y, modifiers: W, className: Mn.join(" "), style: vn, role: "gridcell", "aria-selected": W.selected || void 0, "aria-label": kn, "data-day": s.format(L, "yyyy-MM-dd"), "data-month": Y.outside ? s.format(L, "yyyy-MM") : void 0, "data-selected": W.selected || void 0, "data-disabled": W.disabled || void 0, "data-hidden": W.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": W.focused || void 0, "data-today": W.today || void 0 }, !W.hidden && Xe ? h.createElement(n.DayButton, { className: a[g.DayButton], style: y?.[g.DayButton], type: "button", day: Y, modifiers: W, disabled: W.disabled || void 0, tabIndex: Qt(Y) ? 0 : -1, "aria-label": Ut(L, W, s.options, s), onClick: cn(Y, W), onBlur: ln(Y, W), onFocus: un(Y, W), onKeyDown: dn(Y, W), onMouseEnter: fn(Y, W), onMouseLeave: hn(Y, W) }, M(L, s.options, s)) : !W.hidden && M(Y.date, s.options, s))
2940
- );
2941
- })
2942
- )))
2943
- )
2944
- ))
2945
- ),
2946
- t.footer && // biome-ignore lint/a11y/useSemanticElements: react component
2947
- h.createElement(n.Footer, { className: a[g.Footer], style: y?.[g.Footer], role: "status", "aria-live": "polite" }, t.footer)
2948
- )
2949
- );
2950
- }
2951
- function zs({
2952
- className: e,
2953
- showOutsideDays: t = !0,
2954
- showYearSwitcher: n = !0,
2955
- yearRange: o = 12,
2956
- numberOfMonths: r,
2957
- ...s
2958
- }) {
2959
- const [i, a] = j.useState("days"), [c, l] = j.useState(
2960
- j.useMemo(() => {
2961
- const R = (/* @__PURE__ */ new Date()).getFullYear();
2962
- return {
2963
- from: R - Math.floor(o / 2 - 1),
2964
- to: R + Math.ceil(o / 2)
2965
- };
2966
- }, [o])
2967
- ), { onPrevClick: d, startMonth: u, endMonth: f } = s, m = i === "years" ? 1 : r, p = T("relative flex", s.monthsClassName), b = T("relative mx-10 flex h-7 items-center justify-center", s.monthCaptionClassName), w = T("flex flex-row", s.weekdaysClassName), O = T("w-8 font-normal text-muted-foreground text-sm", s.weekdayClassName), x = T("w-full", s.monthClassName), v = T("relative flex items-center justify-center pt-1", s.captionClassName), _ = T("truncate font-medium text-sm", s.captionLabelClassName), y = Re({
2968
- variant: "outline",
2969
- className: "absolute h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
2970
- }), k = T(y, "right-0", s.buttonNextClassName), M = T(y, "left-0", s.buttonPreviousClassName), N = T("flex items-start", s.navClassName), A = T("mx-auto mt-4", s.monthGridClassName), H = T("mt-2 flex w-max items-start", s.weekClassName), q = T("flex size-8 flex-1 items-center justify-center p-0 text-sm", s.dayClassName), G = T(
2971
- Re({ variant: "ghost" }),
2972
- "size-8 rounded-md p-0 font-normal transition-none aria-selected:opacity-100",
2973
- s.dayButtonClassName
2974
- ), ne = "bg-accent [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground", se = T(ne, "day-range-start rounded-s-md", s.rangeStartClassName), ae = T(ne, "day-range-end rounded-e-md", s.rangeEndClassName), he = T(
2975
- "!text-foreground [&>button]:!text-foreground [&>button]:hover:!text-foreground bg-accent [&>button]:bg-transparent [&>button]:hover:bg-transparent",
2976
- s.rangeMiddleClassName
2977
- ), pe = T(
2978
- "[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground",
2979
- s.selectedClassName
2980
- ), Z = T("[&>button]:bg-accent [&>button]:text-accent-foreground", s.todayClassName), z = T(
2981
- "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
2982
- s.outsideClassName
2983
- ), X = T("text-muted-foreground opacity-50", s.disabledClassName), we = T("invisible flex-1", s.hiddenClassName);
2984
- return /* @__PURE__ */ S.jsx(
2985
- Zs,
2986
- {
2987
- className: T("p-3", e),
2988
- classNames: {
2989
- months: p,
2990
- month_caption: b,
2991
- weekdays: w,
2992
- weekday: O,
2993
- month: x,
2994
- caption: v,
2995
- caption_label: _,
2996
- button_next: k,
2997
- button_previous: M,
2998
- nav: N,
2999
- month_grid: A,
3000
- week: H,
3001
- day: q,
3002
- day_button: G,
3003
- range_start: se,
3004
- range_middle: he,
3005
- range_end: ae,
3006
- selected: pe,
3007
- today: Z,
3008
- outside: z,
3009
- disabled: X,
3010
- hidden: we
3011
- },
3012
- components: {
3013
- Chevron: ({ orientation: R }) => {
3014
- const ue = R === "left" ? vt : Mt;
3015
- return /* @__PURE__ */ S.jsx(ue, { className: "h-4 w-4" });
3016
- },
3017
- Nav: ({ className: R }) => /* @__PURE__ */ S.jsx(
3018
- Ls,
3019
- {
3020
- className: R,
3021
- displayYears: c,
3022
- endMonth: f,
3023
- navView: i,
3024
- onPrevClick: d,
3025
- setDisplayYears: l,
3026
- startMonth: u
3027
- }
3028
- ),
3029
- CaptionLabel: (R) => /* @__PURE__ */ S.jsx(
3030
- Vs,
3031
- {
3032
- displayYears: c,
3033
- navView: i,
3034
- setNavView: a,
3035
- showYearSwitcher: n,
3036
- ...R
3037
- }
3038
- ),
3039
- MonthGrid: ({ className: R, children: ue, ...me }) => /* @__PURE__ */ S.jsx(
3040
- Qs,
3041
- {
3042
- className: R,
3043
- displayYears: c,
3044
- endMonth: f,
3045
- navView: i,
3046
- setNavView: a,
3047
- startMonth: u,
3048
- ...me,
3049
- children: ue
3050
- }
3051
- )
3052
- },
3053
- numberOfMonths: m,
3054
- showOutsideDays: t,
3055
- style: {
3056
- width: `${248.8 * (m ?? 1)}px`
3057
- },
3058
- ...s
3059
- }
3060
- );
3061
- }
3062
- zs.displayName = "Calendar";
3063
- function Ls({
3064
- className: e,
3065
- navView: t,
3066
- startMonth: n,
3067
- endMonth: o,
3068
- displayYears: r,
3069
- setDisplayYears: s,
3070
- onPrevClick: i,
3071
- onNextClick: a
3072
- }) {
3073
- const { nextMonth: c, previousMonth: l, goToMonth: d } = fe(), u = t === "years" ? n && ce(new Date(r.from - 1, 0, 1), n) < 0 || o && ce(new Date(r.from - 1, 0, 1), o) > 0 : !l, f = t === "years" ? n && ce(new Date(r.to + 1, 0, 1), n) < 0 || o && ce(new Date(r.to + 1, 0, 1), o) > 0 : !c, m = j.useCallback(() => {
3074
- if (l) {
3075
- if (t === "years") {
3076
- s((b) => ({
3077
- from: b.from - (b.to - b.from + 1),
3078
- to: b.to - (b.to - b.from + 1)
3079
- })), i?.(new Date(r.from - (r.to - r.from), 0, 1));
3080
- return;
3081
- }
3082
- d(l), i?.(l);
3083
- }
3084
- }, [l, d, r, t, i, s]), p = j.useCallback(() => {
3085
- if (c) {
3086
- if (t === "years") {
3087
- s((b) => ({
3088
- from: b.from + (b.to - b.from + 1),
3089
- to: b.to + (b.to - b.from + 1)
3090
- })), a?.(new Date(r.from + (r.to - r.from), 0, 1));
3091
- return;
3092
- }
3093
- d(c), a?.(c);
3094
- }
3095
- }, [d, c, r, t, a, s]);
3096
- return /* @__PURE__ */ S.jsxs("nav", { className: T("flex items-center", e), children: [
3097
- /* @__PURE__ */ S.jsx(
3098
- De,
3099
- {
3100
- "aria-label": t === "years" ? `Go to the previous ${r.to - r.from + 1} years` : Lt(),
3101
- className: "absolute left-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
3102
- disabled: u,
3103
- onClick: m,
3104
- tabIndex: u ? void 0 : -1,
3105
- type: "button",
3106
- variant: "outline",
3107
- children: /* @__PURE__ */ S.jsx(vt, { className: "h-4 w-4" })
3108
- }
3109
- ),
3110
- /* @__PURE__ */ S.jsx(
3111
- De,
3112
- {
3113
- "aria-label": t === "years" ? `Go to the next ${r.to - r.from + 1} years` : zt(),
3114
- className: "absolute right-0 h-7 w-7 bg-transparent p-0 opacity-80 hover:opacity-100",
3115
- disabled: f,
3116
- onClick: p,
3117
- tabIndex: f ? void 0 : -1,
3118
- type: "button",
3119
- variant: "outline",
3120
- children: /* @__PURE__ */ S.jsx(Mt, { className: "h-4 w-4" })
3121
- }
3122
- )
3123
- ] });
3124
- }
3125
- function Vs({
3126
- children: e,
3127
- showYearSwitcher: t,
3128
- navView: n,
3129
- setNavView: o,
3130
- displayYears: r,
3131
- ...s
3132
- }) {
3133
- return t ? /* @__PURE__ */ S.jsx(
3134
- De,
3135
- {
3136
- className: "h-7 w-full truncate font-medium text-sm",
3137
- onClick: () => o((i) => i === "days" ? "years" : "days"),
3138
- size: "sm",
3139
- variant: "ghost",
3140
- children: n === "days" ? e : `${r.from} - ${r.to}`
3141
- }
3142
- ) : /* @__PURE__ */ S.jsx("span", { ...s, children: e });
3143
- }
3144
- function Qs({
3145
- className: e,
3146
- children: t,
3147
- displayYears: n,
3148
- startMonth: o,
3149
- endMonth: r,
3150
- navView: s,
3151
- setNavView: i,
3152
- ...a
3153
- }) {
3154
- return s === "years" ? /* @__PURE__ */ S.jsx(
3155
- Us,
3156
- {
3157
- className: e,
3158
- displayYears: n,
3159
- endMonth: r,
3160
- navView: s,
3161
- setNavView: i,
3162
- startMonth: o,
3163
- ...a
3164
- }
3165
- ) : /* @__PURE__ */ S.jsx("table", { className: e, ...a, children: t });
3166
- }
3167
- function Us({
3168
- className: e,
3169
- displayYears: t,
3170
- startMonth: n,
3171
- endMonth: o,
3172
- setNavView: r,
3173
- navView: s,
3174
- ...i
3175
- }) {
3176
- const { goToMonth: a, selected: c } = fe();
3177
- return /* @__PURE__ */ S.jsx("div", { className: T("grid grid-cols-4 gap-y-2", e), ...i, children: Array.from({ length: t.to - t.from + 1 }, (l, d) => {
3178
- const u = ce(new Date(t.from + d, 11, 31), n) < 0, f = ce(new Date(t.from + d, 0, 0), o) > 0, m = u || f;
3179
- return /* @__PURE__ */ S.jsx(
3180
- De,
3181
- {
3182
- className: T(
3183
- "h-7 w-full font-normal text-foreground text-sm",
3184
- t.from + d === (/* @__PURE__ */ new Date()).getFullYear() && "bg-accent font-medium text-accent-foreground"
3185
- ),
3186
- disabled: s === "years" ? m : void 0,
3187
- onClick: () => {
3188
- r("days"), a(new Date(t.from + d, c?.getMonth() ?? 0));
3189
- },
3190
- variant: "ghost",
3191
- children: t.from + d
3192
- },
3193
- d
3194
- );
3195
- }) });
3196
- }
3197
- export {
3198
- $n as B,
3199
- Mt as C,
3200
- Sn as S,
3201
- Rn as a,
3202
- qn as b,
3203
- wt as c,
3204
- Re as d,
3205
- vt as e,
3206
- na as f,
3207
- De as g,
3208
- zs as h,
3209
- Wn as i,
3210
- gt as j,
3211
- ta as u
3212
- };