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