@grapadigital/shared-app-modules 0.0.196 → 0.0.198

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,2413 +0,0 @@
1
- import { jsx as g, jsxs as rn } from "react/jsx-runtime";
2
- import * as I from "react";
3
- import f, { useMemo as ce, createContext as an, useContext as sn, useCallback as q, useRef as ve, useLayoutEffect as ln, useState as Ie, useEffect as dn } from "react";
4
- import { aZ as cn, c as b, a as un, L as fn, S as hn, bk as mn, bj as pn, bl as Ke, B as yn, a$ as ot, b1 as gn, b2 as vn, a_ as bn, b0 as Mn, b3 as rt, b5 as at, b6 as ue, b4 as st, b7 as it, b8 as kn, bm as wn, bn as Dn, bo as On, bp as Cn, bq as Wn, ba as Sn, bb as xn, b9 as Nn } from "./switch.D4GUsewk.js";
5
- import { addDays as Pn, addMonths as _n, addWeeks as En, addYears as Tn, differenceInCalendarDays as An, differenceInCalendarMonths as Fn, eachMonthOfInterval as In, eachYearOfInterval as Bn, endOfISOWeek as Yn, endOfMonth as Rn, endOfWeek as zn, endOfYear as jn, format as qn, getISOWeek as Hn, getMonth as $n, getYear as Zn, getWeek as Un, isAfter as Gn, isBefore as Vn, isDate as Kn, isSameDay as Ln, isSameMonth as Jn, isSameYear as Xn, max as Qn, min as eo, setMonth as to, setYear as no, startOfDay as oo, startOfISOWeek as ro, startOfMonth as ao, startOfWeek as so, startOfYear as io } from "date-fns";
6
- const lo = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], co = cn("chevron-left", lo);
7
- function $a({ className: e, ...t }) {
8
- return /* @__PURE__ */ g(
9
- "fieldset",
10
- {
11
- "data-slot": "field-set",
12
- className: b(
13
- "flex flex-col gap-6",
14
- "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
15
- e
16
- ),
17
- ...t
18
- }
19
- );
20
- }
21
- function Za({
22
- className: e,
23
- variant: t = "legend",
24
- ...o
25
- }) {
26
- return /* @__PURE__ */ g(
27
- "legend",
28
- {
29
- "data-slot": "field-legend",
30
- "data-variant": t,
31
- className: b(
32
- "mb-3 font-medium",
33
- "data-[variant=legend]:text-base",
34
- "data-[variant=label]:text-sm",
35
- e
36
- ),
37
- ...o
38
- }
39
- );
40
- }
41
- function Ua({ className: e, ...t }) {
42
- return /* @__PURE__ */ g(
43
- "div",
44
- {
45
- "data-slot": "field-group",
46
- className: b(
47
- "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
48
- e
49
- ),
50
- ...t
51
- }
52
- );
53
- }
54
- const uo = un(
55
- "group/field data-[invalid=true]:text-destructive flex w-full gap-3",
56
- {
57
- variants: {
58
- orientation: {
59
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
60
- horizontal: [
61
- "flex-row items-center",
62
- "[&>[data-slot=field-label]]:flex-auto",
63
- "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
64
- ],
65
- responsive: [
66
- "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
67
- "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
68
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
69
- ]
70
- }
71
- },
72
- defaultVariants: {
73
- orientation: "vertical"
74
- }
75
- }
76
- );
77
- function Ga({
78
- className: e,
79
- orientation: t = "vertical",
80
- ...o
81
- }) {
82
- return /* @__PURE__ */ g(
83
- "div",
84
- {
85
- role: "group",
86
- "data-slot": "field",
87
- "data-orientation": t,
88
- className: b(uo({ orientation: t }), e),
89
- ...o
90
- }
91
- );
92
- }
93
- function Va({ className: e, ...t }) {
94
- return /* @__PURE__ */ g(
95
- "div",
96
- {
97
- "data-slot": "field-content",
98
- className: b(
99
- "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
100
- e
101
- ),
102
- ...t
103
- }
104
- );
105
- }
106
- function Ka({
107
- className: e,
108
- ...t
109
- }) {
110
- return /* @__PURE__ */ g(
111
- fn,
112
- {
113
- "data-slot": "field-label",
114
- className: b(
115
- "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
116
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
117
- "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
118
- e
119
- ),
120
- ...t
121
- }
122
- );
123
- }
124
- function La({ className: e, ...t }) {
125
- return /* @__PURE__ */ g(
126
- "div",
127
- {
128
- "data-slot": "field-label",
129
- className: b(
130
- "flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50",
131
- e
132
- ),
133
- ...t
134
- }
135
- );
136
- }
137
- function Ja({ className: e, ...t }) {
138
- return /* @__PURE__ */ g(
139
- "p",
140
- {
141
- "data-slot": "field-description",
142
- className: b(
143
- "text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
144
- "nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
145
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
146
- e
147
- ),
148
- ...t
149
- }
150
- );
151
- }
152
- function Xa({
153
- children: e,
154
- className: t,
155
- ...o
156
- }) {
157
- return /* @__PURE__ */ rn(
158
- "div",
159
- {
160
- "data-slot": "field-separator",
161
- "data-content": !!e,
162
- className: b(
163
- "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
164
- t
165
- ),
166
- ...o,
167
- children: [
168
- /* @__PURE__ */ g(hn, { className: "absolute inset-0 top-1/2" }),
169
- e && /* @__PURE__ */ g(
170
- "span",
171
- {
172
- className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
173
- "data-slot": "field-separator-content",
174
- children: e
175
- }
176
- )
177
- ]
178
- }
179
- );
180
- }
181
- function Qa({
182
- className: e,
183
- children: t,
184
- errors: o,
185
- ...n
186
- }) {
187
- const r = ce(() => t || (o ? o?.length === 1 && o[0]?.message ? o[0].message : /* @__PURE__ */ g("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: o.map(
188
- (i, a) => i?.message && /* @__PURE__ */ g("li", { children: i.message }, a)
189
- ) }) : null), [t, o]);
190
- return r ? /* @__PURE__ */ g(
191
- "div",
192
- {
193
- role: "alert",
194
- "data-slot": "field-error",
195
- className: b("text-destructive text-sm font-normal", e),
196
- ...n,
197
- children: r
198
- }
199
- ) : null;
200
- }
201
- function fo(e, t, o = "long") {
202
- return new Intl.DateTimeFormat("en-US", {
203
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
204
- hour: "numeric",
205
- timeZone: e,
206
- timeZoneName: o
207
- }).format(t).split(/\s/g).slice(2).join(" ");
208
- }
209
- const ho = {}, de = {};
210
- function re(e, t) {
211
- try {
212
- const n = (ho[e] ||= new Intl.DateTimeFormat("en-US", {
213
- timeZone: e,
214
- timeZoneName: "longOffset"
215
- }).format)(t).split("GMT")[1];
216
- return n in de ? de[n] : Le(n, n.split(":"));
217
- } catch {
218
- if (e in de) return de[e];
219
- const o = e?.match(mo);
220
- return o ? Le(e, o.slice(1)) : NaN;
221
- }
222
- }
223
- const mo = /([+-]\d\d):?(\d\d)?/;
224
- function Le(e, t) {
225
- const o = +(t[0] || 0), n = +(t[1] || 0), r = +(t[2] || 0) / 60;
226
- return de[e] = o * 60 + n > 0 ? o * 60 + n + r : o * 60 - n - r;
227
- }
228
- class K extends Date {
229
- //#region static
230
- constructor(...t) {
231
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(re(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)), lt(this), Be(this)) : this.setTime(Date.now());
232
- }
233
- static tz(t, ...o) {
234
- return o.length ? new K(...o, t) : new K(Date.now(), t);
235
- }
236
- //#endregion
237
- //#region time zone
238
- withTimeZone(t) {
239
- return new K(+this, t);
240
- }
241
- getTimezoneOffset() {
242
- const t = -re(this.timeZone, this);
243
- return t > 0 ? Math.floor(t) : Math.ceil(t);
244
- }
245
- //#endregion
246
- //#region time
247
- setTime(t) {
248
- return Date.prototype.setTime.apply(this, arguments), Be(this), +this;
249
- }
250
- //#endregion
251
- //#region date-fns integration
252
- [Symbol.for("constructDateFrom")](t) {
253
- return new K(+new Date(t), this.timeZone);
254
- }
255
- //#endregion
256
- }
257
- const Je = /^(get|set)(?!UTC)/;
258
- Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
259
- if (!Je.test(e)) return;
260
- const t = e.replace(Je, "$1UTC");
261
- K.prototype[t] && (e.startsWith("get") ? K.prototype[e] = function() {
262
- return this.internal[t]();
263
- } : (K.prototype[e] = function() {
264
- return Date.prototype[t].apply(this.internal, arguments), po(this), +this;
265
- }, K.prototype[t] = function() {
266
- return Date.prototype[t].apply(this, arguments), Be(this), +this;
267
- }));
268
- });
269
- function Be(e) {
270
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-re(e.timeZone, e) * 60));
271
- }
272
- function po(e) {
273
- 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()), lt(e);
274
- }
275
- function lt(e) {
276
- const t = re(e.timeZone, e), o = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
277
- n.setUTCHours(n.getUTCHours() - 1);
278
- const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), a = r - i, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
279
- a && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
280
- const l = r - o;
281
- l && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + l);
282
- const d = /* @__PURE__ */ new Date(+e);
283
- d.setUTCSeconds(0);
284
- const u = r > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, c = Math.round(-(re(e.timeZone, e) * 60)) % 60;
285
- (c || u) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + c), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + c + u));
286
- const h = re(e.timeZone, e), y = h > 0 ? Math.floor(h) : Math.ceil(h), N = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - y, w = y !== o, W = N - l;
287
- if (w && W) {
288
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + W);
289
- const P = re(e.timeZone, e), k = P > 0 ? Math.floor(P) : Math.ceil(P), O = y - k;
290
- O && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + O), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + O));
291
- }
292
- }
293
- class Q extends K {
294
- //#region static
295
- static tz(t, ...o) {
296
- return o.length ? new Q(...o, t) : new Q(Date.now(), t);
297
- }
298
- //#endregion
299
- //#region representation
300
- toISOString() {
301
- const [t, o, n] = this.tzComponents(), r = `${t}${o}:${n}`;
302
- return this.internal.toISOString().slice(0, -1) + r;
303
- }
304
- toString() {
305
- return `${this.toDateString()} ${this.toTimeString()}`;
306
- }
307
- toDateString() {
308
- const [t, o, n, r] = this.internal.toUTCString().split(" ");
309
- return `${t?.slice(0, -1)} ${n} ${o} ${r}`;
310
- }
311
- toTimeString() {
312
- const t = this.internal.toUTCString().split(" ")[4], [o, n, r] = this.tzComponents();
313
- return `${t} GMT${o}${n}${r} (${fo(this.timeZone, this)})`;
314
- }
315
- toLocaleString(t, o) {
316
- return Date.prototype.toLocaleString.call(this, t, {
317
- ...o,
318
- timeZone: o?.timeZone || this.timeZone
319
- });
320
- }
321
- toLocaleDateString(t, o) {
322
- return Date.prototype.toLocaleDateString.call(this, t, {
323
- ...o,
324
- timeZone: o?.timeZone || this.timeZone
325
- });
326
- }
327
- toLocaleTimeString(t, o) {
328
- return Date.prototype.toLocaleTimeString.call(this, t, {
329
- ...o,
330
- timeZone: o?.timeZone || this.timeZone
331
- });
332
- }
333
- //#endregion
334
- //#region private
335
- tzComponents() {
336
- const t = this.getTimezoneOffset(), o = t > 0 ? "-" : "+", n = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), r = String(Math.abs(t) % 60).padStart(2, "0");
337
- return [o, n, r];
338
- }
339
- //#endregion
340
- withTimeZone(t) {
341
- return new Q(+this, t);
342
- }
343
- //#region date-fns integration
344
- [Symbol.for("constructDateFrom")](t) {
345
- return new Q(+new Date(t), this.timeZone);
346
- }
347
- //#endregion
348
- }
349
- const yo = {
350
- lessThanXSeconds: {
351
- one: "less than a second",
352
- other: "less than {{count}} seconds"
353
- },
354
- xSeconds: {
355
- one: "1 second",
356
- other: "{{count}} seconds"
357
- },
358
- halfAMinute: "half a minute",
359
- lessThanXMinutes: {
360
- one: "less than a minute",
361
- other: "less than {{count}} minutes"
362
- },
363
- xMinutes: {
364
- one: "1 minute",
365
- other: "{{count}} minutes"
366
- },
367
- aboutXHours: {
368
- one: "about 1 hour",
369
- other: "about {{count}} hours"
370
- },
371
- xHours: {
372
- one: "1 hour",
373
- other: "{{count}} hours"
374
- },
375
- xDays: {
376
- one: "1 day",
377
- other: "{{count}} days"
378
- },
379
- aboutXWeeks: {
380
- one: "about 1 week",
381
- other: "about {{count}} weeks"
382
- },
383
- xWeeks: {
384
- one: "1 week",
385
- other: "{{count}} weeks"
386
- },
387
- aboutXMonths: {
388
- one: "about 1 month",
389
- other: "about {{count}} months"
390
- },
391
- xMonths: {
392
- one: "1 month",
393
- other: "{{count}} months"
394
- },
395
- aboutXYears: {
396
- one: "about 1 year",
397
- other: "about {{count}} years"
398
- },
399
- xYears: {
400
- one: "1 year",
401
- other: "{{count}} years"
402
- },
403
- overXYears: {
404
- one: "over 1 year",
405
- other: "over {{count}} years"
406
- },
407
- almostXYears: {
408
- one: "almost 1 year",
409
- other: "almost {{count}} years"
410
- }
411
- }, go = (e, t, o) => {
412
- let n;
413
- const r = yo[e];
414
- return typeof r == "string" ? n = r : t === 1 ? n = r.one : n = r.other.replace("{{count}}", t.toString()), o?.addSuffix ? o.comparison && o.comparison > 0 ? "in " + n : n + " ago" : n;
415
- };
416
- function _e(e) {
417
- return (t = {}) => {
418
- const o = t.width ? String(t.width) : e.defaultWidth;
419
- return e.formats[o] || e.formats[e.defaultWidth];
420
- };
421
- }
422
- const vo = {
423
- full: "EEEE, MMMM do, y",
424
- long: "MMMM do, y",
425
- medium: "MMM d, y",
426
- short: "MM/dd/yyyy"
427
- }, bo = {
428
- full: "h:mm:ss a zzzz",
429
- long: "h:mm:ss a z",
430
- medium: "h:mm:ss a",
431
- short: "h:mm a"
432
- }, Mo = {
433
- full: "{{date}} 'at' {{time}}",
434
- long: "{{date}} 'at' {{time}}",
435
- medium: "{{date}}, {{time}}",
436
- short: "{{date}}, {{time}}"
437
- }, ko = {
438
- date: _e({
439
- formats: vo,
440
- defaultWidth: "full"
441
- }),
442
- time: _e({
443
- formats: bo,
444
- defaultWidth: "full"
445
- }),
446
- dateTime: _e({
447
- formats: Mo,
448
- defaultWidth: "full"
449
- })
450
- }, wo = {
451
- lastWeek: "'last' eeee 'at' p",
452
- yesterday: "'yesterday at' p",
453
- today: "'today at' p",
454
- tomorrow: "'tomorrow at' p",
455
- nextWeek: "eeee 'at' p",
456
- other: "P"
457
- }, Do = (e, t, o, n) => wo[e];
458
- function ie(e) {
459
- return (t, o) => {
460
- const n = o?.context ? String(o.context) : "standalone";
461
- let r;
462
- if (n === "formatting" && e.formattingValues) {
463
- const a = e.defaultFormattingWidth || e.defaultWidth, s = o?.width ? String(o.width) : a;
464
- r = e.formattingValues[s] || e.formattingValues[a];
465
- } else {
466
- const a = e.defaultWidth, s = o?.width ? String(o.width) : e.defaultWidth;
467
- r = e.values[s] || e.values[a];
468
- }
469
- const i = e.argumentCallback ? e.argumentCallback(t) : t;
470
- return r[i];
471
- };
472
- }
473
- const Oo = {
474
- narrow: ["B", "A"],
475
- abbreviated: ["BC", "AD"],
476
- wide: ["Before Christ", "Anno Domini"]
477
- }, Co = {
478
- narrow: ["1", "2", "3", "4"],
479
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
480
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
481
- }, Wo = {
482
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
483
- abbreviated: [
484
- "Jan",
485
- "Feb",
486
- "Mar",
487
- "Apr",
488
- "May",
489
- "Jun",
490
- "Jul",
491
- "Aug",
492
- "Sep",
493
- "Oct",
494
- "Nov",
495
- "Dec"
496
- ],
497
- wide: [
498
- "January",
499
- "February",
500
- "March",
501
- "April",
502
- "May",
503
- "June",
504
- "July",
505
- "August",
506
- "September",
507
- "October",
508
- "November",
509
- "December"
510
- ]
511
- }, So = {
512
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
513
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
514
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
515
- wide: [
516
- "Sunday",
517
- "Monday",
518
- "Tuesday",
519
- "Wednesday",
520
- "Thursday",
521
- "Friday",
522
- "Saturday"
523
- ]
524
- }, xo = {
525
- narrow: {
526
- am: "a",
527
- pm: "p",
528
- midnight: "mi",
529
- noon: "n",
530
- morning: "morning",
531
- afternoon: "afternoon",
532
- evening: "evening",
533
- night: "night"
534
- },
535
- abbreviated: {
536
- am: "AM",
537
- pm: "PM",
538
- midnight: "midnight",
539
- noon: "noon",
540
- morning: "morning",
541
- afternoon: "afternoon",
542
- evening: "evening",
543
- night: "night"
544
- },
545
- wide: {
546
- am: "a.m.",
547
- pm: "p.m.",
548
- midnight: "midnight",
549
- noon: "noon",
550
- morning: "morning",
551
- afternoon: "afternoon",
552
- evening: "evening",
553
- night: "night"
554
- }
555
- }, No = {
556
- narrow: {
557
- am: "a",
558
- pm: "p",
559
- midnight: "mi",
560
- noon: "n",
561
- morning: "in the morning",
562
- afternoon: "in the afternoon",
563
- evening: "in the evening",
564
- night: "at night"
565
- },
566
- abbreviated: {
567
- am: "AM",
568
- pm: "PM",
569
- midnight: "midnight",
570
- noon: "noon",
571
- morning: "in the morning",
572
- afternoon: "in the afternoon",
573
- evening: "in the evening",
574
- night: "at night"
575
- },
576
- wide: {
577
- am: "a.m.",
578
- pm: "p.m.",
579
- midnight: "midnight",
580
- noon: "noon",
581
- morning: "in the morning",
582
- afternoon: "in the afternoon",
583
- evening: "in the evening",
584
- night: "at night"
585
- }
586
- }, Po = (e, t) => {
587
- const o = Number(e), n = o % 100;
588
- if (n > 20 || n < 10)
589
- switch (n % 10) {
590
- case 1:
591
- return o + "st";
592
- case 2:
593
- return o + "nd";
594
- case 3:
595
- return o + "rd";
596
- }
597
- return o + "th";
598
- }, _o = {
599
- ordinalNumber: Po,
600
- era: ie({
601
- values: Oo,
602
- defaultWidth: "wide"
603
- }),
604
- quarter: ie({
605
- values: Co,
606
- defaultWidth: "wide",
607
- argumentCallback: (e) => e - 1
608
- }),
609
- month: ie({
610
- values: Wo,
611
- defaultWidth: "wide"
612
- }),
613
- day: ie({
614
- values: So,
615
- defaultWidth: "wide"
616
- }),
617
- dayPeriod: ie({
618
- values: xo,
619
- defaultWidth: "wide",
620
- formattingValues: No,
621
- defaultFormattingWidth: "wide"
622
- })
623
- };
624
- function le(e) {
625
- return (t, o = {}) => {
626
- const n = o.width, r = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], i = t.match(r);
627
- if (!i)
628
- return null;
629
- const a = i[0], s = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], l = Array.isArray(s) ? To(s, (c) => c.test(a)) : (
630
- // [TODO] -- I challenge you to fix the type
631
- Eo(s, (c) => c.test(a))
632
- );
633
- let d;
634
- d = e.valueCallback ? e.valueCallback(l) : l, d = o.valueCallback ? (
635
- // [TODO] -- I challenge you to fix the type
636
- o.valueCallback(d)
637
- ) : d;
638
- const u = t.slice(a.length);
639
- return { value: d, rest: u };
640
- };
641
- }
642
- function Eo(e, t) {
643
- for (const o in e)
644
- if (Object.prototype.hasOwnProperty.call(e, o) && t(e[o]))
645
- return o;
646
- }
647
- function To(e, t) {
648
- for (let o = 0; o < e.length; o++)
649
- if (t(e[o]))
650
- return o;
651
- }
652
- function Ao(e) {
653
- return (t, o = {}) => {
654
- const n = t.match(e.matchPattern);
655
- if (!n) return null;
656
- const r = n[0], i = t.match(e.parsePattern);
657
- if (!i) return null;
658
- let a = e.valueCallback ? e.valueCallback(i[0]) : i[0];
659
- a = o.valueCallback ? o.valueCallback(a) : a;
660
- const s = t.slice(r.length);
661
- return { value: a, rest: s };
662
- };
663
- }
664
- const Fo = /^(\d+)(th|st|nd|rd)?/i, Io = /\d+/i, Bo = {
665
- narrow: /^(b|a)/i,
666
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
667
- wide: /^(before christ|before common era|anno domini|common era)/i
668
- }, Yo = {
669
- any: [/^b/i, /^(a|c)/i]
670
- }, Ro = {
671
- narrow: /^[1234]/i,
672
- abbreviated: /^q[1234]/i,
673
- wide: /^[1234](th|st|nd|rd)? quarter/i
674
- }, zo = {
675
- any: [/1/i, /2/i, /3/i, /4/i]
676
- }, jo = {
677
- narrow: /^[jfmasond]/i,
678
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
679
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
680
- }, qo = {
681
- narrow: [
682
- /^j/i,
683
- /^f/i,
684
- /^m/i,
685
- /^a/i,
686
- /^m/i,
687
- /^j/i,
688
- /^j/i,
689
- /^a/i,
690
- /^s/i,
691
- /^o/i,
692
- /^n/i,
693
- /^d/i
694
- ],
695
- any: [
696
- /^ja/i,
697
- /^f/i,
698
- /^mar/i,
699
- /^ap/i,
700
- /^may/i,
701
- /^jun/i,
702
- /^jul/i,
703
- /^au/i,
704
- /^s/i,
705
- /^o/i,
706
- /^n/i,
707
- /^d/i
708
- ]
709
- }, Ho = {
710
- narrow: /^[smtwf]/i,
711
- short: /^(su|mo|tu|we|th|fr|sa)/i,
712
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
713
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
714
- }, $o = {
715
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
716
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
717
- }, Zo = {
718
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
719
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
720
- }, Uo = {
721
- any: {
722
- am: /^a/i,
723
- pm: /^p/i,
724
- midnight: /^mi/i,
725
- noon: /^no/i,
726
- morning: /morning/i,
727
- afternoon: /afternoon/i,
728
- evening: /evening/i,
729
- night: /night/i
730
- }
731
- }, Go = {
732
- ordinalNumber: Ao({
733
- matchPattern: Fo,
734
- parsePattern: Io,
735
- valueCallback: (e) => parseInt(e, 10)
736
- }),
737
- era: le({
738
- matchPatterns: Bo,
739
- defaultMatchWidth: "wide",
740
- parsePatterns: Yo,
741
- defaultParseWidth: "any"
742
- }),
743
- quarter: le({
744
- matchPatterns: Ro,
745
- defaultMatchWidth: "wide",
746
- parsePatterns: zo,
747
- defaultParseWidth: "any",
748
- valueCallback: (e) => e + 1
749
- }),
750
- month: le({
751
- matchPatterns: jo,
752
- defaultMatchWidth: "wide",
753
- parsePatterns: qo,
754
- defaultParseWidth: "any"
755
- }),
756
- day: le({
757
- matchPatterns: Ho,
758
- defaultMatchWidth: "wide",
759
- parsePatterns: $o,
760
- defaultParseWidth: "any"
761
- }),
762
- dayPeriod: le({
763
- matchPatterns: Zo,
764
- defaultMatchWidth: "any",
765
- parsePatterns: Uo,
766
- defaultParseWidth: "any"
767
- })
768
- }, dt = {
769
- code: "en-US",
770
- formatDistance: go,
771
- formatLong: ko,
772
- formatRelative: Do,
773
- localize: _o,
774
- match: Go,
775
- options: {
776
- weekStartsOn: 0,
777
- firstWeekContainsDate: 1
778
- }
779
- }, Xe = 5, Vo = 4;
780
- function Ko(e, t) {
781
- const o = t.startOfMonth(e), n = o.getDay() > 0 ? o.getDay() : 7, r = t.addDays(e, -n + 1), i = t.addDays(r, Xe * 7 - 1);
782
- return t.getMonth(e) === t.getMonth(i) ? Xe : Vo;
783
- }
784
- function ct(e, t) {
785
- const o = t.startOfMonth(e), n = o.getDay();
786
- return n === 1 ? o : n === 0 ? t.addDays(o, -6) : t.addDays(o, -1 * (n - 1));
787
- }
788
- function Lo(e, t) {
789
- const o = ct(e, t), n = Ko(e, t);
790
- return t.addDays(o, n * 7 - 1);
791
- }
792
- class z {
793
- /**
794
- * Creates an instance of `DateLib`.
795
- *
796
- * @param options Configuration options for the date library.
797
- * @param overrides Custom overrides for the date library functions.
798
- */
799
- constructor(t, o) {
800
- this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? Q.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, r, i) => this.overrides?.newDate ? this.overrides.newDate(n, r, i) : this.options.timeZone ? new Q(n, r, i, this.options.timeZone) : new Date(n, r, i), this.addDays = (n, r) => this.overrides?.addDays ? this.overrides.addDays(n, r) : Pn(n, r), this.addMonths = (n, r) => this.overrides?.addMonths ? this.overrides.addMonths(n, r) : _n(n, r), this.addWeeks = (n, r) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, r) : En(n, r), this.addYears = (n, r) => this.overrides?.addYears ? this.overrides.addYears(n, r) : Tn(n, r), this.differenceInCalendarDays = (n, r) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, r) : An(n, r), this.differenceInCalendarMonths = (n, r) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, r) : Fn(n, r), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : In(n), this.eachYearOfInterval = (n) => {
801
- const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Bn(n), i = new Set(r.map((s) => this.getYear(s)));
802
- if (i.size === r.length)
803
- return r;
804
- const a = [];
805
- return i.forEach((s) => {
806
- a.push(new Date(s, 0, 1));
807
- }), a;
808
- }, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : Lo(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : Yn(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Rn(n), this.endOfWeek = (n, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, r) : zn(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : jn(n), this.format = (n, r, i) => {
809
- const a = this.overrides?.format ? this.overrides.format(n, r, this.options) : qn(n, r, this.options);
810
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(a) : a;
811
- }, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Hn(n), this.getMonth = (n, r) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : $n(n, this.options), this.getYear = (n, r) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : Zn(n, this.options), this.getWeek = (n, r) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Un(n, this.options), this.isAfter = (n, r) => this.overrides?.isAfter ? this.overrides.isAfter(n, r) : Gn(n, r), this.isBefore = (n, r) => this.overrides?.isBefore ? this.overrides.isBefore(n, r) : Vn(n, r), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : Kn(n), this.isSameDay = (n, r) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, r) : Ln(n, r), this.isSameMonth = (n, r) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, r) : Jn(n, r), this.isSameYear = (n, r) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, r) : Xn(n, r), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Qn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : eo(n), this.setMonth = (n, r) => this.overrides?.setMonth ? this.overrides.setMonth(n, r) : to(n, r), this.setYear = (n, r) => this.overrides?.setYear ? this.overrides.setYear(n, r) : no(n, r), this.startOfBroadcastWeek = (n, r) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : ct(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : oo(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : ro(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : ao(n), this.startOfWeek = (n, r) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : so(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : io(n), this.options = { locale: dt, ...t }, this.overrides = o;
812
- }
813
- /**
814
- * Generates a mapping of Arabic digits (0-9) to the target numbering system
815
- * digits.
816
- *
817
- * @since 9.5.0
818
- * @returns A record mapping Arabic digits to the target numerals.
819
- */
820
- getDigitMap() {
821
- const { numerals: t = "latn" } = this.options, o = new Intl.NumberFormat("en-US", {
822
- numberingSystem: t
823
- }), n = {};
824
- for (let r = 0; r < 10; r++)
825
- n[r.toString()] = o.format(r);
826
- return n;
827
- }
828
- /**
829
- * Replaces Arabic digits in a string with the target numbering system digits.
830
- *
831
- * @since 9.5.0
832
- * @param input The string containing Arabic digits.
833
- * @returns The string with digits replaced.
834
- */
835
- replaceDigits(t) {
836
- const o = this.getDigitMap();
837
- return t.replace(/\d/g, (n) => o[n] || n);
838
- }
839
- /**
840
- * Formats a number using the configured numbering system.
841
- *
842
- * @since 9.5.0
843
- * @param value The number to format.
844
- * @returns The formatted number as a string.
845
- */
846
- formatNumber(t) {
847
- return this.replaceDigits(t.toString());
848
- }
849
- /**
850
- * Returns the preferred ordering for month and year labels for the current
851
- * locale.
852
- */
853
- getMonthYearOrder() {
854
- const t = this.options.locale?.code;
855
- return t && z.yearFirstLocales.has(t) ? "year-first" : "month-first";
856
- }
857
- /**
858
- * Formats the month/year pair respecting locale conventions.
859
- *
860
- * @since 9.11.0
861
- */
862
- formatMonthYear(t) {
863
- const { locale: o, timeZone: n, numerals: r } = this.options, i = o?.code;
864
- if (i && z.yearFirstLocales.has(i))
865
- try {
866
- return new Intl.DateTimeFormat(i, {
867
- month: "long",
868
- year: "numeric",
869
- timeZone: n,
870
- numberingSystem: r
871
- }).format(t);
872
- } catch {
873
- }
874
- const a = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
875
- return this.format(t, a);
876
- }
877
- }
878
- z.yearFirstLocales = /* @__PURE__ */ new Set([
879
- "eu",
880
- "hu",
881
- "ja",
882
- "ja-Hira",
883
- "ja-JP",
884
- "ko",
885
- "ko-KR",
886
- "lt",
887
- "lt-LT",
888
- "lv",
889
- "lv-LV",
890
- "mn",
891
- "mn-MN",
892
- "zh",
893
- "zh-CN",
894
- "zh-HK",
895
- "zh-TW"
896
- ]);
897
- const L = new z();
898
- class ut {
899
- constructor(t, o, n = L) {
900
- 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");
901
- }
902
- /**
903
- * Checks if this day is equal to another `CalendarDay`, considering both the
904
- * date and the displayed month.
905
- *
906
- * @param day The `CalendarDay` to compare with.
907
- * @returns `true` if the days are equal, otherwise `false`.
908
- */
909
- isEqualTo(t) {
910
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
911
- }
912
- }
913
- class Jo {
914
- constructor(t, o) {
915
- this.date = t, this.weeks = o;
916
- }
917
- }
918
- class Xo {
919
- constructor(t, o) {
920
- this.days = o, this.weekNumber = t;
921
- }
922
- }
923
- function Qo(e) {
924
- return f.createElement("button", { ...e });
925
- }
926
- function er(e) {
927
- return f.createElement("span", { ...e });
928
- }
929
- function tr(e) {
930
- const { size: t = 24, orientation: o = "left", className: n } = e;
931
- return (
932
- // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
933
- f.createElement(
934
- "svg",
935
- { className: n, width: t, height: t, viewBox: "0 0 24 24" },
936
- o === "up" && f.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
937
- o === "down" && f.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
938
- o === "left" && f.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
939
- o === "right" && f.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
940
- )
941
- );
942
- }
943
- function nr(e) {
944
- const { day: t, modifiers: o, ...n } = e;
945
- return f.createElement("td", { ...n });
946
- }
947
- function or(e) {
948
- const { day: t, modifiers: o, ...n } = e, r = f.useRef(null);
949
- return f.useEffect(() => {
950
- o.focused && r.current?.focus();
951
- }, [o.focused]), f.createElement("button", { ref: r, ...n });
952
- }
953
- var p;
954
- (function(e) {
955
- 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";
956
- })(p || (p = {}));
957
- var A;
958
- (function(e) {
959
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
960
- })(A || (A = {}));
961
- var Z;
962
- (function(e) {
963
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
964
- })(Z || (Z = {}));
965
- var R;
966
- (function(e) {
967
- 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";
968
- })(R || (R = {}));
969
- function rr(e) {
970
- const { options: t, className: o, components: n, classNames: r, ...i } = e, a = [r[p.Dropdown], o].join(" "), s = t?.find(({ value: l }) => l === i.value);
971
- return f.createElement(
972
- "span",
973
- { "data-disabled": i.disabled, className: r[p.DropdownRoot] },
974
- f.createElement(n.Select, { className: a, ...i }, t?.map(({ value: l, label: d, disabled: u }) => f.createElement(n.Option, { key: l, value: l, disabled: u }, d))),
975
- f.createElement(
976
- "span",
977
- { className: r[p.CaptionLabel], "aria-hidden": !0 },
978
- s?.label,
979
- f.createElement(n.Chevron, { orientation: "down", size: 18, className: r[p.Chevron] })
980
- )
981
- );
982
- }
983
- function ar(e) {
984
- return f.createElement("div", { ...e });
985
- }
986
- function sr(e) {
987
- return f.createElement("div", { ...e });
988
- }
989
- function ir(e) {
990
- const { calendarMonth: t, displayIndex: o, ...n } = e;
991
- return f.createElement("div", { ...n }, e.children);
992
- }
993
- function lr(e) {
994
- const { calendarMonth: t, displayIndex: o, ...n } = e;
995
- return f.createElement("div", { ...n });
996
- }
997
- function dr(e) {
998
- return f.createElement("table", { ...e });
999
- }
1000
- function cr(e) {
1001
- return f.createElement("div", { ...e });
1002
- }
1003
- const ft = an(void 0);
1004
- function fe() {
1005
- const e = sn(ft);
1006
- if (e === void 0)
1007
- throw new Error("useDayPicker() must be used within a custom component.");
1008
- return e;
1009
- }
1010
- function ur(e) {
1011
- const { components: t } = fe();
1012
- return f.createElement(t.Dropdown, { ...e });
1013
- }
1014
- function fr(e) {
1015
- const { onPreviousClick: t, onNextClick: o, previousMonth: n, nextMonth: r, ...i } = e, { components: a, classNames: s, labels: { labelPrevious: l, labelNext: d } } = fe(), u = q((h) => {
1016
- r && o?.(h);
1017
- }, [r, o]), c = q((h) => {
1018
- n && t?.(h);
1019
- }, [n, t]);
1020
- return f.createElement(
1021
- "nav",
1022
- { ...i },
1023
- f.createElement(
1024
- a.PreviousMonthButton,
1025
- { type: "button", className: s[p.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": l(n), onClick: c },
1026
- f.createElement(a.Chevron, { disabled: n ? void 0 : !0, className: s[p.Chevron], orientation: "left" })
1027
- ),
1028
- f.createElement(
1029
- a.NextMonthButton,
1030
- { type: "button", className: s[p.NextMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": d(r), onClick: u },
1031
- f.createElement(a.Chevron, { disabled: r ? void 0 : !0, orientation: "right", className: s[p.Chevron] })
1032
- )
1033
- );
1034
- }
1035
- function hr(e) {
1036
- const { components: t } = fe();
1037
- return f.createElement(t.Button, { ...e });
1038
- }
1039
- function mr(e) {
1040
- return f.createElement("option", { ...e });
1041
- }
1042
- function pr(e) {
1043
- const { components: t } = fe();
1044
- return f.createElement(t.Button, { ...e });
1045
- }
1046
- function yr(e) {
1047
- const { rootRef: t, ...o } = e;
1048
- return f.createElement("div", { ...o, ref: t });
1049
- }
1050
- function gr(e) {
1051
- return f.createElement("select", { ...e });
1052
- }
1053
- function vr(e) {
1054
- const { week: t, ...o } = e;
1055
- return f.createElement("tr", { ...o });
1056
- }
1057
- function br(e) {
1058
- return f.createElement("th", { ...e });
1059
- }
1060
- function Mr(e) {
1061
- return f.createElement(
1062
- "thead",
1063
- { "aria-hidden": !0 },
1064
- f.createElement("tr", { ...e })
1065
- );
1066
- }
1067
- function kr(e) {
1068
- const { week: t, ...o } = e;
1069
- return f.createElement("th", { ...o });
1070
- }
1071
- function wr(e) {
1072
- return f.createElement("th", { ...e });
1073
- }
1074
- function Dr(e) {
1075
- return f.createElement("tbody", { ...e });
1076
- }
1077
- function Or(e) {
1078
- const { components: t } = fe();
1079
- return f.createElement(t.Dropdown, { ...e });
1080
- }
1081
- const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1082
- __proto__: null,
1083
- Button: Qo,
1084
- CaptionLabel: er,
1085
- Chevron: tr,
1086
- Day: nr,
1087
- DayButton: or,
1088
- Dropdown: rr,
1089
- DropdownNav: ar,
1090
- Footer: sr,
1091
- Month: ir,
1092
- MonthCaption: lr,
1093
- MonthGrid: dr,
1094
- Months: cr,
1095
- MonthsDropdown: ur,
1096
- Nav: fr,
1097
- NextMonthButton: hr,
1098
- Option: mr,
1099
- PreviousMonthButton: pr,
1100
- Root: yr,
1101
- Select: gr,
1102
- Week: vr,
1103
- WeekNumber: kr,
1104
- WeekNumberHeader: wr,
1105
- Weekday: br,
1106
- Weekdays: Mr,
1107
- Weeks: Dr,
1108
- YearsDropdown: Or
1109
- }, Symbol.toStringTag, { value: "Module" }));
1110
- function ee(e, t, o = !1, n = L) {
1111
- let { from: r, to: i } = e;
1112
- const { differenceInCalendarDays: a, isSameDay: s } = n;
1113
- return r && i ? (a(i, r) < 0 && ([r, i] = [i, r]), a(t, r) >= (o ? 1 : 0) && a(i, t) >= (o ? 1 : 0)) : !o && i ? s(i, t) : !o && r ? s(r, t) : !1;
1114
- }
1115
- function Ye(e) {
1116
- return !!(e && typeof e == "object" && "before" in e && "after" in e);
1117
- }
1118
- function be(e) {
1119
- return !!(e && typeof e == "object" && "from" in e);
1120
- }
1121
- function Re(e) {
1122
- return !!(e && typeof e == "object" && "after" in e);
1123
- }
1124
- function ze(e) {
1125
- return !!(e && typeof e == "object" && "before" in e);
1126
- }
1127
- function ht(e) {
1128
- return !!(e && typeof e == "object" && "dayOfWeek" in e);
1129
- }
1130
- function mt(e, t) {
1131
- return Array.isArray(e) && e.every(t.isDate);
1132
- }
1133
- function te(e, t, o = L) {
1134
- const n = Array.isArray(t) ? t : [t], { isSameDay: r, differenceInCalendarDays: i, isAfter: a } = o;
1135
- return n.some((s) => {
1136
- if (typeof s == "boolean")
1137
- return s;
1138
- if (o.isDate(s))
1139
- return r(e, s);
1140
- if (mt(s, o))
1141
- return s.includes(e);
1142
- if (be(s))
1143
- return ee(s, e, !1, o);
1144
- if (ht(s))
1145
- return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
1146
- if (Ye(s)) {
1147
- const l = i(s.before, e), d = i(s.after, e), u = l > 0, c = d < 0;
1148
- return a(s.before, s.after) ? c && u : u || c;
1149
- }
1150
- return Re(s) ? i(e, s.after) > 0 : ze(s) ? i(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
1151
- });
1152
- }
1153
- function Wr(e, t, o, n, r) {
1154
- const { disabled: i, hidden: a, modifiers: s, showOutsideDays: l, broadcastCalendar: d, today: u = r.today() } = t, { isSameDay: c, isSameMonth: h, startOfMonth: y, isBefore: C, endOfMonth: N, isAfter: w } = r, W = o && y(o), P = n && N(n), k = {
1155
- [A.focused]: [],
1156
- [A.outside]: [],
1157
- [A.disabled]: [],
1158
- [A.hidden]: [],
1159
- [A.today]: []
1160
- }, O = {};
1161
- for (const v of e) {
1162
- const { date: m, displayMonth: S } = v, T = !!(S && !h(m, S)), B = !!(W && C(m, W)), F = !!(P && w(m, P)), U = !!(i && te(m, i, r)), ne = !!(a && te(m, a, r)) || B || F || // Broadcast calendar will show outside days as default
1163
- !d && !l && T || d && l === !1 && T, J = c(m, u);
1164
- T && k.outside.push(v), U && k.disabled.push(v), ne && k.hidden.push(v), J && k.today.push(v), s && Object.keys(s).forEach((j) => {
1165
- const ae = s?.[j];
1166
- ae && te(m, ae, r) && (O[j] ? O[j].push(v) : O[j] = [v]);
1167
- });
1168
- }
1169
- return (v) => {
1170
- const m = {
1171
- [A.focused]: !1,
1172
- [A.disabled]: !1,
1173
- [A.hidden]: !1,
1174
- [A.outside]: !1,
1175
- [A.today]: !1
1176
- }, S = {};
1177
- for (const T in k) {
1178
- const B = k[T];
1179
- m[T] = B.some((F) => F === v);
1180
- }
1181
- for (const T in O)
1182
- S[T] = O[T].some((B) => B === v);
1183
- return {
1184
- ...m,
1185
- // custom modifiers should override all the previous ones
1186
- ...S
1187
- };
1188
- };
1189
- }
1190
- function Sr(e, t, o = {}) {
1191
- return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [i]) => (o[i] ? r.push(o[i]) : t[A[i]] ? r.push(t[A[i]]) : t[Z[i]] && r.push(t[Z[i]]), r), [t[p.Day]]);
1192
- }
1193
- function xr(e) {
1194
- return {
1195
- ...Cr,
1196
- ...e
1197
- };
1198
- }
1199
- function Nr(e) {
1200
- const t = {
1201
- "data-mode": e.mode ?? void 0,
1202
- "data-required": "required" in e ? e.required : void 0,
1203
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
1204
- "data-week-numbers": e.showWeekNumber || void 0,
1205
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
1206
- "data-nav-layout": e.navLayout || void 0
1207
- };
1208
- return Object.entries(e).forEach(([o, n]) => {
1209
- o.startsWith("data-") && (t[o] = n);
1210
- }), t;
1211
- }
1212
- function je() {
1213
- const e = {};
1214
- for (const t in p)
1215
- e[p[t]] = `rdp-${p[t]}`;
1216
- for (const t in A)
1217
- e[A[t]] = `rdp-${A[t]}`;
1218
- for (const t in Z)
1219
- e[Z[t]] = `rdp-${Z[t]}`;
1220
- for (const t in R)
1221
- e[R[t]] = `rdp-${R[t]}`;
1222
- return e;
1223
- }
1224
- function pt(e, t, o) {
1225
- return (o ?? new z(t)).formatMonthYear(e);
1226
- }
1227
- const Pr = pt;
1228
- function _r(e, t, o) {
1229
- return (o ?? new z(t)).format(e, "d");
1230
- }
1231
- function Er(e, t = L) {
1232
- return t.format(e, "LLLL");
1233
- }
1234
- function Tr(e, t, o) {
1235
- return (o ?? new z(t)).format(e, "cccccc");
1236
- }
1237
- function Ar(e, t = L) {
1238
- return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
1239
- }
1240
- function Fr() {
1241
- return "";
1242
- }
1243
- function yt(e, t = L) {
1244
- return t.format(e, "yyyy");
1245
- }
1246
- const Ir = yt, Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1247
- __proto__: null,
1248
- formatCaption: pt,
1249
- formatDay: _r,
1250
- formatMonthCaption: Pr,
1251
- formatMonthDropdown: Er,
1252
- formatWeekNumber: Ar,
1253
- formatWeekNumberHeader: Fr,
1254
- formatWeekdayName: Tr,
1255
- formatYearCaption: Ir,
1256
- formatYearDropdown: yt
1257
- }, Symbol.toStringTag, { value: "Module" }));
1258
- function Yr(e) {
1259
- return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
1260
- ...Br,
1261
- ...e
1262
- };
1263
- }
1264
- function Rr(e, t, o, n, r) {
1265
- const { startOfMonth: i, startOfYear: a, endOfYear: s, eachMonthOfInterval: l, getMonth: d } = r;
1266
- return l({
1267
- start: a(e),
1268
- end: s(e)
1269
- }).map((h) => {
1270
- const y = n.formatMonthDropdown(h, r), C = d(h), N = t && h < i(t) || o && h > i(o) || !1;
1271
- return { value: C, label: y, disabled: N };
1272
- });
1273
- }
1274
- function zr(e, t = {}, o = {}) {
1275
- let n = { ...t?.[p.Day] };
1276
- return Object.entries(e).filter(([, r]) => r === !0).forEach(([r]) => {
1277
- n = {
1278
- ...n,
1279
- ...o?.[r]
1280
- };
1281
- }), n;
1282
- }
1283
- function jr(e, t, o, n) {
1284
- const r = n ?? e.today(), i = o ? e.startOfBroadcastWeek(r, e) : t ? e.startOfISOWeek(r) : e.startOfWeek(r), a = [];
1285
- for (let s = 0; s < 7; s++) {
1286
- const l = e.addDays(i, s);
1287
- a.push(l);
1288
- }
1289
- return a;
1290
- }
1291
- function qr(e, t, o, n, r = !1) {
1292
- if (!e || !t)
1293
- return;
1294
- const { startOfYear: i, endOfYear: a, eachYearOfInterval: s, getYear: l } = n, d = i(e), u = a(t), c = s({ start: d, end: u });
1295
- return r && c.reverse(), c.map((h) => {
1296
- const y = o.formatYearDropdown(h, n);
1297
- return {
1298
- value: l(h),
1299
- label: y,
1300
- disabled: !1
1301
- };
1302
- });
1303
- }
1304
- function gt(e, t, o, n) {
1305
- let r = (n ?? new z(o)).format(e, "PPPP");
1306
- return t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r;
1307
- }
1308
- const Hr = gt;
1309
- function vt(e, t, o) {
1310
- return (o ?? new z(t)).formatMonthYear(e);
1311
- }
1312
- const $r = vt;
1313
- function Zr(e, t, o, n) {
1314
- let r = (n ?? new z(o)).format(e, "PPPP");
1315
- return t?.today && (r = `Today, ${r}`), r;
1316
- }
1317
- function Ur(e) {
1318
- return "Choose the Month";
1319
- }
1320
- function Gr() {
1321
- return "";
1322
- }
1323
- function Vr(e) {
1324
- return "Go to the Next Month";
1325
- }
1326
- function Kr(e) {
1327
- return "Go to the Previous Month";
1328
- }
1329
- function Lr(e, t, o) {
1330
- return (o ?? new z(t)).format(e, "cccc");
1331
- }
1332
- function Jr(e, t) {
1333
- return `Week ${e}`;
1334
- }
1335
- function Xr(e) {
1336
- return "Week Number";
1337
- }
1338
- function Qr(e) {
1339
- return "Choose the Year";
1340
- }
1341
- const ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1342
- __proto__: null,
1343
- labelCaption: $r,
1344
- labelDay: Hr,
1345
- labelDayButton: gt,
1346
- labelGrid: vt,
1347
- labelGridcell: Zr,
1348
- labelMonthDropdown: Ur,
1349
- labelNav: Gr,
1350
- labelNext: Vr,
1351
- labelPrevious: Kr,
1352
- labelWeekNumber: Jr,
1353
- labelWeekNumberHeader: Xr,
1354
- labelWeekday: Lr,
1355
- labelYearDropdown: Qr
1356
- }, Symbol.toStringTag, { value: "Module" })), he = (e) => e instanceof HTMLElement ? e : null, Ee = (e) => [
1357
- ...e.querySelectorAll("[data-animated-month]") ?? []
1358
- ], ta = (e) => he(e.querySelector("[data-animated-month]")), Te = (e) => he(e.querySelector("[data-animated-caption]")), Ae = (e) => he(e.querySelector("[data-animated-weeks]")), na = (e) => he(e.querySelector("[data-animated-nav]")), oa = (e) => he(e.querySelector("[data-animated-weekdays]"));
1359
- function ra(e, t, { classNames: o, months: n, focused: r, dateLib: i }) {
1360
- const a = ve(null), s = ve(n), l = ve(!1);
1361
- ln(() => {
1362
- const d = s.current;
1363
- if (s.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
1364
- !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
1365
- n.length === 0 || d.length === 0 || n.length !== d.length)
1366
- return;
1367
- const u = i.isSameMonth(n[0].date, d[0].date), c = i.isAfter(n[0].date, d[0].date), h = c ? o[R.caption_after_enter] : o[R.caption_before_enter], y = c ? o[R.weeks_after_enter] : o[R.weeks_before_enter], C = a.current, N = e.current.cloneNode(!0);
1368
- if (N instanceof HTMLElement ? (Ee(N).forEach((k) => {
1369
- if (!(k instanceof HTMLElement))
1370
- return;
1371
- const O = ta(k);
1372
- O && k.contains(O) && k.removeChild(O);
1373
- const v = Te(k);
1374
- v && v.classList.remove(h);
1375
- const m = Ae(k);
1376
- m && m.classList.remove(y);
1377
- }), a.current = N) : a.current = null, l.current || u || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
1378
- r)
1379
- return;
1380
- const w = C instanceof HTMLElement ? Ee(C) : [], W = Ee(e.current);
1381
- if (W?.every((P) => P instanceof HTMLElement) && w && w.every((P) => P instanceof HTMLElement)) {
1382
- l.current = !0, e.current.style.isolation = "isolate";
1383
- const P = na(e.current);
1384
- P && (P.style.zIndex = "1"), W.forEach((k, O) => {
1385
- const v = w[O];
1386
- if (!v)
1387
- return;
1388
- k.style.position = "relative", k.style.overflow = "hidden";
1389
- const m = Te(k);
1390
- m && m.classList.add(h);
1391
- const S = Ae(k);
1392
- S && S.classList.add(y);
1393
- const T = () => {
1394
- l.current = !1, e.current && (e.current.style.isolation = ""), P && (P.style.zIndex = ""), m && m.classList.remove(h), S && S.classList.remove(y), k.style.position = "", k.style.overflow = "", k.contains(v) && k.removeChild(v);
1395
- };
1396
- v.style.pointerEvents = "none", v.style.position = "absolute", v.style.overflow = "hidden", v.setAttribute("aria-hidden", "true");
1397
- const B = oa(v);
1398
- B && (B.style.opacity = "0");
1399
- const F = Te(v);
1400
- F && (F.classList.add(c ? o[R.caption_before_exit] : o[R.caption_after_exit]), F.addEventListener("animationend", T));
1401
- const U = Ae(v);
1402
- U && U.classList.add(c ? o[R.weeks_before_exit] : o[R.weeks_after_exit]), k.insertBefore(v, k.firstChild);
1403
- });
1404
- }
1405
- });
1406
- }
1407
- function aa(e, t, o, n) {
1408
- const r = e[0], i = e[e.length - 1], { ISOWeek: a, fixedWeeks: s, broadcastCalendar: l } = o ?? {}, { addDays: d, differenceInCalendarDays: u, differenceInCalendarMonths: c, endOfBroadcastWeek: h, endOfISOWeek: y, endOfMonth: C, endOfWeek: N, isAfter: w, startOfBroadcastWeek: W, startOfISOWeek: P, startOfWeek: k } = n, O = l ? W(r, n) : a ? P(r) : k(r), v = l ? h(i) : a ? y(C(i)) : N(C(i)), m = t && (l ? h(t) : a ? y(t) : N(t)), S = m && w(v, m) ? m : v, T = u(S, O), B = c(i, r) + 1, F = [];
1409
- for (let J = 0; J <= T; J++) {
1410
- const j = d(O, J);
1411
- F.push(j);
1412
- }
1413
- const ne = (l ? 35 : 42) * B;
1414
- if (s && F.length < ne) {
1415
- const J = ne - F.length;
1416
- for (let j = 0; j < J; j++) {
1417
- const ae = d(F[F.length - 1], 1);
1418
- F.push(ae);
1419
- }
1420
- }
1421
- return F;
1422
- }
1423
- function sa(e) {
1424
- const t = [];
1425
- return e.reduce((o, n) => {
1426
- const r = n.weeks.reduce((i, a) => i.concat(a.days.slice()), t.slice());
1427
- return o.concat(r.slice());
1428
- }, t.slice());
1429
- }
1430
- function ia(e, t, o, n) {
1431
- const { numberOfMonths: r = 1 } = o, i = [];
1432
- for (let a = 0; a < r; a++) {
1433
- const s = n.addMonths(e, a);
1434
- if (t && s > t)
1435
- break;
1436
- i.push(s);
1437
- }
1438
- return i;
1439
- }
1440
- function Qe(e, t, o, n) {
1441
- const { month: r, defaultMonth: i, today: a = n.today(), numberOfMonths: s = 1 } = e;
1442
- let l = r || i || a;
1443
- const { differenceInCalendarMonths: d, addMonths: u, startOfMonth: c } = n;
1444
- if (o && d(o, l) < s - 1) {
1445
- const h = -1 * (s - 1);
1446
- l = u(o, h);
1447
- }
1448
- return t && d(l, t) < 0 && (l = t), c(l);
1449
- }
1450
- function la(e, t, o, n) {
1451
- const { addDays: r, endOfBroadcastWeek: i, endOfISOWeek: a, endOfMonth: s, endOfWeek: l, getISOWeek: d, getWeek: u, startOfBroadcastWeek: c, startOfISOWeek: h, startOfWeek: y } = n, C = e.reduce((N, w) => {
1452
- const W = o.broadcastCalendar ? c(w, n) : o.ISOWeek ? h(w) : y(w), P = o.broadcastCalendar ? i(w) : o.ISOWeek ? a(s(w)) : l(s(w)), k = t.filter((S) => S >= W && S <= P), O = o.broadcastCalendar ? 35 : 42;
1453
- if (o.fixedWeeks && k.length < O) {
1454
- const S = t.filter((T) => {
1455
- const B = O - k.length;
1456
- return T > P && T <= r(P, B);
1457
- });
1458
- k.push(...S);
1459
- }
1460
- const v = k.reduce((S, T) => {
1461
- const B = o.ISOWeek ? d(T) : u(T), F = S.find((ne) => ne.weekNumber === B), U = new ut(T, w, n);
1462
- return F ? F.days.push(U) : S.push(new Xo(B, [U])), S;
1463
- }, []), m = new Jo(w, v);
1464
- return N.push(m), N;
1465
- }, []);
1466
- return o.reverseMonths ? C.reverse() : C;
1467
- }
1468
- function da(e, t) {
1469
- let { startMonth: o, endMonth: n } = e;
1470
- const { startOfYear: r, startOfDay: i, startOfMonth: a, endOfMonth: s, addYears: l, endOfYear: d, newDate: u, today: c } = t, { fromYear: h, toYear: y, fromMonth: C, toMonth: N } = e;
1471
- !o && C && (o = C), !o && h && (o = t.newDate(h, 0, 1)), !n && N && (n = N), !n && y && (n = u(y, 11, 31));
1472
- const w = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
1473
- return o ? o = a(o) : h ? o = u(h, 0, 1) : !o && w && (o = r(l(e.today ?? c(), -100))), n ? n = s(n) : y ? n = u(y, 11, 31) : !n && w && (n = d(e.today ?? c())), [
1474
- o && i(o),
1475
- n && i(n)
1476
- ];
1477
- }
1478
- function ca(e, t, o, n) {
1479
- if (o.disableNavigation)
1480
- return;
1481
- const { pagedNavigation: r, numberOfMonths: i = 1 } = o, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: l } = n, d = r ? i : 1, u = a(e);
1482
- if (!t)
1483
- return s(u, d);
1484
- if (!(l(t, e) < i))
1485
- return s(u, d);
1486
- }
1487
- function ua(e, t, o, n) {
1488
- if (o.disableNavigation)
1489
- return;
1490
- const { pagedNavigation: r, numberOfMonths: i } = o, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: l } = n, d = r ? i ?? 1 : 1, u = a(e);
1491
- if (!t)
1492
- return s(u, -d);
1493
- if (!(l(u, t) <= 0))
1494
- return s(u, -d);
1495
- }
1496
- function fa(e) {
1497
- const t = [];
1498
- return e.reduce((o, n) => o.concat(n.weeks.slice()), t.slice());
1499
- }
1500
- function Me(e, t) {
1501
- const [o, n] = Ie(e);
1502
- return [t === void 0 ? o : t, n];
1503
- }
1504
- function ha(e, t) {
1505
- const [o, n] = da(e, t), { startOfMonth: r, endOfMonth: i } = t, a = Qe(e, o, n, t), [s, l] = Me(
1506
- a,
1507
- // initialMonth is always computed from props.month if provided
1508
- e.month ? a : void 0
1509
- );
1510
- dn(() => {
1511
- const O = Qe(e, o, n, t);
1512
- l(O);
1513
- }, [e.timeZone]);
1514
- const { months: d, weeks: u, days: c, previousMonth: h, nextMonth: y } = ce(() => {
1515
- const O = ia(s, n, { numberOfMonths: e.numberOfMonths }, t), v = aa(O, e.endMonth ? i(e.endMonth) : void 0, {
1516
- ISOWeek: e.ISOWeek,
1517
- fixedWeeks: e.fixedWeeks,
1518
- broadcastCalendar: e.broadcastCalendar
1519
- }, t), m = la(O, v, {
1520
- broadcastCalendar: e.broadcastCalendar,
1521
- fixedWeeks: e.fixedWeeks,
1522
- ISOWeek: e.ISOWeek,
1523
- reverseMonths: e.reverseMonths
1524
- }, t), S = fa(m), T = sa(m), B = ua(s, o, e, t), F = ca(s, n, e, t);
1525
- return {
1526
- months: m,
1527
- weeks: S,
1528
- days: T,
1529
- previousMonth: B,
1530
- nextMonth: F
1531
- };
1532
- }, [
1533
- t,
1534
- s.getTime(),
1535
- n?.getTime(),
1536
- o?.getTime(),
1537
- e.disableNavigation,
1538
- e.broadcastCalendar,
1539
- e.endMonth?.getTime(),
1540
- e.fixedWeeks,
1541
- e.ISOWeek,
1542
- e.numberOfMonths,
1543
- e.pagedNavigation,
1544
- e.reverseMonths
1545
- ]), { disableNavigation: C, onMonthChange: N } = e, w = (O) => u.some((v) => v.days.some((m) => m.isEqualTo(O))), W = (O) => {
1546
- if (C)
1547
- return;
1548
- let v = r(O);
1549
- o && v < r(o) && (v = r(o)), n && v > r(n) && (v = r(n)), l(v), N?.(v);
1550
- };
1551
- return {
1552
- months: d,
1553
- weeks: u,
1554
- days: c,
1555
- navStart: o,
1556
- navEnd: n,
1557
- previousMonth: h,
1558
- nextMonth: y,
1559
- goToMonth: W,
1560
- goToDay: (O) => {
1561
- w(O) || W(O.date);
1562
- }
1563
- };
1564
- }
1565
- var V;
1566
- (function(e) {
1567
- e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
1568
- })(V || (V = {}));
1569
- function et(e) {
1570
- return !e[A.disabled] && !e[A.hidden] && !e[A.outside];
1571
- }
1572
- function ma(e, t, o, n) {
1573
- let r, i = -1;
1574
- for (const a of e) {
1575
- const s = t(a);
1576
- et(s) && (s[A.focused] && i < V.FocusedModifier ? (r = a, i = V.FocusedModifier) : n?.isEqualTo(a) && i < V.LastFocused ? (r = a, i = V.LastFocused) : o(a.date) && i < V.Selected ? (r = a, i = V.Selected) : s[A.today] && i < V.Today && (r = a, i = V.Today));
1577
- }
1578
- return r || (r = e.find((a) => et(t(a)))), r;
1579
- }
1580
- function pa(e, t, o, n, r, i, a) {
1581
- const { ISOWeek: s, broadcastCalendar: l } = i, { addDays: d, addMonths: u, addWeeks: c, addYears: h, endOfBroadcastWeek: y, endOfISOWeek: C, endOfWeek: N, max: w, min: W, startOfBroadcastWeek: P, startOfISOWeek: k, startOfWeek: O } = a;
1582
- let m = {
1583
- day: d,
1584
- week: c,
1585
- month: u,
1586
- year: h,
1587
- startOfWeek: (S) => l ? P(S, a) : s ? k(S) : O(S),
1588
- endOfWeek: (S) => l ? y(S) : s ? C(S) : N(S)
1589
- }[e](o, t === "after" ? 1 : -1);
1590
- return t === "before" && n ? m = w([n, m]) : t === "after" && r && (m = W([r, m])), m;
1591
- }
1592
- function bt(e, t, o, n, r, i, a, s = 0) {
1593
- if (s > 365)
1594
- return;
1595
- const l = pa(e, t, o.date, n, r, i, a), d = !!(i.disabled && te(l, i.disabled, a)), u = !!(i.hidden && te(l, i.hidden, a)), c = l, h = new ut(l, c, a);
1596
- return !d && !u ? h : bt(e, t, h, n, r, i, a, s + 1);
1597
- }
1598
- function ya(e, t, o, n, r) {
1599
- const { autoFocus: i } = e, [a, s] = Ie(), l = ma(t.days, o, n || (() => !1), a), [d, u] = Ie(i ? l : void 0);
1600
- return {
1601
- isFocusTarget: (N) => !!l?.isEqualTo(N),
1602
- setFocused: u,
1603
- focused: d,
1604
- blur: () => {
1605
- s(d), u(void 0);
1606
- },
1607
- moveFocus: (N, w) => {
1608
- if (!d)
1609
- return;
1610
- const W = bt(N, w, d, t.navStart, t.navEnd, e, r);
1611
- W && (e.disableNavigation && !t.days.some((k) => k.isEqualTo(W)) || (t.goToDay(W), u(W)));
1612
- }
1613
- };
1614
- }
1615
- function ga(e, t) {
1616
- const { selected: o, required: n, onSelect: r } = e, [i, a] = Me(o, r ? o : void 0), s = r ? o : i, { isSameDay: l } = t, d = (y) => s?.some((C) => l(C, y)) ?? !1, { min: u, max: c } = e;
1617
- return {
1618
- selected: s,
1619
- select: (y, C, N) => {
1620
- let w = [...s ?? []];
1621
- if (d(y)) {
1622
- if (s?.length === u || n && s?.length === 1)
1623
- return;
1624
- w = s?.filter((W) => !l(W, y));
1625
- } else
1626
- s?.length === c ? w = [y] : w = [...w, y];
1627
- return r || a(w), r?.(w, y, C, N), w;
1628
- },
1629
- isSelected: d
1630
- };
1631
- }
1632
- function va(e, t, o = 0, n = 0, r = !1, i = L) {
1633
- const { from: a, to: s } = t || {}, { isSameDay: l, isAfter: d, isBefore: u } = i;
1634
- let c;
1635
- if (!a && !s)
1636
- c = { from: e, to: o > 0 ? void 0 : e };
1637
- else if (a && !s)
1638
- l(a, e) ? o === 0 ? c = { from: a, to: e } : r ? c = { from: a, to: void 0 } : c = void 0 : u(e, a) ? c = { from: e, to: a } : c = { from: a, to: e };
1639
- else if (a && s)
1640
- if (l(a, e) && l(s, e))
1641
- r ? c = { from: a, to: s } : c = void 0;
1642
- else if (l(a, e))
1643
- c = { from: a, to: o > 0 ? void 0 : e };
1644
- else if (l(s, e))
1645
- c = { from: e, to: o > 0 ? void 0 : e };
1646
- else if (u(e, a))
1647
- c = { from: e, to: s };
1648
- else if (d(e, a))
1649
- c = { from: a, to: e };
1650
- else if (d(e, s))
1651
- c = { from: a, to: e };
1652
- else
1653
- throw new Error("Invalid range");
1654
- if (c?.from && c?.to) {
1655
- const h = i.differenceInCalendarDays(c.to, c.from);
1656
- n > 0 && h > n ? c = { from: e, to: void 0 } : o > 1 && h < o && (c = { from: e, to: void 0 });
1657
- }
1658
- return c;
1659
- }
1660
- function ba(e, t, o = L) {
1661
- const n = Array.isArray(t) ? t : [t];
1662
- let r = e.from;
1663
- const i = o.differenceInCalendarDays(e.to, e.from), a = Math.min(i, 6);
1664
- for (let s = 0; s <= a; s++) {
1665
- if (n.includes(r.getDay()))
1666
- return !0;
1667
- r = o.addDays(r, 1);
1668
- }
1669
- return !1;
1670
- }
1671
- function tt(e, t, o = L) {
1672
- return ee(e, t.from, !1, o) || ee(e, t.to, !1, o) || ee(t, e.from, !1, o) || ee(t, e.to, !1, o);
1673
- }
1674
- function Ma(e, t, o = L) {
1675
- const n = Array.isArray(t) ? t : [t];
1676
- if (n.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : o.isDate(s) ? ee(e, s, !1, o) : mt(s, o) ? s.some((l) => ee(e, l, !1, o)) : be(s) ? s.from && s.to ? tt(e, { from: s.from, to: s.to }, o) : !1 : ht(s) ? ba(e, s.dayOfWeek, o) : Ye(s) ? o.isAfter(s.before, s.after) ? tt(e, {
1677
- from: o.addDays(s.after, 1),
1678
- to: o.addDays(s.before, -1)
1679
- }, o) : te(e.from, s, o) || te(e.to, s, o) : Re(s) || ze(s) ? te(e.from, s, o) || te(e.to, s, o) : !1))
1680
- return !0;
1681
- const a = n.filter((s) => typeof s == "function");
1682
- if (a.length) {
1683
- let s = e.from;
1684
- const l = o.differenceInCalendarDays(e.to, e.from);
1685
- for (let d = 0; d <= l; d++) {
1686
- if (a.some((u) => u(s)))
1687
- return !0;
1688
- s = o.addDays(s, 1);
1689
- }
1690
- }
1691
- return !1;
1692
- }
1693
- function ka(e, t) {
1694
- const { disabled: o, excludeDisabled: n, selected: r, required: i, onSelect: a } = e, [s, l] = Me(r, a ? r : void 0), d = a ? r : s;
1695
- return {
1696
- selected: d,
1697
- select: (h, y, C) => {
1698
- const { min: N, max: w } = e, W = h ? va(h, d, N, w, i, t) : void 0;
1699
- return n && o && W?.from && W.to && Ma({ from: W.from, to: W.to }, o, t) && (W.from = h, W.to = void 0), a || l(W), a?.(W, h, y, C), W;
1700
- },
1701
- isSelected: (h) => d && ee(d, h, !1, t)
1702
- };
1703
- }
1704
- function wa(e, t) {
1705
- const { selected: o, required: n, onSelect: r } = e, [i, a] = Me(o, r ? o : void 0), s = r ? o : i, { isSameDay: l } = t;
1706
- return {
1707
- selected: s,
1708
- select: (c, h, y) => {
1709
- let C = c;
1710
- return !n && s && s && l(c, s) && (C = void 0), r || a(C), r?.(C, c, h, y), C;
1711
- },
1712
- isSelected: (c) => s ? l(s, c) : !1
1713
- };
1714
- }
1715
- function Da(e, t) {
1716
- const o = wa(e, t), n = ga(e, t), r = ka(e, t);
1717
- switch (e.mode) {
1718
- case "single":
1719
- return o;
1720
- case "multiple":
1721
- return n;
1722
- case "range":
1723
- return r;
1724
- default:
1725
- return;
1726
- }
1727
- }
1728
- function Y(e, t) {
1729
- return e instanceof Q && e.timeZone === t ? e : new Q(e, t);
1730
- }
1731
- function nt(e, t) {
1732
- return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? Y(e, t) : Array.isArray(e) ? e.map((o) => o instanceof Date ? Y(o, t) : o) : be(e) ? {
1733
- ...e,
1734
- from: e.from ? Y(e.from, t) : e.from,
1735
- to: e.to ? Y(e.to, t) : e.to
1736
- } : Ye(e) ? {
1737
- before: Y(e.before, t),
1738
- after: Y(e.after, t)
1739
- } : Re(e) ? {
1740
- after: Y(e.after, t)
1741
- } : ze(e) ? {
1742
- before: Y(e.before, t)
1743
- } : e;
1744
- }
1745
- function Fe(e, t) {
1746
- return e && (Array.isArray(e) ? e.map((o) => nt(o, t)) : nt(e, t));
1747
- }
1748
- function Oa(e) {
1749
- let t = e;
1750
- const o = t.timeZone;
1751
- if (o && (t = {
1752
- ...e,
1753
- timeZone: o
1754
- }, t.today && (t.today = Y(t.today, o)), t.month && (t.month = Y(t.month, o)), t.defaultMonth && (t.defaultMonth = Y(t.defaultMonth, o)), t.startMonth && (t.startMonth = Y(t.startMonth, o)), t.endMonth && (t.endMonth = Y(t.endMonth, o)), t.mode === "single" && t.selected ? t.selected = Y(t.selected, o) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((D) => Y(D, o)) : t.mode === "range" && t.selected && (t.selected = {
1755
- from: t.selected.from ? Y(t.selected.from, o) : t.selected.from,
1756
- to: t.selected.to ? Y(t.selected.to, o) : t.selected.to
1757
- }), t.disabled !== void 0 && (t.disabled = Fe(t.disabled, o)), t.hidden !== void 0 && (t.hidden = Fe(t.hidden, o)), t.modifiers)) {
1758
- const D = {};
1759
- Object.keys(t.modifiers).forEach((E) => {
1760
- D[E] = Fe(t.modifiers?.[E], o);
1761
- }), t.modifiers = D;
1762
- }
1763
- const { components: n, formatters: r, labels: i, dateLib: a, locale: s, classNames: l } = ce(() => {
1764
- const D = { ...dt, ...t.locale };
1765
- return {
1766
- dateLib: new z({
1767
- locale: D,
1768
- weekStartsOn: t.broadcastCalendar ? 1 : t.weekStartsOn,
1769
- firstWeekContainsDate: t.firstWeekContainsDate,
1770
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
1771
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
1772
- timeZone: t.timeZone,
1773
- numerals: t.numerals
1774
- }, t.dateLib),
1775
- components: xr(t.components),
1776
- formatters: Yr(t.formatters),
1777
- labels: { ...ea, ...t.labels },
1778
- locale: D,
1779
- classNames: { ...je(), ...t.classNames }
1780
- };
1781
- }, [
1782
- t.locale,
1783
- t.broadcastCalendar,
1784
- t.weekStartsOn,
1785
- t.firstWeekContainsDate,
1786
- t.useAdditionalWeekYearTokens,
1787
- t.useAdditionalDayOfYearTokens,
1788
- t.timeZone,
1789
- t.numerals,
1790
- t.dateLib,
1791
- t.components,
1792
- t.formatters,
1793
- t.labels,
1794
- t.classNames
1795
- ]);
1796
- t.today || (t = { ...t, today: a.today() });
1797
- const { captionLayout: d, mode: u, navLayout: c, numberOfMonths: h = 1, onDayBlur: y, onDayClick: C, onDayFocus: N, onDayKeyDown: w, onDayMouseEnter: W, onDayMouseLeave: P, onNextClick: k, onPrevClick: O, showWeekNumber: v, styles: m } = t, { formatCaption: S, formatDay: T, formatMonthDropdown: B, formatWeekNumber: F, formatWeekNumberHeader: U, formatWeekdayName: ne, formatYearDropdown: J } = r, j = ha(t, a), { days: ae, months: pe, navStart: we, navEnd: De, previousMonth: H, nextMonth: $, goToMonth: X } = j, Oe = Wr(ae, t, we, De, a), { isSelected: Ce, select: We, selected: ye } = Da(t, a) ?? {}, { blur: He, focused: $e, isFocusTarget: _t, moveFocus: Ze, setFocused: ge } = ya(t, j, Oe, Ce ?? (() => !1), a), { labelDayButton: Et, labelGridcell: Tt, labelGrid: At, labelMonthDropdown: Ft, labelNav: Ue, labelPrevious: It, labelNext: Bt, labelWeekday: Yt, labelWeekNumber: Rt, labelWeekNumberHeader: zt, labelYearDropdown: jt } = i, qt = ce(() => jr(a, t.ISOWeek, t.broadcastCalendar, t.today), [a, t.ISOWeek, t.broadcastCalendar, t.today]), Ge = u !== void 0 || C !== void 0, Se = q(() => {
1798
- H && (X(H), O?.(H));
1799
- }, [H, X, O]), xe = q(() => {
1800
- $ && (X($), k?.($));
1801
- }, [X, $, k]), Ht = q((D, E) => (M) => {
1802
- M.preventDefault(), M.stopPropagation(), ge(D), !E.disabled && (We?.(D.date, E, M), C?.(D.date, E, M));
1803
- }, [We, C, ge]), $t = q((D, E) => (M) => {
1804
- ge(D), N?.(D.date, E, M);
1805
- }, [N, ge]), Zt = q((D, E) => (M) => {
1806
- He(), y?.(D.date, E, M);
1807
- }, [He, y]), Ut = q((D, E) => (M) => {
1808
- const _ = {
1809
- ArrowLeft: [
1810
- M.shiftKey ? "month" : "day",
1811
- t.dir === "rtl" ? "after" : "before"
1812
- ],
1813
- ArrowRight: [
1814
- M.shiftKey ? "month" : "day",
1815
- t.dir === "rtl" ? "before" : "after"
1816
- ],
1817
- ArrowDown: [M.shiftKey ? "year" : "week", "after"],
1818
- ArrowUp: [M.shiftKey ? "year" : "week", "before"],
1819
- PageUp: [M.shiftKey ? "year" : "month", "before"],
1820
- PageDown: [M.shiftKey ? "year" : "month", "after"],
1821
- Home: ["startOfWeek", "before"],
1822
- End: ["endOfWeek", "after"]
1823
- };
1824
- if (_[M.key]) {
1825
- M.preventDefault(), M.stopPropagation();
1826
- const [G, x] = _[M.key];
1827
- Ze(G, x);
1828
- }
1829
- w?.(D.date, E, M);
1830
- }, [Ze, w, t.dir]), Gt = q((D, E) => (M) => {
1831
- W?.(D.date, E, M);
1832
- }, [W]), Vt = q((D, E) => (M) => {
1833
- P?.(D.date, E, M);
1834
- }, [P]), Kt = q((D) => (E) => {
1835
- const M = Number(E.target.value), _ = a.setMonth(a.startOfMonth(D), M);
1836
- X(_);
1837
- }, [a, X]), Lt = q((D) => (E) => {
1838
- const M = Number(E.target.value), _ = a.setYear(a.startOfMonth(D), M);
1839
- X(_);
1840
- }, [a, X]), { className: Jt, style: Xt } = ce(() => ({
1841
- className: [l[p.Root], t.className].filter(Boolean).join(" "),
1842
- style: { ...m?.[p.Root], ...t.style }
1843
- }), [l, t.className, t.style, m]), Qt = Nr(t), Ve = ve(null);
1844
- ra(Ve, !!t.animate, {
1845
- classNames: l,
1846
- months: pe,
1847
- focused: $e,
1848
- dateLib: a
1849
- });
1850
- const en = {
1851
- dayPickerProps: t,
1852
- selected: ye,
1853
- select: We,
1854
- isSelected: Ce,
1855
- months: pe,
1856
- nextMonth: $,
1857
- previousMonth: H,
1858
- goToMonth: X,
1859
- getModifiers: Oe,
1860
- components: n,
1861
- classNames: l,
1862
- styles: m,
1863
- labels: i,
1864
- formatters: r
1865
- };
1866
- return f.createElement(
1867
- ft.Provider,
1868
- { value: en },
1869
- f.createElement(
1870
- n.Root,
1871
- { rootRef: t.animate ? Ve : void 0, className: Jt, style: Xt, 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"], ...Qt },
1872
- f.createElement(
1873
- n.Months,
1874
- { className: l[p.Months], style: m?.[p.Months] },
1875
- !t.hideNavigation && !c && f.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: l[p.Nav], style: m?.[p.Nav], "aria-label": Ue(), onPreviousClick: Se, onNextClick: xe, previousMonth: H, nextMonth: $ }),
1876
- pe.map((D, E) => f.createElement(
1877
- n.Month,
1878
- {
1879
- "data-animated-month": t.animate ? "true" : void 0,
1880
- className: l[p.Month],
1881
- style: m?.[p.Month],
1882
- // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
1883
- key: E,
1884
- displayIndex: E,
1885
- calendarMonth: D
1886
- },
1887
- c === "around" && !t.hideNavigation && E === 0 && f.createElement(
1888
- n.PreviousMonthButton,
1889
- { type: "button", className: l[p.PreviousMonthButton], tabIndex: H ? void 0 : -1, "aria-disabled": H ? void 0 : !0, "aria-label": It(H), onClick: Se, "data-animated-button": t.animate ? "true" : void 0 },
1890
- f.createElement(n.Chevron, { disabled: H ? void 0 : !0, className: l[p.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
1891
- ),
1892
- f.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: l[p.MonthCaption], style: m?.[p.MonthCaption], calendarMonth: D, displayIndex: E }, d?.startsWith("dropdown") ? f.createElement(
1893
- n.DropdownNav,
1894
- { className: l[p.Dropdowns], style: m?.[p.Dropdowns] },
1895
- (() => {
1896
- const M = d === "dropdown" || d === "dropdown-months" ? f.createElement(n.MonthsDropdown, { key: "month", className: l[p.MonthsDropdown], "aria-label": Ft(), classNames: l, components: n, disabled: !!t.disableNavigation, onChange: Kt(D.date), options: Rr(D.date, we, De, r, a), style: m?.[p.Dropdown], value: a.getMonth(D.date) }) : f.createElement("span", { key: "month" }, B(D.date, a)), _ = d === "dropdown" || d === "dropdown-years" ? f.createElement(n.YearsDropdown, { key: "year", className: l[p.YearsDropdown], "aria-label": jt(a.options), classNames: l, components: n, disabled: !!t.disableNavigation, onChange: Lt(D.date), options: qr(we, De, r, a, !!t.reverseYears), style: m?.[p.Dropdown], value: a.getYear(D.date) }) : f.createElement("span", { key: "year" }, J(D.date, a));
1897
- return a.getMonthYearOrder() === "year-first" ? [_, M] : [M, _];
1898
- })(),
1899
- f.createElement("span", { role: "status", "aria-live": "polite", style: {
1900
- border: 0,
1901
- clip: "rect(0 0 0 0)",
1902
- height: "1px",
1903
- margin: "-1px",
1904
- overflow: "hidden",
1905
- padding: 0,
1906
- position: "absolute",
1907
- width: "1px",
1908
- whiteSpace: "nowrap",
1909
- wordWrap: "normal"
1910
- } }, S(D.date, a.options, a))
1911
- ) : f.createElement(n.CaptionLabel, { className: l[p.CaptionLabel], role: "status", "aria-live": "polite" }, S(D.date, a.options, a))),
1912
- c === "around" && !t.hideNavigation && E === h - 1 && f.createElement(
1913
- n.NextMonthButton,
1914
- { type: "button", className: l[p.NextMonthButton], tabIndex: $ ? void 0 : -1, "aria-disabled": $ ? void 0 : !0, "aria-label": Bt($), onClick: xe, "data-animated-button": t.animate ? "true" : void 0 },
1915
- f.createElement(n.Chevron, { disabled: $ ? void 0 : !0, className: l[p.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
1916
- ),
1917
- E === h - 1 && c === "after" && !t.hideNavigation && f.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: l[p.Nav], style: m?.[p.Nav], "aria-label": Ue(), onPreviousClick: Se, onNextClick: xe, previousMonth: H, nextMonth: $ }),
1918
- f.createElement(
1919
- n.MonthGrid,
1920
- { role: "grid", "aria-multiselectable": u === "multiple" || u === "range", "aria-label": At(D.date, a.options, a) || void 0, className: l[p.MonthGrid], style: m?.[p.MonthGrid] },
1921
- !t.hideWeekdays && f.createElement(
1922
- n.Weekdays,
1923
- { "data-animated-weekdays": t.animate ? "true" : void 0, className: l[p.Weekdays], style: m?.[p.Weekdays] },
1924
- v && f.createElement(n.WeekNumberHeader, { "aria-label": zt(a.options), className: l[p.WeekNumberHeader], style: m?.[p.WeekNumberHeader], scope: "col" }, U()),
1925
- qt.map((M) => f.createElement(n.Weekday, { "aria-label": Yt(M, a.options, a), className: l[p.Weekday], key: String(M), style: m?.[p.Weekday], scope: "col" }, ne(M, a.options, a)))
1926
- ),
1927
- f.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: l[p.Weeks], style: m?.[p.Weeks] }, D.weeks.map((M) => f.createElement(
1928
- n.Week,
1929
- { className: l[p.Week], key: M.weekNumber, style: m?.[p.Week], week: M },
1930
- v && f.createElement(n.WeekNumber, { week: M, style: m?.[p.WeekNumber], "aria-label": Rt(M.weekNumber, {
1931
- locale: s
1932
- }), className: l[p.WeekNumber], scope: "row", role: "rowheader" }, F(M.weekNumber, a)),
1933
- M.days.map((_) => {
1934
- const { date: G } = _, x = Oe(_);
1935
- if (x[A.focused] = !x.hidden && !!$e?.isEqualTo(_), x[Z.selected] = Ce?.(G) || x.selected, be(ye)) {
1936
- const { from: Ne, to: Pe } = ye;
1937
- x[Z.range_start] = !!(Ne && Pe && a.isSameDay(G, Ne)), x[Z.range_end] = !!(Ne && Pe && a.isSameDay(G, Pe)), x[Z.range_middle] = ee(ye, G, !0, a);
1938
- }
1939
- const tn = zr(x, m, t.modifiersStyles), nn = Sr(x, l, t.modifiersClassNames), on = !Ge && !x.hidden ? Tt(G, x, a.options, a) : void 0;
1940
- return f.createElement(n.Day, { key: `${_.isoDate}_${_.displayMonthId}`, day: _, modifiers: x, className: nn.join(" "), style: tn, role: "gridcell", "aria-selected": x.selected || void 0, "aria-label": on, "data-day": _.isoDate, "data-month": _.outside ? _.dateMonthId : void 0, "data-selected": x.selected || void 0, "data-disabled": x.disabled || void 0, "data-hidden": x.hidden || void 0, "data-outside": _.outside || void 0, "data-focused": x.focused || void 0, "data-today": x.today || void 0 }, !x.hidden && Ge ? f.createElement(n.DayButton, { className: l[p.DayButton], style: m?.[p.DayButton], type: "button", day: _, modifiers: x, disabled: !x.focused && x.disabled || void 0, "aria-disabled": x.focused && x.disabled || void 0, tabIndex: _t(_) ? 0 : -1, "aria-label": Et(G, x, a.options, a), onClick: Ht(_, x), onBlur: Zt(_, x), onFocus: $t(_, x), onKeyDown: Ut(_, x), onMouseEnter: Gt(_, x), onMouseLeave: Vt(_, x) }, T(G, a.options, a)) : !x.hidden && T(_.date, a.options, a));
1941
- })
1942
- )))
1943
- )
1944
- ))
1945
- ),
1946
- t.footer && f.createElement(n.Footer, { className: l[p.Footer], style: m?.[p.Footer], role: "status", "aria-live": "polite" }, t.footer)
1947
- )
1948
- );
1949
- }
1950
- function es({
1951
- className: e,
1952
- classNames: t,
1953
- showOutsideDays: o = !0,
1954
- captionLayout: n = "label",
1955
- buttonVariant: r = "ghost",
1956
- formatters: i,
1957
- components: a,
1958
- ...s
1959
- }) {
1960
- const l = je();
1961
- return /* @__PURE__ */ g(
1962
- Oa,
1963
- {
1964
- showOutsideDays: o,
1965
- className: b(
1966
- "bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
1967
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
1968
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
1969
- e
1970
- ),
1971
- captionLayout: n,
1972
- formatters: {
1973
- formatMonthDropdown: (d) => d.toLocaleString("default", { month: "short" }),
1974
- ...i
1975
- },
1976
- classNames: {
1977
- root: b("w-fit", l.root),
1978
- months: b(
1979
- "relative flex flex-col gap-4 md:flex-row",
1980
- l.months
1981
- ),
1982
- month: b("flex w-full flex-col gap-4", l.month),
1983
- nav: b(
1984
- "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
1985
- l.nav
1986
- ),
1987
- button_previous: b(
1988
- Ke({ variant: r }),
1989
- "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
1990
- l.button_previous
1991
- ),
1992
- button_next: b(
1993
- Ke({ variant: r }),
1994
- "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
1995
- l.button_next
1996
- ),
1997
- month_caption: b(
1998
- "flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
1999
- l.month_caption
2000
- ),
2001
- dropdowns: b(
2002
- "flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
2003
- l.dropdowns
2004
- ),
2005
- dropdown_root: b(
2006
- "has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
2007
- l.dropdown_root
2008
- ),
2009
- dropdown: b(
2010
- "bg-popover absolute inset-0 opacity-0",
2011
- l.dropdown
2012
- ),
2013
- caption_label: b(
2014
- "select-none font-medium",
2015
- n === "label" ? "text-sm" : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
2016
- l.caption_label
2017
- ),
2018
- table: "w-full border-collapse",
2019
- weekdays: b("flex", l.weekdays),
2020
- weekday: b(
2021
- "text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
2022
- l.weekday
2023
- ),
2024
- week: b("mt-2 flex w-full", l.week),
2025
- week_number_header: b(
2026
- "w-[--cell-size] select-none",
2027
- l.week_number_header
2028
- ),
2029
- week_number: b(
2030
- "text-muted-foreground select-none text-[0.8rem]",
2031
- l.week_number
2032
- ),
2033
- day: b(
2034
- "group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
2035
- l.day
2036
- ),
2037
- range_start: b(
2038
- "bg-accent rounded-l-md",
2039
- l.range_start
2040
- ),
2041
- range_middle: b("rounded-none", l.range_middle),
2042
- range_end: b("bg-accent rounded-r-md", l.range_end),
2043
- today: b(
2044
- "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
2045
- l.today
2046
- ),
2047
- outside: b(
2048
- "text-muted-foreground aria-selected:text-muted-foreground",
2049
- l.outside
2050
- ),
2051
- disabled: b(
2052
- "text-muted-foreground opacity-50",
2053
- l.disabled
2054
- ),
2055
- hidden: b("invisible", l.hidden),
2056
- ...t
2057
- },
2058
- components: {
2059
- Root: ({ className: d, rootRef: u, ...c }) => /* @__PURE__ */ g(
2060
- "div",
2061
- {
2062
- "data-slot": "calendar",
2063
- ref: u,
2064
- className: b(d),
2065
- ...c
2066
- }
2067
- ),
2068
- Chevron: ({ className: d, orientation: u, ...c }) => u === "left" ? /* @__PURE__ */ g(co, { className: b("size-4", d), ...c }) : u === "right" ? /* @__PURE__ */ g(
2069
- mn,
2070
- {
2071
- className: b("size-4", d),
2072
- ...c
2073
- }
2074
- ) : /* @__PURE__ */ g(pn, { className: b("size-4", d), ...c }),
2075
- DayButton: Ca,
2076
- WeekNumber: ({ children: d, ...u }) => /* @__PURE__ */ g("td", { ...u, children: /* @__PURE__ */ g("div", { className: "flex size-[--cell-size] items-center justify-center text-center", children: d }) }),
2077
- ...a
2078
- },
2079
- ...s
2080
- }
2081
- );
2082
- }
2083
- function Ca({
2084
- className: e,
2085
- day: t,
2086
- modifiers: o,
2087
- ...n
2088
- }) {
2089
- const r = je(), i = I.useRef(null);
2090
- return I.useEffect(() => {
2091
- o.focused && i.current?.focus();
2092
- }, [o.focused]), /* @__PURE__ */ g(
2093
- yn,
2094
- {
2095
- ref: i,
2096
- variant: "ghost",
2097
- size: "icon",
2098
- "data-day": t.date.toLocaleDateString(),
2099
- "data-selected-single": o.selected && !o.range_start && !o.range_end && !o.range_middle,
2100
- "data-range-start": o.range_start,
2101
- "data-range-end": o.range_end,
2102
- "data-range-middle": o.range_middle,
2103
- className: b(
2104
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
2105
- r.day,
2106
- e
2107
- ),
2108
- ...n
2109
- }
2110
- );
2111
- }
2112
- var ke = "Popover", [Mt] = bn(ke, [
2113
- ot
2114
- ]), me = ot(), [Wa, oe] = Mt(ke), kt = (e) => {
2115
- const {
2116
- __scopePopover: t,
2117
- children: o,
2118
- open: n,
2119
- defaultOpen: r,
2120
- onOpenChange: i,
2121
- modal: a = !1
2122
- } = e, s = me(t), l = I.useRef(null), [d, u] = I.useState(!1), [c, h] = gn({
2123
- prop: n,
2124
- defaultProp: r ?? !1,
2125
- onChange: i,
2126
- caller: ke
2127
- });
2128
- return /* @__PURE__ */ g(vn, { ...s, children: /* @__PURE__ */ g(
2129
- Wa,
2130
- {
2131
- scope: t,
2132
- contentId: Mn(),
2133
- triggerRef: l,
2134
- open: c,
2135
- onOpenChange: h,
2136
- onOpenToggle: I.useCallback(() => h((y) => !y), [h]),
2137
- hasCustomAnchor: d,
2138
- onCustomAnchorAdd: I.useCallback(() => u(!0), []),
2139
- onCustomAnchorRemove: I.useCallback(() => u(!1), []),
2140
- modal: a,
2141
- children: o
2142
- }
2143
- ) });
2144
- };
2145
- kt.displayName = ke;
2146
- var wt = "PopoverAnchor", Dt = I.forwardRef(
2147
- (e, t) => {
2148
- const { __scopePopover: o, ...n } = e, r = oe(wt, o), i = me(o), { onCustomAnchorAdd: a, onCustomAnchorRemove: s } = r;
2149
- return I.useEffect(() => (a(), () => s()), [a, s]), /* @__PURE__ */ g(st, { ...i, ...n, ref: t });
2150
- }
2151
- );
2152
- Dt.displayName = wt;
2153
- var Ot = "PopoverTrigger", Ct = I.forwardRef(
2154
- (e, t) => {
2155
- const { __scopePopover: o, ...n } = e, r = oe(Ot, o), i = me(o), a = rt(t, r.triggerRef), s = /* @__PURE__ */ g(
2156
- at.button,
2157
- {
2158
- type: "button",
2159
- "aria-haspopup": "dialog",
2160
- "aria-expanded": r.open,
2161
- "aria-controls": r.contentId,
2162
- "data-state": Pt(r.open),
2163
- ...n,
2164
- ref: a,
2165
- onClick: ue(e.onClick, r.onOpenToggle)
2166
- }
2167
- );
2168
- return r.hasCustomAnchor ? s : /* @__PURE__ */ g(st, { asChild: !0, ...i, children: s });
2169
- }
2170
- );
2171
- Ct.displayName = Ot;
2172
- var qe = "PopoverPortal", [Sa, xa] = Mt(qe, {
2173
- forceMount: void 0
2174
- }), Wt = (e) => {
2175
- const { __scopePopover: t, forceMount: o, children: n, container: r } = e, i = oe(qe, t);
2176
- return /* @__PURE__ */ g(Sa, { scope: t, forceMount: o, children: /* @__PURE__ */ g(it, { present: o || i.open, children: /* @__PURE__ */ g(kn, { asChild: !0, container: r, children: n }) }) });
2177
- };
2178
- Wt.displayName = qe;
2179
- var se = "PopoverContent", St = I.forwardRef(
2180
- (e, t) => {
2181
- const o = xa(se, e.__scopePopover), { forceMount: n = o.forceMount, ...r } = e, i = oe(se, e.__scopePopover);
2182
- return /* @__PURE__ */ g(it, { present: n || i.open, children: i.modal ? /* @__PURE__ */ g(Pa, { ...r, ref: t }) : /* @__PURE__ */ g(_a, { ...r, ref: t }) });
2183
- }
2184
- );
2185
- St.displayName = se;
2186
- var Na = On("PopoverContent.RemoveScroll"), Pa = I.forwardRef(
2187
- (e, t) => {
2188
- const o = oe(se, e.__scopePopover), n = I.useRef(null), r = rt(t, n), i = I.useRef(!1);
2189
- return I.useEffect(() => {
2190
- const a = n.current;
2191
- if (a) return wn(a);
2192
- }, []), /* @__PURE__ */ g(Dn, { as: Na, allowPinchZoom: !0, children: /* @__PURE__ */ g(
2193
- xt,
2194
- {
2195
- ...e,
2196
- ref: r,
2197
- trapFocus: o.open,
2198
- disableOutsidePointerEvents: !0,
2199
- onCloseAutoFocus: ue(e.onCloseAutoFocus, (a) => {
2200
- a.preventDefault(), i.current || o.triggerRef.current?.focus();
2201
- }),
2202
- onPointerDownOutside: ue(
2203
- e.onPointerDownOutside,
2204
- (a) => {
2205
- const s = a.detail.originalEvent, l = s.button === 0 && s.ctrlKey === !0, d = s.button === 2 || l;
2206
- i.current = d;
2207
- },
2208
- { checkForDefaultPrevented: !1 }
2209
- ),
2210
- onFocusOutside: ue(
2211
- e.onFocusOutside,
2212
- (a) => a.preventDefault(),
2213
- { checkForDefaultPrevented: !1 }
2214
- )
2215
- }
2216
- ) });
2217
- }
2218
- ), _a = I.forwardRef(
2219
- (e, t) => {
2220
- const o = oe(se, e.__scopePopover), n = I.useRef(!1), r = I.useRef(!1);
2221
- return /* @__PURE__ */ g(
2222
- xt,
2223
- {
2224
- ...e,
2225
- ref: t,
2226
- trapFocus: !1,
2227
- disableOutsidePointerEvents: !1,
2228
- onCloseAutoFocus: (i) => {
2229
- e.onCloseAutoFocus?.(i), i.defaultPrevented || (n.current || o.triggerRef.current?.focus(), i.preventDefault()), n.current = !1, r.current = !1;
2230
- },
2231
- onInteractOutside: (i) => {
2232
- e.onInteractOutside?.(i), i.defaultPrevented || (n.current = !0, i.detail.originalEvent.type === "pointerdown" && (r.current = !0));
2233
- const a = i.target;
2234
- o.triggerRef.current?.contains(a) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && r.current && i.preventDefault();
2235
- }
2236
- }
2237
- );
2238
- }
2239
- ), xt = I.forwardRef(
2240
- (e, t) => {
2241
- const {
2242
- __scopePopover: o,
2243
- trapFocus: n,
2244
- onOpenAutoFocus: r,
2245
- onCloseAutoFocus: i,
2246
- disableOutsidePointerEvents: a,
2247
- onEscapeKeyDown: s,
2248
- onPointerDownOutside: l,
2249
- onFocusOutside: d,
2250
- onInteractOutside: u,
2251
- ...c
2252
- } = e, h = oe(se, o), y = me(o);
2253
- return Cn(), /* @__PURE__ */ g(
2254
- Wn,
2255
- {
2256
- asChild: !0,
2257
- loop: !0,
2258
- trapped: n,
2259
- onMountAutoFocus: r,
2260
- onUnmountAutoFocus: i,
2261
- children: /* @__PURE__ */ g(
2262
- Sn,
2263
- {
2264
- asChild: !0,
2265
- disableOutsidePointerEvents: a,
2266
- onInteractOutside: u,
2267
- onEscapeKeyDown: s,
2268
- onPointerDownOutside: l,
2269
- onFocusOutside: d,
2270
- onDismiss: () => h.onOpenChange(!1),
2271
- children: /* @__PURE__ */ g(
2272
- xn,
2273
- {
2274
- "data-state": Pt(h.open),
2275
- role: "dialog",
2276
- id: h.contentId,
2277
- ...y,
2278
- ...c,
2279
- ref: t,
2280
- style: {
2281
- ...c.style,
2282
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
2283
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
2284
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
2285
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
2286
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
2287
- }
2288
- }
2289
- )
2290
- }
2291
- )
2292
- }
2293
- );
2294
- }
2295
- ), Nt = "PopoverClose", Ea = I.forwardRef(
2296
- (e, t) => {
2297
- const { __scopePopover: o, ...n } = e, r = oe(Nt, o);
2298
- return /* @__PURE__ */ g(
2299
- at.button,
2300
- {
2301
- type: "button",
2302
- ...n,
2303
- ref: t,
2304
- onClick: ue(e.onClick, () => r.onOpenChange(!1))
2305
- }
2306
- );
2307
- }
2308
- );
2309
- Ea.displayName = Nt;
2310
- var Ta = "PopoverArrow", Aa = I.forwardRef(
2311
- (e, t) => {
2312
- const { __scopePopover: o, ...n } = e, r = me(o);
2313
- return /* @__PURE__ */ g(Nn, { ...r, ...n, ref: t });
2314
- }
2315
- );
2316
- Aa.displayName = Ta;
2317
- function Pt(e) {
2318
- return e ? "open" : "closed";
2319
- }
2320
- var Fa = kt, Ia = Dt, Ba = Ct, Ya = Wt, Ra = St;
2321
- function ts({
2322
- ...e
2323
- }) {
2324
- return /* @__PURE__ */ g(Fa, { "data-slot": "popover", ...e });
2325
- }
2326
- function ns({
2327
- ...e
2328
- }) {
2329
- return /* @__PURE__ */ g(Ba, { "data-slot": "popover-trigger", ...e });
2330
- }
2331
- function os({
2332
- className: e,
2333
- align: t = "center",
2334
- sideOffset: o = 4,
2335
- ...n
2336
- }) {
2337
- return /* @__PURE__ */ g(Ya, { children: /* @__PURE__ */ g(
2338
- Ra,
2339
- {
2340
- "data-slot": "popover-content",
2341
- align: t,
2342
- sideOffset: o,
2343
- className: b(
2344
- "z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
2345
- e
2346
- ),
2347
- ...n
2348
- }
2349
- ) });
2350
- }
2351
- function rs({
2352
- ...e
2353
- }) {
2354
- return /* @__PURE__ */ g(Ia, { "data-slot": "popover-anchor", ...e });
2355
- }
2356
- function as({ className: e, ...t }) {
2357
- return /* @__PURE__ */ g(
2358
- "div",
2359
- {
2360
- "data-slot": "popover-header",
2361
- className: b("flex flex-col gap-1 text-sm", e),
2362
- ...t
2363
- }
2364
- );
2365
- }
2366
- function ss({ className: e, ...t }) {
2367
- return /* @__PURE__ */ g(
2368
- "div",
2369
- {
2370
- "data-slot": "popover-title",
2371
- className: b("font-medium", e),
2372
- ...t
2373
- }
2374
- );
2375
- }
2376
- function is({
2377
- className: e,
2378
- ...t
2379
- }) {
2380
- return /* @__PURE__ */ g(
2381
- "p",
2382
- {
2383
- "data-slot": "popover-description",
2384
- className: b("text-muted-foreground", e),
2385
- ...t
2386
- }
2387
- );
2388
- }
2389
- export {
2390
- es as C,
2391
- Ga as F,
2392
- ts as P,
2393
- Ka as a,
2394
- Ja as b,
2395
- Qa as c,
2396
- Ua as d,
2397
- Za as e,
2398
- Xa as f,
2399
- $a as g,
2400
- Va as h,
2401
- La as i,
2402
- Ca as j,
2403
- ns as k,
2404
- os as l,
2405
- rs as m,
2406
- as as n,
2407
- ss as o,
2408
- is as p,
2409
- _e as q,
2410
- ie as r,
2411
- le as s,
2412
- Ao as t
2413
- };