brd-ui-kit 0.1.82 → 0.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/calendar-Cf3VkgyX.js +1881 -0
  2. package/dist/calendar-Cf3VkgyX.js.map +1 -0
  3. package/dist/calendar-DvDG9hIB.cjs +2 -0
  4. package/dist/calendar-DvDG9hIB.cjs.map +1 -0
  5. package/dist/calendar-locale-Br6M-e1P.cjs +2 -0
  6. package/dist/calendar-locale-Br6M-e1P.cjs.map +1 -0
  7. package/dist/calendar-locale-DivjTEYg.js +31 -0
  8. package/dist/calendar-locale-DivjTEYg.js.map +1 -0
  9. package/dist/components-approval-log-approval-log.cjs +1 -1
  10. package/dist/components-approval-log-approval-log.js +1 -1
  11. package/dist/components-avatar-uploader-avatar-uploader.cjs +1 -1
  12. package/dist/components-avatar-uploader-avatar-uploader.js +1 -1
  13. package/dist/components-basic-avatar-basic-avatar.cjs +1 -1
  14. package/dist/components-basic-avatar-basic-avatar.js +1 -1
  15. package/dist/components-checkbox-group-checkbox-group.cjs +1 -1
  16. package/dist/components-checkbox-group-checkbox-group.js +1 -1
  17. package/dist/components-input-contact-input-contact.cjs +1 -1
  18. package/dist/components-input-contact-input-contact.js +1 -1
  19. package/dist/components-story-drawer-story-drawer.cjs +2 -2
  20. package/dist/components-story-drawer-story-drawer.cjs.map +1 -1
  21. package/dist/components-story-drawer-story-drawer.js +10 -9
  22. package/dist/components-story-drawer-story-drawer.js.map +1 -1
  23. package/dist/components-ui-calendar-calendar.cjs +1 -1
  24. package/dist/components-ui-calendar-calendar.js +4 -3
  25. package/dist/components-ui-calendar-calendar.js.map +1 -1
  26. package/dist/components-ui-calendar.cjs +1 -1
  27. package/dist/components-ui-calendar.js +2 -2
  28. package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs +1 -1
  29. package/dist/components-ui-select-calendar-menu-select-calendar-menu.js +1 -1
  30. package/dist/format-BSaJ7xya.js +1248 -0
  31. package/dist/format-BSaJ7xya.js.map +1 -0
  32. package/dist/format-C1iwqCnX.cjs +2 -0
  33. package/dist/format-C1iwqCnX.cjs.map +1 -0
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.js +2 -2
  36. package/dist/{calendar-locale-DqQZymBn.js → ru-DIeHL4OP.js} +83 -107
  37. package/dist/ru-DIeHL4OP.js.map +1 -0
  38. package/dist/ru-t19YoSZw.cjs +2 -0
  39. package/dist/ru-t19YoSZw.cjs.map +1 -0
  40. package/dist/utils/helpers.d.ts +1 -0
  41. package/dist/utils-helpers.cjs +1 -1
  42. package/dist/utils-helpers.cjs.map +1 -1
  43. package/dist/utils-helpers.js +17 -14
  44. package/dist/utils-helpers.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/calendar-PqChui7l.cjs +0 -2
  47. package/dist/calendar-PqChui7l.cjs.map +0 -1
  48. package/dist/calendar-XWqEaWHP.js +0 -3113
  49. package/dist/calendar-XWqEaWHP.js.map +0 -1
  50. package/dist/calendar-locale-CosU_VZY.cjs +0 -2
  51. package/dist/calendar-locale-CosU_VZY.cjs.map +0 -1
  52. package/dist/calendar-locale-DqQZymBn.js.map +0 -1
@@ -0,0 +1,1881 @@
1
+ import { jsx as z, Fragment as hn, jsxs as Xe } from "react/jsx-runtime";
2
+ import { cn as _ } from "./lib-utils.js";
3
+ import u, { createContext as lt, useContext as mn, useCallback as U, useRef as me, useLayoutEffect as yn, useState as ge, useEffect as ct, useMemo as be, use as pn } from "react";
4
+ import { Button as ft } from "./components-ui-button-button.js";
5
+ import { buttonVariants as Le } from "./components-ui-button-button.styles.js";
6
+ import { Card as Dn, CardContent as kn, CardFooter as Mn } from "./components-ui-card-card.js";
7
+ import { Icon as Ee } from "./components-ui-icon-icon.js";
8
+ import "phosphor-strokes-icons/icons";
9
+ import { Typography as bn } from "./components-ui-typography-typography.js";
10
+ import { getTypographyClassName as gn } from "./components-ui-typography-typography.styles.js";
11
+ import { calendarHiddenClassName as vn, calendarDisabledClassName as On, calendarOutsideClassName as wn, calendarTodayClassName as Nn, calendarRangeEndClassName as Cn, calendarRangeMiddleClassName as Wn, calendarRangeStartClassName as Sn, calendarDayVariants as _n, calendarWeekNumberVariants as Yn, calendarWeekNumberHeaderClassName as Tn, calendarWeekVariants as En, calendarWeekdayVariants as xn, calendarWeekdaysVariants as Bn, calendarCaptionLabelVariants as Fn, calendarDropdownClassName as In, calendarDropdownRootClassName as Pn, calendarDropdownsVariants as An, calendarMonthCaptionClassName as Hn, calendarNavButtonClassName as et, calendarNavClassName as $n, calendarMonthClassName as jn, calendarMonthsClassName as zn, calendarRootVariants as Rn, calendarContentPaddingVariants as qn, calendarFooterVariants as Gn, calendarWrapperClassName as Vn, calendarTypographyVariantBySize as Un, calendarDayTextVariants as Kn, calendarRangeLastClickedClassName as Zn, calendarTodayButtonIndicatorClassName as Jn, calendarDayButtonClassName as Qn, calendarWeekNumberCellClassName as Xn, calendarIconClassName as xe } from "./components-ui-calendar-calendar.styles.js";
12
+ import { t as P, e as Z, n as ye, g as ve, h as Ln, i as de, f as ue, j as dt, k as ut, l as ht, m as eo, o as to, s as no, p as oo } from "./format-BSaJ7xya.js";
13
+ function $e(e, t, o) {
14
+ const n = P(e, o?.in);
15
+ return isNaN(t) ? Z(e, NaN) : (t && n.setDate(n.getDate() + t), n);
16
+ }
17
+ function mt(e, t, o) {
18
+ const n = P(e, o?.in);
19
+ if (isNaN(t)) return Z(e, NaN);
20
+ if (!t)
21
+ return n;
22
+ const s = n.getDate(), l = Z(e, n.getTime());
23
+ l.setMonth(n.getMonth() + t + 1, 0);
24
+ const a = l.getDate();
25
+ return s >= a ? l : (n.setFullYear(
26
+ l.getFullYear(),
27
+ l.getMonth(),
28
+ s
29
+ ), n);
30
+ }
31
+ function so(e, t, o) {
32
+ return $e(e, t * 7, o);
33
+ }
34
+ function ro(e, t, o) {
35
+ return mt(e, t * 12, o);
36
+ }
37
+ function ao(e, t) {
38
+ let o, n = t?.in;
39
+ return e.forEach((s) => {
40
+ !n && typeof s == "object" && (n = Z.bind(null, s));
41
+ const l = P(s, n);
42
+ (!o || o < l || isNaN(+l)) && (o = l);
43
+ }), Z(n, o || NaN);
44
+ }
45
+ function io(e, t) {
46
+ let o, n = t?.in;
47
+ return e.forEach((s) => {
48
+ !n && typeof s == "object" && (n = Z.bind(null, s));
49
+ const l = P(s, n);
50
+ (!o || o > l || isNaN(+l)) && (o = l);
51
+ }), Z(n, o || NaN);
52
+ }
53
+ function lo(e, t, o) {
54
+ const [n, s] = ye(
55
+ o?.in,
56
+ e,
57
+ t
58
+ );
59
+ return +ve(n) == +ve(s);
60
+ }
61
+ function yt(e, t, o) {
62
+ const [n, s] = ye(
63
+ o?.in,
64
+ e,
65
+ t
66
+ ), l = n.getFullYear() - s.getFullYear(), a = n.getMonth() - s.getMonth();
67
+ return l * 12 + a;
68
+ }
69
+ function co(e, t) {
70
+ const o = P(e, t?.in), n = o.getMonth();
71
+ return o.setFullYear(o.getFullYear(), n + 1, 0), o.setHours(23, 59, 59, 999), o;
72
+ }
73
+ function pt(e, t) {
74
+ const [o, n] = ye(e, t.start, t.end);
75
+ return { start: o, end: n };
76
+ }
77
+ function fo(e, t) {
78
+ const { start: o, end: n } = pt(t?.in, e);
79
+ let s = +o > +n;
80
+ const l = s ? +o : +n, a = s ? n : o;
81
+ a.setHours(0, 0, 0, 0), a.setDate(1);
82
+ let r = 1;
83
+ const i = [];
84
+ for (; +a <= l; )
85
+ i.push(Z(o, a)), a.setMonth(a.getMonth() + r);
86
+ return s ? i.reverse() : i;
87
+ }
88
+ function uo(e, t) {
89
+ const o = P(e, t?.in);
90
+ return o.setDate(1), o.setHours(0, 0, 0, 0), o;
91
+ }
92
+ function ho(e, t) {
93
+ const o = P(e, t?.in), n = o.getFullYear();
94
+ return o.setFullYear(n + 1, 0, 0), o.setHours(23, 59, 59, 999), o;
95
+ }
96
+ function mo(e, t) {
97
+ const { start: o, end: n } = pt(t?.in, e);
98
+ let s = +o > +n;
99
+ const l = s ? +o : +n, a = s ? n : o;
100
+ a.setHours(0, 0, 0, 0), a.setMonth(0, 1);
101
+ let r = 1;
102
+ const i = [];
103
+ for (; +a <= l; )
104
+ i.push(Z(o, a)), a.setFullYear(a.getFullYear() + r);
105
+ return s ? i.reverse() : i;
106
+ }
107
+ function Dt(e, t) {
108
+ const o = Ln(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, s = P(e, t?.in), l = s.getDay(), a = (l < n ? -7 : 0) + 6 - (l - n);
109
+ return s.setDate(s.getDate() + a), s.setHours(23, 59, 59, 999), s;
110
+ }
111
+ function yo(e, t) {
112
+ return Dt(e, { ...t, weekStartsOn: 1 });
113
+ }
114
+ function po(e, t) {
115
+ const o = P(e, t?.in), n = o.getFullYear(), s = o.getMonth(), l = Z(o, 0);
116
+ return l.setFullYear(n, s + 1, 0), l.setHours(0, 0, 0, 0), l.getDate();
117
+ }
118
+ function Do(e, t) {
119
+ return P(e, t?.in).getMonth();
120
+ }
121
+ function ko(e, t) {
122
+ return P(e, t?.in).getFullYear();
123
+ }
124
+ function Mo(e, t) {
125
+ return +P(e) > +P(t);
126
+ }
127
+ function bo(e, t) {
128
+ return +P(e) < +P(t);
129
+ }
130
+ function go(e, t, o) {
131
+ const [n, s] = ye(
132
+ o?.in,
133
+ e,
134
+ t
135
+ );
136
+ return n.getFullYear() === s.getFullYear() && n.getMonth() === s.getMonth();
137
+ }
138
+ function vo(e, t, o) {
139
+ const [n, s] = ye(
140
+ o?.in,
141
+ e,
142
+ t
143
+ );
144
+ return n.getFullYear() === s.getFullYear();
145
+ }
146
+ function Oo(e, t, o) {
147
+ const n = P(e, o?.in), s = n.getFullYear(), l = n.getDate(), a = Z(e, 0);
148
+ a.setFullYear(s, t, 15), a.setHours(0, 0, 0, 0);
149
+ const r = po(a);
150
+ return n.setMonth(t, Math.min(l, r)), n;
151
+ }
152
+ function wo(e, t, o) {
153
+ const n = P(e, o?.in);
154
+ return isNaN(+n) ? Z(e, NaN) : (n.setFullYear(t), n);
155
+ }
156
+ function No(e, t, o = "long") {
157
+ return new Intl.DateTimeFormat("en-US", {
158
+ // Enforces engine to render the time. Without the option JavaScriptCore omits it.
159
+ hour: "numeric",
160
+ timeZone: e,
161
+ timeZoneName: o
162
+ }).format(t).split(/\s/g).slice(2).join(" ");
163
+ }
164
+ const Be = {}, he = {};
165
+ function ie(e, t) {
166
+ try {
167
+ const n = (Be[e] || (Be[e] = new Intl.DateTimeFormat("en-US", {
168
+ timeZone: e,
169
+ timeZoneName: "longOffset"
170
+ }).format))(t).split("GMT")[1];
171
+ return n in he ? he[n] : tt(n, n.split(":"));
172
+ } catch {
173
+ if (e in he) return he[e];
174
+ const o = e?.match(Co);
175
+ return o ? tt(e, o.slice(1)) : NaN;
176
+ }
177
+ }
178
+ const Co = /([+-]\d\d):?(\d\d)?/;
179
+ function tt(e, t) {
180
+ const o = +(t[0] || 0), n = +(t[1] || 0), s = +(t[2] || 0) / 60;
181
+ return he[e] = o * 60 + n > 0 ? o * 60 + n + s : o * 60 - n - s;
182
+ }
183
+ class ne extends Date {
184
+ //#region static
185
+ constructor(...t) {
186
+ super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ie(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)), kt(this), He(this)) : this.setTime(Date.now());
187
+ }
188
+ static tz(t, ...o) {
189
+ return o.length ? new ne(...o, t) : new ne(Date.now(), t);
190
+ }
191
+ //#endregion
192
+ //#region time zone
193
+ withTimeZone(t) {
194
+ return new ne(+this, t);
195
+ }
196
+ getTimezoneOffset() {
197
+ const t = -ie(this.timeZone, this);
198
+ return t > 0 ? Math.floor(t) : Math.ceil(t);
199
+ }
200
+ //#endregion
201
+ //#region time
202
+ setTime(t) {
203
+ return Date.prototype.setTime.apply(this, arguments), He(this), +this;
204
+ }
205
+ //#endregion
206
+ //#region date-fns integration
207
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
208
+ return new ne(+new Date(t), this.timeZone);
209
+ }
210
+ //#endregion
211
+ }
212
+ const nt = /^(get|set)(?!UTC)/;
213
+ Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
214
+ if (!nt.test(e)) return;
215
+ const t = e.replace(nt, "$1UTC");
216
+ ne.prototype[t] && (e.startsWith("get") ? ne.prototype[e] = function() {
217
+ return this.internal[t]();
218
+ } : (ne.prototype[e] = function() {
219
+ return Date.prototype[t].apply(this.internal, arguments), Wo(this), +this;
220
+ }, ne.prototype[t] = function() {
221
+ return Date.prototype[t].apply(this, arguments), He(this), +this;
222
+ }));
223
+ });
224
+ function He(e) {
225
+ e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ie(e.timeZone, e) * 60));
226
+ }
227
+ function Wo(e) {
228
+ 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()), kt(e);
229
+ }
230
+ function kt(e) {
231
+ const t = ie(e.timeZone, e), o = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
232
+ n.setUTCHours(n.getUTCHours() - 1);
233
+ const s = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), l = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), a = s - l, r = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
234
+ a && r && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
235
+ const i = s - o;
236
+ i && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + i);
237
+ const c = /* @__PURE__ */ new Date(+e);
238
+ c.setUTCSeconds(0);
239
+ const d = s > 0 ? c.getSeconds() : (c.getSeconds() - 60) % 60, f = Math.round(-(ie(e.timeZone, e) * 60)) % 60;
240
+ (f || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + d));
241
+ const y = ie(e.timeZone, e), D = y > 0 ? Math.floor(y) : Math.ceil(y), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - D, v = D !== o, N = W - i;
242
+ if (v && N) {
243
+ Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + N);
244
+ const h = ie(e.timeZone, e), M = h > 0 ? Math.floor(h) : Math.ceil(h), g = D - M;
245
+ g && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + g), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + g));
246
+ }
247
+ }
248
+ class A extends ne {
249
+ //#region static
250
+ static tz(t, ...o) {
251
+ return o.length ? new A(...o, t) : new A(Date.now(), t);
252
+ }
253
+ //#endregion
254
+ //#region representation
255
+ toISOString() {
256
+ const [t, o, n] = this.tzComponents(), s = `${t}${o}:${n}`;
257
+ return this.internal.toISOString().slice(0, -1) + s;
258
+ }
259
+ toString() {
260
+ return `${this.toDateString()} ${this.toTimeString()}`;
261
+ }
262
+ toDateString() {
263
+ const [t, o, n, s] = this.internal.toUTCString().split(" ");
264
+ return `${t?.slice(0, -1)} ${n} ${o} ${s}`;
265
+ }
266
+ toTimeString() {
267
+ const t = this.internal.toUTCString().split(" ")[4], [o, n, s] = this.tzComponents();
268
+ return `${t} GMT${o}${n}${s} (${No(this.timeZone, this)})`;
269
+ }
270
+ toLocaleString(t, o) {
271
+ return Date.prototype.toLocaleString.call(this, t, {
272
+ ...o,
273
+ timeZone: o?.timeZone || this.timeZone
274
+ });
275
+ }
276
+ toLocaleDateString(t, o) {
277
+ return Date.prototype.toLocaleDateString.call(this, t, {
278
+ ...o,
279
+ timeZone: o?.timeZone || this.timeZone
280
+ });
281
+ }
282
+ toLocaleTimeString(t, o) {
283
+ return Date.prototype.toLocaleTimeString.call(this, t, {
284
+ ...o,
285
+ timeZone: o?.timeZone || this.timeZone
286
+ });
287
+ }
288
+ //#endregion
289
+ //#region private
290
+ tzComponents() {
291
+ const t = this.getTimezoneOffset(), o = t > 0 ? "-" : "+", n = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), s = String(Math.abs(t) % 60).padStart(2, "0");
292
+ return [o, n, s];
293
+ }
294
+ //#endregion
295
+ withTimeZone(t) {
296
+ return new A(+this, t);
297
+ }
298
+ //#region date-fns integration
299
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
300
+ return new A(+new Date(t), this.timeZone);
301
+ }
302
+ //#endregion
303
+ }
304
+ const ot = 5, So = 4;
305
+ function _o(e, t) {
306
+ const o = t.startOfMonth(e), n = o.getDay() > 0 ? o.getDay() : 7, s = t.addDays(e, -n + 1), l = t.addDays(s, ot * 7 - 1);
307
+ return t.getMonth(e) === t.getMonth(l) ? ot : So;
308
+ }
309
+ function Mt(e, t) {
310
+ const o = t.startOfMonth(e), n = o.getDay();
311
+ return n === 1 ? o : n === 0 ? t.addDays(o, -6) : t.addDays(o, -1 * (n - 1));
312
+ }
313
+ function Yo(e, t) {
314
+ const o = Mt(e, t), n = _o(e, t);
315
+ return t.addDays(o, n * 7 - 1);
316
+ }
317
+ const bt = {
318
+ ...de,
319
+ labels: {
320
+ labelDayButton: (e, t, o, n) => {
321
+ let s;
322
+ n && typeof n.format == "function" ? s = n.format.bind(n) : s = (a, r) => ue(a, r, { locale: de, ...o });
323
+ let l = s(e, "PPPP");
324
+ return t.today && (l = `Today, ${l}`), t.selected && (l = `${l}, selected`), l;
325
+ },
326
+ labelMonthDropdown: "Choose the Month",
327
+ labelNext: "Go to the Next Month",
328
+ labelPrevious: "Go to the Previous Month",
329
+ labelWeekNumber: (e) => `Week ${e}`,
330
+ labelYearDropdown: "Choose the Year",
331
+ labelGrid: (e, t, o) => {
332
+ let n;
333
+ return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (s, l) => ue(s, l, { locale: de, ...t }), n(e, "LLLL yyyy");
334
+ },
335
+ labelGridcell: (e, t, o, n) => {
336
+ let s;
337
+ n && typeof n.format == "function" ? s = n.format.bind(n) : s = (a, r) => ue(a, r, { locale: de, ...o });
338
+ let l = s(e, "PPPP");
339
+ return t?.today && (l = `Today, ${l}`), l;
340
+ },
341
+ labelNav: "Navigation bar",
342
+ labelWeekNumberHeader: "Week Number",
343
+ labelWeekday: (e, t, o) => {
344
+ let n;
345
+ return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (s, l) => ue(s, l, { locale: de, ...t }), n(e, "cccc");
346
+ }
347
+ }
348
+ };
349
+ class R {
350
+ /**
351
+ * Creates an instance of `DateLib`.
352
+ *
353
+ * @param options Configuration options for the date library.
354
+ * @param overrides Custom overrides for the date library functions.
355
+ */
356
+ constructor(t, o) {
357
+ this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? A.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, s, l) => this.overrides?.newDate ? this.overrides.newDate(n, s, l) : this.options.timeZone ? new A(n, s, l, this.options.timeZone) : new Date(n, s, l), this.addDays = (n, s) => this.overrides?.addDays ? this.overrides.addDays(n, s) : $e(n, s), this.addMonths = (n, s) => this.overrides?.addMonths ? this.overrides.addMonths(n, s) : mt(n, s), this.addWeeks = (n, s) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, s) : so(n, s), this.addYears = (n, s) => this.overrides?.addYears ? this.overrides.addYears(n, s) : ro(n, s), this.differenceInCalendarDays = (n, s) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, s) : dt(n, s), this.differenceInCalendarMonths = (n, s) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, s) : yt(n, s), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : fo(n), this.eachYearOfInterval = (n) => {
358
+ const s = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : mo(n), l = new Set(s.map((r) => this.getYear(r)));
359
+ if (l.size === s.length)
360
+ return s;
361
+ const a = [];
362
+ return l.forEach((r) => {
363
+ a.push(new Date(r, 0, 1));
364
+ }), a;
365
+ }, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : Yo(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : yo(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : co(n), this.endOfWeek = (n, s) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, s) : Dt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : ho(n), this.format = (n, s, l) => {
366
+ const a = this.overrides?.format ? this.overrides.format(n, s, this.options) : ue(n, s, this.options);
367
+ return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(a) : a;
368
+ }, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : ut(n), this.getMonth = (n, s) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Do(n, this.options), this.getYear = (n, s) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : ko(n, this.options), this.getWeek = (n, s) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : ht(n, this.options), this.isAfter = (n, s) => this.overrides?.isAfter ? this.overrides.isAfter(n, s) : Mo(n, s), this.isBefore = (n, s) => this.overrides?.isBefore ? this.overrides.isBefore(n, s) : bo(n, s), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : eo(n), this.isSameDay = (n, s) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, s) : lo(n, s), this.isSameMonth = (n, s) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, s) : go(n, s), this.isSameYear = (n, s) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, s) : vo(n, s), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : ao(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : io(n), this.setMonth = (n, s) => this.overrides?.setMonth ? this.overrides.setMonth(n, s) : Oo(n, s), this.setYear = (n, s) => this.overrides?.setYear ? this.overrides.setYear(n, s) : wo(n, s), this.startOfBroadcastWeek = (n, s) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Mt(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : ve(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : to(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : uo(n), this.startOfWeek = (n, s) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : no(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : oo(n), this.options = { locale: bt, ...t }, this.overrides = o;
369
+ }
370
+ /**
371
+ * Generates a mapping of Arabic digits (0-9) to the target numbering system
372
+ * digits.
373
+ *
374
+ * @since 9.5.0
375
+ * @returns A record mapping Arabic digits to the target numerals.
376
+ */
377
+ getDigitMap() {
378
+ const { numerals: t = "latn" } = this.options, o = new Intl.NumberFormat("en-US", {
379
+ numberingSystem: t
380
+ }), n = {};
381
+ for (let s = 0; s < 10; s++)
382
+ n[s.toString()] = o.format(s);
383
+ return n;
384
+ }
385
+ /**
386
+ * Replaces Arabic digits in a string with the target numbering system digits.
387
+ *
388
+ * @since 9.5.0
389
+ * @param input The string containing Arabic digits.
390
+ * @returns The string with digits replaced.
391
+ */
392
+ replaceDigits(t) {
393
+ const o = this.getDigitMap();
394
+ return t.replace(/\d/g, (n) => o[n] || n);
395
+ }
396
+ /**
397
+ * Formats a number using the configured numbering system.
398
+ *
399
+ * @since 9.5.0
400
+ * @param value The number to format.
401
+ * @returns The formatted number as a string.
402
+ */
403
+ formatNumber(t) {
404
+ return this.replaceDigits(t.toString());
405
+ }
406
+ /**
407
+ * Returns the preferred ordering for month and year labels for the current
408
+ * locale.
409
+ */
410
+ getMonthYearOrder() {
411
+ const t = this.options.locale?.code;
412
+ return t && R.yearFirstLocales.has(t) ? "year-first" : "month-first";
413
+ }
414
+ /**
415
+ * Formats the month/year pair respecting locale conventions.
416
+ *
417
+ * @since 9.11.0
418
+ */
419
+ formatMonthYear(t) {
420
+ const { locale: o, timeZone: n, numerals: s } = this.options, l = o?.code;
421
+ if (l && R.yearFirstLocales.has(l))
422
+ try {
423
+ return new Intl.DateTimeFormat(l, {
424
+ month: "long",
425
+ year: "numeric",
426
+ timeZone: n,
427
+ numberingSystem: s
428
+ }).format(t);
429
+ } catch {
430
+ }
431
+ const a = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
432
+ return this.format(t, a);
433
+ }
434
+ }
435
+ R.yearFirstLocales = /* @__PURE__ */ new Set([
436
+ "eu",
437
+ "hu",
438
+ "ja",
439
+ "ja-Hira",
440
+ "ja-JP",
441
+ "ko",
442
+ "ko-KR",
443
+ "lt",
444
+ "lt-LT",
445
+ "lv",
446
+ "lv-LV",
447
+ "mn",
448
+ "mn-MN",
449
+ "zh",
450
+ "zh-CN",
451
+ "zh-HK",
452
+ "zh-TW"
453
+ ]);
454
+ const oe = new R();
455
+ class gt {
456
+ constructor(t, o, n = oe) {
457
+ this.date = t, this.displayMonth = o, this.outside = !!(o && !n.isSameMonth(t, o)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(o, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
458
+ }
459
+ /**
460
+ * Checks if this day is equal to another `CalendarDay`, considering both the
461
+ * date and the displayed month.
462
+ *
463
+ * @param day The `CalendarDay` to compare with.
464
+ * @returns `true` if the days are equal, otherwise `false`.
465
+ */
466
+ isEqualTo(t) {
467
+ return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
468
+ }
469
+ }
470
+ class To {
471
+ constructor(t, o) {
472
+ this.date = t, this.weeks = o;
473
+ }
474
+ }
475
+ class Eo {
476
+ constructor(t, o) {
477
+ this.days = o, this.weekNumber = t;
478
+ }
479
+ }
480
+ function xo(e) {
481
+ return u.createElement("button", { ...e });
482
+ }
483
+ function Bo(e) {
484
+ return u.createElement("span", { ...e });
485
+ }
486
+ function Fo(e) {
487
+ const { size: t = 24, orientation: o = "left", className: n } = e;
488
+ return (
489
+ // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
490
+ u.createElement(
491
+ "svg",
492
+ { className: n, width: t, height: t, viewBox: "0 0 24 24" },
493
+ o === "up" && u.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
494
+ o === "down" && u.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
495
+ o === "left" && u.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
496
+ o === "right" && u.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
497
+ )
498
+ );
499
+ }
500
+ function Io(e) {
501
+ const { day: t, modifiers: o, ...n } = e;
502
+ return u.createElement("td", { ...n });
503
+ }
504
+ function Po(e) {
505
+ const { day: t, modifiers: o, ...n } = e, s = u.useRef(null);
506
+ return u.useEffect(() => {
507
+ o.focused && s.current?.focus();
508
+ }, [o.focused]), u.createElement("button", { ref: s, ...n });
509
+ }
510
+ var p;
511
+ (function(e) {
512
+ 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";
513
+ })(p || (p = {}));
514
+ var F;
515
+ (function(e) {
516
+ e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
517
+ })(F || (F = {}));
518
+ var L;
519
+ (function(e) {
520
+ e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
521
+ })(L || (L = {}));
522
+ var j;
523
+ (function(e) {
524
+ 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";
525
+ })(j || (j = {}));
526
+ function Ao(e) {
527
+ const { options: t, className: o, components: n, classNames: s, ...l } = e, a = [s[p.Dropdown], o].join(" "), r = t?.find(({ value: i }) => i === l.value);
528
+ return u.createElement(
529
+ "span",
530
+ { "data-disabled": l.disabled, className: s[p.DropdownRoot] },
531
+ u.createElement(n.Select, { className: a, ...l }, t?.map(({ value: i, label: c, disabled: d }) => u.createElement(n.Option, { key: i, value: i, disabled: d }, c))),
532
+ u.createElement(
533
+ "span",
534
+ { className: s[p.CaptionLabel], "aria-hidden": !0 },
535
+ r?.label,
536
+ u.createElement(n.Chevron, { orientation: "down", size: 18, className: s[p.Chevron] })
537
+ )
538
+ );
539
+ }
540
+ function Ho(e) {
541
+ return u.createElement("div", { ...e });
542
+ }
543
+ function $o(e) {
544
+ return u.createElement("div", { ...e });
545
+ }
546
+ function jo(e) {
547
+ const { calendarMonth: t, displayIndex: o, ...n } = e;
548
+ return u.createElement("div", { ...n }, e.children);
549
+ }
550
+ function zo(e) {
551
+ const { calendarMonth: t, displayIndex: o, ...n } = e;
552
+ return u.createElement("div", { ...n });
553
+ }
554
+ function Ro(e) {
555
+ return u.createElement("table", { ...e });
556
+ }
557
+ function qo(e) {
558
+ return u.createElement("div", { ...e });
559
+ }
560
+ const vt = lt(void 0);
561
+ function pe() {
562
+ const e = mn(vt);
563
+ if (e === void 0)
564
+ throw new Error("useDayPicker() must be used within a custom component.");
565
+ return e;
566
+ }
567
+ function Go(e) {
568
+ const { components: t } = pe();
569
+ return u.createElement(t.Dropdown, { ...e });
570
+ }
571
+ function Vo(e) {
572
+ const { onPreviousClick: t, onNextClick: o, previousMonth: n, nextMonth: s, ...l } = e, { components: a, classNames: r, labels: { labelPrevious: i, labelNext: c } } = pe(), d = U((y) => {
573
+ s && o?.(y);
574
+ }, [s, o]), f = U((y) => {
575
+ n && t?.(y);
576
+ }, [n, t]);
577
+ return u.createElement(
578
+ "nav",
579
+ { ...l },
580
+ u.createElement(
581
+ a.PreviousMonthButton,
582
+ { type: "button", className: r[p.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": i(n), onClick: f },
583
+ u.createElement(a.Chevron, { disabled: n ? void 0 : !0, className: r[p.Chevron], orientation: "left" })
584
+ ),
585
+ u.createElement(
586
+ a.NextMonthButton,
587
+ { type: "button", className: r[p.NextMonthButton], tabIndex: s ? void 0 : -1, "aria-disabled": s ? void 0 : !0, "aria-label": c(s), onClick: d },
588
+ u.createElement(a.Chevron, { disabled: s ? void 0 : !0, orientation: "right", className: r[p.Chevron] })
589
+ )
590
+ );
591
+ }
592
+ function Uo(e) {
593
+ const { components: t } = pe();
594
+ return u.createElement(t.Button, { ...e });
595
+ }
596
+ function Ko(e) {
597
+ return u.createElement("option", { ...e });
598
+ }
599
+ function Zo(e) {
600
+ const { components: t } = pe();
601
+ return u.createElement(t.Button, { ...e });
602
+ }
603
+ function Jo(e) {
604
+ const { rootRef: t, ...o } = e;
605
+ return u.createElement("div", { ...o, ref: t });
606
+ }
607
+ function Qo(e) {
608
+ return u.createElement("select", { ...e });
609
+ }
610
+ function Xo(e) {
611
+ const { week: t, ...o } = e;
612
+ return u.createElement("tr", { ...o });
613
+ }
614
+ function Lo(e) {
615
+ return u.createElement("th", { ...e });
616
+ }
617
+ function es(e) {
618
+ return u.createElement(
619
+ "thead",
620
+ { "aria-hidden": !0 },
621
+ u.createElement("tr", { ...e })
622
+ );
623
+ }
624
+ function ts(e) {
625
+ const { week: t, ...o } = e;
626
+ return u.createElement("th", { ...o });
627
+ }
628
+ function ns(e) {
629
+ return u.createElement("th", { ...e });
630
+ }
631
+ function os(e) {
632
+ return u.createElement("tbody", { ...e });
633
+ }
634
+ function ss(e) {
635
+ const { components: t } = pe();
636
+ return u.createElement(t.Dropdown, { ...e });
637
+ }
638
+ const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
639
+ __proto__: null,
640
+ Button: xo,
641
+ CaptionLabel: Bo,
642
+ Chevron: Fo,
643
+ Day: Io,
644
+ DayButton: Po,
645
+ Dropdown: Ao,
646
+ DropdownNav: Ho,
647
+ Footer: $o,
648
+ Month: jo,
649
+ MonthCaption: zo,
650
+ MonthGrid: Ro,
651
+ Months: qo,
652
+ MonthsDropdown: Go,
653
+ Nav: Vo,
654
+ NextMonthButton: Uo,
655
+ Option: Ko,
656
+ PreviousMonthButton: Zo,
657
+ Root: Jo,
658
+ Select: Qo,
659
+ Week: Xo,
660
+ WeekNumber: ts,
661
+ WeekNumberHeader: ns,
662
+ Weekday: Lo,
663
+ Weekdays: es,
664
+ Weeks: os,
665
+ YearsDropdown: ss
666
+ }, Symbol.toStringTag, { value: "Module" }));
667
+ function se(e, t, o = !1, n = oe) {
668
+ let { from: s, to: l } = e;
669
+ const { differenceInCalendarDays: a, isSameDay: r } = n;
670
+ return s && l ? (a(l, s) < 0 && ([s, l] = [l, s]), a(t, s) >= (o ? 1 : 0) && a(l, t) >= (o ? 1 : 0)) : !o && l ? r(l, t) : !o && s ? r(s, t) : !1;
671
+ }
672
+ function je(e) {
673
+ return !!(e && typeof e == "object" && "before" in e && "after" in e);
674
+ }
675
+ function Oe(e) {
676
+ return !!(e && typeof e == "object" && "from" in e);
677
+ }
678
+ function ze(e) {
679
+ return !!(e && typeof e == "object" && "after" in e);
680
+ }
681
+ function Re(e) {
682
+ return !!(e && typeof e == "object" && "before" in e);
683
+ }
684
+ function Ot(e) {
685
+ return !!(e && typeof e == "object" && "dayOfWeek" in e);
686
+ }
687
+ function wt(e, t) {
688
+ return Array.isArray(e) && e.every(t.isDate);
689
+ }
690
+ function re(e, t, o = oe) {
691
+ const n = Array.isArray(t) ? t : [t], { isSameDay: s, differenceInCalendarDays: l, isAfter: a } = o;
692
+ return n.some((r) => {
693
+ if (typeof r == "boolean")
694
+ return r;
695
+ if (o.isDate(r))
696
+ return s(e, r);
697
+ if (wt(r, o))
698
+ return r.some((i) => s(e, i));
699
+ if (Oe(r))
700
+ return se(r, e, !1, o);
701
+ if (Ot(r))
702
+ return Array.isArray(r.dayOfWeek) ? r.dayOfWeek.includes(e.getDay()) : r.dayOfWeek === e.getDay();
703
+ if (je(r)) {
704
+ const i = l(r.before, e), c = l(r.after, e), d = i > 0, f = c < 0;
705
+ return a(r.before, r.after) ? f && d : d || f;
706
+ }
707
+ return ze(r) ? l(e, r.after) > 0 : Re(r) ? l(r.before, e) > 0 : typeof r == "function" ? r(e) : !1;
708
+ });
709
+ }
710
+ function as(e, t, o, n, s) {
711
+ const { disabled: l, hidden: a, modifiers: r, showOutsideDays: i, broadcastCalendar: c, today: d = s.today() } = t, { isSameDay: f, isSameMonth: y, startOfMonth: D, isBefore: w, endOfMonth: W, isAfter: v } = s, N = o && D(o), h = n && W(n), M = {
712
+ [F.focused]: [],
713
+ [F.outside]: [],
714
+ [F.disabled]: [],
715
+ [F.hidden]: [],
716
+ [F.today]: []
717
+ }, g = {};
718
+ for (const k of e) {
719
+ const { date: m, displayMonth: C } = k, x = !!(C && !y(m, C)), I = !!(N && w(m, N)), B = !!(h && v(m, h)), q = !!(l && re(m, l, s)), J = !!(a && re(m, a, s)) || I || B || // Broadcast calendar will show outside days as default
720
+ !c && !i && x || c && i === !1 && x, Q = f(m, d);
721
+ x && M.outside.push(k), q && M.disabled.push(k), J && M.hidden.push(k), Q && M.today.push(k), r && Object.keys(r).forEach((Y) => {
722
+ const H = r?.[Y];
723
+ H && re(m, H, s) && (g[Y] ? g[Y].push(k) : g[Y] = [k]);
724
+ });
725
+ }
726
+ return (k) => {
727
+ const m = {
728
+ [F.focused]: !1,
729
+ [F.disabled]: !1,
730
+ [F.hidden]: !1,
731
+ [F.outside]: !1,
732
+ [F.today]: !1
733
+ }, C = {};
734
+ for (const x in M) {
735
+ const I = M[x];
736
+ m[x] = I.some((B) => B === k);
737
+ }
738
+ for (const x in g)
739
+ C[x] = g[x].some((I) => I === k);
740
+ return {
741
+ ...m,
742
+ // custom modifiers should override all the previous ones
743
+ ...C
744
+ };
745
+ };
746
+ }
747
+ function is(e, t, o = {}) {
748
+ return Object.entries(e).filter(([, s]) => s === !0).reduce((s, [l]) => (o[l] ? s.push(o[l]) : t[F[l]] ? s.push(t[F[l]]) : t[L[l]] && s.push(t[L[l]]), s), [t[p.Day]]);
749
+ }
750
+ function ls(e) {
751
+ return {
752
+ ...rs,
753
+ ...e
754
+ };
755
+ }
756
+ function cs(e) {
757
+ const t = {
758
+ "data-mode": e.mode ?? void 0,
759
+ "data-required": "required" in e ? e.required : void 0,
760
+ "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
761
+ "data-week-numbers": e.showWeekNumber || void 0,
762
+ "data-broadcast-calendar": e.broadcastCalendar || void 0,
763
+ "data-nav-layout": e.navLayout || void 0
764
+ };
765
+ return Object.entries(e).forEach(([o, n]) => {
766
+ o.startsWith("data-") && (t[o] = n);
767
+ }), t;
768
+ }
769
+ function Nt() {
770
+ const e = {};
771
+ for (const t in p)
772
+ e[p[t]] = `rdp-${p[t]}`;
773
+ for (const t in F)
774
+ e[F[t]] = `rdp-${F[t]}`;
775
+ for (const t in L)
776
+ e[L[t]] = `rdp-${L[t]}`;
777
+ for (const t in j)
778
+ e[j[t]] = `rdp-${j[t]}`;
779
+ return e;
780
+ }
781
+ function Ct(e, t, o) {
782
+ return (o ?? new R(t)).formatMonthYear(e);
783
+ }
784
+ const fs = Ct;
785
+ function ds(e, t, o) {
786
+ return (o ?? new R(t)).format(e, "d");
787
+ }
788
+ function us(e, t = oe) {
789
+ return t.format(e, "LLLL");
790
+ }
791
+ function hs(e, t, o) {
792
+ return (o ?? new R(t)).format(e, "cccccc");
793
+ }
794
+ function ms(e, t = oe) {
795
+ return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
796
+ }
797
+ function ys() {
798
+ return "";
799
+ }
800
+ function Wt(e, t = oe) {
801
+ return t.format(e, "yyyy");
802
+ }
803
+ const ps = Wt, Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
804
+ __proto__: null,
805
+ formatCaption: Ct,
806
+ formatDay: ds,
807
+ formatMonthCaption: fs,
808
+ formatMonthDropdown: us,
809
+ formatWeekNumber: ms,
810
+ formatWeekNumberHeader: ys,
811
+ formatWeekdayName: hs,
812
+ formatYearCaption: ps,
813
+ formatYearDropdown: Wt
814
+ }, Symbol.toStringTag, { value: "Module" }));
815
+ function ks(e) {
816
+ return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
817
+ ...Ds,
818
+ ...e
819
+ };
820
+ }
821
+ function qe(e, t, o, n) {
822
+ let s = (n ?? new R(o)).format(e, "PPPP");
823
+ return t.today && (s = `Today, ${s}`), t.selected && (s = `${s}, selected`), s;
824
+ }
825
+ const Ms = qe;
826
+ function Ge(e, t, o) {
827
+ return (o ?? new R(t)).formatMonthYear(e);
828
+ }
829
+ const bs = Ge;
830
+ function St(e, t, o, n) {
831
+ let s = (n ?? new R(o)).format(e, "PPPP");
832
+ return t?.today && (s = `Today, ${s}`), s;
833
+ }
834
+ function _t(e) {
835
+ return "Choose the Month";
836
+ }
837
+ function Yt() {
838
+ return "";
839
+ }
840
+ const gs = "Go to the Next Month";
841
+ function Tt(e, t) {
842
+ return gs;
843
+ }
844
+ function Et(e) {
845
+ return "Go to the Previous Month";
846
+ }
847
+ function xt(e, t, o) {
848
+ return (o ?? new R(t)).format(e, "cccc");
849
+ }
850
+ function Bt(e, t) {
851
+ return `Week ${e}`;
852
+ }
853
+ function Ft(e) {
854
+ return "Week Number";
855
+ }
856
+ function It(e) {
857
+ return "Choose the Year";
858
+ }
859
+ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
860
+ __proto__: null,
861
+ labelCaption: bs,
862
+ labelDay: Ms,
863
+ labelDayButton: qe,
864
+ labelGrid: Ge,
865
+ labelGridcell: St,
866
+ labelMonthDropdown: _t,
867
+ labelNav: Yt,
868
+ labelNext: Tt,
869
+ labelPrevious: Et,
870
+ labelWeekNumber: Bt,
871
+ labelWeekNumberHeader: Ft,
872
+ labelWeekday: xt,
873
+ labelYearDropdown: It
874
+ }, Symbol.toStringTag, { value: "Module" })), X = (e, t, o) => t || (o ? typeof o == "function" ? o : (...n) => o : e);
875
+ function Os(e, t) {
876
+ const o = t.locale?.labels ?? {};
877
+ return {
878
+ ...vs,
879
+ ...e ?? {},
880
+ labelDayButton: X(qe, e?.labelDayButton, o.labelDayButton),
881
+ labelMonthDropdown: X(_t, e?.labelMonthDropdown, o.labelMonthDropdown),
882
+ labelNext: X(Tt, e?.labelNext, o.labelNext),
883
+ labelPrevious: X(Et, e?.labelPrevious, o.labelPrevious),
884
+ labelWeekNumber: X(Bt, e?.labelWeekNumber, o.labelWeekNumber),
885
+ labelYearDropdown: X(It, e?.labelYearDropdown, o.labelYearDropdown),
886
+ labelGrid: X(Ge, e?.labelGrid, o.labelGrid),
887
+ labelGridcell: X(St, e?.labelGridcell, o.labelGridcell),
888
+ labelNav: X(Yt, e?.labelNav, o.labelNav),
889
+ labelWeekNumberHeader: X(Ft, e?.labelWeekNumberHeader, o.labelWeekNumberHeader),
890
+ labelWeekday: X(xt, e?.labelWeekday, o.labelWeekday)
891
+ };
892
+ }
893
+ function ws(e, t, o, n, s) {
894
+ const { startOfMonth: l, startOfYear: a, endOfYear: r, eachMonthOfInterval: i, getMonth: c } = s;
895
+ return i({
896
+ start: a(e),
897
+ end: r(e)
898
+ }).map((y) => {
899
+ const D = n.formatMonthDropdown(y, s), w = c(y), W = t && y < l(t) || o && y > l(o) || !1;
900
+ return { value: w, label: D, disabled: W };
901
+ });
902
+ }
903
+ function Ns(e, t = {}, o = {}) {
904
+ let n = { ...t?.[p.Day] };
905
+ return Object.entries(e).filter(([, s]) => s === !0).forEach(([s]) => {
906
+ n = {
907
+ ...n,
908
+ ...o?.[s]
909
+ };
910
+ }), n;
911
+ }
912
+ function Cs(e, t, o, n) {
913
+ const s = n ?? e.today(), l = o ? e.startOfBroadcastWeek(s, e) : t ? e.startOfISOWeek(s) : e.startOfWeek(s), a = [];
914
+ for (let r = 0; r < 7; r++) {
915
+ const i = e.addDays(l, r);
916
+ a.push(i);
917
+ }
918
+ return a;
919
+ }
920
+ function Ws(e, t, o, n, s = !1) {
921
+ if (!e || !t)
922
+ return;
923
+ const { startOfYear: l, endOfYear: a, eachYearOfInterval: r, getYear: i } = n, c = l(e), d = a(t), f = r({ start: c, end: d });
924
+ return s && f.reverse(), f.map((y) => {
925
+ const D = o.formatYearDropdown(y, n);
926
+ return {
927
+ value: i(y),
928
+ label: D,
929
+ disabled: !1
930
+ };
931
+ });
932
+ }
933
+ function Ss(e, t = {}) {
934
+ const { weekStartsOn: o, locale: n } = t, s = o ?? n?.options?.weekStartsOn ?? 0, l = (r) => {
935
+ const i = typeof r == "number" || typeof r == "string" ? new Date(r) : r;
936
+ return new A(i.getFullYear(), i.getMonth(), i.getDate(), 12, 0, 0, e);
937
+ }, a = (r) => {
938
+ const i = l(r);
939
+ return new Date(i.getFullYear(), i.getMonth(), i.getDate(), 0, 0, 0, 0);
940
+ };
941
+ return {
942
+ today: () => l(A.tz(e)),
943
+ newDate: (r, i, c) => new A(r, i, c, 12, 0, 0, e),
944
+ startOfDay: (r) => l(r),
945
+ startOfWeek: (r, i) => {
946
+ const c = l(r), d = i?.weekStartsOn ?? s, f = (c.getDay() - d + 7) % 7;
947
+ return c.setDate(c.getDate() - f), c;
948
+ },
949
+ startOfISOWeek: (r) => {
950
+ const i = l(r), c = (i.getDay() - 1 + 7) % 7;
951
+ return i.setDate(i.getDate() - c), i;
952
+ },
953
+ startOfMonth: (r) => {
954
+ const i = l(r);
955
+ return i.setDate(1), i;
956
+ },
957
+ startOfYear: (r) => {
958
+ const i = l(r);
959
+ return i.setMonth(0, 1), i;
960
+ },
961
+ endOfWeek: (r, i) => {
962
+ const c = l(r), y = (((i?.weekStartsOn ?? s) + 6) % 7 - c.getDay() + 7) % 7;
963
+ return c.setDate(c.getDate() + y), c;
964
+ },
965
+ endOfISOWeek: (r) => {
966
+ const i = l(r), c = (7 - i.getDay()) % 7;
967
+ return i.setDate(i.getDate() + c), i;
968
+ },
969
+ endOfMonth: (r) => {
970
+ const i = l(r);
971
+ return i.setMonth(i.getMonth() + 1, 0), i;
972
+ },
973
+ endOfYear: (r) => {
974
+ const i = l(r);
975
+ return i.setMonth(11, 31), i;
976
+ },
977
+ eachMonthOfInterval: (r) => {
978
+ const i = l(r.start), c = l(r.end), d = [], f = new A(i.getFullYear(), i.getMonth(), 1, 12, 0, 0, e), y = c.getFullYear() * 12 + c.getMonth();
979
+ for (; f.getFullYear() * 12 + f.getMonth() <= y; )
980
+ d.push(new A(f, e)), f.setMonth(f.getMonth() + 1, 1);
981
+ return d;
982
+ },
983
+ // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
984
+ // mutate the same TZDate, and return it.
985
+ addDays: (r, i) => {
986
+ const c = l(r);
987
+ return c.setDate(c.getDate() + i), c;
988
+ },
989
+ addWeeks: (r, i) => {
990
+ const c = l(r);
991
+ return c.setDate(c.getDate() + i * 7), c;
992
+ },
993
+ addMonths: (r, i) => {
994
+ const c = l(r);
995
+ return c.setMonth(c.getMonth() + i), c;
996
+ },
997
+ addYears: (r, i) => {
998
+ const c = l(r);
999
+ return c.setFullYear(c.getFullYear() + i), c;
1000
+ },
1001
+ eachYearOfInterval: (r) => {
1002
+ const i = l(r.start), c = l(r.end), d = [], f = new A(i.getFullYear(), 0, 1, 12, 0, 0, e);
1003
+ for (; f.getFullYear() <= c.getFullYear(); )
1004
+ d.push(new A(f, e)), f.setFullYear(f.getFullYear() + 1, 0, 1);
1005
+ return d;
1006
+ },
1007
+ getWeek: (r, i) => {
1008
+ const c = a(r);
1009
+ return ht(c, {
1010
+ weekStartsOn: i?.weekStartsOn ?? s,
1011
+ firstWeekContainsDate: i?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
1012
+ });
1013
+ },
1014
+ getISOWeek: (r) => {
1015
+ const i = a(r);
1016
+ return ut(i);
1017
+ },
1018
+ differenceInCalendarDays: (r, i) => {
1019
+ const c = a(r), d = a(i);
1020
+ return dt(c, d);
1021
+ },
1022
+ differenceInCalendarMonths: (r, i) => {
1023
+ const c = a(r), d = a(i);
1024
+ return yt(c, d);
1025
+ }
1026
+ };
1027
+ }
1028
+ const De = (e) => e instanceof HTMLElement ? e : null, Fe = (e) => [
1029
+ ...e.querySelectorAll("[data-animated-month]") ?? []
1030
+ ], _s = (e) => De(e.querySelector("[data-animated-month]")), Ie = (e) => De(e.querySelector("[data-animated-caption]")), Pe = (e) => De(e.querySelector("[data-animated-weeks]")), Ys = (e) => De(e.querySelector("[data-animated-nav]")), Ts = (e) => De(e.querySelector("[data-animated-weekdays]"));
1031
+ function Es(e, t, { classNames: o, months: n, focused: s, dateLib: l }) {
1032
+ const a = me(null), r = me(n), i = me(!1);
1033
+ yn(() => {
1034
+ const c = r.current;
1035
+ if (r.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
1036
+ !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
1037
+ n.length === 0 || c.length === 0 || n.length !== c.length)
1038
+ return;
1039
+ const d = l.isSameMonth(n[0].date, c[0].date), f = l.isAfter(n[0].date, c[0].date), y = f ? o[j.caption_after_enter] : o[j.caption_before_enter], D = f ? o[j.weeks_after_enter] : o[j.weeks_before_enter], w = a.current, W = e.current.cloneNode(!0);
1040
+ if (W instanceof HTMLElement ? (Fe(W).forEach((M) => {
1041
+ if (!(M instanceof HTMLElement))
1042
+ return;
1043
+ const g = _s(M);
1044
+ g && M.contains(g) && M.removeChild(g);
1045
+ const k = Ie(M);
1046
+ k && k.classList.remove(y);
1047
+ const m = Pe(M);
1048
+ m && m.classList.remove(D);
1049
+ }), a.current = W) : a.current = null, i.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
1050
+ s)
1051
+ return;
1052
+ const v = w instanceof HTMLElement ? Fe(w) : [], N = Fe(e.current);
1053
+ if (N?.every((h) => h instanceof HTMLElement) && v && v.every((h) => h instanceof HTMLElement)) {
1054
+ i.current = !0, e.current.style.isolation = "isolate";
1055
+ const h = Ys(e.current);
1056
+ h && (h.style.zIndex = "1"), N.forEach((M, g) => {
1057
+ const k = v[g];
1058
+ if (!k)
1059
+ return;
1060
+ M.style.position = "relative", M.style.overflow = "hidden";
1061
+ const m = Ie(M);
1062
+ m && m.classList.add(y);
1063
+ const C = Pe(M);
1064
+ C && C.classList.add(D);
1065
+ const x = () => {
1066
+ i.current = !1, e.current && (e.current.style.isolation = ""), h && (h.style.zIndex = ""), m && m.classList.remove(y), C && C.classList.remove(D), M.style.position = "", M.style.overflow = "", M.contains(k) && M.removeChild(k);
1067
+ };
1068
+ k.style.pointerEvents = "none", k.style.position = "absolute", k.style.overflow = "hidden", k.setAttribute("aria-hidden", "true");
1069
+ const I = Ts(k);
1070
+ I && (I.style.opacity = "0");
1071
+ const B = Ie(k);
1072
+ B && (B.classList.add(f ? o[j.caption_before_exit] : o[j.caption_after_exit]), B.addEventListener("animationend", x));
1073
+ const q = Pe(k);
1074
+ q && q.classList.add(f ? o[j.weeks_before_exit] : o[j.weeks_after_exit]), M.insertBefore(k, M.firstChild);
1075
+ });
1076
+ }
1077
+ });
1078
+ }
1079
+ function xs(e, t, o, n) {
1080
+ const s = e[0], l = e[e.length - 1], { ISOWeek: a, fixedWeeks: r, broadcastCalendar: i } = o ?? {}, { addDays: c, differenceInCalendarDays: d, differenceInCalendarMonths: f, endOfBroadcastWeek: y, endOfISOWeek: D, endOfMonth: w, endOfWeek: W, isAfter: v, startOfBroadcastWeek: N, startOfISOWeek: h, startOfWeek: M } = n, g = i ? N(s, n) : a ? h(s) : M(s), k = i ? y(l) : a ? D(w(l)) : W(w(l)), m = t && (i ? y(t) : a ? D(t) : W(t)), C = m && v(k, m) ? m : k, x = d(C, g), I = f(l, s) + 1, B = [];
1081
+ for (let Q = 0; Q <= x; Q++) {
1082
+ const Y = c(g, Q);
1083
+ B.push(Y);
1084
+ }
1085
+ const J = (i ? 35 : 42) * I;
1086
+ if (r && B.length < J) {
1087
+ const Q = J - B.length;
1088
+ for (let Y = 0; Y < Q; Y++) {
1089
+ const H = c(B[B.length - 1], 1);
1090
+ B.push(H);
1091
+ }
1092
+ }
1093
+ return B;
1094
+ }
1095
+ function Bs(e) {
1096
+ const t = [];
1097
+ return e.reduce((o, n) => {
1098
+ const s = n.weeks.reduce((l, a) => l.concat(a.days.slice()), t.slice());
1099
+ return o.concat(s.slice());
1100
+ }, t.slice());
1101
+ }
1102
+ function Fs(e, t, o, n) {
1103
+ const { numberOfMonths: s = 1 } = o, l = [];
1104
+ for (let a = 0; a < s; a++) {
1105
+ const r = n.addMonths(e, a);
1106
+ if (t && r > t)
1107
+ break;
1108
+ l.push(r);
1109
+ }
1110
+ return l;
1111
+ }
1112
+ function st(e, t, o, n) {
1113
+ const { month: s, defaultMonth: l, today: a = n.today(), numberOfMonths: r = 1 } = e;
1114
+ let i = s || l || a;
1115
+ const { differenceInCalendarMonths: c, addMonths: d, startOfMonth: f } = n;
1116
+ if (o && c(o, i) < r - 1) {
1117
+ const y = -1 * (r - 1);
1118
+ i = d(o, y);
1119
+ }
1120
+ return t && c(i, t) < 0 && (i = t), f(i);
1121
+ }
1122
+ function Is(e, t, o, n) {
1123
+ const { addDays: s, endOfBroadcastWeek: l, endOfISOWeek: a, endOfMonth: r, endOfWeek: i, getISOWeek: c, getWeek: d, startOfBroadcastWeek: f, startOfISOWeek: y, startOfWeek: D } = n, w = e.reduce((W, v) => {
1124
+ const N = o.broadcastCalendar ? f(v, n) : o.ISOWeek ? y(v) : D(v), h = o.broadcastCalendar ? l(v) : o.ISOWeek ? a(r(v)) : i(r(v)), M = t.filter((C) => C >= N && C <= h), g = o.broadcastCalendar ? 35 : 42;
1125
+ if (o.fixedWeeks && M.length < g) {
1126
+ const C = t.filter((x) => {
1127
+ const I = g - M.length;
1128
+ return x > h && x <= s(h, I);
1129
+ });
1130
+ M.push(...C);
1131
+ }
1132
+ const k = M.reduce((C, x) => {
1133
+ const I = o.ISOWeek ? c(x) : d(x), B = C.find((J) => J.weekNumber === I), q = new gt(x, v, n);
1134
+ return B ? B.days.push(q) : C.push(new Eo(I, [q])), C;
1135
+ }, []), m = new To(v, k);
1136
+ return W.push(m), W;
1137
+ }, []);
1138
+ return o.reverseMonths ? w.reverse() : w;
1139
+ }
1140
+ function Ps(e, t) {
1141
+ let { startMonth: o, endMonth: n } = e;
1142
+ const { startOfYear: s, startOfDay: l, startOfMonth: a, endOfMonth: r, addYears: i, endOfYear: c, newDate: d, today: f } = t, { fromYear: y, toYear: D, fromMonth: w, toMonth: W } = e;
1143
+ !o && w && (o = w), !o && y && (o = t.newDate(y, 0, 1)), !n && W && (n = W), !n && D && (n = d(D, 11, 31));
1144
+ const v = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
1145
+ return o ? o = a(o) : y ? o = d(y, 0, 1) : !o && v && (o = s(i(e.today ?? f(), -100))), n ? n = r(n) : D ? n = d(D, 11, 31) : !n && v && (n = c(e.today ?? f())), [
1146
+ o && l(o),
1147
+ n && l(n)
1148
+ ];
1149
+ }
1150
+ function As(e, t, o, n) {
1151
+ if (o.disableNavigation)
1152
+ return;
1153
+ const { pagedNavigation: s, numberOfMonths: l = 1 } = o, { startOfMonth: a, addMonths: r, differenceInCalendarMonths: i } = n, c = s ? l : 1, d = a(e);
1154
+ if (!t)
1155
+ return r(d, c);
1156
+ if (!(i(t, e) < l))
1157
+ return r(d, c);
1158
+ }
1159
+ function Hs(e, t, o, n) {
1160
+ if (o.disableNavigation)
1161
+ return;
1162
+ const { pagedNavigation: s, numberOfMonths: l } = o, { startOfMonth: a, addMonths: r, differenceInCalendarMonths: i } = n, c = s ? l ?? 1 : 1, d = a(e);
1163
+ if (!t)
1164
+ return r(d, -c);
1165
+ if (!(i(d, t) <= 0))
1166
+ return r(d, -c);
1167
+ }
1168
+ function $s(e) {
1169
+ const t = [];
1170
+ return e.reduce((o, n) => o.concat(n.weeks.slice()), t.slice());
1171
+ }
1172
+ function we(e, t) {
1173
+ const [o, n] = ge(e);
1174
+ return [t === void 0 ? o : t, n];
1175
+ }
1176
+ function js(e, t) {
1177
+ const [o, n] = Ps(e, t), { startOfMonth: s, endOfMonth: l } = t, a = st(e, o, n, t), [r, i] = we(
1178
+ a,
1179
+ // initialMonth is always computed from props.month if provided
1180
+ e.month ? a : void 0
1181
+ );
1182
+ ct(() => {
1183
+ const g = st(e, o, n, t);
1184
+ i(g);
1185
+ }, [e.timeZone]);
1186
+ const { months: c, weeks: d, days: f, previousMonth: y, nextMonth: D } = be(() => {
1187
+ const g = Fs(r, n, { numberOfMonths: e.numberOfMonths }, t), k = xs(g, e.endMonth ? l(e.endMonth) : void 0, {
1188
+ ISOWeek: e.ISOWeek,
1189
+ fixedWeeks: e.fixedWeeks,
1190
+ broadcastCalendar: e.broadcastCalendar
1191
+ }, t), m = Is(g, k, {
1192
+ broadcastCalendar: e.broadcastCalendar,
1193
+ fixedWeeks: e.fixedWeeks,
1194
+ ISOWeek: e.ISOWeek,
1195
+ reverseMonths: e.reverseMonths
1196
+ }, t), C = $s(m), x = Bs(m), I = Hs(r, o, e, t), B = As(r, n, e, t);
1197
+ return {
1198
+ months: m,
1199
+ weeks: C,
1200
+ days: x,
1201
+ previousMonth: I,
1202
+ nextMonth: B
1203
+ };
1204
+ }, [
1205
+ t,
1206
+ r.getTime(),
1207
+ n?.getTime(),
1208
+ o?.getTime(),
1209
+ e.disableNavigation,
1210
+ e.broadcastCalendar,
1211
+ e.endMonth?.getTime(),
1212
+ e.fixedWeeks,
1213
+ e.ISOWeek,
1214
+ e.numberOfMonths,
1215
+ e.pagedNavigation,
1216
+ e.reverseMonths
1217
+ ]), { disableNavigation: w, onMonthChange: W } = e, v = (g) => d.some((k) => k.days.some((m) => m.isEqualTo(g))), N = (g) => {
1218
+ if (w)
1219
+ return;
1220
+ let k = s(g);
1221
+ o && k < s(o) && (k = s(o)), n && k > s(n) && (k = s(n)), i(k), W?.(k);
1222
+ };
1223
+ return {
1224
+ months: c,
1225
+ weeks: d,
1226
+ days: f,
1227
+ navStart: o,
1228
+ navEnd: n,
1229
+ previousMonth: y,
1230
+ nextMonth: D,
1231
+ goToMonth: N,
1232
+ goToDay: (g) => {
1233
+ v(g) || N(g.date);
1234
+ }
1235
+ };
1236
+ }
1237
+ var te;
1238
+ (function(e) {
1239
+ e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
1240
+ })(te || (te = {}));
1241
+ function rt(e) {
1242
+ return !e[F.disabled] && !e[F.hidden] && !e[F.outside];
1243
+ }
1244
+ function zs(e, t, o, n) {
1245
+ let s, l = -1;
1246
+ for (const a of e) {
1247
+ const r = t(a);
1248
+ rt(r) && (r[F.focused] && l < te.FocusedModifier ? (s = a, l = te.FocusedModifier) : n?.isEqualTo(a) && l < te.LastFocused ? (s = a, l = te.LastFocused) : o(a.date) && l < te.Selected ? (s = a, l = te.Selected) : r[F.today] && l < te.Today && (s = a, l = te.Today));
1249
+ }
1250
+ return s || (s = e.find((a) => rt(t(a)))), s;
1251
+ }
1252
+ function Rs(e, t, o, n, s, l, a) {
1253
+ const { ISOWeek: r, broadcastCalendar: i } = l, { addDays: c, addMonths: d, addWeeks: f, addYears: y, endOfBroadcastWeek: D, endOfISOWeek: w, endOfWeek: W, max: v, min: N, startOfBroadcastWeek: h, startOfISOWeek: M, startOfWeek: g } = a;
1254
+ let m = {
1255
+ day: c,
1256
+ week: f,
1257
+ month: d,
1258
+ year: y,
1259
+ startOfWeek: (C) => i ? h(C, a) : r ? M(C) : g(C),
1260
+ endOfWeek: (C) => i ? D(C) : r ? w(C) : W(C)
1261
+ }[e](o, t === "after" ? 1 : -1);
1262
+ return t === "before" && n ? m = v([n, m]) : t === "after" && s && (m = N([s, m])), m;
1263
+ }
1264
+ function Pt(e, t, o, n, s, l, a, r = 0) {
1265
+ if (r > 365)
1266
+ return;
1267
+ const i = Rs(e, t, o.date, n, s, l, a), c = !!(l.disabled && re(i, l.disabled, a)), d = !!(l.hidden && re(i, l.hidden, a)), f = i, y = new gt(i, f, a);
1268
+ return !c && !d ? y : Pt(e, t, y, n, s, l, a, r + 1);
1269
+ }
1270
+ function qs(e, t, o, n, s) {
1271
+ const { autoFocus: l } = e, [a, r] = ge(), i = zs(t.days, o, n || (() => !1), a), [c, d] = ge(l ? i : void 0);
1272
+ return {
1273
+ isFocusTarget: (W) => !!i?.isEqualTo(W),
1274
+ setFocused: d,
1275
+ focused: c,
1276
+ blur: () => {
1277
+ r(c), d(void 0);
1278
+ },
1279
+ moveFocus: (W, v) => {
1280
+ if (!c)
1281
+ return;
1282
+ const N = Pt(W, v, c, t.navStart, t.navEnd, e, s);
1283
+ N && (e.disableNavigation && !t.days.some((M) => M.isEqualTo(N)) || (t.goToDay(N), d(N)));
1284
+ }
1285
+ };
1286
+ }
1287
+ function Gs(e, t) {
1288
+ const { selected: o, required: n, onSelect: s } = e, [l, a] = we(o, s ? o : void 0), r = s ? o : l, { isSameDay: i } = t, c = (D) => r?.some((w) => i(w, D)) ?? !1, { min: d, max: f } = e;
1289
+ return {
1290
+ selected: r,
1291
+ select: (D, w, W) => {
1292
+ let v = [...r ?? []];
1293
+ if (c(D)) {
1294
+ if (r?.length === d || n && r?.length === 1)
1295
+ return;
1296
+ v = r?.filter((N) => !i(N, D));
1297
+ } else
1298
+ r?.length === f ? v = [D] : v = [...v, D];
1299
+ return s || a(v), s?.(v, D, w, W), v;
1300
+ },
1301
+ isSelected: c
1302
+ };
1303
+ }
1304
+ function Vs(e, t, o = 0, n = 0, s = !1, l = oe) {
1305
+ const { from: a, to: r } = t || {}, { isSameDay: i, isAfter: c, isBefore: d } = l;
1306
+ let f;
1307
+ if (!a && !r)
1308
+ f = { from: e, to: o > 0 ? void 0 : e };
1309
+ else if (a && !r)
1310
+ i(a, e) ? o === 0 ? f = { from: a, to: e } : s ? f = { from: a, to: void 0 } : f = void 0 : d(e, a) ? f = { from: e, to: a } : f = { from: a, to: e };
1311
+ else if (a && r)
1312
+ if (i(a, e) && i(r, e))
1313
+ s ? f = { from: a, to: r } : f = void 0;
1314
+ else if (i(a, e))
1315
+ f = { from: a, to: o > 0 ? void 0 : e };
1316
+ else if (i(r, e))
1317
+ f = { from: e, to: o > 0 ? void 0 : e };
1318
+ else if (d(e, a))
1319
+ f = { from: e, to: r };
1320
+ else if (c(e, a))
1321
+ f = { from: a, to: e };
1322
+ else if (c(e, r))
1323
+ f = { from: a, to: e };
1324
+ else
1325
+ throw new Error("Invalid range");
1326
+ if (f?.from && f?.to) {
1327
+ const y = l.differenceInCalendarDays(f.to, f.from);
1328
+ n > 0 && y > n ? f = { from: e, to: void 0 } : o > 1 && y < o && (f = { from: e, to: void 0 });
1329
+ }
1330
+ return f;
1331
+ }
1332
+ function Us(e, t, o = oe) {
1333
+ const n = Array.isArray(t) ? t : [t];
1334
+ let s = e.from;
1335
+ const l = o.differenceInCalendarDays(e.to, e.from), a = Math.min(l, 6);
1336
+ for (let r = 0; r <= a; r++) {
1337
+ if (n.includes(s.getDay()))
1338
+ return !0;
1339
+ s = o.addDays(s, 1);
1340
+ }
1341
+ return !1;
1342
+ }
1343
+ function at(e, t, o = oe) {
1344
+ return se(e, t.from, !1, o) || se(e, t.to, !1, o) || se(t, e.from, !1, o) || se(t, e.to, !1, o);
1345
+ }
1346
+ function Ks(e, t, o = oe) {
1347
+ const n = Array.isArray(t) ? t : [t];
1348
+ if (n.filter((r) => typeof r != "function").some((r) => typeof r == "boolean" ? r : o.isDate(r) ? se(e, r, !1, o) : wt(r, o) ? r.some((i) => se(e, i, !1, o)) : Oe(r) ? r.from && r.to ? at(e, { from: r.from, to: r.to }, o) : !1 : Ot(r) ? Us(e, r.dayOfWeek, o) : je(r) ? o.isAfter(r.before, r.after) ? at(e, {
1349
+ from: o.addDays(r.after, 1),
1350
+ to: o.addDays(r.before, -1)
1351
+ }, o) : re(e.from, r, o) || re(e.to, r, o) : ze(r) || Re(r) ? re(e.from, r, o) || re(e.to, r, o) : !1))
1352
+ return !0;
1353
+ const a = n.filter((r) => typeof r == "function");
1354
+ if (a.length) {
1355
+ let r = e.from;
1356
+ const i = o.differenceInCalendarDays(e.to, e.from);
1357
+ for (let c = 0; c <= i; c++) {
1358
+ if (a.some((d) => d(r)))
1359
+ return !0;
1360
+ r = o.addDays(r, 1);
1361
+ }
1362
+ }
1363
+ return !1;
1364
+ }
1365
+ function Zs(e, t) {
1366
+ const { disabled: o, excludeDisabled: n, resetOnSelect: s, selected: l, required: a, onSelect: r } = e, [i, c] = we(l, r ? l : void 0), d = r ? l : i;
1367
+ return {
1368
+ selected: d,
1369
+ select: (D, w, W) => {
1370
+ const { min: v, max: N } = e;
1371
+ let h;
1372
+ if (D) {
1373
+ const M = d?.from, g = d?.to, k = !!M && !!g, m = !!M && !!g && t.isSameDay(M, g) && t.isSameDay(D, M);
1374
+ s && (k || !d?.from) ? !a && m ? h = void 0 : h = { from: D, to: void 0 } : h = Vs(D, d, v, N, a, t);
1375
+ }
1376
+ return n && o && h?.from && h.to && Ks({ from: h.from, to: h.to }, o, t) && (h.from = D, h.to = void 0), r || c(h), r?.(h, D, w, W), h;
1377
+ },
1378
+ isSelected: (D) => d && se(d, D, !1, t)
1379
+ };
1380
+ }
1381
+ function Js(e, t) {
1382
+ const { selected: o, required: n, onSelect: s } = e, [l, a] = we(o, s ? o : void 0), r = s ? o : l, { isSameDay: i } = t;
1383
+ return {
1384
+ selected: r,
1385
+ select: (f, y, D) => {
1386
+ let w = f;
1387
+ return !n && r && r && i(f, r) && (w = void 0), s || a(w), s?.(w, f, y, D), w;
1388
+ },
1389
+ isSelected: (f) => r ? i(r, f) : !1
1390
+ };
1391
+ }
1392
+ function Qs(e, t) {
1393
+ const o = Js(e, t), n = Gs(e, t), s = Zs(e, t);
1394
+ switch (e.mode) {
1395
+ case "single":
1396
+ return o;
1397
+ case "multiple":
1398
+ return n;
1399
+ case "range":
1400
+ return s;
1401
+ default:
1402
+ return;
1403
+ }
1404
+ }
1405
+ function K(e, t) {
1406
+ return e instanceof A && e.timeZone === t ? e : new A(e, t);
1407
+ }
1408
+ function le(e, t, o) {
1409
+ return K(e, t);
1410
+ }
1411
+ function it(e, t, o) {
1412
+ return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? le(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? le(n, t) : n) : Oe(e) ? {
1413
+ ...e,
1414
+ from: e.from ? K(e.from, t) : e.from,
1415
+ to: e.to ? K(e.to, t) : e.to
1416
+ } : je(e) ? {
1417
+ before: le(e.before, t),
1418
+ after: le(e.after, t)
1419
+ } : ze(e) ? {
1420
+ after: le(e.after, t)
1421
+ } : Re(e) ? {
1422
+ before: le(e.before, t)
1423
+ } : e;
1424
+ }
1425
+ function Ae(e, t, o) {
1426
+ return e && (Array.isArray(e) ? e.map((n) => it(n, t)) : it(e, t));
1427
+ }
1428
+ function Xs(e) {
1429
+ let t = e;
1430
+ const o = t.timeZone;
1431
+ if (o && (t = {
1432
+ ...e,
1433
+ timeZone: o
1434
+ }, t.today && (t.today = K(t.today, o)), t.month && (t.month = K(t.month, o)), t.defaultMonth && (t.defaultMonth = K(t.defaultMonth, o)), t.startMonth && (t.startMonth = K(t.startMonth, o)), t.endMonth && (t.endMonth = K(t.endMonth, o)), t.mode === "single" && t.selected ? t.selected = K(t.selected, o) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((O) => K(O, o)) : t.mode === "range" && t.selected && (t.selected = {
1435
+ from: t.selected.from ? K(t.selected.from, o) : t.selected.from,
1436
+ to: t.selected.to ? K(t.selected.to, o) : t.selected.to
1437
+ }), t.disabled !== void 0 && (t.disabled = Ae(t.disabled, o)), t.hidden !== void 0 && (t.hidden = Ae(t.hidden, o)), t.modifiers)) {
1438
+ const O = {};
1439
+ Object.keys(t.modifiers).forEach((E) => {
1440
+ O[E] = Ae(t.modifiers?.[E], o);
1441
+ }), t.modifiers = O;
1442
+ }
1443
+ const { components: n, formatters: s, labels: l, dateLib: a, locale: r, classNames: i } = be(() => {
1444
+ const O = { ...bt, ...t.locale }, E = t.broadcastCalendar ? 1 : t.weekStartsOn, b = t.noonSafe && t.timeZone ? Ss(t.timeZone, {
1445
+ weekStartsOn: E,
1446
+ locale: O
1447
+ }) : void 0, T = t.dateLib && b ? { ...b, ...t.dateLib } : t.dateLib ?? b, $ = new R({
1448
+ locale: O,
1449
+ weekStartsOn: E,
1450
+ firstWeekContainsDate: t.firstWeekContainsDate,
1451
+ useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
1452
+ useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
1453
+ timeZone: t.timeZone,
1454
+ numerals: t.numerals
1455
+ }, T);
1456
+ return {
1457
+ dateLib: $,
1458
+ components: ls(t.components),
1459
+ formatters: ks(t.formatters),
1460
+ labels: Os(t.labels, $.options),
1461
+ locale: O,
1462
+ classNames: { ...Nt(), ...t.classNames }
1463
+ };
1464
+ }, [
1465
+ t.locale,
1466
+ t.broadcastCalendar,
1467
+ t.weekStartsOn,
1468
+ t.firstWeekContainsDate,
1469
+ t.useAdditionalWeekYearTokens,
1470
+ t.useAdditionalDayOfYearTokens,
1471
+ t.timeZone,
1472
+ t.numerals,
1473
+ t.dateLib,
1474
+ t.noonSafe,
1475
+ t.components,
1476
+ t.formatters,
1477
+ t.labels,
1478
+ t.classNames
1479
+ ]);
1480
+ t.today || (t = { ...t, today: a.today() });
1481
+ const { captionLayout: c, mode: d, navLayout: f, numberOfMonths: y = 1, onDayBlur: D, onDayClick: w, onDayFocus: W, onDayKeyDown: v, onDayMouseEnter: N, onDayMouseLeave: h, onNextClick: M, onPrevClick: g, showWeekNumber: k, styles: m } = t, { formatCaption: C, formatDay: x, formatMonthDropdown: I, formatWeekNumber: B, formatWeekNumberHeader: q, formatWeekdayName: J, formatYearDropdown: Q } = s, Y = js(t, a), { days: H, months: ae, navStart: ce, navEnd: fe, previousMonth: G, nextMonth: V, goToMonth: ee } = Y, Ne = as(H, t, ce, fe, a), { isSelected: Ce, select: We, selected: ke } = Qs(t, a) ?? {}, { blur: Ve, focused: Ue, isFocusTarget: Ht, moveFocus: Ke, setFocused: Me } = qs(t, Y, Ne, Ce ?? (() => !1), a), { labelDayButton: $t, labelGridcell: jt, labelGrid: zt, labelMonthDropdown: Rt, labelNav: Ze, labelPrevious: qt, labelNext: Gt, labelWeekday: Vt, labelWeekNumber: Ut, labelWeekNumberHeader: Kt, labelYearDropdown: Zt } = l, Jt = be(() => Cs(a, t.ISOWeek, t.broadcastCalendar, t.today), [a, t.ISOWeek, t.broadcastCalendar, t.today]), Je = d !== void 0 || w !== void 0, Se = U(() => {
1482
+ G && (ee(G), g?.(G));
1483
+ }, [G, ee, g]), _e = U(() => {
1484
+ V && (ee(V), M?.(V));
1485
+ }, [ee, V, M]), Qt = U((O, E) => (b) => {
1486
+ b.preventDefault(), b.stopPropagation(), Me(O), !E.disabled && (We?.(O.date, E, b), w?.(O.date, E, b));
1487
+ }, [We, w, Me]), Xt = U((O, E) => (b) => {
1488
+ Me(O), W?.(O.date, E, b);
1489
+ }, [W, Me]), Lt = U((O, E) => (b) => {
1490
+ Ve(), D?.(O.date, E, b);
1491
+ }, [Ve, D]), en = U((O, E) => (b) => {
1492
+ const T = {
1493
+ ArrowLeft: [
1494
+ b.shiftKey ? "month" : "day",
1495
+ t.dir === "rtl" ? "after" : "before"
1496
+ ],
1497
+ ArrowRight: [
1498
+ b.shiftKey ? "month" : "day",
1499
+ t.dir === "rtl" ? "before" : "after"
1500
+ ],
1501
+ ArrowDown: [b.shiftKey ? "year" : "week", "after"],
1502
+ ArrowUp: [b.shiftKey ? "year" : "week", "before"],
1503
+ PageUp: [b.shiftKey ? "year" : "month", "before"],
1504
+ PageDown: [b.shiftKey ? "year" : "month", "after"],
1505
+ Home: ["startOfWeek", "before"],
1506
+ End: ["endOfWeek", "after"]
1507
+ };
1508
+ if (T[b.key]) {
1509
+ b.preventDefault(), b.stopPropagation();
1510
+ const [$, S] = T[b.key];
1511
+ Ke($, S);
1512
+ }
1513
+ v?.(O.date, E, b);
1514
+ }, [Ke, v, t.dir]), tn = U((O, E) => (b) => {
1515
+ N?.(O.date, E, b);
1516
+ }, [N]), nn = U((O, E) => (b) => {
1517
+ h?.(O.date, E, b);
1518
+ }, [h]), on = U((O) => (E) => {
1519
+ const b = Number(E.target.value), T = a.setMonth(a.startOfMonth(O), b);
1520
+ ee(T);
1521
+ }, [a, ee]), sn = U((O) => (E) => {
1522
+ const b = Number(E.target.value), T = a.setYear(a.startOfMonth(O), b);
1523
+ ee(T);
1524
+ }, [a, ee]), { className: rn, style: an } = be(() => ({
1525
+ className: [i[p.Root], t.className].filter(Boolean).join(" "),
1526
+ style: { ...m?.[p.Root], ...t.style }
1527
+ }), [i, t.className, t.style, m]), ln = cs(t), Qe = me(null);
1528
+ Es(Qe, !!t.animate, {
1529
+ classNames: i,
1530
+ months: ae,
1531
+ focused: Ue,
1532
+ dateLib: a
1533
+ });
1534
+ const cn = {
1535
+ dayPickerProps: t,
1536
+ selected: ke,
1537
+ select: We,
1538
+ isSelected: Ce,
1539
+ months: ae,
1540
+ nextMonth: V,
1541
+ previousMonth: G,
1542
+ goToMonth: ee,
1543
+ getModifiers: Ne,
1544
+ components: n,
1545
+ classNames: i,
1546
+ styles: m,
1547
+ labels: l,
1548
+ formatters: s
1549
+ };
1550
+ return u.createElement(
1551
+ vt.Provider,
1552
+ { value: cn },
1553
+ u.createElement(
1554
+ n.Root,
1555
+ { rootRef: t.animate ? Qe : void 0, className: rn, style: an, dir: t.dir, id: t.id, lang: t.lang ?? r.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...ln },
1556
+ u.createElement(
1557
+ n.Months,
1558
+ { className: i[p.Months], style: m?.[p.Months] },
1559
+ !t.hideNavigation && !f && u.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: i[p.Nav], style: m?.[p.Nav], "aria-label": Ze(), onPreviousClick: Se, onNextClick: _e, previousMonth: G, nextMonth: V }),
1560
+ ae.map((O, E) => u.createElement(
1561
+ n.Month,
1562
+ {
1563
+ "data-animated-month": t.animate ? "true" : void 0,
1564
+ className: i[p.Month],
1565
+ style: m?.[p.Month],
1566
+ // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
1567
+ key: E,
1568
+ displayIndex: E,
1569
+ calendarMonth: O
1570
+ },
1571
+ f === "around" && !t.hideNavigation && E === 0 && u.createElement(
1572
+ n.PreviousMonthButton,
1573
+ { type: "button", className: i[p.PreviousMonthButton], tabIndex: G ? void 0 : -1, "aria-disabled": G ? void 0 : !0, "aria-label": qt(G), onClick: Se, "data-animated-button": t.animate ? "true" : void 0 },
1574
+ u.createElement(n.Chevron, { disabled: G ? void 0 : !0, className: i[p.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
1575
+ ),
1576
+ u.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: i[p.MonthCaption], style: m?.[p.MonthCaption], calendarMonth: O, displayIndex: E }, c?.startsWith("dropdown") ? u.createElement(
1577
+ n.DropdownNav,
1578
+ { className: i[p.Dropdowns], style: m?.[p.Dropdowns] },
1579
+ (() => {
1580
+ const b = c === "dropdown" || c === "dropdown-months" ? u.createElement(n.MonthsDropdown, { key: "month", className: i[p.MonthsDropdown], "aria-label": Rt(), classNames: i, components: n, disabled: !!t.disableNavigation, onChange: on(O.date), options: ws(O.date, ce, fe, s, a), style: m?.[p.Dropdown], value: a.getMonth(O.date) }) : u.createElement("span", { key: "month" }, I(O.date, a)), T = c === "dropdown" || c === "dropdown-years" ? u.createElement(n.YearsDropdown, { key: "year", className: i[p.YearsDropdown], "aria-label": Zt(a.options), classNames: i, components: n, disabled: !!t.disableNavigation, onChange: sn(O.date), options: Ws(ce, fe, s, a, !!t.reverseYears), style: m?.[p.Dropdown], value: a.getYear(O.date) }) : u.createElement("span", { key: "year" }, Q(O.date, a));
1581
+ return a.getMonthYearOrder() === "year-first" ? [T, b] : [b, T];
1582
+ })(),
1583
+ u.createElement("span", { role: "status", "aria-live": "polite", style: {
1584
+ border: 0,
1585
+ clip: "rect(0 0 0 0)",
1586
+ height: "1px",
1587
+ margin: "-1px",
1588
+ overflow: "hidden",
1589
+ padding: 0,
1590
+ position: "absolute",
1591
+ width: "1px",
1592
+ whiteSpace: "nowrap",
1593
+ wordWrap: "normal"
1594
+ } }, C(O.date, a.options, a))
1595
+ ) : u.createElement(n.CaptionLabel, { className: i[p.CaptionLabel], role: "status", "aria-live": "polite" }, C(O.date, a.options, a))),
1596
+ f === "around" && !t.hideNavigation && E === y - 1 && u.createElement(
1597
+ n.NextMonthButton,
1598
+ { type: "button", className: i[p.NextMonthButton], tabIndex: V ? void 0 : -1, "aria-disabled": V ? void 0 : !0, "aria-label": Gt(V), onClick: _e, "data-animated-button": t.animate ? "true" : void 0 },
1599
+ u.createElement(n.Chevron, { disabled: V ? void 0 : !0, className: i[p.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
1600
+ ),
1601
+ E === y - 1 && f === "after" && !t.hideNavigation && u.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: i[p.Nav], style: m?.[p.Nav], "aria-label": Ze(), onPreviousClick: Se, onNextClick: _e, previousMonth: G, nextMonth: V }),
1602
+ u.createElement(
1603
+ n.MonthGrid,
1604
+ { role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": zt(O.date, a.options, a) || void 0, className: i[p.MonthGrid], style: m?.[p.MonthGrid] },
1605
+ !t.hideWeekdays && u.createElement(
1606
+ n.Weekdays,
1607
+ { "data-animated-weekdays": t.animate ? "true" : void 0, className: i[p.Weekdays], style: m?.[p.Weekdays] },
1608
+ k && u.createElement(n.WeekNumberHeader, { "aria-label": Kt(a.options), className: i[p.WeekNumberHeader], style: m?.[p.WeekNumberHeader], scope: "col" }, q()),
1609
+ Jt.map((b) => u.createElement(n.Weekday, { "aria-label": Vt(b, a.options, a), className: i[p.Weekday], key: String(b), style: m?.[p.Weekday], scope: "col" }, J(b, a.options, a)))
1610
+ ),
1611
+ u.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: i[p.Weeks], style: m?.[p.Weeks] }, O.weeks.map((b) => u.createElement(
1612
+ n.Week,
1613
+ { className: i[p.Week], key: b.weekNumber, style: m?.[p.Week], week: b },
1614
+ k && u.createElement(n.WeekNumber, { week: b, style: m?.[p.WeekNumber], "aria-label": Ut(b.weekNumber, {
1615
+ locale: r
1616
+ }), className: i[p.WeekNumber], scope: "row", role: "rowheader" }, B(b.weekNumber, a)),
1617
+ b.days.map((T) => {
1618
+ const { date: $ } = T, S = Ne(T);
1619
+ if (S[F.focused] = !S.hidden && !!Ue?.isEqualTo(T), S[L.selected] = Ce?.($) || S.selected, Oe(ke)) {
1620
+ const { from: Ye, to: Te } = ke;
1621
+ S[L.range_start] = !!(Ye && Te && a.isSameDay($, Ye)), S[L.range_end] = !!(Ye && Te && a.isSameDay($, Te)), S[L.range_middle] = se(ke, $, !0, a);
1622
+ }
1623
+ const fn = Ns(S, m, t.modifiersStyles), dn = is(S, i, t.modifiersClassNames), un = !Je && !S.hidden ? jt($, S, a.options, a) : void 0;
1624
+ return u.createElement(n.Day, { key: `${T.isoDate}_${T.displayMonthId}`, day: T, modifiers: S, className: dn.join(" "), style: fn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": un, "data-day": T.isoDate, "data-month": T.outside ? T.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": T.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && Je ? u.createElement(n.DayButton, { className: i[p.DayButton], style: m?.[p.DayButton], type: "button", day: T, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Ht(T) ? 0 : -1, "aria-label": $t($, S, a.options, a), onClick: Qt(T, S), onBlur: Lt(T, S), onFocus: Xt(T, S), onKeyDown: en(T, S), onMouseEnter: tn(T, S), onMouseLeave: nn(T, S) }, x($, a.options, a)) : !S.hidden && x(T.date, a.options, a));
1625
+ })
1626
+ )))
1627
+ )
1628
+ ))
1629
+ ),
1630
+ t.footer && u.createElement(n.Footer, { className: i[p.Footer], style: m?.[p.Footer], role: "status", "aria-live": "polite" }, t.footer)
1631
+ )
1632
+ );
1633
+ }
1634
+ const At = lt({
1635
+ size: "md"
1636
+ });
1637
+ function Ls({ className: e, rootRef: t, ...o }) {
1638
+ return /* @__PURE__ */ z(
1639
+ "div",
1640
+ {
1641
+ "data-slot": "calendar",
1642
+ ref: t,
1643
+ className: _(e),
1644
+ ...o
1645
+ }
1646
+ );
1647
+ }
1648
+ function er({
1649
+ className: e,
1650
+ orientation: t,
1651
+ disabled: o
1652
+ }) {
1653
+ return t === "left" ? /* @__PURE__ */ z(
1654
+ Ee,
1655
+ {
1656
+ disabled: o,
1657
+ size: "small",
1658
+ type: "caret-left-filled",
1659
+ className: _(xe, e)
1660
+ }
1661
+ ) : t === "right" ? /* @__PURE__ */ z(
1662
+ Ee,
1663
+ {
1664
+ size: "small",
1665
+ type: "caret-right-filled",
1666
+ className: _(xe, e)
1667
+ }
1668
+ ) : /* @__PURE__ */ z(
1669
+ Ee,
1670
+ {
1671
+ type: "caret-down",
1672
+ size: "small",
1673
+ className: _(xe, e)
1674
+ }
1675
+ );
1676
+ }
1677
+ function tr({ children: e, ...t }) {
1678
+ return /* @__PURE__ */ z("th", { ...t, children: /* @__PURE__ */ z("div", { className: Xn, children: e }) });
1679
+ }
1680
+ function yr({
1681
+ className: e,
1682
+ classNames: t,
1683
+ classNameWrapper: o,
1684
+ classNameFooter: n,
1685
+ showOutsideDays: s = !0,
1686
+ captionLayout: l = "label",
1687
+ buttonVariant: a = "ghost",
1688
+ size: r = "md",
1689
+ locale: i,
1690
+ formatters: c,
1691
+ components: d,
1692
+ footer: f,
1693
+ appendFooter: y,
1694
+ presets: D,
1695
+ presetBaseDate: w,
1696
+ onPresetClick: W,
1697
+ onDayClick: v,
1698
+ ...N
1699
+ }) {
1700
+ const h = Nt(), [M, g] = ge(), k = (N.numberOfMonths ?? 1) === 1, m = N.onSelect, C = N.onSelect, x = !!D?.length, I = r === "sm" ? "max-w-[15.5rem]" : r === "md" ? "max-w-[20rem]" : "max-w-[20.5rem]", B = ve(w ?? /* @__PURE__ */ new Date()), q = (Y) => {
1701
+ if (N.mode === "range") {
1702
+ const ce = B.getTime() <= Y.getTime() ? B : Y, fe = B.getTime() <= Y.getTime() ? Y : B;
1703
+ C?.({ from: ce, to: fe }, Y, {}, {});
1704
+ return;
1705
+ }
1706
+ m?.(Y, Y, {}, {});
1707
+ }, J = f ?? (x ? /* @__PURE__ */ z(hn, { children: D.map((Y) => {
1708
+ const H = $e(B, Y.days);
1709
+ return /* @__PURE__ */ z(
1710
+ ft,
1711
+ {
1712
+ variant: "outlined",
1713
+ size: "xs",
1714
+ className: _("flex-1", gn("body-xxs-medium")),
1715
+ onClick: () => {
1716
+ g(H.toDateString()), q(H), W?.(Y, H);
1717
+ },
1718
+ children: Y.text
1719
+ },
1720
+ `${Y.text}-${Y.days}`
1721
+ );
1722
+ }) }) : null), Q = J != null || !!y;
1723
+ return /* @__PURE__ */ Xe(Dn, { className: _(Vn, o), children: [
1724
+ /* @__PURE__ */ z(kn, { className: qn({ size: r }), children: /* @__PURE__ */ z(At, { value: { locale: i, size: r, lastClickedDay: M, mode: N.mode }, children: /* @__PURE__ */ z(
1725
+ Xs,
1726
+ {
1727
+ showOutsideDays: s,
1728
+ className: _(Rn({ size: r }), e),
1729
+ captionLayout: l,
1730
+ locale: i,
1731
+ formatters: {
1732
+ formatMonthDropdown: (Y) => Y.toLocaleString(i?.code, { month: "short" }),
1733
+ ...c
1734
+ },
1735
+ classNames: {
1736
+ root: _("w-fit", h.root),
1737
+ months: _(zn, h.months),
1738
+ month: _(jn, h.month),
1739
+ nav: _($n, h.nav),
1740
+ button_previous: _(
1741
+ Le({ variant: a }),
1742
+ et,
1743
+ h.button_previous
1744
+ ),
1745
+ button_next: _(
1746
+ Le({ variant: a }),
1747
+ et,
1748
+ h.button_next
1749
+ ),
1750
+ month_caption: _(
1751
+ Hn,
1752
+ h.month_caption
1753
+ ),
1754
+ dropdowns: _(
1755
+ h.dropdowns,
1756
+ An({ size: r })
1757
+ ),
1758
+ dropdown_root: _(
1759
+ Pn,
1760
+ h.dropdown_root
1761
+ ),
1762
+ dropdown: _(In, h.dropdown),
1763
+ caption_label: _(
1764
+ h.caption_label,
1765
+ Fn({
1766
+ layout: l === "label" ? "label" : "dropdown",
1767
+ size: r
1768
+ })
1769
+ ),
1770
+ table: "w-full border-collapse",
1771
+ weekdays: _(
1772
+ h.weekdays,
1773
+ Bn({ size: r })
1774
+ ),
1775
+ weekday: _(h.weekday, xn({ size: r })),
1776
+ week: _(h.week, En({ size: r })),
1777
+ week_number_header: _(
1778
+ Tn,
1779
+ h.week_number_header
1780
+ ),
1781
+ week_number: _(
1782
+ h.week_number,
1783
+ Yn({ size: r })
1784
+ ),
1785
+ day: _(
1786
+ h.day,
1787
+ _n({ showWeekNumber: !!N.showWeekNumber })
1788
+ ),
1789
+ day_button: _(
1790
+ h.day_button,
1791
+ "size-(--cell-size) p-0 focus-visible:ring-0 focus-visible:outline-none"
1792
+ ),
1793
+ range_start: _(Sn, h.range_start),
1794
+ range_middle: _(
1795
+ Wn,
1796
+ h.range_middle
1797
+ ),
1798
+ range_end: _(Cn, h.range_end),
1799
+ today: _(Nn, h.today),
1800
+ outside: _(wn, h.outside),
1801
+ disabled: _(h.disabled, On),
1802
+ hidden: _(vn, h.hidden),
1803
+ ...t
1804
+ },
1805
+ components: {
1806
+ Root: Ls,
1807
+ Chevron: er,
1808
+ DayButton: nr,
1809
+ WeekNumber: tr,
1810
+ ...d
1811
+ },
1812
+ onDayClick: (Y, H, ae) => {
1813
+ g(Y.toDateString()), v?.(Y, H, ae);
1814
+ },
1815
+ ...N
1816
+ }
1817
+ ) }) }),
1818
+ Q && /* @__PURE__ */ Xe(
1819
+ Mn,
1820
+ {
1821
+ className: _(
1822
+ Gn({ size: r }),
1823
+ x && "justify-center gap-2.5",
1824
+ k && x && I,
1825
+ n
1826
+ ),
1827
+ children: [
1828
+ J,
1829
+ y
1830
+ ]
1831
+ }
1832
+ )
1833
+ ] });
1834
+ }
1835
+ function nr({
1836
+ className: e,
1837
+ day: t,
1838
+ modifiers: o,
1839
+ children: n,
1840
+ ...s
1841
+ }) {
1842
+ const { locale: l, size: a, lastClickedDay: r, mode: i } = pn(At), c = me(null);
1843
+ return ct(() => {
1844
+ o.focused && c.current?.focus();
1845
+ }, [o.focused]), /* @__PURE__ */ z(
1846
+ ft,
1847
+ {
1848
+ ref: c,
1849
+ variant: "ghost",
1850
+ size: "sm",
1851
+ "data-day": t.date.toLocaleDateString(l?.code),
1852
+ "data-last-clicked": r === t.date.toDateString(),
1853
+ "data-selected-single": o.selected && !o.range_start && !o.range_end && !o.range_middle,
1854
+ "data-range-start": o.range_start,
1855
+ "data-range-end": o.range_end,
1856
+ "data-range-middle": o.range_middle,
1857
+ className: _(
1858
+ e,
1859
+ Qn,
1860
+ o.today && !o.disabled && Jn,
1861
+ i === "range" && Zn
1862
+ ),
1863
+ ...s,
1864
+ children: /* @__PURE__ */ z(
1865
+ bn,
1866
+ {
1867
+ variant: Un[a],
1868
+ className: Kn({ size: a }),
1869
+ children: n
1870
+ }
1871
+ )
1872
+ }
1873
+ );
1874
+ }
1875
+ export {
1876
+ yr as C,
1877
+ R as D,
1878
+ nr as a,
1879
+ bt as e
1880
+ };
1881
+ //# sourceMappingURL=calendar-Cf3VkgyX.js.map