@kaanolin/react 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Badge-BdwYClmA.js +46 -0
- package/dist/Badge-D-fw1KUp.cjs +1 -0
- package/dist/Button-DeGRO_vB.cjs +1 -0
- package/dist/Button-DqS-IYl4.js +412 -0
- package/dist/Card-D4IOT1yc.js +218 -0
- package/dist/Card-JKuBVmXq.cjs +1 -0
- package/dist/DatePickerRange-BPYe2jNs.cjs +1 -0
- package/dist/DatePickerRange-DVctX_Qb.js +5029 -0
- package/dist/Input-BpWJLED2.js +223 -0
- package/dist/Input-CstnV1U8.cjs +1 -0
- package/dist/InputGroup-SVC5Ep6J.js +97 -0
- package/dist/InputGroup-whgNDsHd.cjs +1 -0
- package/dist/Modal-DAyvQW7Z.js +260 -0
- package/dist/Modal-DQLhEOJ2.cjs +1 -0
- package/dist/Select-1U2YyMRi.cjs +1 -0
- package/dist/Select-C2A4HgEF.js +551 -0
- package/dist/Textarea-BHhXafu9.js +117 -0
- package/dist/Textarea-Ceix8Thf.cjs +1 -0
- package/dist/_shared/form-field.styles.d.ts +7 -0
- package/dist/_shared/form-field.styles.d.ts.map +1 -0
- package/dist/_shared/icons.d.ts +2 -0
- package/dist/_shared/icons.d.ts.map +1 -0
- package/dist/_shared/index.d.ts +3 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/badge/Badge.d.ts +8 -0
- package/dist/badge/Badge.d.ts.map +1 -0
- package/dist/badge/Badge.styles.d.ts +5 -0
- package/dist/badge/Badge.styles.d.ts.map +1 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +5 -0
- package/dist/button/Button.d.ts +22 -0
- package/dist/button/Button.d.ts.map +1 -0
- package/dist/button/Button.styles.d.ts +21 -0
- package/dist/button/Button.styles.d.ts.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +10 -0
- package/dist/card/Card.d.ts +26 -0
- package/dist/card/Card.d.ts.map +1 -0
- package/dist/card/Card.styles.d.ts +28 -0
- package/dist/card/Card.styles.d.ts.map +1 -0
- package/dist/card/index.d.ts +3 -0
- package/dist/card/index.d.ts.map +1 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +20 -0
- package/dist/cx-C5SviAs-.cjs +1 -0
- package/dist/cx-CMoRfr5S.js +2304 -0
- package/dist/date-picker-range/DatePickerRange.d.ts +36 -0
- package/dist/date-picker-range/DatePickerRange.d.ts.map +1 -0
- package/dist/date-picker-range/DatePickerRange.styles.d.ts +16 -0
- package/dist/date-picker-range/DatePickerRange.styles.d.ts.map +1 -0
- package/dist/date-picker-range/index.d.ts +3 -0
- package/dist/date-picker-range/index.d.ts.map +1 -0
- package/dist/date-picker-range.cjs +1 -0
- package/dist/date-picker-range.js +11 -0
- package/dist/form-field.styles-BHdf4QA5.cjs +1 -0
- package/dist/form-field.styles-Bt9srSak.js +32 -0
- package/dist/icons-BFvETcdo.js +22 -0
- package/dist/icons-jGx5qsVM.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/input/Input.d.ts +22 -0
- package/dist/input/Input.d.ts.map +1 -0
- package/dist/input/Input.styles.d.ts +18 -0
- package/dist/input/Input.styles.d.ts.map +1 -0
- package/dist/input/index.d.ts +6 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input-group/InputGroup.d.ts +36 -0
- package/dist/input-group/InputGroup.d.ts.map +1 -0
- package/dist/input-group/InputGroup.styles.d.ts +7 -0
- package/dist/input-group/InputGroup.styles.d.ts.map +1 -0
- package/dist/input-group/index.d.ts +3 -0
- package/dist/input-group/index.d.ts.map +1 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +7 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +23 -0
- package/dist/modal/Modal.d.ts +37 -0
- package/dist/modal/Modal.d.ts.map +1 -0
- package/dist/modal/Modal.styles.d.ts +16 -0
- package/dist/modal/Modal.styles.d.ts.map +1 -0
- package/dist/modal/index.d.ts +3 -0
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +21 -0
- package/dist/select/Select.d.ts +51 -0
- package/dist/select/Select.d.ts.map +1 -0
- package/dist/select/Select.styles.d.ts +20 -0
- package/dist/select/Select.styles.d.ts.map +1 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.d.ts.map +1 -0
- package/dist/select.cjs +1 -0
- package/dist/select.js +14 -0
- package/dist/styles/colors.css +391 -0
- package/dist/styles/index.css +487 -0
- package/dist/styles/shadows.css +32 -0
- package/dist/styles/spacing.css +20 -0
- package/dist/styles/typography.css +44 -0
- package/dist/textarea/Textarea.d.ts +18 -0
- package/dist/textarea/Textarea.d.ts.map +1 -0
- package/dist/textarea/Textarea.styles.d.ts +6 -0
- package/dist/textarea/Textarea.styles.d.ts.map +1 -0
- package/dist/textarea/index.d.ts +3 -0
- package/dist/textarea/index.d.ts.map +1 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +5 -0
- package/package.json +162 -0
|
@@ -0,0 +1,5029 @@
|
|
|
1
|
+
var Zn = Object.defineProperty;
|
|
2
|
+
var Jn = (t, n, e) => n in t ? Zn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var g = (t, n, e) => Jn(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { jsxs as De, jsx as X, Fragment as Ln } from "react/jsx-runtime";
|
|
5
|
+
import * as ue from "react";
|
|
6
|
+
import w, { createContext as er, useContext as tr, useCallback as ae, useRef as Qe, useLayoutEffect as nr, useState as ut, useEffect as rr, useMemo as $e } from "react";
|
|
7
|
+
import { c as Z } from "./cx-CMoRfr5S.js";
|
|
8
|
+
import { cva as We } from "class-variance-authority";
|
|
9
|
+
function ar(t, n, e = "long") {
|
|
10
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
11
|
+
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
12
|
+
hour: "numeric",
|
|
13
|
+
timeZone: t,
|
|
14
|
+
timeZoneName: e
|
|
15
|
+
}).format(n).split(/\s/g).slice(2).join(" ");
|
|
16
|
+
}
|
|
17
|
+
const rt = {}, Be = {};
|
|
18
|
+
function Oe(t, n) {
|
|
19
|
+
try {
|
|
20
|
+
const r = (rt[t] || (rt[t] = new Intl.DateTimeFormat("en-US", {
|
|
21
|
+
timeZone: t,
|
|
22
|
+
timeZoneName: "longOffset"
|
|
23
|
+
}).format))(n).split("GMT")[1];
|
|
24
|
+
return r in Be ? Be[r] : Yt(r, r.split(":"));
|
|
25
|
+
} catch {
|
|
26
|
+
if (t in Be) return Be[t];
|
|
27
|
+
const e = t == null ? void 0 : t.match(sr);
|
|
28
|
+
return e ? Yt(t, e.slice(1)) : NaN;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const sr = /([+-]\d\d):?(\d\d)?/;
|
|
32
|
+
function Yt(t, n) {
|
|
33
|
+
const e = +(n[0] || 0), r = +(n[1] || 0), a = +(n[2] || 0) / 60;
|
|
34
|
+
return Be[t] = e * 60 + r > 0 ? e * 60 + r + a : e * 60 - r - a;
|
|
35
|
+
}
|
|
36
|
+
class he extends Date {
|
|
37
|
+
//#region static
|
|
38
|
+
constructor(...n) {
|
|
39
|
+
super(), n.length > 1 && typeof n[n.length - 1] == "string" && (this.timeZone = n.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(Oe(this.timeZone, this)) ? this.setTime(NaN) : n.length ? typeof n[0] == "number" && (n.length === 1 || n.length === 2 && typeof n[1] != "number") ? this.setTime(n[0]) : typeof n[0] == "string" ? this.setTime(+new Date(n[0])) : n[0] instanceof Date ? this.setTime(+n[0]) : (this.setTime(+new Date(...n)), Gt(this), lt(this)) : this.setTime(Date.now());
|
|
40
|
+
}
|
|
41
|
+
static tz(n, ...e) {
|
|
42
|
+
return e.length ? new he(...e, n) : new he(Date.now(), n);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region time zone
|
|
46
|
+
withTimeZone(n) {
|
|
47
|
+
return new he(+this, n);
|
|
48
|
+
}
|
|
49
|
+
getTimezoneOffset() {
|
|
50
|
+
const n = -Oe(this.timeZone, this);
|
|
51
|
+
return n > 0 ? Math.floor(n) : Math.ceil(n);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region time
|
|
55
|
+
setTime(n) {
|
|
56
|
+
return Date.prototype.setTime.apply(this, arguments), lt(this), +this;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region date-fns integration
|
|
60
|
+
[Symbol.for("constructDateFrom")](n) {
|
|
61
|
+
return new he(+new Date(n), this.timeZone);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
}
|
|
65
|
+
const Pt = /^(get|set)(?!UTC)/;
|
|
66
|
+
Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
|
|
67
|
+
if (!Pt.test(t)) return;
|
|
68
|
+
const n = t.replace(Pt, "$1UTC");
|
|
69
|
+
he.prototype[n] && (t.startsWith("get") ? he.prototype[t] = function() {
|
|
70
|
+
return this.internal[n]();
|
|
71
|
+
} : (he.prototype[t] = function() {
|
|
72
|
+
return Date.prototype[n].apply(this.internal, arguments), or(this), +this;
|
|
73
|
+
}, he.prototype[n] = function() {
|
|
74
|
+
return Date.prototype[n].apply(this, arguments), lt(this), +this;
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
function lt(t) {
|
|
78
|
+
t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() - Math.round(-Oe(t.timeZone, t) * 60));
|
|
79
|
+
}
|
|
80
|
+
function or(t) {
|
|
81
|
+
Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), Gt(t);
|
|
82
|
+
}
|
|
83
|
+
function Gt(t) {
|
|
84
|
+
const n = Oe(t.timeZone, t), e = n > 0 ? Math.floor(n) : Math.ceil(n), r = /* @__PURE__ */ new Date(+t);
|
|
85
|
+
r.setUTCHours(r.getUTCHours() - 1);
|
|
86
|
+
const a = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), o = a - s, i = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours();
|
|
87
|
+
o && i && t.internal.setUTCMinutes(t.internal.getUTCMinutes() + o);
|
|
88
|
+
const c = a - e;
|
|
89
|
+
c && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + c);
|
|
90
|
+
const u = /* @__PURE__ */ new Date(+t);
|
|
91
|
+
u.setUTCSeconds(0);
|
|
92
|
+
const l = a > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, f = Math.round(-(Oe(t.timeZone, t) * 60)) % 60;
|
|
93
|
+
(f || l) && (t.internal.setUTCSeconds(t.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(t, Date.prototype.getUTCSeconds.call(t) + f + l));
|
|
94
|
+
const h = Oe(t.timeZone, t), b = h > 0 ? Math.floor(h) : Math.ceil(h), p = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - b, O = b !== e, k = p - c;
|
|
95
|
+
if (O && k) {
|
|
96
|
+
Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + k);
|
|
97
|
+
const D = Oe(t.timeZone, t), M = D > 0 ? Math.floor(D) : Math.ceil(D), y = b - M;
|
|
98
|
+
y && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + y), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + y));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
class V extends he {
|
|
102
|
+
//#region static
|
|
103
|
+
static tz(n, ...e) {
|
|
104
|
+
return e.length ? new V(...e, n) : new V(Date.now(), n);
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region representation
|
|
108
|
+
toISOString() {
|
|
109
|
+
const [n, e, r] = this.tzComponents(), a = `${n}${e}:${r}`;
|
|
110
|
+
return this.internal.toISOString().slice(0, -1) + a;
|
|
111
|
+
}
|
|
112
|
+
toString() {
|
|
113
|
+
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
114
|
+
}
|
|
115
|
+
toDateString() {
|
|
116
|
+
const [n, e, r, a] = this.internal.toUTCString().split(" ");
|
|
117
|
+
return `${n == null ? void 0 : n.slice(0, -1)} ${r} ${e} ${a}`;
|
|
118
|
+
}
|
|
119
|
+
toTimeString() {
|
|
120
|
+
const n = this.internal.toUTCString().split(" ")[4], [e, r, a] = this.tzComponents();
|
|
121
|
+
return `${n} GMT${e}${r}${a} (${ar(this.timeZone, this)})`;
|
|
122
|
+
}
|
|
123
|
+
toLocaleString(n, e) {
|
|
124
|
+
return Date.prototype.toLocaleString.call(this, n, {
|
|
125
|
+
...e,
|
|
126
|
+
timeZone: (e == null ? void 0 : e.timeZone) || this.timeZone
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
toLocaleDateString(n, e) {
|
|
130
|
+
return Date.prototype.toLocaleDateString.call(this, n, {
|
|
131
|
+
...e,
|
|
132
|
+
timeZone: (e == null ? void 0 : e.timeZone) || this.timeZone
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
toLocaleTimeString(n, e) {
|
|
136
|
+
return Date.prototype.toLocaleTimeString.call(this, n, {
|
|
137
|
+
...e,
|
|
138
|
+
timeZone: (e == null ? void 0 : e.timeZone) || this.timeZone
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region private
|
|
143
|
+
tzComponents() {
|
|
144
|
+
const n = this.getTimezoneOffset(), e = n > 0 ? "-" : "+", r = String(Math.floor(Math.abs(n) / 60)).padStart(2, "0"), a = String(Math.abs(n) % 60).padStart(2, "0");
|
|
145
|
+
return [e, r, a];
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
withTimeZone(n) {
|
|
149
|
+
return new V(+this, n);
|
|
150
|
+
}
|
|
151
|
+
//#region date-fns integration
|
|
152
|
+
[Symbol.for("constructDateFrom")](n) {
|
|
153
|
+
return new V(+new Date(n), this.timeZone);
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
}
|
|
157
|
+
const Qt = 6048e5, ir = 864e5, cr = 6e4, ur = 36e5, lr = 1e3, Ct = Symbol.for("constructDateFrom");
|
|
158
|
+
function B(t, n) {
|
|
159
|
+
return typeof t == "function" ? t(n) : t && typeof t == "object" && Ct in t ? t[Ct](n) : t instanceof Date ? new t.constructor(n) : new Date(n);
|
|
160
|
+
}
|
|
161
|
+
function Y(t, n) {
|
|
162
|
+
return B(n || t, t);
|
|
163
|
+
}
|
|
164
|
+
function Ve(t, n, e) {
|
|
165
|
+
const r = Y(t, e == null ? void 0 : e.in);
|
|
166
|
+
return isNaN(n) ? B((e == null ? void 0 : e.in) || t, NaN) : (n && r.setDate(r.getDate() + n), r);
|
|
167
|
+
}
|
|
168
|
+
function $t(t, n, e) {
|
|
169
|
+
const r = Y(t, e == null ? void 0 : e.in);
|
|
170
|
+
if (isNaN(n)) return B(t, NaN);
|
|
171
|
+
if (!n)
|
|
172
|
+
return r;
|
|
173
|
+
const a = r.getDate(), s = B(t, r.getTime());
|
|
174
|
+
s.setMonth(r.getMonth() + n + 1, 0);
|
|
175
|
+
const o = s.getDate();
|
|
176
|
+
return a >= o ? s : (r.setFullYear(
|
|
177
|
+
s.getFullYear(),
|
|
178
|
+
s.getMonth(),
|
|
179
|
+
a
|
|
180
|
+
), r);
|
|
181
|
+
}
|
|
182
|
+
let dr = {};
|
|
183
|
+
function Te() {
|
|
184
|
+
return dr;
|
|
185
|
+
}
|
|
186
|
+
function ge(t, n) {
|
|
187
|
+
var i, c, u, l;
|
|
188
|
+
const e = Te(), r = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (i = n == null ? void 0 : n.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((l = (u = e.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, n == null ? void 0 : n.in), s = a.getDay(), o = (s < r ? 7 : 0) + s - r;
|
|
189
|
+
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
190
|
+
}
|
|
191
|
+
function pe(t, n) {
|
|
192
|
+
return ge(t, { ...n, weekStartsOn: 1 });
|
|
193
|
+
}
|
|
194
|
+
function zt(t, n) {
|
|
195
|
+
const e = Y(t, n == null ? void 0 : n.in), r = e.getFullYear(), a = B(e, 0);
|
|
196
|
+
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
197
|
+
const s = pe(a), o = B(e, 0);
|
|
198
|
+
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
199
|
+
const i = pe(o);
|
|
200
|
+
return e.getTime() >= s.getTime() ? r + 1 : e.getTime() >= i.getTime() ? r : r - 1;
|
|
201
|
+
}
|
|
202
|
+
function ze(t) {
|
|
203
|
+
const n = Y(t), e = new Date(
|
|
204
|
+
Date.UTC(
|
|
205
|
+
n.getFullYear(),
|
|
206
|
+
n.getMonth(),
|
|
207
|
+
n.getDate(),
|
|
208
|
+
n.getHours(),
|
|
209
|
+
n.getMinutes(),
|
|
210
|
+
n.getSeconds(),
|
|
211
|
+
n.getMilliseconds()
|
|
212
|
+
)
|
|
213
|
+
);
|
|
214
|
+
return e.setUTCFullYear(n.getFullYear()), +t - +e;
|
|
215
|
+
}
|
|
216
|
+
function _e(t, ...n) {
|
|
217
|
+
const e = B.bind(
|
|
218
|
+
null,
|
|
219
|
+
n.find((r) => typeof r == "object")
|
|
220
|
+
);
|
|
221
|
+
return n.map(e);
|
|
222
|
+
}
|
|
223
|
+
function He(t, n) {
|
|
224
|
+
const e = Y(t, n == null ? void 0 : n.in);
|
|
225
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
226
|
+
}
|
|
227
|
+
function mt(t, n, e) {
|
|
228
|
+
const [r, a] = _e(
|
|
229
|
+
e == null ? void 0 : e.in,
|
|
230
|
+
t,
|
|
231
|
+
n
|
|
232
|
+
), s = He(r), o = He(a), i = +s - ze(s), c = +o - ze(o);
|
|
233
|
+
return Math.round((i - c) / ir);
|
|
234
|
+
}
|
|
235
|
+
function fr(t, n) {
|
|
236
|
+
const e = zt(t, n), r = B(t, 0);
|
|
237
|
+
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), pe(r);
|
|
238
|
+
}
|
|
239
|
+
function hr(t, n, e) {
|
|
240
|
+
return Ve(t, n * 7, e);
|
|
241
|
+
}
|
|
242
|
+
function mr(t, n, e) {
|
|
243
|
+
return $t(t, n * 12, e);
|
|
244
|
+
}
|
|
245
|
+
function yr(t, n) {
|
|
246
|
+
let e, r = n == null ? void 0 : n.in;
|
|
247
|
+
return t.forEach((a) => {
|
|
248
|
+
!r && typeof a == "object" && (r = B.bind(null, a));
|
|
249
|
+
const s = Y(a, r);
|
|
250
|
+
(!e || e < s || isNaN(+s)) && (e = s);
|
|
251
|
+
}), B(r, e || NaN);
|
|
252
|
+
}
|
|
253
|
+
function wr(t, n) {
|
|
254
|
+
let e, r = n == null ? void 0 : n.in;
|
|
255
|
+
return t.forEach((a) => {
|
|
256
|
+
!r && typeof a == "object" && (r = B.bind(null, a));
|
|
257
|
+
const s = Y(a, r);
|
|
258
|
+
(!e || e > s || isNaN(+s)) && (e = s);
|
|
259
|
+
}), B(r, e || NaN);
|
|
260
|
+
}
|
|
261
|
+
function br(t, n, e) {
|
|
262
|
+
const [r, a] = _e(
|
|
263
|
+
e == null ? void 0 : e.in,
|
|
264
|
+
t,
|
|
265
|
+
n
|
|
266
|
+
);
|
|
267
|
+
return +He(r) == +He(a);
|
|
268
|
+
}
|
|
269
|
+
function Xt(t) {
|
|
270
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
271
|
+
}
|
|
272
|
+
function dt(t) {
|
|
273
|
+
return !(!Xt(t) && typeof t != "number" || isNaN(+Y(t)));
|
|
274
|
+
}
|
|
275
|
+
function Vt(t, n, e) {
|
|
276
|
+
const [r, a] = _e(
|
|
277
|
+
e == null ? void 0 : e.in,
|
|
278
|
+
t,
|
|
279
|
+
n
|
|
280
|
+
), s = r.getFullYear() - a.getFullYear(), o = r.getMonth() - a.getMonth();
|
|
281
|
+
return s * 12 + o;
|
|
282
|
+
}
|
|
283
|
+
function gr(t, n) {
|
|
284
|
+
const e = Y(t, n == null ? void 0 : n.in), r = e.getMonth();
|
|
285
|
+
return e.setFullYear(e.getFullYear(), r + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
286
|
+
}
|
|
287
|
+
function Ut(t, n) {
|
|
288
|
+
const [e, r] = _e(t, n.start, n.end);
|
|
289
|
+
return { start: e, end: r };
|
|
290
|
+
}
|
|
291
|
+
function kr(t, n) {
|
|
292
|
+
const { start: e, end: r } = Ut(n == null ? void 0 : n.in, t);
|
|
293
|
+
let a = +e > +r;
|
|
294
|
+
const s = a ? +e : +r, o = a ? r : e;
|
|
295
|
+
o.setHours(0, 0, 0, 0), o.setDate(1);
|
|
296
|
+
let i = 1;
|
|
297
|
+
const c = [];
|
|
298
|
+
for (; +o <= s; )
|
|
299
|
+
c.push(B(e, o)), o.setMonth(o.getMonth() + i);
|
|
300
|
+
return a ? c.reverse() : c;
|
|
301
|
+
}
|
|
302
|
+
function Mr(t, n) {
|
|
303
|
+
const e = Y(t, n == null ? void 0 : n.in);
|
|
304
|
+
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
305
|
+
}
|
|
306
|
+
function Dr(t, n) {
|
|
307
|
+
const e = Y(t, n == null ? void 0 : n.in), r = e.getFullYear();
|
|
308
|
+
return e.setFullYear(r + 1, 0, 0), e.setHours(23, 59, 59, 999), e;
|
|
309
|
+
}
|
|
310
|
+
function Kt(t, n) {
|
|
311
|
+
const e = Y(t, n == null ? void 0 : n.in);
|
|
312
|
+
return e.setFullYear(e.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
313
|
+
}
|
|
314
|
+
function xr(t, n) {
|
|
315
|
+
const { start: e, end: r } = Ut(n == null ? void 0 : n.in, t);
|
|
316
|
+
let a = +e > +r;
|
|
317
|
+
const s = a ? +e : +r, o = a ? r : e;
|
|
318
|
+
o.setHours(0, 0, 0, 0), o.setMonth(0, 1);
|
|
319
|
+
let i = 1;
|
|
320
|
+
const c = [];
|
|
321
|
+
for (; +o <= s; )
|
|
322
|
+
c.push(B(e, o)), o.setFullYear(o.getFullYear() + i);
|
|
323
|
+
return a ? c.reverse() : c;
|
|
324
|
+
}
|
|
325
|
+
function Zt(t, n) {
|
|
326
|
+
var i, c, u, l;
|
|
327
|
+
const e = Te(), r = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (i = n == null ? void 0 : n.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((l = (u = e.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, n == null ? void 0 : n.in), s = a.getDay(), o = (s < r ? -7 : 0) + 6 - (s - r);
|
|
328
|
+
return a.setDate(a.getDate() + o), a.setHours(23, 59, 59, 999), a;
|
|
329
|
+
}
|
|
330
|
+
function vr(t, n) {
|
|
331
|
+
return Zt(t, { ...n, weekStartsOn: 1 });
|
|
332
|
+
}
|
|
333
|
+
const Or = {
|
|
334
|
+
lessThanXSeconds: {
|
|
335
|
+
one: "less than a second",
|
|
336
|
+
other: "less than {{count}} seconds"
|
|
337
|
+
},
|
|
338
|
+
xSeconds: {
|
|
339
|
+
one: "1 second",
|
|
340
|
+
other: "{{count}} seconds"
|
|
341
|
+
},
|
|
342
|
+
halfAMinute: "half a minute",
|
|
343
|
+
lessThanXMinutes: {
|
|
344
|
+
one: "less than a minute",
|
|
345
|
+
other: "less than {{count}} minutes"
|
|
346
|
+
},
|
|
347
|
+
xMinutes: {
|
|
348
|
+
one: "1 minute",
|
|
349
|
+
other: "{{count}} minutes"
|
|
350
|
+
},
|
|
351
|
+
aboutXHours: {
|
|
352
|
+
one: "about 1 hour",
|
|
353
|
+
other: "about {{count}} hours"
|
|
354
|
+
},
|
|
355
|
+
xHours: {
|
|
356
|
+
one: "1 hour",
|
|
357
|
+
other: "{{count}} hours"
|
|
358
|
+
},
|
|
359
|
+
xDays: {
|
|
360
|
+
one: "1 day",
|
|
361
|
+
other: "{{count}} days"
|
|
362
|
+
},
|
|
363
|
+
aboutXWeeks: {
|
|
364
|
+
one: "about 1 week",
|
|
365
|
+
other: "about {{count}} weeks"
|
|
366
|
+
},
|
|
367
|
+
xWeeks: {
|
|
368
|
+
one: "1 week",
|
|
369
|
+
other: "{{count}} weeks"
|
|
370
|
+
},
|
|
371
|
+
aboutXMonths: {
|
|
372
|
+
one: "about 1 month",
|
|
373
|
+
other: "about {{count}} months"
|
|
374
|
+
},
|
|
375
|
+
xMonths: {
|
|
376
|
+
one: "1 month",
|
|
377
|
+
other: "{{count}} months"
|
|
378
|
+
},
|
|
379
|
+
aboutXYears: {
|
|
380
|
+
one: "about 1 year",
|
|
381
|
+
other: "about {{count}} years"
|
|
382
|
+
},
|
|
383
|
+
xYears: {
|
|
384
|
+
one: "1 year",
|
|
385
|
+
other: "{{count}} years"
|
|
386
|
+
},
|
|
387
|
+
overXYears: {
|
|
388
|
+
one: "over 1 year",
|
|
389
|
+
other: "over {{count}} years"
|
|
390
|
+
},
|
|
391
|
+
almostXYears: {
|
|
392
|
+
one: "almost 1 year",
|
|
393
|
+
other: "almost {{count}} years"
|
|
394
|
+
}
|
|
395
|
+
}, pr = (t, n, e) => {
|
|
396
|
+
let r;
|
|
397
|
+
const a = Or[t];
|
|
398
|
+
return typeof a == "string" ? r = a : n === 1 ? r = a.one : r = a.other.replace("{{count}}", n.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
399
|
+
};
|
|
400
|
+
function at(t) {
|
|
401
|
+
return (n = {}) => {
|
|
402
|
+
const e = n.width ? String(n.width) : t.defaultWidth;
|
|
403
|
+
return t.formats[e] || t.formats[t.defaultWidth];
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
const Wr = {
|
|
407
|
+
full: "EEEE, MMMM do, y",
|
|
408
|
+
long: "MMMM do, y",
|
|
409
|
+
medium: "MMM d, y",
|
|
410
|
+
short: "MM/dd/yyyy"
|
|
411
|
+
}, Tr = {
|
|
412
|
+
full: "h:mm:ss a zzzz",
|
|
413
|
+
long: "h:mm:ss a z",
|
|
414
|
+
medium: "h:mm:ss a",
|
|
415
|
+
short: "h:mm a"
|
|
416
|
+
}, Nr = {
|
|
417
|
+
full: "{{date}} 'at' {{time}}",
|
|
418
|
+
long: "{{date}} 'at' {{time}}",
|
|
419
|
+
medium: "{{date}}, {{time}}",
|
|
420
|
+
short: "{{date}}, {{time}}"
|
|
421
|
+
}, Yr = {
|
|
422
|
+
date: at({
|
|
423
|
+
formats: Wr,
|
|
424
|
+
defaultWidth: "full"
|
|
425
|
+
}),
|
|
426
|
+
time: at({
|
|
427
|
+
formats: Tr,
|
|
428
|
+
defaultWidth: "full"
|
|
429
|
+
}),
|
|
430
|
+
dateTime: at({
|
|
431
|
+
formats: Nr,
|
|
432
|
+
defaultWidth: "full"
|
|
433
|
+
})
|
|
434
|
+
}, Pr = {
|
|
435
|
+
lastWeek: "'last' eeee 'at' p",
|
|
436
|
+
yesterday: "'yesterday at' p",
|
|
437
|
+
today: "'today at' p",
|
|
438
|
+
tomorrow: "'tomorrow at' p",
|
|
439
|
+
nextWeek: "eeee 'at' p",
|
|
440
|
+
other: "P"
|
|
441
|
+
}, Cr = (t, n, e, r) => Pr[t];
|
|
442
|
+
function Ie(t) {
|
|
443
|
+
return (n, e) => {
|
|
444
|
+
const r = e != null && e.context ? String(e.context) : "standalone";
|
|
445
|
+
let a;
|
|
446
|
+
if (r === "formatting" && t.formattingValues) {
|
|
447
|
+
const o = t.defaultFormattingWidth || t.defaultWidth, i = e != null && e.width ? String(e.width) : o;
|
|
448
|
+
a = t.formattingValues[i] || t.formattingValues[o];
|
|
449
|
+
} else {
|
|
450
|
+
const o = t.defaultWidth, i = e != null && e.width ? String(e.width) : t.defaultWidth;
|
|
451
|
+
a = t.values[i] || t.values[o];
|
|
452
|
+
}
|
|
453
|
+
const s = t.argumentCallback ? t.argumentCallback(n) : n;
|
|
454
|
+
return a[s];
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
const _r = {
|
|
458
|
+
narrow: ["B", "A"],
|
|
459
|
+
abbreviated: ["BC", "AD"],
|
|
460
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
461
|
+
}, Er = {
|
|
462
|
+
narrow: ["1", "2", "3", "4"],
|
|
463
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
464
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
465
|
+
}, Sr = {
|
|
466
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
467
|
+
abbreviated: [
|
|
468
|
+
"Jan",
|
|
469
|
+
"Feb",
|
|
470
|
+
"Mar",
|
|
471
|
+
"Apr",
|
|
472
|
+
"May",
|
|
473
|
+
"Jun",
|
|
474
|
+
"Jul",
|
|
475
|
+
"Aug",
|
|
476
|
+
"Sep",
|
|
477
|
+
"Oct",
|
|
478
|
+
"Nov",
|
|
479
|
+
"Dec"
|
|
480
|
+
],
|
|
481
|
+
wide: [
|
|
482
|
+
"January",
|
|
483
|
+
"February",
|
|
484
|
+
"March",
|
|
485
|
+
"April",
|
|
486
|
+
"May",
|
|
487
|
+
"June",
|
|
488
|
+
"July",
|
|
489
|
+
"August",
|
|
490
|
+
"September",
|
|
491
|
+
"October",
|
|
492
|
+
"November",
|
|
493
|
+
"December"
|
|
494
|
+
]
|
|
495
|
+
}, Ir = {
|
|
496
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
497
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
498
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
499
|
+
wide: [
|
|
500
|
+
"Sunday",
|
|
501
|
+
"Monday",
|
|
502
|
+
"Tuesday",
|
|
503
|
+
"Wednesday",
|
|
504
|
+
"Thursday",
|
|
505
|
+
"Friday",
|
|
506
|
+
"Saturday"
|
|
507
|
+
]
|
|
508
|
+
}, Fr = {
|
|
509
|
+
narrow: {
|
|
510
|
+
am: "a",
|
|
511
|
+
pm: "p",
|
|
512
|
+
midnight: "mi",
|
|
513
|
+
noon: "n",
|
|
514
|
+
morning: "morning",
|
|
515
|
+
afternoon: "afternoon",
|
|
516
|
+
evening: "evening",
|
|
517
|
+
night: "night"
|
|
518
|
+
},
|
|
519
|
+
abbreviated: {
|
|
520
|
+
am: "AM",
|
|
521
|
+
pm: "PM",
|
|
522
|
+
midnight: "midnight",
|
|
523
|
+
noon: "noon",
|
|
524
|
+
morning: "morning",
|
|
525
|
+
afternoon: "afternoon",
|
|
526
|
+
evening: "evening",
|
|
527
|
+
night: "night"
|
|
528
|
+
},
|
|
529
|
+
wide: {
|
|
530
|
+
am: "a.m.",
|
|
531
|
+
pm: "p.m.",
|
|
532
|
+
midnight: "midnight",
|
|
533
|
+
noon: "noon",
|
|
534
|
+
morning: "morning",
|
|
535
|
+
afternoon: "afternoon",
|
|
536
|
+
evening: "evening",
|
|
537
|
+
night: "night"
|
|
538
|
+
}
|
|
539
|
+
}, Br = {
|
|
540
|
+
narrow: {
|
|
541
|
+
am: "a",
|
|
542
|
+
pm: "p",
|
|
543
|
+
midnight: "mi",
|
|
544
|
+
noon: "n",
|
|
545
|
+
morning: "in the morning",
|
|
546
|
+
afternoon: "in the afternoon",
|
|
547
|
+
evening: "in the evening",
|
|
548
|
+
night: "at night"
|
|
549
|
+
},
|
|
550
|
+
abbreviated: {
|
|
551
|
+
am: "AM",
|
|
552
|
+
pm: "PM",
|
|
553
|
+
midnight: "midnight",
|
|
554
|
+
noon: "noon",
|
|
555
|
+
morning: "in the morning",
|
|
556
|
+
afternoon: "in the afternoon",
|
|
557
|
+
evening: "in the evening",
|
|
558
|
+
night: "at night"
|
|
559
|
+
},
|
|
560
|
+
wide: {
|
|
561
|
+
am: "a.m.",
|
|
562
|
+
pm: "p.m.",
|
|
563
|
+
midnight: "midnight",
|
|
564
|
+
noon: "noon",
|
|
565
|
+
morning: "in the morning",
|
|
566
|
+
afternoon: "in the afternoon",
|
|
567
|
+
evening: "in the evening",
|
|
568
|
+
night: "at night"
|
|
569
|
+
}
|
|
570
|
+
}, Hr = (t, n) => {
|
|
571
|
+
const e = Number(t), r = e % 100;
|
|
572
|
+
if (r > 20 || r < 10)
|
|
573
|
+
switch (r % 10) {
|
|
574
|
+
case 1:
|
|
575
|
+
return e + "st";
|
|
576
|
+
case 2:
|
|
577
|
+
return e + "nd";
|
|
578
|
+
case 3:
|
|
579
|
+
return e + "rd";
|
|
580
|
+
}
|
|
581
|
+
return e + "th";
|
|
582
|
+
}, qr = {
|
|
583
|
+
ordinalNumber: Hr,
|
|
584
|
+
era: Ie({
|
|
585
|
+
values: _r,
|
|
586
|
+
defaultWidth: "wide"
|
|
587
|
+
}),
|
|
588
|
+
quarter: Ie({
|
|
589
|
+
values: Er,
|
|
590
|
+
defaultWidth: "wide",
|
|
591
|
+
argumentCallback: (t) => t - 1
|
|
592
|
+
}),
|
|
593
|
+
month: Ie({
|
|
594
|
+
values: Sr,
|
|
595
|
+
defaultWidth: "wide"
|
|
596
|
+
}),
|
|
597
|
+
day: Ie({
|
|
598
|
+
values: Ir,
|
|
599
|
+
defaultWidth: "wide"
|
|
600
|
+
}),
|
|
601
|
+
dayPeriod: Ie({
|
|
602
|
+
values: Fr,
|
|
603
|
+
defaultWidth: "wide",
|
|
604
|
+
formattingValues: Br,
|
|
605
|
+
defaultFormattingWidth: "wide"
|
|
606
|
+
})
|
|
607
|
+
};
|
|
608
|
+
function Fe(t) {
|
|
609
|
+
return (n, e = {}) => {
|
|
610
|
+
const r = e.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = n.match(a);
|
|
611
|
+
if (!s)
|
|
612
|
+
return null;
|
|
613
|
+
const o = s[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? Rr(i, (f) => f.test(o)) : (
|
|
614
|
+
// [TODO] -- I challenge you to fix the type
|
|
615
|
+
Ar(i, (f) => f.test(o))
|
|
616
|
+
);
|
|
617
|
+
let u;
|
|
618
|
+
u = t.valueCallback ? t.valueCallback(c) : c, u = e.valueCallback ? (
|
|
619
|
+
// [TODO] -- I challenge you to fix the type
|
|
620
|
+
e.valueCallback(u)
|
|
621
|
+
) : u;
|
|
622
|
+
const l = n.slice(o.length);
|
|
623
|
+
return { value: u, rest: l };
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function Ar(t, n) {
|
|
627
|
+
for (const e in t)
|
|
628
|
+
if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
|
|
629
|
+
return e;
|
|
630
|
+
}
|
|
631
|
+
function Rr(t, n) {
|
|
632
|
+
for (let e = 0; e < t.length; e++)
|
|
633
|
+
if (n(t[e]))
|
|
634
|
+
return e;
|
|
635
|
+
}
|
|
636
|
+
function jr(t) {
|
|
637
|
+
return (n, e = {}) => {
|
|
638
|
+
const r = n.match(t.matchPattern);
|
|
639
|
+
if (!r) return null;
|
|
640
|
+
const a = r[0], s = n.match(t.parsePattern);
|
|
641
|
+
if (!s) return null;
|
|
642
|
+
let o = t.valueCallback ? t.valueCallback(s[0]) : s[0];
|
|
643
|
+
o = e.valueCallback ? e.valueCallback(o) : o;
|
|
644
|
+
const i = n.slice(a.length);
|
|
645
|
+
return { value: o, rest: i };
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
const Gr = /^(\d+)(th|st|nd|rd)?/i, Qr = /\d+/i, $r = {
|
|
649
|
+
narrow: /^(b|a)/i,
|
|
650
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
651
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
652
|
+
}, zr = {
|
|
653
|
+
any: [/^b/i, /^(a|c)/i]
|
|
654
|
+
}, Xr = {
|
|
655
|
+
narrow: /^[1234]/i,
|
|
656
|
+
abbreviated: /^q[1234]/i,
|
|
657
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
658
|
+
}, Vr = {
|
|
659
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
660
|
+
}, Ur = {
|
|
661
|
+
narrow: /^[jfmasond]/i,
|
|
662
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
663
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
664
|
+
}, Kr = {
|
|
665
|
+
narrow: [
|
|
666
|
+
/^j/i,
|
|
667
|
+
/^f/i,
|
|
668
|
+
/^m/i,
|
|
669
|
+
/^a/i,
|
|
670
|
+
/^m/i,
|
|
671
|
+
/^j/i,
|
|
672
|
+
/^j/i,
|
|
673
|
+
/^a/i,
|
|
674
|
+
/^s/i,
|
|
675
|
+
/^o/i,
|
|
676
|
+
/^n/i,
|
|
677
|
+
/^d/i
|
|
678
|
+
],
|
|
679
|
+
any: [
|
|
680
|
+
/^ja/i,
|
|
681
|
+
/^f/i,
|
|
682
|
+
/^mar/i,
|
|
683
|
+
/^ap/i,
|
|
684
|
+
/^may/i,
|
|
685
|
+
/^jun/i,
|
|
686
|
+
/^jul/i,
|
|
687
|
+
/^au/i,
|
|
688
|
+
/^s/i,
|
|
689
|
+
/^o/i,
|
|
690
|
+
/^n/i,
|
|
691
|
+
/^d/i
|
|
692
|
+
]
|
|
693
|
+
}, Zr = {
|
|
694
|
+
narrow: /^[smtwf]/i,
|
|
695
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
696
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
697
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
698
|
+
}, Jr = {
|
|
699
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
700
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
701
|
+
}, Lr = {
|
|
702
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
703
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
704
|
+
}, ea = {
|
|
705
|
+
any: {
|
|
706
|
+
am: /^a/i,
|
|
707
|
+
pm: /^p/i,
|
|
708
|
+
midnight: /^mi/i,
|
|
709
|
+
noon: /^no/i,
|
|
710
|
+
morning: /morning/i,
|
|
711
|
+
afternoon: /afternoon/i,
|
|
712
|
+
evening: /evening/i,
|
|
713
|
+
night: /night/i
|
|
714
|
+
}
|
|
715
|
+
}, ta = {
|
|
716
|
+
ordinalNumber: jr({
|
|
717
|
+
matchPattern: Gr,
|
|
718
|
+
parsePattern: Qr,
|
|
719
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
720
|
+
}),
|
|
721
|
+
era: Fe({
|
|
722
|
+
matchPatterns: $r,
|
|
723
|
+
defaultMatchWidth: "wide",
|
|
724
|
+
parsePatterns: zr,
|
|
725
|
+
defaultParseWidth: "any"
|
|
726
|
+
}),
|
|
727
|
+
quarter: Fe({
|
|
728
|
+
matchPatterns: Xr,
|
|
729
|
+
defaultMatchWidth: "wide",
|
|
730
|
+
parsePatterns: Vr,
|
|
731
|
+
defaultParseWidth: "any",
|
|
732
|
+
valueCallback: (t) => t + 1
|
|
733
|
+
}),
|
|
734
|
+
month: Fe({
|
|
735
|
+
matchPatterns: Ur,
|
|
736
|
+
defaultMatchWidth: "wide",
|
|
737
|
+
parsePatterns: Kr,
|
|
738
|
+
defaultParseWidth: "any"
|
|
739
|
+
}),
|
|
740
|
+
day: Fe({
|
|
741
|
+
matchPatterns: Zr,
|
|
742
|
+
defaultMatchWidth: "wide",
|
|
743
|
+
parsePatterns: Jr,
|
|
744
|
+
defaultParseWidth: "any"
|
|
745
|
+
}),
|
|
746
|
+
dayPeriod: Fe({
|
|
747
|
+
matchPatterns: Lr,
|
|
748
|
+
defaultMatchWidth: "any",
|
|
749
|
+
parsePatterns: ea,
|
|
750
|
+
defaultParseWidth: "any"
|
|
751
|
+
})
|
|
752
|
+
}, ve = {
|
|
753
|
+
code: "en-US",
|
|
754
|
+
formatDistance: pr,
|
|
755
|
+
formatLong: Yr,
|
|
756
|
+
formatRelative: Cr,
|
|
757
|
+
localize: qr,
|
|
758
|
+
match: ta,
|
|
759
|
+
options: {
|
|
760
|
+
weekStartsOn: 0,
|
|
761
|
+
firstWeekContainsDate: 1
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
function na(t, n) {
|
|
765
|
+
const e = Y(t, n == null ? void 0 : n.in);
|
|
766
|
+
return mt(e, Kt(e)) + 1;
|
|
767
|
+
}
|
|
768
|
+
function Ue(t, n) {
|
|
769
|
+
const e = Y(t, n == null ? void 0 : n.in), r = +pe(e) - +fr(e);
|
|
770
|
+
return Math.round(r / Qt) + 1;
|
|
771
|
+
}
|
|
772
|
+
function yt(t, n) {
|
|
773
|
+
var l, f, h, b;
|
|
774
|
+
const e = Y(t, n == null ? void 0 : n.in), r = e.getFullYear(), a = Te(), s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((b = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, o = B((n == null ? void 0 : n.in) || t, 0);
|
|
775
|
+
o.setFullYear(r + 1, 0, s), o.setHours(0, 0, 0, 0);
|
|
776
|
+
const i = ge(o, n), c = B((n == null ? void 0 : n.in) || t, 0);
|
|
777
|
+
c.setFullYear(r, 0, s), c.setHours(0, 0, 0, 0);
|
|
778
|
+
const u = ge(c, n);
|
|
779
|
+
return +e >= +i ? r + 1 : +e >= +u ? r : r - 1;
|
|
780
|
+
}
|
|
781
|
+
function ra(t, n) {
|
|
782
|
+
var i, c, u, l;
|
|
783
|
+
const e = Te(), r = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((c = (i = n == null ? void 0 : n.locale) == null ? void 0 : i.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((l = (u = e.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = yt(t, n), s = B((n == null ? void 0 : n.in) || t, 0);
|
|
784
|
+
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), ge(s, n);
|
|
785
|
+
}
|
|
786
|
+
function Ke(t, n) {
|
|
787
|
+
const e = Y(t, n == null ? void 0 : n.in), r = +ge(e, n) - +ra(e, n);
|
|
788
|
+
return Math.round(r / Qt) + 1;
|
|
789
|
+
}
|
|
790
|
+
function F(t, n) {
|
|
791
|
+
const e = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(n, "0");
|
|
792
|
+
return e + r;
|
|
793
|
+
}
|
|
794
|
+
const Me = {
|
|
795
|
+
// Year
|
|
796
|
+
y(t, n) {
|
|
797
|
+
const e = t.getFullYear(), r = e > 0 ? e : 1 - e;
|
|
798
|
+
return F(n === "yy" ? r % 100 : r, n.length);
|
|
799
|
+
},
|
|
800
|
+
// Month
|
|
801
|
+
M(t, n) {
|
|
802
|
+
const e = t.getMonth();
|
|
803
|
+
return n === "M" ? String(e + 1) : F(e + 1, 2);
|
|
804
|
+
},
|
|
805
|
+
// Day of the month
|
|
806
|
+
d(t, n) {
|
|
807
|
+
return F(t.getDate(), n.length);
|
|
808
|
+
},
|
|
809
|
+
// AM or PM
|
|
810
|
+
a(t, n) {
|
|
811
|
+
const e = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
812
|
+
switch (n) {
|
|
813
|
+
case "a":
|
|
814
|
+
case "aa":
|
|
815
|
+
return e.toUpperCase();
|
|
816
|
+
case "aaa":
|
|
817
|
+
return e;
|
|
818
|
+
case "aaaaa":
|
|
819
|
+
return e[0];
|
|
820
|
+
case "aaaa":
|
|
821
|
+
default:
|
|
822
|
+
return e === "am" ? "a.m." : "p.m.";
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
// Hour [1-12]
|
|
826
|
+
h(t, n) {
|
|
827
|
+
return F(t.getHours() % 12 || 12, n.length);
|
|
828
|
+
},
|
|
829
|
+
// Hour [0-23]
|
|
830
|
+
H(t, n) {
|
|
831
|
+
return F(t.getHours(), n.length);
|
|
832
|
+
},
|
|
833
|
+
// Minute
|
|
834
|
+
m(t, n) {
|
|
835
|
+
return F(t.getMinutes(), n.length);
|
|
836
|
+
},
|
|
837
|
+
// Second
|
|
838
|
+
s(t, n) {
|
|
839
|
+
return F(t.getSeconds(), n.length);
|
|
840
|
+
},
|
|
841
|
+
// Fraction of second
|
|
842
|
+
S(t, n) {
|
|
843
|
+
const e = n.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
844
|
+
r * Math.pow(10, e - 3)
|
|
845
|
+
);
|
|
846
|
+
return F(a, n.length);
|
|
847
|
+
}
|
|
848
|
+
}, Pe = {
|
|
849
|
+
midnight: "midnight",
|
|
850
|
+
noon: "noon",
|
|
851
|
+
morning: "morning",
|
|
852
|
+
afternoon: "afternoon",
|
|
853
|
+
evening: "evening",
|
|
854
|
+
night: "night"
|
|
855
|
+
}, _t = {
|
|
856
|
+
// Era
|
|
857
|
+
G: function(t, n, e) {
|
|
858
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
859
|
+
switch (n) {
|
|
860
|
+
// AD, BC
|
|
861
|
+
case "G":
|
|
862
|
+
case "GG":
|
|
863
|
+
case "GGG":
|
|
864
|
+
return e.era(r, { width: "abbreviated" });
|
|
865
|
+
// A, B
|
|
866
|
+
case "GGGGG":
|
|
867
|
+
return e.era(r, { width: "narrow" });
|
|
868
|
+
// Anno Domini, Before Christ
|
|
869
|
+
case "GGGG":
|
|
870
|
+
default:
|
|
871
|
+
return e.era(r, { width: "wide" });
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
// Year
|
|
875
|
+
y: function(t, n, e) {
|
|
876
|
+
if (n === "yo") {
|
|
877
|
+
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
878
|
+
return e.ordinalNumber(a, { unit: "year" });
|
|
879
|
+
}
|
|
880
|
+
return Me.y(t, n);
|
|
881
|
+
},
|
|
882
|
+
// Local week-numbering year
|
|
883
|
+
Y: function(t, n, e, r) {
|
|
884
|
+
const a = yt(t, r), s = a > 0 ? a : 1 - a;
|
|
885
|
+
if (n === "YY") {
|
|
886
|
+
const o = s % 100;
|
|
887
|
+
return F(o, 2);
|
|
888
|
+
}
|
|
889
|
+
return n === "Yo" ? e.ordinalNumber(s, { unit: "year" }) : F(s, n.length);
|
|
890
|
+
},
|
|
891
|
+
// ISO week-numbering year
|
|
892
|
+
R: function(t, n) {
|
|
893
|
+
const e = zt(t);
|
|
894
|
+
return F(e, n.length);
|
|
895
|
+
},
|
|
896
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
897
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
898
|
+
// | Year | `y` | `u` |
|
|
899
|
+
// |------|-----|-----|
|
|
900
|
+
// | AC 1 | 1 | 1 |
|
|
901
|
+
// | BC 1 | 1 | 0 |
|
|
902
|
+
// | BC 2 | 2 | -1 |
|
|
903
|
+
// Also `yy` always returns the last two digits of a year,
|
|
904
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
905
|
+
u: function(t, n) {
|
|
906
|
+
const e = t.getFullYear();
|
|
907
|
+
return F(e, n.length);
|
|
908
|
+
},
|
|
909
|
+
// Quarter
|
|
910
|
+
Q: function(t, n, e) {
|
|
911
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
912
|
+
switch (n) {
|
|
913
|
+
// 1, 2, 3, 4
|
|
914
|
+
case "Q":
|
|
915
|
+
return String(r);
|
|
916
|
+
// 01, 02, 03, 04
|
|
917
|
+
case "QQ":
|
|
918
|
+
return F(r, 2);
|
|
919
|
+
// 1st, 2nd, 3rd, 4th
|
|
920
|
+
case "Qo":
|
|
921
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
922
|
+
// Q1, Q2, Q3, Q4
|
|
923
|
+
case "QQQ":
|
|
924
|
+
return e.quarter(r, {
|
|
925
|
+
width: "abbreviated",
|
|
926
|
+
context: "formatting"
|
|
927
|
+
});
|
|
928
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
929
|
+
case "QQQQQ":
|
|
930
|
+
return e.quarter(r, {
|
|
931
|
+
width: "narrow",
|
|
932
|
+
context: "formatting"
|
|
933
|
+
});
|
|
934
|
+
// 1st quarter, 2nd quarter, ...
|
|
935
|
+
case "QQQQ":
|
|
936
|
+
default:
|
|
937
|
+
return e.quarter(r, {
|
|
938
|
+
width: "wide",
|
|
939
|
+
context: "formatting"
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
// Stand-alone quarter
|
|
944
|
+
q: function(t, n, e) {
|
|
945
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
946
|
+
switch (n) {
|
|
947
|
+
// 1, 2, 3, 4
|
|
948
|
+
case "q":
|
|
949
|
+
return String(r);
|
|
950
|
+
// 01, 02, 03, 04
|
|
951
|
+
case "qq":
|
|
952
|
+
return F(r, 2);
|
|
953
|
+
// 1st, 2nd, 3rd, 4th
|
|
954
|
+
case "qo":
|
|
955
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
956
|
+
// Q1, Q2, Q3, Q4
|
|
957
|
+
case "qqq":
|
|
958
|
+
return e.quarter(r, {
|
|
959
|
+
width: "abbreviated",
|
|
960
|
+
context: "standalone"
|
|
961
|
+
});
|
|
962
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
963
|
+
case "qqqqq":
|
|
964
|
+
return e.quarter(r, {
|
|
965
|
+
width: "narrow",
|
|
966
|
+
context: "standalone"
|
|
967
|
+
});
|
|
968
|
+
// 1st quarter, 2nd quarter, ...
|
|
969
|
+
case "qqqq":
|
|
970
|
+
default:
|
|
971
|
+
return e.quarter(r, {
|
|
972
|
+
width: "wide",
|
|
973
|
+
context: "standalone"
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
// Month
|
|
978
|
+
M: function(t, n, e) {
|
|
979
|
+
const r = t.getMonth();
|
|
980
|
+
switch (n) {
|
|
981
|
+
case "M":
|
|
982
|
+
case "MM":
|
|
983
|
+
return Me.M(t, n);
|
|
984
|
+
// 1st, 2nd, ..., 12th
|
|
985
|
+
case "Mo":
|
|
986
|
+
return e.ordinalNumber(r + 1, { unit: "month" });
|
|
987
|
+
// Jan, Feb, ..., Dec
|
|
988
|
+
case "MMM":
|
|
989
|
+
return e.month(r, {
|
|
990
|
+
width: "abbreviated",
|
|
991
|
+
context: "formatting"
|
|
992
|
+
});
|
|
993
|
+
// J, F, ..., D
|
|
994
|
+
case "MMMMM":
|
|
995
|
+
return e.month(r, {
|
|
996
|
+
width: "narrow",
|
|
997
|
+
context: "formatting"
|
|
998
|
+
});
|
|
999
|
+
// January, February, ..., December
|
|
1000
|
+
case "MMMM":
|
|
1001
|
+
default:
|
|
1002
|
+
return e.month(r, { width: "wide", context: "formatting" });
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
// Stand-alone month
|
|
1006
|
+
L: function(t, n, e) {
|
|
1007
|
+
const r = t.getMonth();
|
|
1008
|
+
switch (n) {
|
|
1009
|
+
// 1, 2, ..., 12
|
|
1010
|
+
case "L":
|
|
1011
|
+
return String(r + 1);
|
|
1012
|
+
// 01, 02, ..., 12
|
|
1013
|
+
case "LL":
|
|
1014
|
+
return F(r + 1, 2);
|
|
1015
|
+
// 1st, 2nd, ..., 12th
|
|
1016
|
+
case "Lo":
|
|
1017
|
+
return e.ordinalNumber(r + 1, { unit: "month" });
|
|
1018
|
+
// Jan, Feb, ..., Dec
|
|
1019
|
+
case "LLL":
|
|
1020
|
+
return e.month(r, {
|
|
1021
|
+
width: "abbreviated",
|
|
1022
|
+
context: "standalone"
|
|
1023
|
+
});
|
|
1024
|
+
// J, F, ..., D
|
|
1025
|
+
case "LLLLL":
|
|
1026
|
+
return e.month(r, {
|
|
1027
|
+
width: "narrow",
|
|
1028
|
+
context: "standalone"
|
|
1029
|
+
});
|
|
1030
|
+
// January, February, ..., December
|
|
1031
|
+
case "LLLL":
|
|
1032
|
+
default:
|
|
1033
|
+
return e.month(r, { width: "wide", context: "standalone" });
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
// Local week of year
|
|
1037
|
+
w: function(t, n, e, r) {
|
|
1038
|
+
const a = Ke(t, r);
|
|
1039
|
+
return n === "wo" ? e.ordinalNumber(a, { unit: "week" }) : F(a, n.length);
|
|
1040
|
+
},
|
|
1041
|
+
// ISO week of year
|
|
1042
|
+
I: function(t, n, e) {
|
|
1043
|
+
const r = Ue(t);
|
|
1044
|
+
return n === "Io" ? e.ordinalNumber(r, { unit: "week" }) : F(r, n.length);
|
|
1045
|
+
},
|
|
1046
|
+
// Day of the month
|
|
1047
|
+
d: function(t, n, e) {
|
|
1048
|
+
return n === "do" ? e.ordinalNumber(t.getDate(), { unit: "date" }) : Me.d(t, n);
|
|
1049
|
+
},
|
|
1050
|
+
// Day of year
|
|
1051
|
+
D: function(t, n, e) {
|
|
1052
|
+
const r = na(t);
|
|
1053
|
+
return n === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : F(r, n.length);
|
|
1054
|
+
},
|
|
1055
|
+
// Day of week
|
|
1056
|
+
E: function(t, n, e) {
|
|
1057
|
+
const r = t.getDay();
|
|
1058
|
+
switch (n) {
|
|
1059
|
+
// Tue
|
|
1060
|
+
case "E":
|
|
1061
|
+
case "EE":
|
|
1062
|
+
case "EEE":
|
|
1063
|
+
return e.day(r, {
|
|
1064
|
+
width: "abbreviated",
|
|
1065
|
+
context: "formatting"
|
|
1066
|
+
});
|
|
1067
|
+
// T
|
|
1068
|
+
case "EEEEE":
|
|
1069
|
+
return e.day(r, {
|
|
1070
|
+
width: "narrow",
|
|
1071
|
+
context: "formatting"
|
|
1072
|
+
});
|
|
1073
|
+
// Tu
|
|
1074
|
+
case "EEEEEE":
|
|
1075
|
+
return e.day(r, {
|
|
1076
|
+
width: "short",
|
|
1077
|
+
context: "formatting"
|
|
1078
|
+
});
|
|
1079
|
+
// Tuesday
|
|
1080
|
+
case "EEEE":
|
|
1081
|
+
default:
|
|
1082
|
+
return e.day(r, {
|
|
1083
|
+
width: "wide",
|
|
1084
|
+
context: "formatting"
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
// Local day of week
|
|
1089
|
+
e: function(t, n, e, r) {
|
|
1090
|
+
const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1091
|
+
switch (n) {
|
|
1092
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1093
|
+
case "e":
|
|
1094
|
+
return String(s);
|
|
1095
|
+
// Padded numerical value
|
|
1096
|
+
case "ee":
|
|
1097
|
+
return F(s, 2);
|
|
1098
|
+
// 1st, 2nd, ..., 7th
|
|
1099
|
+
case "eo":
|
|
1100
|
+
return e.ordinalNumber(s, { unit: "day" });
|
|
1101
|
+
case "eee":
|
|
1102
|
+
return e.day(a, {
|
|
1103
|
+
width: "abbreviated",
|
|
1104
|
+
context: "formatting"
|
|
1105
|
+
});
|
|
1106
|
+
// T
|
|
1107
|
+
case "eeeee":
|
|
1108
|
+
return e.day(a, {
|
|
1109
|
+
width: "narrow",
|
|
1110
|
+
context: "formatting"
|
|
1111
|
+
});
|
|
1112
|
+
// Tu
|
|
1113
|
+
case "eeeeee":
|
|
1114
|
+
return e.day(a, {
|
|
1115
|
+
width: "short",
|
|
1116
|
+
context: "formatting"
|
|
1117
|
+
});
|
|
1118
|
+
// Tuesday
|
|
1119
|
+
case "eeee":
|
|
1120
|
+
default:
|
|
1121
|
+
return e.day(a, {
|
|
1122
|
+
width: "wide",
|
|
1123
|
+
context: "formatting"
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
// Stand-alone local day of week
|
|
1128
|
+
c: function(t, n, e, r) {
|
|
1129
|
+
const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1130
|
+
switch (n) {
|
|
1131
|
+
// Numerical value (same as in `e`)
|
|
1132
|
+
case "c":
|
|
1133
|
+
return String(s);
|
|
1134
|
+
// Padded numerical value
|
|
1135
|
+
case "cc":
|
|
1136
|
+
return F(s, n.length);
|
|
1137
|
+
// 1st, 2nd, ..., 7th
|
|
1138
|
+
case "co":
|
|
1139
|
+
return e.ordinalNumber(s, { unit: "day" });
|
|
1140
|
+
case "ccc":
|
|
1141
|
+
return e.day(a, {
|
|
1142
|
+
width: "abbreviated",
|
|
1143
|
+
context: "standalone"
|
|
1144
|
+
});
|
|
1145
|
+
// T
|
|
1146
|
+
case "ccccc":
|
|
1147
|
+
return e.day(a, {
|
|
1148
|
+
width: "narrow",
|
|
1149
|
+
context: "standalone"
|
|
1150
|
+
});
|
|
1151
|
+
// Tu
|
|
1152
|
+
case "cccccc":
|
|
1153
|
+
return e.day(a, {
|
|
1154
|
+
width: "short",
|
|
1155
|
+
context: "standalone"
|
|
1156
|
+
});
|
|
1157
|
+
// Tuesday
|
|
1158
|
+
case "cccc":
|
|
1159
|
+
default:
|
|
1160
|
+
return e.day(a, {
|
|
1161
|
+
width: "wide",
|
|
1162
|
+
context: "standalone"
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
},
|
|
1166
|
+
// ISO day of week
|
|
1167
|
+
i: function(t, n, e) {
|
|
1168
|
+
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
1169
|
+
switch (n) {
|
|
1170
|
+
// 2
|
|
1171
|
+
case "i":
|
|
1172
|
+
return String(a);
|
|
1173
|
+
// 02
|
|
1174
|
+
case "ii":
|
|
1175
|
+
return F(a, n.length);
|
|
1176
|
+
// 2nd
|
|
1177
|
+
case "io":
|
|
1178
|
+
return e.ordinalNumber(a, { unit: "day" });
|
|
1179
|
+
// Tue
|
|
1180
|
+
case "iii":
|
|
1181
|
+
return e.day(r, {
|
|
1182
|
+
width: "abbreviated",
|
|
1183
|
+
context: "formatting"
|
|
1184
|
+
});
|
|
1185
|
+
// T
|
|
1186
|
+
case "iiiii":
|
|
1187
|
+
return e.day(r, {
|
|
1188
|
+
width: "narrow",
|
|
1189
|
+
context: "formatting"
|
|
1190
|
+
});
|
|
1191
|
+
// Tu
|
|
1192
|
+
case "iiiiii":
|
|
1193
|
+
return e.day(r, {
|
|
1194
|
+
width: "short",
|
|
1195
|
+
context: "formatting"
|
|
1196
|
+
});
|
|
1197
|
+
// Tuesday
|
|
1198
|
+
case "iiii":
|
|
1199
|
+
default:
|
|
1200
|
+
return e.day(r, {
|
|
1201
|
+
width: "wide",
|
|
1202
|
+
context: "formatting"
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
// AM or PM
|
|
1207
|
+
a: function(t, n, e) {
|
|
1208
|
+
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1209
|
+
switch (n) {
|
|
1210
|
+
case "a":
|
|
1211
|
+
case "aa":
|
|
1212
|
+
return e.dayPeriod(a, {
|
|
1213
|
+
width: "abbreviated",
|
|
1214
|
+
context: "formatting"
|
|
1215
|
+
});
|
|
1216
|
+
case "aaa":
|
|
1217
|
+
return e.dayPeriod(a, {
|
|
1218
|
+
width: "abbreviated",
|
|
1219
|
+
context: "formatting"
|
|
1220
|
+
}).toLowerCase();
|
|
1221
|
+
case "aaaaa":
|
|
1222
|
+
return e.dayPeriod(a, {
|
|
1223
|
+
width: "narrow",
|
|
1224
|
+
context: "formatting"
|
|
1225
|
+
});
|
|
1226
|
+
case "aaaa":
|
|
1227
|
+
default:
|
|
1228
|
+
return e.dayPeriod(a, {
|
|
1229
|
+
width: "wide",
|
|
1230
|
+
context: "formatting"
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
// AM, PM, midnight, noon
|
|
1235
|
+
b: function(t, n, e) {
|
|
1236
|
+
const r = t.getHours();
|
|
1237
|
+
let a;
|
|
1238
|
+
switch (r === 12 ? a = Pe.noon : r === 0 ? a = Pe.midnight : a = r / 12 >= 1 ? "pm" : "am", n) {
|
|
1239
|
+
case "b":
|
|
1240
|
+
case "bb":
|
|
1241
|
+
return e.dayPeriod(a, {
|
|
1242
|
+
width: "abbreviated",
|
|
1243
|
+
context: "formatting"
|
|
1244
|
+
});
|
|
1245
|
+
case "bbb":
|
|
1246
|
+
return e.dayPeriod(a, {
|
|
1247
|
+
width: "abbreviated",
|
|
1248
|
+
context: "formatting"
|
|
1249
|
+
}).toLowerCase();
|
|
1250
|
+
case "bbbbb":
|
|
1251
|
+
return e.dayPeriod(a, {
|
|
1252
|
+
width: "narrow",
|
|
1253
|
+
context: "formatting"
|
|
1254
|
+
});
|
|
1255
|
+
case "bbbb":
|
|
1256
|
+
default:
|
|
1257
|
+
return e.dayPeriod(a, {
|
|
1258
|
+
width: "wide",
|
|
1259
|
+
context: "formatting"
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1264
|
+
B: function(t, n, e) {
|
|
1265
|
+
const r = t.getHours();
|
|
1266
|
+
let a;
|
|
1267
|
+
switch (r >= 17 ? a = Pe.evening : r >= 12 ? a = Pe.afternoon : r >= 4 ? a = Pe.morning : a = Pe.night, n) {
|
|
1268
|
+
case "B":
|
|
1269
|
+
case "BB":
|
|
1270
|
+
case "BBB":
|
|
1271
|
+
return e.dayPeriod(a, {
|
|
1272
|
+
width: "abbreviated",
|
|
1273
|
+
context: "formatting"
|
|
1274
|
+
});
|
|
1275
|
+
case "BBBBB":
|
|
1276
|
+
return e.dayPeriod(a, {
|
|
1277
|
+
width: "narrow",
|
|
1278
|
+
context: "formatting"
|
|
1279
|
+
});
|
|
1280
|
+
case "BBBB":
|
|
1281
|
+
default:
|
|
1282
|
+
return e.dayPeriod(a, {
|
|
1283
|
+
width: "wide",
|
|
1284
|
+
context: "formatting"
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
// Hour [1-12]
|
|
1289
|
+
h: function(t, n, e) {
|
|
1290
|
+
if (n === "ho") {
|
|
1291
|
+
let r = t.getHours() % 12;
|
|
1292
|
+
return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
|
|
1293
|
+
}
|
|
1294
|
+
return Me.h(t, n);
|
|
1295
|
+
},
|
|
1296
|
+
// Hour [0-23]
|
|
1297
|
+
H: function(t, n, e) {
|
|
1298
|
+
return n === "Ho" ? e.ordinalNumber(t.getHours(), { unit: "hour" }) : Me.H(t, n);
|
|
1299
|
+
},
|
|
1300
|
+
// Hour [0-11]
|
|
1301
|
+
K: function(t, n, e) {
|
|
1302
|
+
const r = t.getHours() % 12;
|
|
1303
|
+
return n === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : F(r, n.length);
|
|
1304
|
+
},
|
|
1305
|
+
// Hour [1-24]
|
|
1306
|
+
k: function(t, n, e) {
|
|
1307
|
+
let r = t.getHours();
|
|
1308
|
+
return r === 0 && (r = 24), n === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : F(r, n.length);
|
|
1309
|
+
},
|
|
1310
|
+
// Minute
|
|
1311
|
+
m: function(t, n, e) {
|
|
1312
|
+
return n === "mo" ? e.ordinalNumber(t.getMinutes(), { unit: "minute" }) : Me.m(t, n);
|
|
1313
|
+
},
|
|
1314
|
+
// Second
|
|
1315
|
+
s: function(t, n, e) {
|
|
1316
|
+
return n === "so" ? e.ordinalNumber(t.getSeconds(), { unit: "second" }) : Me.s(t, n);
|
|
1317
|
+
},
|
|
1318
|
+
// Fraction of second
|
|
1319
|
+
S: function(t, n) {
|
|
1320
|
+
return Me.S(t, n);
|
|
1321
|
+
},
|
|
1322
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1323
|
+
X: function(t, n, e) {
|
|
1324
|
+
const r = t.getTimezoneOffset();
|
|
1325
|
+
if (r === 0)
|
|
1326
|
+
return "Z";
|
|
1327
|
+
switch (n) {
|
|
1328
|
+
// Hours and optional minutes
|
|
1329
|
+
case "X":
|
|
1330
|
+
return St(r);
|
|
1331
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1332
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1333
|
+
// so this token always has the same output as `XX`
|
|
1334
|
+
case "XXXX":
|
|
1335
|
+
case "XX":
|
|
1336
|
+
return xe(r);
|
|
1337
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1338
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1339
|
+
// so this token always has the same output as `XXX`
|
|
1340
|
+
case "XXXXX":
|
|
1341
|
+
case "XXX":
|
|
1342
|
+
// Hours and minutes with `:` delimiter
|
|
1343
|
+
default:
|
|
1344
|
+
return xe(r, ":");
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1348
|
+
x: function(t, n, e) {
|
|
1349
|
+
const r = t.getTimezoneOffset();
|
|
1350
|
+
switch (n) {
|
|
1351
|
+
// Hours and optional minutes
|
|
1352
|
+
case "x":
|
|
1353
|
+
return St(r);
|
|
1354
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1355
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1356
|
+
// so this token always has the same output as `xx`
|
|
1357
|
+
case "xxxx":
|
|
1358
|
+
case "xx":
|
|
1359
|
+
return xe(r);
|
|
1360
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1361
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1362
|
+
// so this token always has the same output as `xxx`
|
|
1363
|
+
case "xxxxx":
|
|
1364
|
+
case "xxx":
|
|
1365
|
+
// Hours and minutes with `:` delimiter
|
|
1366
|
+
default:
|
|
1367
|
+
return xe(r, ":");
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
// Timezone (GMT)
|
|
1371
|
+
O: function(t, n, e) {
|
|
1372
|
+
const r = t.getTimezoneOffset();
|
|
1373
|
+
switch (n) {
|
|
1374
|
+
// Short
|
|
1375
|
+
case "O":
|
|
1376
|
+
case "OO":
|
|
1377
|
+
case "OOO":
|
|
1378
|
+
return "GMT" + Et(r, ":");
|
|
1379
|
+
// Long
|
|
1380
|
+
case "OOOO":
|
|
1381
|
+
default:
|
|
1382
|
+
return "GMT" + xe(r, ":");
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
// Timezone (specific non-location)
|
|
1386
|
+
z: function(t, n, e) {
|
|
1387
|
+
const r = t.getTimezoneOffset();
|
|
1388
|
+
switch (n) {
|
|
1389
|
+
// Short
|
|
1390
|
+
case "z":
|
|
1391
|
+
case "zz":
|
|
1392
|
+
case "zzz":
|
|
1393
|
+
return "GMT" + Et(r, ":");
|
|
1394
|
+
// Long
|
|
1395
|
+
case "zzzz":
|
|
1396
|
+
default:
|
|
1397
|
+
return "GMT" + xe(r, ":");
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
// Seconds timestamp
|
|
1401
|
+
t: function(t, n, e) {
|
|
1402
|
+
const r = Math.trunc(+t / 1e3);
|
|
1403
|
+
return F(r, n.length);
|
|
1404
|
+
},
|
|
1405
|
+
// Milliseconds timestamp
|
|
1406
|
+
T: function(t, n, e) {
|
|
1407
|
+
return F(+t, n.length);
|
|
1408
|
+
}
|
|
1409
|
+
};
|
|
1410
|
+
function Et(t, n = "") {
|
|
1411
|
+
const e = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), s = r % 60;
|
|
1412
|
+
return s === 0 ? e + String(a) : e + String(a) + n + F(s, 2);
|
|
1413
|
+
}
|
|
1414
|
+
function St(t, n) {
|
|
1415
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + F(Math.abs(t) / 60, 2) : xe(t, n);
|
|
1416
|
+
}
|
|
1417
|
+
function xe(t, n = "") {
|
|
1418
|
+
const e = t > 0 ? "-" : "+", r = Math.abs(t), a = F(Math.trunc(r / 60), 2), s = F(r % 60, 2);
|
|
1419
|
+
return e + a + n + s;
|
|
1420
|
+
}
|
|
1421
|
+
const It = (t, n) => {
|
|
1422
|
+
switch (t) {
|
|
1423
|
+
case "P":
|
|
1424
|
+
return n.date({ width: "short" });
|
|
1425
|
+
case "PP":
|
|
1426
|
+
return n.date({ width: "medium" });
|
|
1427
|
+
case "PPP":
|
|
1428
|
+
return n.date({ width: "long" });
|
|
1429
|
+
case "PPPP":
|
|
1430
|
+
default:
|
|
1431
|
+
return n.date({ width: "full" });
|
|
1432
|
+
}
|
|
1433
|
+
}, Jt = (t, n) => {
|
|
1434
|
+
switch (t) {
|
|
1435
|
+
case "p":
|
|
1436
|
+
return n.time({ width: "short" });
|
|
1437
|
+
case "pp":
|
|
1438
|
+
return n.time({ width: "medium" });
|
|
1439
|
+
case "ppp":
|
|
1440
|
+
return n.time({ width: "long" });
|
|
1441
|
+
case "pppp":
|
|
1442
|
+
default:
|
|
1443
|
+
return n.time({ width: "full" });
|
|
1444
|
+
}
|
|
1445
|
+
}, aa = (t, n) => {
|
|
1446
|
+
const e = t.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
|
|
1447
|
+
if (!a)
|
|
1448
|
+
return It(t, n);
|
|
1449
|
+
let s;
|
|
1450
|
+
switch (r) {
|
|
1451
|
+
case "P":
|
|
1452
|
+
s = n.dateTime({ width: "short" });
|
|
1453
|
+
break;
|
|
1454
|
+
case "PP":
|
|
1455
|
+
s = n.dateTime({ width: "medium" });
|
|
1456
|
+
break;
|
|
1457
|
+
case "PPP":
|
|
1458
|
+
s = n.dateTime({ width: "long" });
|
|
1459
|
+
break;
|
|
1460
|
+
case "PPPP":
|
|
1461
|
+
default:
|
|
1462
|
+
s = n.dateTime({ width: "full" });
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
return s.replace("{{date}}", It(r, n)).replace("{{time}}", Jt(a, n));
|
|
1466
|
+
}, ft = {
|
|
1467
|
+
p: Jt,
|
|
1468
|
+
P: aa
|
|
1469
|
+
}, sa = /^D+$/, oa = /^Y+$/, ia = ["D", "DD", "YY", "YYYY"];
|
|
1470
|
+
function Lt(t) {
|
|
1471
|
+
return sa.test(t);
|
|
1472
|
+
}
|
|
1473
|
+
function en(t) {
|
|
1474
|
+
return oa.test(t);
|
|
1475
|
+
}
|
|
1476
|
+
function ht(t, n, e) {
|
|
1477
|
+
const r = ca(t, n, e);
|
|
1478
|
+
if (console.warn(r), ia.includes(t)) throw new RangeError(r);
|
|
1479
|
+
}
|
|
1480
|
+
function ca(t, n, e) {
|
|
1481
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1482
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1483
|
+
}
|
|
1484
|
+
const ua = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, la = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, da = /^'([^]*?)'?$/, fa = /''/g, ha = /[a-zA-Z]/;
|
|
1485
|
+
function ye(t, n, e) {
|
|
1486
|
+
var l, f, h, b, v, p, O, k;
|
|
1487
|
+
const r = Te(), a = (e == null ? void 0 : e.locale) ?? r.locale ?? ve, s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((f = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((b = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, o = (e == null ? void 0 : e.weekStartsOn) ?? ((p = (v = e == null ? void 0 : e.locale) == null ? void 0 : v.options) == null ? void 0 : p.weekStartsOn) ?? r.weekStartsOn ?? ((k = (O = r.locale) == null ? void 0 : O.options) == null ? void 0 : k.weekStartsOn) ?? 0, i = Y(t, e == null ? void 0 : e.in);
|
|
1488
|
+
if (!dt(i))
|
|
1489
|
+
throw new RangeError("Invalid time value");
|
|
1490
|
+
let c = n.match(la).map((D) => {
|
|
1491
|
+
const M = D[0];
|
|
1492
|
+
if (M === "p" || M === "P") {
|
|
1493
|
+
const y = ft[M];
|
|
1494
|
+
return y(D, a.formatLong);
|
|
1495
|
+
}
|
|
1496
|
+
return D;
|
|
1497
|
+
}).join("").match(ua).map((D) => {
|
|
1498
|
+
if (D === "''")
|
|
1499
|
+
return { isToken: !1, value: "'" };
|
|
1500
|
+
const M = D[0];
|
|
1501
|
+
if (M === "'")
|
|
1502
|
+
return { isToken: !1, value: ma(D) };
|
|
1503
|
+
if (_t[M])
|
|
1504
|
+
return { isToken: !0, value: D };
|
|
1505
|
+
if (M.match(ha))
|
|
1506
|
+
throw new RangeError(
|
|
1507
|
+
"Format string contains an unescaped latin alphabet character `" + M + "`"
|
|
1508
|
+
);
|
|
1509
|
+
return { isToken: !1, value: D };
|
|
1510
|
+
});
|
|
1511
|
+
a.localize.preprocessor && (c = a.localize.preprocessor(i, c));
|
|
1512
|
+
const u = {
|
|
1513
|
+
firstWeekContainsDate: s,
|
|
1514
|
+
weekStartsOn: o,
|
|
1515
|
+
locale: a
|
|
1516
|
+
};
|
|
1517
|
+
return c.map((D) => {
|
|
1518
|
+
if (!D.isToken) return D.value;
|
|
1519
|
+
const M = D.value;
|
|
1520
|
+
(!(e != null && e.useAdditionalWeekYearTokens) && en(M) || !(e != null && e.useAdditionalDayOfYearTokens) && Lt(M)) && ht(M, n, String(t));
|
|
1521
|
+
const y = _t[M[0]];
|
|
1522
|
+
return y(i, M, a.localize, u);
|
|
1523
|
+
}).join("");
|
|
1524
|
+
}
|
|
1525
|
+
function ma(t) {
|
|
1526
|
+
const n = t.match(da);
|
|
1527
|
+
return n ? n[1].replace(fa, "'") : t;
|
|
1528
|
+
}
|
|
1529
|
+
function ya(t, n) {
|
|
1530
|
+
const e = Y(t, n == null ? void 0 : n.in), r = e.getFullYear(), a = e.getMonth(), s = B(e, 0);
|
|
1531
|
+
return s.setFullYear(r, a + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
|
|
1532
|
+
}
|
|
1533
|
+
function wa() {
|
|
1534
|
+
return Object.assign({}, Te());
|
|
1535
|
+
}
|
|
1536
|
+
function ba(t, n) {
|
|
1537
|
+
const e = Y(t, n == null ? void 0 : n.in).getDay();
|
|
1538
|
+
return e === 0 ? 7 : e;
|
|
1539
|
+
}
|
|
1540
|
+
function ga(t, n) {
|
|
1541
|
+
return Y(t, n == null ? void 0 : n.in).getMonth();
|
|
1542
|
+
}
|
|
1543
|
+
function ka(t, n) {
|
|
1544
|
+
return Y(t, n == null ? void 0 : n.in).getFullYear();
|
|
1545
|
+
}
|
|
1546
|
+
function Ma(t, n) {
|
|
1547
|
+
return +Y(t) > +Y(n);
|
|
1548
|
+
}
|
|
1549
|
+
function Da(t, n) {
|
|
1550
|
+
return +Y(t) < +Y(n);
|
|
1551
|
+
}
|
|
1552
|
+
function xa(t, n) {
|
|
1553
|
+
const e = va(n) ? new n(0) : B(n, 0);
|
|
1554
|
+
return e.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), e.setHours(
|
|
1555
|
+
t.getHours(),
|
|
1556
|
+
t.getMinutes(),
|
|
1557
|
+
t.getSeconds(),
|
|
1558
|
+
t.getMilliseconds()
|
|
1559
|
+
), e;
|
|
1560
|
+
}
|
|
1561
|
+
function va(t) {
|
|
1562
|
+
var n;
|
|
1563
|
+
return typeof t == "function" && ((n = t.prototype) == null ? void 0 : n.constructor) === t;
|
|
1564
|
+
}
|
|
1565
|
+
const Oa = 10;
|
|
1566
|
+
class tn {
|
|
1567
|
+
constructor() {
|
|
1568
|
+
g(this, "subPriority", 0);
|
|
1569
|
+
}
|
|
1570
|
+
validate(n, e) {
|
|
1571
|
+
return !0;
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
class pa extends tn {
|
|
1575
|
+
constructor(n, e, r, a, s) {
|
|
1576
|
+
super(), this.value = n, this.validateValue = e, this.setValue = r, this.priority = a, s && (this.subPriority = s);
|
|
1577
|
+
}
|
|
1578
|
+
validate(n, e) {
|
|
1579
|
+
return this.validateValue(n, this.value, e);
|
|
1580
|
+
}
|
|
1581
|
+
set(n, e, r) {
|
|
1582
|
+
return this.setValue(n, e, this.value, r);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
class Wa extends tn {
|
|
1586
|
+
constructor(e, r) {
|
|
1587
|
+
super();
|
|
1588
|
+
g(this, "priority", Oa);
|
|
1589
|
+
g(this, "subPriority", -1);
|
|
1590
|
+
this.context = e || ((a) => B(r, a));
|
|
1591
|
+
}
|
|
1592
|
+
set(e, r) {
|
|
1593
|
+
return r.timestampIsSet ? e : B(e, xa(e, this.context));
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
class E {
|
|
1597
|
+
run(n, e, r, a) {
|
|
1598
|
+
const s = this.parse(n, e, r, a);
|
|
1599
|
+
return s ? {
|
|
1600
|
+
setter: new pa(
|
|
1601
|
+
s.value,
|
|
1602
|
+
this.validate,
|
|
1603
|
+
this.set,
|
|
1604
|
+
this.priority,
|
|
1605
|
+
this.subPriority
|
|
1606
|
+
),
|
|
1607
|
+
rest: s.rest
|
|
1608
|
+
} : null;
|
|
1609
|
+
}
|
|
1610
|
+
validate(n, e, r) {
|
|
1611
|
+
return !0;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
class Ta extends E {
|
|
1615
|
+
constructor() {
|
|
1616
|
+
super(...arguments);
|
|
1617
|
+
g(this, "priority", 140);
|
|
1618
|
+
g(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
1619
|
+
}
|
|
1620
|
+
parse(e, r, a) {
|
|
1621
|
+
switch (r) {
|
|
1622
|
+
// AD, BC
|
|
1623
|
+
case "G":
|
|
1624
|
+
case "GG":
|
|
1625
|
+
case "GGG":
|
|
1626
|
+
return a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
|
|
1627
|
+
// A, B
|
|
1628
|
+
case "GGGGG":
|
|
1629
|
+
return a.era(e, { width: "narrow" });
|
|
1630
|
+
// Anno Domini, Before Christ
|
|
1631
|
+
case "GGGG":
|
|
1632
|
+
default:
|
|
1633
|
+
return a.era(e, { width: "wide" }) || a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
set(e, r, a) {
|
|
1637
|
+
return r.era = a, e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
const G = {
|
|
1641
|
+
month: /^(1[0-2]|0?\d)/,
|
|
1642
|
+
// 0 to 12
|
|
1643
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
1644
|
+
// 0 to 31
|
|
1645
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
1646
|
+
// 0 to 366
|
|
1647
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
1648
|
+
// 0 to 53
|
|
1649
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
1650
|
+
// 0 to 23
|
|
1651
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
1652
|
+
// 0 to 24
|
|
1653
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
1654
|
+
// 0 to 11
|
|
1655
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
1656
|
+
// 0 to 12
|
|
1657
|
+
minute: /^[0-5]?\d/,
|
|
1658
|
+
// 0 to 59
|
|
1659
|
+
second: /^[0-5]?\d/,
|
|
1660
|
+
// 0 to 59
|
|
1661
|
+
singleDigit: /^\d/,
|
|
1662
|
+
// 0 to 9
|
|
1663
|
+
twoDigits: /^\d{1,2}/,
|
|
1664
|
+
// 0 to 99
|
|
1665
|
+
threeDigits: /^\d{1,3}/,
|
|
1666
|
+
// 0 to 999
|
|
1667
|
+
fourDigits: /^\d{1,4}/,
|
|
1668
|
+
// 0 to 9999
|
|
1669
|
+
anyDigitsSigned: /^-?\d+/,
|
|
1670
|
+
singleDigitSigned: /^-?\d/,
|
|
1671
|
+
// 0 to 9, -0 to -9
|
|
1672
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
1673
|
+
// 0 to 99, -0 to -99
|
|
1674
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
1675
|
+
// 0 to 999, -0 to -999
|
|
1676
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
1677
|
+
// 0 to 9999, -0 to -9999
|
|
1678
|
+
}, de = {
|
|
1679
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1680
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1681
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
1682
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
1683
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
1684
|
+
};
|
|
1685
|
+
function Q(t, n) {
|
|
1686
|
+
return t && {
|
|
1687
|
+
value: n(t.value),
|
|
1688
|
+
rest: t.rest
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
function A(t, n) {
|
|
1692
|
+
const e = n.match(t);
|
|
1693
|
+
return e ? {
|
|
1694
|
+
value: parseInt(e[0], 10),
|
|
1695
|
+
rest: n.slice(e[0].length)
|
|
1696
|
+
} : null;
|
|
1697
|
+
}
|
|
1698
|
+
function fe(t, n) {
|
|
1699
|
+
const e = n.match(t);
|
|
1700
|
+
if (!e)
|
|
1701
|
+
return null;
|
|
1702
|
+
if (e[0] === "Z")
|
|
1703
|
+
return {
|
|
1704
|
+
value: 0,
|
|
1705
|
+
rest: n.slice(1)
|
|
1706
|
+
};
|
|
1707
|
+
const r = e[1] === "+" ? 1 : -1, a = e[2] ? parseInt(e[2], 10) : 0, s = e[3] ? parseInt(e[3], 10) : 0, o = e[5] ? parseInt(e[5], 10) : 0;
|
|
1708
|
+
return {
|
|
1709
|
+
value: r * (a * ur + s * cr + o * lr),
|
|
1710
|
+
rest: n.slice(e[0].length)
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
function nn(t) {
|
|
1714
|
+
return A(G.anyDigitsSigned, t);
|
|
1715
|
+
}
|
|
1716
|
+
function R(t, n) {
|
|
1717
|
+
switch (t) {
|
|
1718
|
+
case 1:
|
|
1719
|
+
return A(G.singleDigit, n);
|
|
1720
|
+
case 2:
|
|
1721
|
+
return A(G.twoDigits, n);
|
|
1722
|
+
case 3:
|
|
1723
|
+
return A(G.threeDigits, n);
|
|
1724
|
+
case 4:
|
|
1725
|
+
return A(G.fourDigits, n);
|
|
1726
|
+
default:
|
|
1727
|
+
return A(new RegExp("^\\d{1," + t + "}"), n);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
function Xe(t, n) {
|
|
1731
|
+
switch (t) {
|
|
1732
|
+
case 1:
|
|
1733
|
+
return A(G.singleDigitSigned, n);
|
|
1734
|
+
case 2:
|
|
1735
|
+
return A(G.twoDigitsSigned, n);
|
|
1736
|
+
case 3:
|
|
1737
|
+
return A(G.threeDigitsSigned, n);
|
|
1738
|
+
case 4:
|
|
1739
|
+
return A(G.fourDigitsSigned, n);
|
|
1740
|
+
default:
|
|
1741
|
+
return A(new RegExp("^-?\\d{1," + t + "}"), n);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function wt(t) {
|
|
1745
|
+
switch (t) {
|
|
1746
|
+
case "morning":
|
|
1747
|
+
return 4;
|
|
1748
|
+
case "evening":
|
|
1749
|
+
return 17;
|
|
1750
|
+
case "pm":
|
|
1751
|
+
case "noon":
|
|
1752
|
+
case "afternoon":
|
|
1753
|
+
return 12;
|
|
1754
|
+
case "am":
|
|
1755
|
+
case "midnight":
|
|
1756
|
+
case "night":
|
|
1757
|
+
default:
|
|
1758
|
+
return 0;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function rn(t, n) {
|
|
1762
|
+
const e = n > 0, r = e ? n : 1 - n;
|
|
1763
|
+
let a;
|
|
1764
|
+
if (r <= 50)
|
|
1765
|
+
a = t || 100;
|
|
1766
|
+
else {
|
|
1767
|
+
const s = r + 50, o = Math.trunc(s / 100) * 100, i = t >= s % 100;
|
|
1768
|
+
a = t + o - (i ? 100 : 0);
|
|
1769
|
+
}
|
|
1770
|
+
return e ? a : 1 - a;
|
|
1771
|
+
}
|
|
1772
|
+
function an(t) {
|
|
1773
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
1774
|
+
}
|
|
1775
|
+
class Na extends E {
|
|
1776
|
+
constructor() {
|
|
1777
|
+
super(...arguments);
|
|
1778
|
+
g(this, "priority", 130);
|
|
1779
|
+
g(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
1780
|
+
}
|
|
1781
|
+
parse(e, r, a) {
|
|
1782
|
+
const s = (o) => ({
|
|
1783
|
+
year: o,
|
|
1784
|
+
isTwoDigitYear: r === "yy"
|
|
1785
|
+
});
|
|
1786
|
+
switch (r) {
|
|
1787
|
+
case "y":
|
|
1788
|
+
return Q(R(4, e), s);
|
|
1789
|
+
case "yo":
|
|
1790
|
+
return Q(
|
|
1791
|
+
a.ordinalNumber(e, {
|
|
1792
|
+
unit: "year"
|
|
1793
|
+
}),
|
|
1794
|
+
s
|
|
1795
|
+
);
|
|
1796
|
+
default:
|
|
1797
|
+
return Q(R(r.length, e), s);
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
validate(e, r) {
|
|
1801
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
1802
|
+
}
|
|
1803
|
+
set(e, r, a) {
|
|
1804
|
+
const s = e.getFullYear();
|
|
1805
|
+
if (a.isTwoDigitYear) {
|
|
1806
|
+
const i = rn(
|
|
1807
|
+
a.year,
|
|
1808
|
+
s
|
|
1809
|
+
);
|
|
1810
|
+
return e.setFullYear(i, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1811
|
+
}
|
|
1812
|
+
const o = !("era" in r) || r.era === 1 ? a.year : 1 - a.year;
|
|
1813
|
+
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
class Ya extends E {
|
|
1817
|
+
constructor() {
|
|
1818
|
+
super(...arguments);
|
|
1819
|
+
g(this, "priority", 130);
|
|
1820
|
+
g(this, "incompatibleTokens", [
|
|
1821
|
+
"y",
|
|
1822
|
+
"R",
|
|
1823
|
+
"u",
|
|
1824
|
+
"Q",
|
|
1825
|
+
"q",
|
|
1826
|
+
"M",
|
|
1827
|
+
"L",
|
|
1828
|
+
"I",
|
|
1829
|
+
"d",
|
|
1830
|
+
"D",
|
|
1831
|
+
"i",
|
|
1832
|
+
"t",
|
|
1833
|
+
"T"
|
|
1834
|
+
]);
|
|
1835
|
+
}
|
|
1836
|
+
parse(e, r, a) {
|
|
1837
|
+
const s = (o) => ({
|
|
1838
|
+
year: o,
|
|
1839
|
+
isTwoDigitYear: r === "YY"
|
|
1840
|
+
});
|
|
1841
|
+
switch (r) {
|
|
1842
|
+
case "Y":
|
|
1843
|
+
return Q(R(4, e), s);
|
|
1844
|
+
case "Yo":
|
|
1845
|
+
return Q(
|
|
1846
|
+
a.ordinalNumber(e, {
|
|
1847
|
+
unit: "year"
|
|
1848
|
+
}),
|
|
1849
|
+
s
|
|
1850
|
+
);
|
|
1851
|
+
default:
|
|
1852
|
+
return Q(R(r.length, e), s);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
validate(e, r) {
|
|
1856
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
1857
|
+
}
|
|
1858
|
+
set(e, r, a, s) {
|
|
1859
|
+
const o = yt(e, s);
|
|
1860
|
+
if (a.isTwoDigitYear) {
|
|
1861
|
+
const c = rn(
|
|
1862
|
+
a.year,
|
|
1863
|
+
o
|
|
1864
|
+
);
|
|
1865
|
+
return e.setFullYear(
|
|
1866
|
+
c,
|
|
1867
|
+
0,
|
|
1868
|
+
s.firstWeekContainsDate
|
|
1869
|
+
), e.setHours(0, 0, 0, 0), ge(e, s);
|
|
1870
|
+
}
|
|
1871
|
+
const i = !("era" in r) || r.era === 1 ? a.year : 1 - a.year;
|
|
1872
|
+
return e.setFullYear(i, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), ge(e, s);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
class Pa extends E {
|
|
1876
|
+
constructor() {
|
|
1877
|
+
super(...arguments);
|
|
1878
|
+
g(this, "priority", 130);
|
|
1879
|
+
g(this, "incompatibleTokens", [
|
|
1880
|
+
"G",
|
|
1881
|
+
"y",
|
|
1882
|
+
"Y",
|
|
1883
|
+
"u",
|
|
1884
|
+
"Q",
|
|
1885
|
+
"q",
|
|
1886
|
+
"M",
|
|
1887
|
+
"L",
|
|
1888
|
+
"w",
|
|
1889
|
+
"d",
|
|
1890
|
+
"D",
|
|
1891
|
+
"e",
|
|
1892
|
+
"c",
|
|
1893
|
+
"t",
|
|
1894
|
+
"T"
|
|
1895
|
+
]);
|
|
1896
|
+
}
|
|
1897
|
+
parse(e, r) {
|
|
1898
|
+
return Xe(r === "R" ? 4 : r.length, e);
|
|
1899
|
+
}
|
|
1900
|
+
set(e, r, a) {
|
|
1901
|
+
const s = B(e, 0);
|
|
1902
|
+
return s.setFullYear(a, 0, 4), s.setHours(0, 0, 0, 0), pe(s);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
class Ca extends E {
|
|
1906
|
+
constructor() {
|
|
1907
|
+
super(...arguments);
|
|
1908
|
+
g(this, "priority", 130);
|
|
1909
|
+
g(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
1910
|
+
}
|
|
1911
|
+
parse(e, r) {
|
|
1912
|
+
return Xe(r === "u" ? 4 : r.length, e);
|
|
1913
|
+
}
|
|
1914
|
+
set(e, r, a) {
|
|
1915
|
+
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
class _a extends E {
|
|
1919
|
+
constructor() {
|
|
1920
|
+
super(...arguments);
|
|
1921
|
+
g(this, "priority", 120);
|
|
1922
|
+
g(this, "incompatibleTokens", [
|
|
1923
|
+
"Y",
|
|
1924
|
+
"R",
|
|
1925
|
+
"q",
|
|
1926
|
+
"M",
|
|
1927
|
+
"L",
|
|
1928
|
+
"w",
|
|
1929
|
+
"I",
|
|
1930
|
+
"d",
|
|
1931
|
+
"D",
|
|
1932
|
+
"i",
|
|
1933
|
+
"e",
|
|
1934
|
+
"c",
|
|
1935
|
+
"t",
|
|
1936
|
+
"T"
|
|
1937
|
+
]);
|
|
1938
|
+
}
|
|
1939
|
+
parse(e, r, a) {
|
|
1940
|
+
switch (r) {
|
|
1941
|
+
// 1, 2, 3, 4
|
|
1942
|
+
case "Q":
|
|
1943
|
+
case "QQ":
|
|
1944
|
+
return R(r.length, e);
|
|
1945
|
+
// 1st, 2nd, 3rd, 4th
|
|
1946
|
+
case "Qo":
|
|
1947
|
+
return a.ordinalNumber(e, { unit: "quarter" });
|
|
1948
|
+
// Q1, Q2, Q3, Q4
|
|
1949
|
+
case "QQQ":
|
|
1950
|
+
return a.quarter(e, {
|
|
1951
|
+
width: "abbreviated",
|
|
1952
|
+
context: "formatting"
|
|
1953
|
+
}) || a.quarter(e, {
|
|
1954
|
+
width: "narrow",
|
|
1955
|
+
context: "formatting"
|
|
1956
|
+
});
|
|
1957
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1958
|
+
case "QQQQQ":
|
|
1959
|
+
return a.quarter(e, {
|
|
1960
|
+
width: "narrow",
|
|
1961
|
+
context: "formatting"
|
|
1962
|
+
});
|
|
1963
|
+
// 1st quarter, 2nd quarter, ...
|
|
1964
|
+
case "QQQQ":
|
|
1965
|
+
default:
|
|
1966
|
+
return a.quarter(e, {
|
|
1967
|
+
width: "wide",
|
|
1968
|
+
context: "formatting"
|
|
1969
|
+
}) || a.quarter(e, {
|
|
1970
|
+
width: "abbreviated",
|
|
1971
|
+
context: "formatting"
|
|
1972
|
+
}) || a.quarter(e, {
|
|
1973
|
+
width: "narrow",
|
|
1974
|
+
context: "formatting"
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
validate(e, r) {
|
|
1979
|
+
return r >= 1 && r <= 4;
|
|
1980
|
+
}
|
|
1981
|
+
set(e, r, a) {
|
|
1982
|
+
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
class Ea extends E {
|
|
1986
|
+
constructor() {
|
|
1987
|
+
super(...arguments);
|
|
1988
|
+
g(this, "priority", 120);
|
|
1989
|
+
g(this, "incompatibleTokens", [
|
|
1990
|
+
"Y",
|
|
1991
|
+
"R",
|
|
1992
|
+
"Q",
|
|
1993
|
+
"M",
|
|
1994
|
+
"L",
|
|
1995
|
+
"w",
|
|
1996
|
+
"I",
|
|
1997
|
+
"d",
|
|
1998
|
+
"D",
|
|
1999
|
+
"i",
|
|
2000
|
+
"e",
|
|
2001
|
+
"c",
|
|
2002
|
+
"t",
|
|
2003
|
+
"T"
|
|
2004
|
+
]);
|
|
2005
|
+
}
|
|
2006
|
+
parse(e, r, a) {
|
|
2007
|
+
switch (r) {
|
|
2008
|
+
// 1, 2, 3, 4
|
|
2009
|
+
case "q":
|
|
2010
|
+
case "qq":
|
|
2011
|
+
return R(r.length, e);
|
|
2012
|
+
// 1st, 2nd, 3rd, 4th
|
|
2013
|
+
case "qo":
|
|
2014
|
+
return a.ordinalNumber(e, { unit: "quarter" });
|
|
2015
|
+
// Q1, Q2, Q3, Q4
|
|
2016
|
+
case "qqq":
|
|
2017
|
+
return a.quarter(e, {
|
|
2018
|
+
width: "abbreviated",
|
|
2019
|
+
context: "standalone"
|
|
2020
|
+
}) || a.quarter(e, {
|
|
2021
|
+
width: "narrow",
|
|
2022
|
+
context: "standalone"
|
|
2023
|
+
});
|
|
2024
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2025
|
+
case "qqqqq":
|
|
2026
|
+
return a.quarter(e, {
|
|
2027
|
+
width: "narrow",
|
|
2028
|
+
context: "standalone"
|
|
2029
|
+
});
|
|
2030
|
+
// 1st quarter, 2nd quarter, ...
|
|
2031
|
+
case "qqqq":
|
|
2032
|
+
default:
|
|
2033
|
+
return a.quarter(e, {
|
|
2034
|
+
width: "wide",
|
|
2035
|
+
context: "standalone"
|
|
2036
|
+
}) || a.quarter(e, {
|
|
2037
|
+
width: "abbreviated",
|
|
2038
|
+
context: "standalone"
|
|
2039
|
+
}) || a.quarter(e, {
|
|
2040
|
+
width: "narrow",
|
|
2041
|
+
context: "standalone"
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
validate(e, r) {
|
|
2046
|
+
return r >= 1 && r <= 4;
|
|
2047
|
+
}
|
|
2048
|
+
set(e, r, a) {
|
|
2049
|
+
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
class Sa extends E {
|
|
2053
|
+
constructor() {
|
|
2054
|
+
super(...arguments);
|
|
2055
|
+
g(this, "incompatibleTokens", [
|
|
2056
|
+
"Y",
|
|
2057
|
+
"R",
|
|
2058
|
+
"q",
|
|
2059
|
+
"Q",
|
|
2060
|
+
"L",
|
|
2061
|
+
"w",
|
|
2062
|
+
"I",
|
|
2063
|
+
"D",
|
|
2064
|
+
"i",
|
|
2065
|
+
"e",
|
|
2066
|
+
"c",
|
|
2067
|
+
"t",
|
|
2068
|
+
"T"
|
|
2069
|
+
]);
|
|
2070
|
+
g(this, "priority", 110);
|
|
2071
|
+
}
|
|
2072
|
+
parse(e, r, a) {
|
|
2073
|
+
const s = (o) => o - 1;
|
|
2074
|
+
switch (r) {
|
|
2075
|
+
// 1, 2, ..., 12
|
|
2076
|
+
case "M":
|
|
2077
|
+
return Q(
|
|
2078
|
+
A(G.month, e),
|
|
2079
|
+
s
|
|
2080
|
+
);
|
|
2081
|
+
// 01, 02, ..., 12
|
|
2082
|
+
case "MM":
|
|
2083
|
+
return Q(R(2, e), s);
|
|
2084
|
+
// 1st, 2nd, ..., 12th
|
|
2085
|
+
case "Mo":
|
|
2086
|
+
return Q(
|
|
2087
|
+
a.ordinalNumber(e, {
|
|
2088
|
+
unit: "month"
|
|
2089
|
+
}),
|
|
2090
|
+
s
|
|
2091
|
+
);
|
|
2092
|
+
// Jan, Feb, ..., Dec
|
|
2093
|
+
case "MMM":
|
|
2094
|
+
return a.month(e, {
|
|
2095
|
+
width: "abbreviated",
|
|
2096
|
+
context: "formatting"
|
|
2097
|
+
}) || a.month(e, { width: "narrow", context: "formatting" });
|
|
2098
|
+
// J, F, ..., D
|
|
2099
|
+
case "MMMMM":
|
|
2100
|
+
return a.month(e, {
|
|
2101
|
+
width: "narrow",
|
|
2102
|
+
context: "formatting"
|
|
2103
|
+
});
|
|
2104
|
+
// January, February, ..., December
|
|
2105
|
+
case "MMMM":
|
|
2106
|
+
default:
|
|
2107
|
+
return a.month(e, { width: "wide", context: "formatting" }) || a.month(e, {
|
|
2108
|
+
width: "abbreviated",
|
|
2109
|
+
context: "formatting"
|
|
2110
|
+
}) || a.month(e, { width: "narrow", context: "formatting" });
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
validate(e, r) {
|
|
2114
|
+
return r >= 0 && r <= 11;
|
|
2115
|
+
}
|
|
2116
|
+
set(e, r, a) {
|
|
2117
|
+
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
class Ia extends E {
|
|
2121
|
+
constructor() {
|
|
2122
|
+
super(...arguments);
|
|
2123
|
+
g(this, "priority", 110);
|
|
2124
|
+
g(this, "incompatibleTokens", [
|
|
2125
|
+
"Y",
|
|
2126
|
+
"R",
|
|
2127
|
+
"q",
|
|
2128
|
+
"Q",
|
|
2129
|
+
"M",
|
|
2130
|
+
"w",
|
|
2131
|
+
"I",
|
|
2132
|
+
"D",
|
|
2133
|
+
"i",
|
|
2134
|
+
"e",
|
|
2135
|
+
"c",
|
|
2136
|
+
"t",
|
|
2137
|
+
"T"
|
|
2138
|
+
]);
|
|
2139
|
+
}
|
|
2140
|
+
parse(e, r, a) {
|
|
2141
|
+
const s = (o) => o - 1;
|
|
2142
|
+
switch (r) {
|
|
2143
|
+
// 1, 2, ..., 12
|
|
2144
|
+
case "L":
|
|
2145
|
+
return Q(
|
|
2146
|
+
A(G.month, e),
|
|
2147
|
+
s
|
|
2148
|
+
);
|
|
2149
|
+
// 01, 02, ..., 12
|
|
2150
|
+
case "LL":
|
|
2151
|
+
return Q(R(2, e), s);
|
|
2152
|
+
// 1st, 2nd, ..., 12th
|
|
2153
|
+
case "Lo":
|
|
2154
|
+
return Q(
|
|
2155
|
+
a.ordinalNumber(e, {
|
|
2156
|
+
unit: "month"
|
|
2157
|
+
}),
|
|
2158
|
+
s
|
|
2159
|
+
);
|
|
2160
|
+
// Jan, Feb, ..., Dec
|
|
2161
|
+
case "LLL":
|
|
2162
|
+
return a.month(e, {
|
|
2163
|
+
width: "abbreviated",
|
|
2164
|
+
context: "standalone"
|
|
2165
|
+
}) || a.month(e, { width: "narrow", context: "standalone" });
|
|
2166
|
+
// J, F, ..., D
|
|
2167
|
+
case "LLLLL":
|
|
2168
|
+
return a.month(e, {
|
|
2169
|
+
width: "narrow",
|
|
2170
|
+
context: "standalone"
|
|
2171
|
+
});
|
|
2172
|
+
// January, February, ..., December
|
|
2173
|
+
case "LLLL":
|
|
2174
|
+
default:
|
|
2175
|
+
return a.month(e, { width: "wide", context: "standalone" }) || a.month(e, {
|
|
2176
|
+
width: "abbreviated",
|
|
2177
|
+
context: "standalone"
|
|
2178
|
+
}) || a.month(e, { width: "narrow", context: "standalone" });
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
validate(e, r) {
|
|
2182
|
+
return r >= 0 && r <= 11;
|
|
2183
|
+
}
|
|
2184
|
+
set(e, r, a) {
|
|
2185
|
+
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function Fa(t, n, e) {
|
|
2189
|
+
const r = Y(t, e == null ? void 0 : e.in), a = Ke(r, e) - n;
|
|
2190
|
+
return r.setDate(r.getDate() - a * 7), Y(r, e == null ? void 0 : e.in);
|
|
2191
|
+
}
|
|
2192
|
+
class Ba extends E {
|
|
2193
|
+
constructor() {
|
|
2194
|
+
super(...arguments);
|
|
2195
|
+
g(this, "priority", 100);
|
|
2196
|
+
g(this, "incompatibleTokens", [
|
|
2197
|
+
"y",
|
|
2198
|
+
"R",
|
|
2199
|
+
"u",
|
|
2200
|
+
"q",
|
|
2201
|
+
"Q",
|
|
2202
|
+
"M",
|
|
2203
|
+
"L",
|
|
2204
|
+
"I",
|
|
2205
|
+
"d",
|
|
2206
|
+
"D",
|
|
2207
|
+
"i",
|
|
2208
|
+
"t",
|
|
2209
|
+
"T"
|
|
2210
|
+
]);
|
|
2211
|
+
}
|
|
2212
|
+
parse(e, r, a) {
|
|
2213
|
+
switch (r) {
|
|
2214
|
+
case "w":
|
|
2215
|
+
return A(G.week, e);
|
|
2216
|
+
case "wo":
|
|
2217
|
+
return a.ordinalNumber(e, { unit: "week" });
|
|
2218
|
+
default:
|
|
2219
|
+
return R(r.length, e);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
validate(e, r) {
|
|
2223
|
+
return r >= 1 && r <= 53;
|
|
2224
|
+
}
|
|
2225
|
+
set(e, r, a, s) {
|
|
2226
|
+
return ge(Fa(e, a, s), s);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
function Ha(t, n, e) {
|
|
2230
|
+
const r = Y(t, e == null ? void 0 : e.in), a = Ue(r, e) - n;
|
|
2231
|
+
return r.setDate(r.getDate() - a * 7), r;
|
|
2232
|
+
}
|
|
2233
|
+
class qa extends E {
|
|
2234
|
+
constructor() {
|
|
2235
|
+
super(...arguments);
|
|
2236
|
+
g(this, "priority", 100);
|
|
2237
|
+
g(this, "incompatibleTokens", [
|
|
2238
|
+
"y",
|
|
2239
|
+
"Y",
|
|
2240
|
+
"u",
|
|
2241
|
+
"q",
|
|
2242
|
+
"Q",
|
|
2243
|
+
"M",
|
|
2244
|
+
"L",
|
|
2245
|
+
"w",
|
|
2246
|
+
"d",
|
|
2247
|
+
"D",
|
|
2248
|
+
"e",
|
|
2249
|
+
"c",
|
|
2250
|
+
"t",
|
|
2251
|
+
"T"
|
|
2252
|
+
]);
|
|
2253
|
+
}
|
|
2254
|
+
parse(e, r, a) {
|
|
2255
|
+
switch (r) {
|
|
2256
|
+
case "I":
|
|
2257
|
+
return A(G.week, e);
|
|
2258
|
+
case "Io":
|
|
2259
|
+
return a.ordinalNumber(e, { unit: "week" });
|
|
2260
|
+
default:
|
|
2261
|
+
return R(r.length, e);
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
validate(e, r) {
|
|
2265
|
+
return r >= 1 && r <= 53;
|
|
2266
|
+
}
|
|
2267
|
+
set(e, r, a) {
|
|
2268
|
+
return pe(Ha(e, a));
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
const Aa = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ra = [
|
|
2272
|
+
31,
|
|
2273
|
+
29,
|
|
2274
|
+
31,
|
|
2275
|
+
30,
|
|
2276
|
+
31,
|
|
2277
|
+
30,
|
|
2278
|
+
31,
|
|
2279
|
+
31,
|
|
2280
|
+
30,
|
|
2281
|
+
31,
|
|
2282
|
+
30,
|
|
2283
|
+
31
|
|
2284
|
+
];
|
|
2285
|
+
class ja extends E {
|
|
2286
|
+
constructor() {
|
|
2287
|
+
super(...arguments);
|
|
2288
|
+
g(this, "priority", 90);
|
|
2289
|
+
g(this, "subPriority", 1);
|
|
2290
|
+
g(this, "incompatibleTokens", [
|
|
2291
|
+
"Y",
|
|
2292
|
+
"R",
|
|
2293
|
+
"q",
|
|
2294
|
+
"Q",
|
|
2295
|
+
"w",
|
|
2296
|
+
"I",
|
|
2297
|
+
"D",
|
|
2298
|
+
"i",
|
|
2299
|
+
"e",
|
|
2300
|
+
"c",
|
|
2301
|
+
"t",
|
|
2302
|
+
"T"
|
|
2303
|
+
]);
|
|
2304
|
+
}
|
|
2305
|
+
parse(e, r, a) {
|
|
2306
|
+
switch (r) {
|
|
2307
|
+
case "d":
|
|
2308
|
+
return A(G.date, e);
|
|
2309
|
+
case "do":
|
|
2310
|
+
return a.ordinalNumber(e, { unit: "date" });
|
|
2311
|
+
default:
|
|
2312
|
+
return R(r.length, e);
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
validate(e, r) {
|
|
2316
|
+
const a = e.getFullYear(), s = an(a), o = e.getMonth();
|
|
2317
|
+
return s ? r >= 1 && r <= Ra[o] : r >= 1 && r <= Aa[o];
|
|
2318
|
+
}
|
|
2319
|
+
set(e, r, a) {
|
|
2320
|
+
return e.setDate(a), e.setHours(0, 0, 0, 0), e;
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
class Ga extends E {
|
|
2324
|
+
constructor() {
|
|
2325
|
+
super(...arguments);
|
|
2326
|
+
g(this, "priority", 90);
|
|
2327
|
+
g(this, "subpriority", 1);
|
|
2328
|
+
g(this, "incompatibleTokens", [
|
|
2329
|
+
"Y",
|
|
2330
|
+
"R",
|
|
2331
|
+
"q",
|
|
2332
|
+
"Q",
|
|
2333
|
+
"M",
|
|
2334
|
+
"L",
|
|
2335
|
+
"w",
|
|
2336
|
+
"I",
|
|
2337
|
+
"d",
|
|
2338
|
+
"E",
|
|
2339
|
+
"i",
|
|
2340
|
+
"e",
|
|
2341
|
+
"c",
|
|
2342
|
+
"t",
|
|
2343
|
+
"T"
|
|
2344
|
+
]);
|
|
2345
|
+
}
|
|
2346
|
+
parse(e, r, a) {
|
|
2347
|
+
switch (r) {
|
|
2348
|
+
case "D":
|
|
2349
|
+
case "DD":
|
|
2350
|
+
return A(G.dayOfYear, e);
|
|
2351
|
+
case "Do":
|
|
2352
|
+
return a.ordinalNumber(e, { unit: "date" });
|
|
2353
|
+
default:
|
|
2354
|
+
return R(r.length, e);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
validate(e, r) {
|
|
2358
|
+
const a = e.getFullYear();
|
|
2359
|
+
return an(a) ? r >= 1 && r <= 366 : r >= 1 && r <= 365;
|
|
2360
|
+
}
|
|
2361
|
+
set(e, r, a) {
|
|
2362
|
+
return e.setMonth(0, a), e.setHours(0, 0, 0, 0), e;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function bt(t, n, e) {
|
|
2366
|
+
var f, h, b, v;
|
|
2367
|
+
const r = Te(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((h = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : h.weekStartsOn) ?? r.weekStartsOn ?? ((v = (b = r.locale) == null ? void 0 : b.options) == null ? void 0 : v.weekStartsOn) ?? 0, s = Y(t, e == null ? void 0 : e.in), o = s.getDay(), c = (n % 7 + 7) % 7, u = 7 - a, l = n < 0 || n > 6 ? n - (o + u) % 7 : (c + u) % 7 - (o + u) % 7;
|
|
2368
|
+
return Ve(s, l, e);
|
|
2369
|
+
}
|
|
2370
|
+
class Qa extends E {
|
|
2371
|
+
constructor() {
|
|
2372
|
+
super(...arguments);
|
|
2373
|
+
g(this, "priority", 90);
|
|
2374
|
+
g(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
2375
|
+
}
|
|
2376
|
+
parse(e, r, a) {
|
|
2377
|
+
switch (r) {
|
|
2378
|
+
// Tue
|
|
2379
|
+
case "E":
|
|
2380
|
+
case "EE":
|
|
2381
|
+
case "EEE":
|
|
2382
|
+
return a.day(e, {
|
|
2383
|
+
width: "abbreviated",
|
|
2384
|
+
context: "formatting"
|
|
2385
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2386
|
+
// T
|
|
2387
|
+
case "EEEEE":
|
|
2388
|
+
return a.day(e, {
|
|
2389
|
+
width: "narrow",
|
|
2390
|
+
context: "formatting"
|
|
2391
|
+
});
|
|
2392
|
+
// Tu
|
|
2393
|
+
case "EEEEEE":
|
|
2394
|
+
return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2395
|
+
// Tuesday
|
|
2396
|
+
case "EEEE":
|
|
2397
|
+
default:
|
|
2398
|
+
return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
|
|
2399
|
+
width: "abbreviated",
|
|
2400
|
+
context: "formatting"
|
|
2401
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
validate(e, r) {
|
|
2405
|
+
return r >= 0 && r <= 6;
|
|
2406
|
+
}
|
|
2407
|
+
set(e, r, a, s) {
|
|
2408
|
+
return e = bt(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
class $a extends E {
|
|
2412
|
+
constructor() {
|
|
2413
|
+
super(...arguments);
|
|
2414
|
+
g(this, "priority", 90);
|
|
2415
|
+
g(this, "incompatibleTokens", [
|
|
2416
|
+
"y",
|
|
2417
|
+
"R",
|
|
2418
|
+
"u",
|
|
2419
|
+
"q",
|
|
2420
|
+
"Q",
|
|
2421
|
+
"M",
|
|
2422
|
+
"L",
|
|
2423
|
+
"I",
|
|
2424
|
+
"d",
|
|
2425
|
+
"D",
|
|
2426
|
+
"E",
|
|
2427
|
+
"i",
|
|
2428
|
+
"c",
|
|
2429
|
+
"t",
|
|
2430
|
+
"T"
|
|
2431
|
+
]);
|
|
2432
|
+
}
|
|
2433
|
+
parse(e, r, a, s) {
|
|
2434
|
+
const o = (i) => {
|
|
2435
|
+
const c = Math.floor((i - 1) / 7) * 7;
|
|
2436
|
+
return (i + s.weekStartsOn + 6) % 7 + c;
|
|
2437
|
+
};
|
|
2438
|
+
switch (r) {
|
|
2439
|
+
// 3
|
|
2440
|
+
case "e":
|
|
2441
|
+
case "ee":
|
|
2442
|
+
return Q(R(r.length, e), o);
|
|
2443
|
+
// 3rd
|
|
2444
|
+
case "eo":
|
|
2445
|
+
return Q(
|
|
2446
|
+
a.ordinalNumber(e, {
|
|
2447
|
+
unit: "day"
|
|
2448
|
+
}),
|
|
2449
|
+
o
|
|
2450
|
+
);
|
|
2451
|
+
// Tue
|
|
2452
|
+
case "eee":
|
|
2453
|
+
return a.day(e, {
|
|
2454
|
+
width: "abbreviated",
|
|
2455
|
+
context: "formatting"
|
|
2456
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2457
|
+
// T
|
|
2458
|
+
case "eeeee":
|
|
2459
|
+
return a.day(e, {
|
|
2460
|
+
width: "narrow",
|
|
2461
|
+
context: "formatting"
|
|
2462
|
+
});
|
|
2463
|
+
// Tu
|
|
2464
|
+
case "eeeeee":
|
|
2465
|
+
return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2466
|
+
// Tuesday
|
|
2467
|
+
case "eeee":
|
|
2468
|
+
default:
|
|
2469
|
+
return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
|
|
2470
|
+
width: "abbreviated",
|
|
2471
|
+
context: "formatting"
|
|
2472
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
validate(e, r) {
|
|
2476
|
+
return r >= 0 && r <= 6;
|
|
2477
|
+
}
|
|
2478
|
+
set(e, r, a, s) {
|
|
2479
|
+
return e = bt(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
class za extends E {
|
|
2483
|
+
constructor() {
|
|
2484
|
+
super(...arguments);
|
|
2485
|
+
g(this, "priority", 90);
|
|
2486
|
+
g(this, "incompatibleTokens", [
|
|
2487
|
+
"y",
|
|
2488
|
+
"R",
|
|
2489
|
+
"u",
|
|
2490
|
+
"q",
|
|
2491
|
+
"Q",
|
|
2492
|
+
"M",
|
|
2493
|
+
"L",
|
|
2494
|
+
"I",
|
|
2495
|
+
"d",
|
|
2496
|
+
"D",
|
|
2497
|
+
"E",
|
|
2498
|
+
"i",
|
|
2499
|
+
"e",
|
|
2500
|
+
"t",
|
|
2501
|
+
"T"
|
|
2502
|
+
]);
|
|
2503
|
+
}
|
|
2504
|
+
parse(e, r, a, s) {
|
|
2505
|
+
const o = (i) => {
|
|
2506
|
+
const c = Math.floor((i - 1) / 7) * 7;
|
|
2507
|
+
return (i + s.weekStartsOn + 6) % 7 + c;
|
|
2508
|
+
};
|
|
2509
|
+
switch (r) {
|
|
2510
|
+
// 3
|
|
2511
|
+
case "c":
|
|
2512
|
+
case "cc":
|
|
2513
|
+
return Q(R(r.length, e), o);
|
|
2514
|
+
// 3rd
|
|
2515
|
+
case "co":
|
|
2516
|
+
return Q(
|
|
2517
|
+
a.ordinalNumber(e, {
|
|
2518
|
+
unit: "day"
|
|
2519
|
+
}),
|
|
2520
|
+
o
|
|
2521
|
+
);
|
|
2522
|
+
// Tue
|
|
2523
|
+
case "ccc":
|
|
2524
|
+
return a.day(e, {
|
|
2525
|
+
width: "abbreviated",
|
|
2526
|
+
context: "standalone"
|
|
2527
|
+
}) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
2528
|
+
// T
|
|
2529
|
+
case "ccccc":
|
|
2530
|
+
return a.day(e, {
|
|
2531
|
+
width: "narrow",
|
|
2532
|
+
context: "standalone"
|
|
2533
|
+
});
|
|
2534
|
+
// Tu
|
|
2535
|
+
case "cccccc":
|
|
2536
|
+
return a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
2537
|
+
// Tuesday
|
|
2538
|
+
case "cccc":
|
|
2539
|
+
default:
|
|
2540
|
+
return a.day(e, { width: "wide", context: "standalone" }) || a.day(e, {
|
|
2541
|
+
width: "abbreviated",
|
|
2542
|
+
context: "standalone"
|
|
2543
|
+
}) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
validate(e, r) {
|
|
2547
|
+
return r >= 0 && r <= 6;
|
|
2548
|
+
}
|
|
2549
|
+
set(e, r, a, s) {
|
|
2550
|
+
return e = bt(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
function Xa(t, n, e) {
|
|
2554
|
+
const r = Y(t, e == null ? void 0 : e.in), a = ba(r, e), s = n - a;
|
|
2555
|
+
return Ve(r, s, e);
|
|
2556
|
+
}
|
|
2557
|
+
class Va extends E {
|
|
2558
|
+
constructor() {
|
|
2559
|
+
super(...arguments);
|
|
2560
|
+
g(this, "priority", 90);
|
|
2561
|
+
g(this, "incompatibleTokens", [
|
|
2562
|
+
"y",
|
|
2563
|
+
"Y",
|
|
2564
|
+
"u",
|
|
2565
|
+
"q",
|
|
2566
|
+
"Q",
|
|
2567
|
+
"M",
|
|
2568
|
+
"L",
|
|
2569
|
+
"w",
|
|
2570
|
+
"d",
|
|
2571
|
+
"D",
|
|
2572
|
+
"E",
|
|
2573
|
+
"e",
|
|
2574
|
+
"c",
|
|
2575
|
+
"t",
|
|
2576
|
+
"T"
|
|
2577
|
+
]);
|
|
2578
|
+
}
|
|
2579
|
+
parse(e, r, a) {
|
|
2580
|
+
const s = (o) => o === 0 ? 7 : o;
|
|
2581
|
+
switch (r) {
|
|
2582
|
+
// 2
|
|
2583
|
+
case "i":
|
|
2584
|
+
case "ii":
|
|
2585
|
+
return R(r.length, e);
|
|
2586
|
+
// 2nd
|
|
2587
|
+
case "io":
|
|
2588
|
+
return a.ordinalNumber(e, { unit: "day" });
|
|
2589
|
+
// Tue
|
|
2590
|
+
case "iii":
|
|
2591
|
+
return Q(
|
|
2592
|
+
a.day(e, {
|
|
2593
|
+
width: "abbreviated",
|
|
2594
|
+
context: "formatting"
|
|
2595
|
+
}) || a.day(e, {
|
|
2596
|
+
width: "short",
|
|
2597
|
+
context: "formatting"
|
|
2598
|
+
}) || a.day(e, {
|
|
2599
|
+
width: "narrow",
|
|
2600
|
+
context: "formatting"
|
|
2601
|
+
}),
|
|
2602
|
+
s
|
|
2603
|
+
);
|
|
2604
|
+
// T
|
|
2605
|
+
case "iiiii":
|
|
2606
|
+
return Q(
|
|
2607
|
+
a.day(e, {
|
|
2608
|
+
width: "narrow",
|
|
2609
|
+
context: "formatting"
|
|
2610
|
+
}),
|
|
2611
|
+
s
|
|
2612
|
+
);
|
|
2613
|
+
// Tu
|
|
2614
|
+
case "iiiiii":
|
|
2615
|
+
return Q(
|
|
2616
|
+
a.day(e, {
|
|
2617
|
+
width: "short",
|
|
2618
|
+
context: "formatting"
|
|
2619
|
+
}) || a.day(e, {
|
|
2620
|
+
width: "narrow",
|
|
2621
|
+
context: "formatting"
|
|
2622
|
+
}),
|
|
2623
|
+
s
|
|
2624
|
+
);
|
|
2625
|
+
// Tuesday
|
|
2626
|
+
case "iiii":
|
|
2627
|
+
default:
|
|
2628
|
+
return Q(
|
|
2629
|
+
a.day(e, {
|
|
2630
|
+
width: "wide",
|
|
2631
|
+
context: "formatting"
|
|
2632
|
+
}) || a.day(e, {
|
|
2633
|
+
width: "abbreviated",
|
|
2634
|
+
context: "formatting"
|
|
2635
|
+
}) || a.day(e, {
|
|
2636
|
+
width: "short",
|
|
2637
|
+
context: "formatting"
|
|
2638
|
+
}) || a.day(e, {
|
|
2639
|
+
width: "narrow",
|
|
2640
|
+
context: "formatting"
|
|
2641
|
+
}),
|
|
2642
|
+
s
|
|
2643
|
+
);
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
validate(e, r) {
|
|
2647
|
+
return r >= 1 && r <= 7;
|
|
2648
|
+
}
|
|
2649
|
+
set(e, r, a) {
|
|
2650
|
+
return e = Xa(e, a), e.setHours(0, 0, 0, 0), e;
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
class Ua extends E {
|
|
2654
|
+
constructor() {
|
|
2655
|
+
super(...arguments);
|
|
2656
|
+
g(this, "priority", 80);
|
|
2657
|
+
g(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
2658
|
+
}
|
|
2659
|
+
parse(e, r, a) {
|
|
2660
|
+
switch (r) {
|
|
2661
|
+
case "a":
|
|
2662
|
+
case "aa":
|
|
2663
|
+
case "aaa":
|
|
2664
|
+
return a.dayPeriod(e, {
|
|
2665
|
+
width: "abbreviated",
|
|
2666
|
+
context: "formatting"
|
|
2667
|
+
}) || a.dayPeriod(e, {
|
|
2668
|
+
width: "narrow",
|
|
2669
|
+
context: "formatting"
|
|
2670
|
+
});
|
|
2671
|
+
case "aaaaa":
|
|
2672
|
+
return a.dayPeriod(e, {
|
|
2673
|
+
width: "narrow",
|
|
2674
|
+
context: "formatting"
|
|
2675
|
+
});
|
|
2676
|
+
case "aaaa":
|
|
2677
|
+
default:
|
|
2678
|
+
return a.dayPeriod(e, {
|
|
2679
|
+
width: "wide",
|
|
2680
|
+
context: "formatting"
|
|
2681
|
+
}) || a.dayPeriod(e, {
|
|
2682
|
+
width: "abbreviated",
|
|
2683
|
+
context: "formatting"
|
|
2684
|
+
}) || a.dayPeriod(e, {
|
|
2685
|
+
width: "narrow",
|
|
2686
|
+
context: "formatting"
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
set(e, r, a) {
|
|
2691
|
+
return e.setHours(wt(a), 0, 0, 0), e;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
class Ka extends E {
|
|
2695
|
+
constructor() {
|
|
2696
|
+
super(...arguments);
|
|
2697
|
+
g(this, "priority", 80);
|
|
2698
|
+
g(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
2699
|
+
}
|
|
2700
|
+
parse(e, r, a) {
|
|
2701
|
+
switch (r) {
|
|
2702
|
+
case "b":
|
|
2703
|
+
case "bb":
|
|
2704
|
+
case "bbb":
|
|
2705
|
+
return a.dayPeriod(e, {
|
|
2706
|
+
width: "abbreviated",
|
|
2707
|
+
context: "formatting"
|
|
2708
|
+
}) || a.dayPeriod(e, {
|
|
2709
|
+
width: "narrow",
|
|
2710
|
+
context: "formatting"
|
|
2711
|
+
});
|
|
2712
|
+
case "bbbbb":
|
|
2713
|
+
return a.dayPeriod(e, {
|
|
2714
|
+
width: "narrow",
|
|
2715
|
+
context: "formatting"
|
|
2716
|
+
});
|
|
2717
|
+
case "bbbb":
|
|
2718
|
+
default:
|
|
2719
|
+
return a.dayPeriod(e, {
|
|
2720
|
+
width: "wide",
|
|
2721
|
+
context: "formatting"
|
|
2722
|
+
}) || a.dayPeriod(e, {
|
|
2723
|
+
width: "abbreviated",
|
|
2724
|
+
context: "formatting"
|
|
2725
|
+
}) || a.dayPeriod(e, {
|
|
2726
|
+
width: "narrow",
|
|
2727
|
+
context: "formatting"
|
|
2728
|
+
});
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
set(e, r, a) {
|
|
2732
|
+
return e.setHours(wt(a), 0, 0, 0), e;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
class Za extends E {
|
|
2736
|
+
constructor() {
|
|
2737
|
+
super(...arguments);
|
|
2738
|
+
g(this, "priority", 80);
|
|
2739
|
+
g(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
2740
|
+
}
|
|
2741
|
+
parse(e, r, a) {
|
|
2742
|
+
switch (r) {
|
|
2743
|
+
case "B":
|
|
2744
|
+
case "BB":
|
|
2745
|
+
case "BBB":
|
|
2746
|
+
return a.dayPeriod(e, {
|
|
2747
|
+
width: "abbreviated",
|
|
2748
|
+
context: "formatting"
|
|
2749
|
+
}) || a.dayPeriod(e, {
|
|
2750
|
+
width: "narrow",
|
|
2751
|
+
context: "formatting"
|
|
2752
|
+
});
|
|
2753
|
+
case "BBBBB":
|
|
2754
|
+
return a.dayPeriod(e, {
|
|
2755
|
+
width: "narrow",
|
|
2756
|
+
context: "formatting"
|
|
2757
|
+
});
|
|
2758
|
+
case "BBBB":
|
|
2759
|
+
default:
|
|
2760
|
+
return a.dayPeriod(e, {
|
|
2761
|
+
width: "wide",
|
|
2762
|
+
context: "formatting"
|
|
2763
|
+
}) || a.dayPeriod(e, {
|
|
2764
|
+
width: "abbreviated",
|
|
2765
|
+
context: "formatting"
|
|
2766
|
+
}) || a.dayPeriod(e, {
|
|
2767
|
+
width: "narrow",
|
|
2768
|
+
context: "formatting"
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
set(e, r, a) {
|
|
2773
|
+
return e.setHours(wt(a), 0, 0, 0), e;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
class Ja extends E {
|
|
2777
|
+
constructor() {
|
|
2778
|
+
super(...arguments);
|
|
2779
|
+
g(this, "priority", 70);
|
|
2780
|
+
g(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
2781
|
+
}
|
|
2782
|
+
parse(e, r, a) {
|
|
2783
|
+
switch (r) {
|
|
2784
|
+
case "h":
|
|
2785
|
+
return A(G.hour12h, e);
|
|
2786
|
+
case "ho":
|
|
2787
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
2788
|
+
default:
|
|
2789
|
+
return R(r.length, e);
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
validate(e, r) {
|
|
2793
|
+
return r >= 1 && r <= 12;
|
|
2794
|
+
}
|
|
2795
|
+
set(e, r, a) {
|
|
2796
|
+
const s = e.getHours() >= 12;
|
|
2797
|
+
return s && a < 12 ? e.setHours(a + 12, 0, 0, 0) : !s && a === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
class La extends E {
|
|
2801
|
+
constructor() {
|
|
2802
|
+
super(...arguments);
|
|
2803
|
+
g(this, "priority", 70);
|
|
2804
|
+
g(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
2805
|
+
}
|
|
2806
|
+
parse(e, r, a) {
|
|
2807
|
+
switch (r) {
|
|
2808
|
+
case "H":
|
|
2809
|
+
return A(G.hour23h, e);
|
|
2810
|
+
case "Ho":
|
|
2811
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
2812
|
+
default:
|
|
2813
|
+
return R(r.length, e);
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
validate(e, r) {
|
|
2817
|
+
return r >= 0 && r <= 23;
|
|
2818
|
+
}
|
|
2819
|
+
set(e, r, a) {
|
|
2820
|
+
return e.setHours(a, 0, 0, 0), e;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
class es extends E {
|
|
2824
|
+
constructor() {
|
|
2825
|
+
super(...arguments);
|
|
2826
|
+
g(this, "priority", 70);
|
|
2827
|
+
g(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
2828
|
+
}
|
|
2829
|
+
parse(e, r, a) {
|
|
2830
|
+
switch (r) {
|
|
2831
|
+
case "K":
|
|
2832
|
+
return A(G.hour11h, e);
|
|
2833
|
+
case "Ko":
|
|
2834
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
2835
|
+
default:
|
|
2836
|
+
return R(r.length, e);
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
validate(e, r) {
|
|
2840
|
+
return r >= 0 && r <= 11;
|
|
2841
|
+
}
|
|
2842
|
+
set(e, r, a) {
|
|
2843
|
+
return e.getHours() >= 12 && a < 12 ? e.setHours(a + 12, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
class ts extends E {
|
|
2847
|
+
constructor() {
|
|
2848
|
+
super(...arguments);
|
|
2849
|
+
g(this, "priority", 70);
|
|
2850
|
+
g(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
2851
|
+
}
|
|
2852
|
+
parse(e, r, a) {
|
|
2853
|
+
switch (r) {
|
|
2854
|
+
case "k":
|
|
2855
|
+
return A(G.hour24h, e);
|
|
2856
|
+
case "ko":
|
|
2857
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
2858
|
+
default:
|
|
2859
|
+
return R(r.length, e);
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
validate(e, r) {
|
|
2863
|
+
return r >= 1 && r <= 24;
|
|
2864
|
+
}
|
|
2865
|
+
set(e, r, a) {
|
|
2866
|
+
const s = a <= 24 ? a % 24 : a;
|
|
2867
|
+
return e.setHours(s, 0, 0, 0), e;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
class ns extends E {
|
|
2871
|
+
constructor() {
|
|
2872
|
+
super(...arguments);
|
|
2873
|
+
g(this, "priority", 60);
|
|
2874
|
+
g(this, "incompatibleTokens", ["t", "T"]);
|
|
2875
|
+
}
|
|
2876
|
+
parse(e, r, a) {
|
|
2877
|
+
switch (r) {
|
|
2878
|
+
case "m":
|
|
2879
|
+
return A(G.minute, e);
|
|
2880
|
+
case "mo":
|
|
2881
|
+
return a.ordinalNumber(e, { unit: "minute" });
|
|
2882
|
+
default:
|
|
2883
|
+
return R(r.length, e);
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
validate(e, r) {
|
|
2887
|
+
return r >= 0 && r <= 59;
|
|
2888
|
+
}
|
|
2889
|
+
set(e, r, a) {
|
|
2890
|
+
return e.setMinutes(a, 0, 0), e;
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
class rs extends E {
|
|
2894
|
+
constructor() {
|
|
2895
|
+
super(...arguments);
|
|
2896
|
+
g(this, "priority", 50);
|
|
2897
|
+
g(this, "incompatibleTokens", ["t", "T"]);
|
|
2898
|
+
}
|
|
2899
|
+
parse(e, r, a) {
|
|
2900
|
+
switch (r) {
|
|
2901
|
+
case "s":
|
|
2902
|
+
return A(G.second, e);
|
|
2903
|
+
case "so":
|
|
2904
|
+
return a.ordinalNumber(e, { unit: "second" });
|
|
2905
|
+
default:
|
|
2906
|
+
return R(r.length, e);
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
validate(e, r) {
|
|
2910
|
+
return r >= 0 && r <= 59;
|
|
2911
|
+
}
|
|
2912
|
+
set(e, r, a) {
|
|
2913
|
+
return e.setSeconds(a, 0), e;
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
class as extends E {
|
|
2917
|
+
constructor() {
|
|
2918
|
+
super(...arguments);
|
|
2919
|
+
g(this, "priority", 30);
|
|
2920
|
+
g(this, "incompatibleTokens", ["t", "T"]);
|
|
2921
|
+
}
|
|
2922
|
+
parse(e, r) {
|
|
2923
|
+
const a = (s) => Math.trunc(s * Math.pow(10, -r.length + 3));
|
|
2924
|
+
return Q(R(r.length, e), a);
|
|
2925
|
+
}
|
|
2926
|
+
set(e, r, a) {
|
|
2927
|
+
return e.setMilliseconds(a), e;
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
class ss extends E {
|
|
2931
|
+
constructor() {
|
|
2932
|
+
super(...arguments);
|
|
2933
|
+
g(this, "priority", 10);
|
|
2934
|
+
g(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
2935
|
+
}
|
|
2936
|
+
parse(e, r) {
|
|
2937
|
+
switch (r) {
|
|
2938
|
+
case "X":
|
|
2939
|
+
return fe(
|
|
2940
|
+
de.basicOptionalMinutes,
|
|
2941
|
+
e
|
|
2942
|
+
);
|
|
2943
|
+
case "XX":
|
|
2944
|
+
return fe(de.basic, e);
|
|
2945
|
+
case "XXXX":
|
|
2946
|
+
return fe(
|
|
2947
|
+
de.basicOptionalSeconds,
|
|
2948
|
+
e
|
|
2949
|
+
);
|
|
2950
|
+
case "XXXXX":
|
|
2951
|
+
return fe(
|
|
2952
|
+
de.extendedOptionalSeconds,
|
|
2953
|
+
e
|
|
2954
|
+
);
|
|
2955
|
+
case "XXX":
|
|
2956
|
+
default:
|
|
2957
|
+
return fe(de.extended, e);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
set(e, r, a) {
|
|
2961
|
+
return r.timestampIsSet ? e : B(
|
|
2962
|
+
e,
|
|
2963
|
+
e.getTime() - ze(e) - a
|
|
2964
|
+
);
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
class os extends E {
|
|
2968
|
+
constructor() {
|
|
2969
|
+
super(...arguments);
|
|
2970
|
+
g(this, "priority", 10);
|
|
2971
|
+
g(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
2972
|
+
}
|
|
2973
|
+
parse(e, r) {
|
|
2974
|
+
switch (r) {
|
|
2975
|
+
case "x":
|
|
2976
|
+
return fe(
|
|
2977
|
+
de.basicOptionalMinutes,
|
|
2978
|
+
e
|
|
2979
|
+
);
|
|
2980
|
+
case "xx":
|
|
2981
|
+
return fe(de.basic, e);
|
|
2982
|
+
case "xxxx":
|
|
2983
|
+
return fe(
|
|
2984
|
+
de.basicOptionalSeconds,
|
|
2985
|
+
e
|
|
2986
|
+
);
|
|
2987
|
+
case "xxxxx":
|
|
2988
|
+
return fe(
|
|
2989
|
+
de.extendedOptionalSeconds,
|
|
2990
|
+
e
|
|
2991
|
+
);
|
|
2992
|
+
case "xxx":
|
|
2993
|
+
default:
|
|
2994
|
+
return fe(de.extended, e);
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
set(e, r, a) {
|
|
2998
|
+
return r.timestampIsSet ? e : B(
|
|
2999
|
+
e,
|
|
3000
|
+
e.getTime() - ze(e) - a
|
|
3001
|
+
);
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
class is extends E {
|
|
3005
|
+
constructor() {
|
|
3006
|
+
super(...arguments);
|
|
3007
|
+
g(this, "priority", 40);
|
|
3008
|
+
g(this, "incompatibleTokens", "*");
|
|
3009
|
+
}
|
|
3010
|
+
parse(e) {
|
|
3011
|
+
return nn(e);
|
|
3012
|
+
}
|
|
3013
|
+
set(e, r, a) {
|
|
3014
|
+
return [B(e, a * 1e3), { timestampIsSet: !0 }];
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
class cs extends E {
|
|
3018
|
+
constructor() {
|
|
3019
|
+
super(...arguments);
|
|
3020
|
+
g(this, "priority", 20);
|
|
3021
|
+
g(this, "incompatibleTokens", "*");
|
|
3022
|
+
}
|
|
3023
|
+
parse(e) {
|
|
3024
|
+
return nn(e);
|
|
3025
|
+
}
|
|
3026
|
+
set(e, r, a) {
|
|
3027
|
+
return [B(e, a), { timestampIsSet: !0 }];
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
const us = {
|
|
3031
|
+
G: new Ta(),
|
|
3032
|
+
y: new Na(),
|
|
3033
|
+
Y: new Ya(),
|
|
3034
|
+
R: new Pa(),
|
|
3035
|
+
u: new Ca(),
|
|
3036
|
+
Q: new _a(),
|
|
3037
|
+
q: new Ea(),
|
|
3038
|
+
M: new Sa(),
|
|
3039
|
+
L: new Ia(),
|
|
3040
|
+
w: new Ba(),
|
|
3041
|
+
I: new qa(),
|
|
3042
|
+
d: new ja(),
|
|
3043
|
+
D: new Ga(),
|
|
3044
|
+
E: new Qa(),
|
|
3045
|
+
e: new $a(),
|
|
3046
|
+
c: new za(),
|
|
3047
|
+
i: new Va(),
|
|
3048
|
+
a: new Ua(),
|
|
3049
|
+
b: new Ka(),
|
|
3050
|
+
B: new Za(),
|
|
3051
|
+
h: new Ja(),
|
|
3052
|
+
H: new La(),
|
|
3053
|
+
K: new es(),
|
|
3054
|
+
k: new ts(),
|
|
3055
|
+
m: new ns(),
|
|
3056
|
+
s: new rs(),
|
|
3057
|
+
S: new as(),
|
|
3058
|
+
X: new ss(),
|
|
3059
|
+
x: new os(),
|
|
3060
|
+
t: new is(),
|
|
3061
|
+
T: new cs()
|
|
3062
|
+
}, ls = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ds = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, fs = /^'([^]*?)'?$/, hs = /''/g, ms = /\S/, ys = /[a-zA-Z]/;
|
|
3063
|
+
function Ft(t, n, e, r) {
|
|
3064
|
+
var O, k, D, M;
|
|
3065
|
+
const a = () => B(e, NaN), s = wa(), o = s.locale ?? ve, i = s.firstWeekContainsDate ?? ((k = (O = s.locale) == null ? void 0 : O.options) == null ? void 0 : k.firstWeekContainsDate) ?? 1, c = s.weekStartsOn ?? ((M = (D = s.locale) == null ? void 0 : D.options) == null ? void 0 : M.weekStartsOn) ?? 0;
|
|
3066
|
+
if (!n)
|
|
3067
|
+
return t ? a() : Y(e, r == null ? void 0 : r.in);
|
|
3068
|
+
const u = {
|
|
3069
|
+
firstWeekContainsDate: i,
|
|
3070
|
+
weekStartsOn: c,
|
|
3071
|
+
locale: o
|
|
3072
|
+
}, l = [new Wa(r == null ? void 0 : r.in, e)], f = n.match(ds).map((y) => {
|
|
3073
|
+
const m = y[0];
|
|
3074
|
+
if (m in ft) {
|
|
3075
|
+
const d = ft[m];
|
|
3076
|
+
return d(y, o.formatLong);
|
|
3077
|
+
}
|
|
3078
|
+
return y;
|
|
3079
|
+
}).join("").match(ls), h = [];
|
|
3080
|
+
for (let y of f) {
|
|
3081
|
+
en(y) && ht(y, n, t), Lt(y) && ht(y, n, t);
|
|
3082
|
+
const m = y[0], d = us[m];
|
|
3083
|
+
if (d) {
|
|
3084
|
+
const { incompatibleTokens: T } = d;
|
|
3085
|
+
if (Array.isArray(T)) {
|
|
3086
|
+
const H = h.find(
|
|
3087
|
+
(S) => T.includes(S.token) || S.token === m
|
|
3088
|
+
);
|
|
3089
|
+
if (H)
|
|
3090
|
+
throw new RangeError(
|
|
3091
|
+
`The format string mustn't contain \`${H.fullToken}\` and \`${y}\` at the same time`
|
|
3092
|
+
);
|
|
3093
|
+
} else if (d.incompatibleTokens === "*" && h.length > 0)
|
|
3094
|
+
throw new RangeError(
|
|
3095
|
+
`The format string mustn't contain \`${y}\` and any other token at the same time`
|
|
3096
|
+
);
|
|
3097
|
+
h.push({ token: m, fullToken: y });
|
|
3098
|
+
const P = d.run(
|
|
3099
|
+
t,
|
|
3100
|
+
y,
|
|
3101
|
+
o.match,
|
|
3102
|
+
u
|
|
3103
|
+
);
|
|
3104
|
+
if (!P)
|
|
3105
|
+
return a();
|
|
3106
|
+
l.push(P.setter), t = P.rest;
|
|
3107
|
+
} else {
|
|
3108
|
+
if (m.match(ys))
|
|
3109
|
+
throw new RangeError(
|
|
3110
|
+
"Format string contains an unescaped latin alphabet character `" + m + "`"
|
|
3111
|
+
);
|
|
3112
|
+
if (y === "''" ? y = "'" : m === "'" && (y = ws(y)), t.indexOf(y) === 0)
|
|
3113
|
+
t = t.slice(y.length);
|
|
3114
|
+
else
|
|
3115
|
+
return a();
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
if (t.length > 0 && ms.test(t))
|
|
3119
|
+
return a();
|
|
3120
|
+
const b = l.map((y) => y.priority).sort((y, m) => m - y).filter((y, m, d) => d.indexOf(y) === m).map(
|
|
3121
|
+
(y) => l.filter((m) => m.priority === y).sort((m, d) => d.subPriority - m.subPriority)
|
|
3122
|
+
).map((y) => y[0]);
|
|
3123
|
+
let v = Y(e, r == null ? void 0 : r.in);
|
|
3124
|
+
if (isNaN(+v)) return a();
|
|
3125
|
+
const p = {};
|
|
3126
|
+
for (const y of b) {
|
|
3127
|
+
if (!y.validate(v, u))
|
|
3128
|
+
return a();
|
|
3129
|
+
const m = y.set(v, p, u);
|
|
3130
|
+
Array.isArray(m) ? (v = m[0], Object.assign(p, m[1])) : v = m;
|
|
3131
|
+
}
|
|
3132
|
+
return v;
|
|
3133
|
+
}
|
|
3134
|
+
function ws(t) {
|
|
3135
|
+
return t.match(fs)[1].replace(hs, "'");
|
|
3136
|
+
}
|
|
3137
|
+
function bs(t, n, e) {
|
|
3138
|
+
const [r, a] = _e(
|
|
3139
|
+
e == null ? void 0 : e.in,
|
|
3140
|
+
t,
|
|
3141
|
+
n
|
|
3142
|
+
);
|
|
3143
|
+
return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
|
|
3144
|
+
}
|
|
3145
|
+
function gs(t, n, e) {
|
|
3146
|
+
const [r, a] = _e(
|
|
3147
|
+
e == null ? void 0 : e.in,
|
|
3148
|
+
t,
|
|
3149
|
+
n
|
|
3150
|
+
);
|
|
3151
|
+
return r.getFullYear() === a.getFullYear();
|
|
3152
|
+
}
|
|
3153
|
+
function ks(t, n, e) {
|
|
3154
|
+
const r = Y(t, e == null ? void 0 : e.in), a = r.getFullYear(), s = r.getDate(), o = B(t, 0);
|
|
3155
|
+
o.setFullYear(a, n, 15), o.setHours(0, 0, 0, 0);
|
|
3156
|
+
const i = ya(o);
|
|
3157
|
+
return r.setMonth(n, Math.min(s, i)), r;
|
|
3158
|
+
}
|
|
3159
|
+
function Ms(t, n, e) {
|
|
3160
|
+
const r = Y(t, e == null ? void 0 : e.in);
|
|
3161
|
+
return isNaN(+r) ? B(t, NaN) : (r.setFullYear(n), r);
|
|
3162
|
+
}
|
|
3163
|
+
const Bt = 5, Ds = 4;
|
|
3164
|
+
function xs(t, n) {
|
|
3165
|
+
const e = n.startOfMonth(t), r = e.getDay() > 0 ? e.getDay() : 7, a = n.addDays(t, -r + 1), s = n.addDays(a, Bt * 7 - 1);
|
|
3166
|
+
return n.getMonth(t) === n.getMonth(s) ? Bt : Ds;
|
|
3167
|
+
}
|
|
3168
|
+
function sn(t, n) {
|
|
3169
|
+
const e = n.startOfMonth(t), r = e.getDay();
|
|
3170
|
+
return r === 1 ? e : r === 0 ? n.addDays(e, -1 * 6) : n.addDays(e, -1 * (r - 1));
|
|
3171
|
+
}
|
|
3172
|
+
function vs(t, n) {
|
|
3173
|
+
const e = sn(t, n), r = xs(t, n);
|
|
3174
|
+
return n.addDays(e, r * 7 - 1);
|
|
3175
|
+
}
|
|
3176
|
+
const on = {
|
|
3177
|
+
...ve,
|
|
3178
|
+
labels: {
|
|
3179
|
+
labelDayButton: (t, n, e, r) => {
|
|
3180
|
+
let a;
|
|
3181
|
+
r && typeof r.format == "function" ? a = r.format.bind(r) : a = (o, i) => ye(o, i, { locale: ve, ...e });
|
|
3182
|
+
let s = a(t, "PPPP");
|
|
3183
|
+
return n.today && (s = `Today, ${s}`), n.selected && (s = `${s}, selected`), s;
|
|
3184
|
+
},
|
|
3185
|
+
labelMonthDropdown: "Choose the Month",
|
|
3186
|
+
labelNext: "Go to the Next Month",
|
|
3187
|
+
labelPrevious: "Go to the Previous Month",
|
|
3188
|
+
labelWeekNumber: (t) => `Week ${t}`,
|
|
3189
|
+
labelYearDropdown: "Choose the Year",
|
|
3190
|
+
labelGrid: (t, n, e) => {
|
|
3191
|
+
let r;
|
|
3192
|
+
return e && typeof e.format == "function" ? r = e.format.bind(e) : r = (a, s) => ye(a, s, { locale: ve, ...n }), r(t, "LLLL yyyy");
|
|
3193
|
+
},
|
|
3194
|
+
labelGridcell: (t, n, e, r) => {
|
|
3195
|
+
let a;
|
|
3196
|
+
r && typeof r.format == "function" ? a = r.format.bind(r) : a = (o, i) => ye(o, i, { locale: ve, ...e });
|
|
3197
|
+
let s = a(t, "PPPP");
|
|
3198
|
+
return n != null && n.today && (s = `Today, ${s}`), s;
|
|
3199
|
+
},
|
|
3200
|
+
labelNav: "Navigation bar",
|
|
3201
|
+
labelWeekNumberHeader: "Week Number",
|
|
3202
|
+
labelWeekday: (t, n, e) => {
|
|
3203
|
+
let r;
|
|
3204
|
+
return e && typeof e.format == "function" ? r = e.format.bind(e) : r = (a, s) => ye(a, s, { locale: ve, ...n }), r(t, "cccc");
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
class ne {
|
|
3209
|
+
/**
|
|
3210
|
+
* Creates an instance of `DateLib`.
|
|
3211
|
+
*
|
|
3212
|
+
* @param options Configuration options for the date library.
|
|
3213
|
+
* @param overrides Custom overrides for the date library functions.
|
|
3214
|
+
*/
|
|
3215
|
+
constructor(n, e) {
|
|
3216
|
+
this.Date = Date, this.today = () => {
|
|
3217
|
+
var r;
|
|
3218
|
+
return (r = this.overrides) != null && r.today ? this.overrides.today() : this.options.timeZone ? V.tz(this.options.timeZone) : new this.Date();
|
|
3219
|
+
}, this.newDate = (r, a, s) => {
|
|
3220
|
+
var o;
|
|
3221
|
+
return (o = this.overrides) != null && o.newDate ? this.overrides.newDate(r, a, s) : this.options.timeZone ? new V(r, a, s, this.options.timeZone) : new Date(r, a, s);
|
|
3222
|
+
}, this.addDays = (r, a) => {
|
|
3223
|
+
var s;
|
|
3224
|
+
return (s = this.overrides) != null && s.addDays ? this.overrides.addDays(r, a) : Ve(r, a);
|
|
3225
|
+
}, this.addMonths = (r, a) => {
|
|
3226
|
+
var s;
|
|
3227
|
+
return (s = this.overrides) != null && s.addMonths ? this.overrides.addMonths(r, a) : $t(r, a);
|
|
3228
|
+
}, this.addWeeks = (r, a) => {
|
|
3229
|
+
var s;
|
|
3230
|
+
return (s = this.overrides) != null && s.addWeeks ? this.overrides.addWeeks(r, a) : hr(r, a);
|
|
3231
|
+
}, this.addYears = (r, a) => {
|
|
3232
|
+
var s;
|
|
3233
|
+
return (s = this.overrides) != null && s.addYears ? this.overrides.addYears(r, a) : mr(r, a);
|
|
3234
|
+
}, this.differenceInCalendarDays = (r, a) => {
|
|
3235
|
+
var s;
|
|
3236
|
+
return (s = this.overrides) != null && s.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : mt(r, a);
|
|
3237
|
+
}, this.differenceInCalendarMonths = (r, a) => {
|
|
3238
|
+
var s;
|
|
3239
|
+
return (s = this.overrides) != null && s.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : Vt(r, a);
|
|
3240
|
+
}, this.eachMonthOfInterval = (r) => {
|
|
3241
|
+
var a;
|
|
3242
|
+
return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : kr(r);
|
|
3243
|
+
}, this.eachYearOfInterval = (r) => {
|
|
3244
|
+
var i;
|
|
3245
|
+
const a = (i = this.overrides) != null && i.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : xr(r), s = new Set(a.map((c) => this.getYear(c)));
|
|
3246
|
+
if (s.size === a.length)
|
|
3247
|
+
return a;
|
|
3248
|
+
const o = [];
|
|
3249
|
+
return s.forEach((c) => {
|
|
3250
|
+
o.push(new Date(c, 0, 1));
|
|
3251
|
+
}), o;
|
|
3252
|
+
}, this.endOfBroadcastWeek = (r) => {
|
|
3253
|
+
var a;
|
|
3254
|
+
return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : vs(r, this);
|
|
3255
|
+
}, this.endOfISOWeek = (r) => {
|
|
3256
|
+
var a;
|
|
3257
|
+
return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : vr(r);
|
|
3258
|
+
}, this.endOfMonth = (r) => {
|
|
3259
|
+
var a;
|
|
3260
|
+
return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : gr(r);
|
|
3261
|
+
}, this.endOfWeek = (r, a) => {
|
|
3262
|
+
var s;
|
|
3263
|
+
return (s = this.overrides) != null && s.endOfWeek ? this.overrides.endOfWeek(r, a) : Zt(r, this.options);
|
|
3264
|
+
}, this.endOfYear = (r) => {
|
|
3265
|
+
var a;
|
|
3266
|
+
return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : Dr(r);
|
|
3267
|
+
}, this.format = (r, a, s) => {
|
|
3268
|
+
var i;
|
|
3269
|
+
const o = (i = this.overrides) != null && i.format ? this.overrides.format(r, a, this.options) : ye(r, a, this.options);
|
|
3270
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(o) : o;
|
|
3271
|
+
}, this.getISOWeek = (r) => {
|
|
3272
|
+
var a;
|
|
3273
|
+
return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : Ue(r);
|
|
3274
|
+
}, this.getMonth = (r, a) => {
|
|
3275
|
+
var s;
|
|
3276
|
+
return (s = this.overrides) != null && s.getMonth ? this.overrides.getMonth(r, this.options) : ga(r, this.options);
|
|
3277
|
+
}, this.getYear = (r, a) => {
|
|
3278
|
+
var s;
|
|
3279
|
+
return (s = this.overrides) != null && s.getYear ? this.overrides.getYear(r, this.options) : ka(r, this.options);
|
|
3280
|
+
}, this.getWeek = (r, a) => {
|
|
3281
|
+
var s;
|
|
3282
|
+
return (s = this.overrides) != null && s.getWeek ? this.overrides.getWeek(r, this.options) : Ke(r, this.options);
|
|
3283
|
+
}, this.isAfter = (r, a) => {
|
|
3284
|
+
var s;
|
|
3285
|
+
return (s = this.overrides) != null && s.isAfter ? this.overrides.isAfter(r, a) : Ma(r, a);
|
|
3286
|
+
}, this.isBefore = (r, a) => {
|
|
3287
|
+
var s;
|
|
3288
|
+
return (s = this.overrides) != null && s.isBefore ? this.overrides.isBefore(r, a) : Da(r, a);
|
|
3289
|
+
}, this.isDate = (r) => {
|
|
3290
|
+
var a;
|
|
3291
|
+
return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : Xt(r);
|
|
3292
|
+
}, this.isSameDay = (r, a) => {
|
|
3293
|
+
var s;
|
|
3294
|
+
return (s = this.overrides) != null && s.isSameDay ? this.overrides.isSameDay(r, a) : br(r, a);
|
|
3295
|
+
}, this.isSameMonth = (r, a) => {
|
|
3296
|
+
var s;
|
|
3297
|
+
return (s = this.overrides) != null && s.isSameMonth ? this.overrides.isSameMonth(r, a) : bs(r, a);
|
|
3298
|
+
}, this.isSameYear = (r, a) => {
|
|
3299
|
+
var s;
|
|
3300
|
+
return (s = this.overrides) != null && s.isSameYear ? this.overrides.isSameYear(r, a) : gs(r, a);
|
|
3301
|
+
}, this.max = (r) => {
|
|
3302
|
+
var a;
|
|
3303
|
+
return (a = this.overrides) != null && a.max ? this.overrides.max(r) : yr(r);
|
|
3304
|
+
}, this.min = (r) => {
|
|
3305
|
+
var a;
|
|
3306
|
+
return (a = this.overrides) != null && a.min ? this.overrides.min(r) : wr(r);
|
|
3307
|
+
}, this.setMonth = (r, a) => {
|
|
3308
|
+
var s;
|
|
3309
|
+
return (s = this.overrides) != null && s.setMonth ? this.overrides.setMonth(r, a) : ks(r, a);
|
|
3310
|
+
}, this.setYear = (r, a) => {
|
|
3311
|
+
var s;
|
|
3312
|
+
return (s = this.overrides) != null && s.setYear ? this.overrides.setYear(r, a) : Ms(r, a);
|
|
3313
|
+
}, this.startOfBroadcastWeek = (r, a) => {
|
|
3314
|
+
var s;
|
|
3315
|
+
return (s = this.overrides) != null && s.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : sn(r, this);
|
|
3316
|
+
}, this.startOfDay = (r) => {
|
|
3317
|
+
var a;
|
|
3318
|
+
return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) : He(r);
|
|
3319
|
+
}, this.startOfISOWeek = (r) => {
|
|
3320
|
+
var a;
|
|
3321
|
+
return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) : pe(r);
|
|
3322
|
+
}, this.startOfMonth = (r) => {
|
|
3323
|
+
var a;
|
|
3324
|
+
return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) : Mr(r);
|
|
3325
|
+
}, this.startOfWeek = (r, a) => {
|
|
3326
|
+
var s;
|
|
3327
|
+
return (s = this.overrides) != null && s.startOfWeek ? this.overrides.startOfWeek(r, this.options) : ge(r, this.options);
|
|
3328
|
+
}, this.startOfYear = (r) => {
|
|
3329
|
+
var a;
|
|
3330
|
+
return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) : Kt(r);
|
|
3331
|
+
}, this.options = { locale: on, ...n }, this.overrides = e;
|
|
3332
|
+
}
|
|
3333
|
+
/**
|
|
3334
|
+
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
3335
|
+
* digits.
|
|
3336
|
+
*
|
|
3337
|
+
* @since 9.5.0
|
|
3338
|
+
* @returns A record mapping Arabic digits to the target numerals.
|
|
3339
|
+
*/
|
|
3340
|
+
getDigitMap() {
|
|
3341
|
+
const { numerals: n = "latn" } = this.options, e = new Intl.NumberFormat("en-US", {
|
|
3342
|
+
numberingSystem: n
|
|
3343
|
+
}), r = {};
|
|
3344
|
+
for (let a = 0; a < 10; a++)
|
|
3345
|
+
r[a.toString()] = e.format(a);
|
|
3346
|
+
return r;
|
|
3347
|
+
}
|
|
3348
|
+
/**
|
|
3349
|
+
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
3350
|
+
*
|
|
3351
|
+
* @since 9.5.0
|
|
3352
|
+
* @param input The string containing Arabic digits.
|
|
3353
|
+
* @returns The string with digits replaced.
|
|
3354
|
+
*/
|
|
3355
|
+
replaceDigits(n) {
|
|
3356
|
+
const e = this.getDigitMap();
|
|
3357
|
+
return n.replace(/\d/g, (r) => e[r] || r);
|
|
3358
|
+
}
|
|
3359
|
+
/**
|
|
3360
|
+
* Formats a number using the configured numbering system.
|
|
3361
|
+
*
|
|
3362
|
+
* @since 9.5.0
|
|
3363
|
+
* @param value The number to format.
|
|
3364
|
+
* @returns The formatted number as a string.
|
|
3365
|
+
*/
|
|
3366
|
+
formatNumber(n) {
|
|
3367
|
+
return this.replaceDigits(n.toString());
|
|
3368
|
+
}
|
|
3369
|
+
/**
|
|
3370
|
+
* Returns the preferred ordering for month and year labels for the current
|
|
3371
|
+
* locale.
|
|
3372
|
+
*/
|
|
3373
|
+
getMonthYearOrder() {
|
|
3374
|
+
var e;
|
|
3375
|
+
const n = (e = this.options.locale) == null ? void 0 : e.code;
|
|
3376
|
+
return n && ne.yearFirstLocales.has(n) ? "year-first" : "month-first";
|
|
3377
|
+
}
|
|
3378
|
+
/**
|
|
3379
|
+
* Formats the month/year pair respecting locale conventions.
|
|
3380
|
+
*
|
|
3381
|
+
* @since 9.11.0
|
|
3382
|
+
*/
|
|
3383
|
+
formatMonthYear(n) {
|
|
3384
|
+
const { locale: e, timeZone: r, numerals: a } = this.options, s = e == null ? void 0 : e.code;
|
|
3385
|
+
if (s && ne.yearFirstLocales.has(s))
|
|
3386
|
+
try {
|
|
3387
|
+
return new Intl.DateTimeFormat(s, {
|
|
3388
|
+
month: "long",
|
|
3389
|
+
year: "numeric",
|
|
3390
|
+
timeZone: r,
|
|
3391
|
+
numberingSystem: a
|
|
3392
|
+
}).format(n);
|
|
3393
|
+
} catch {
|
|
3394
|
+
}
|
|
3395
|
+
const o = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
3396
|
+
return this.format(n, o);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
ne.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
3400
|
+
"eu",
|
|
3401
|
+
"hu",
|
|
3402
|
+
"ja",
|
|
3403
|
+
"ja-Hira",
|
|
3404
|
+
"ja-JP",
|
|
3405
|
+
"ko",
|
|
3406
|
+
"ko-KR",
|
|
3407
|
+
"lt",
|
|
3408
|
+
"lt-LT",
|
|
3409
|
+
"lv",
|
|
3410
|
+
"lv-LV",
|
|
3411
|
+
"mn",
|
|
3412
|
+
"mn-MN",
|
|
3413
|
+
"zh",
|
|
3414
|
+
"zh-CN",
|
|
3415
|
+
"zh-HK",
|
|
3416
|
+
"zh-TW"
|
|
3417
|
+
]);
|
|
3418
|
+
const me = new ne();
|
|
3419
|
+
class cn {
|
|
3420
|
+
constructor(n, e, r = me) {
|
|
3421
|
+
this.date = n, this.displayMonth = e, this.outside = !!(e && !r.isSameMonth(n, e)), this.dateLib = r, this.isoDate = r.format(n, "yyyy-MM-dd"), this.displayMonthId = r.format(e, "yyyy-MM"), this.dateMonthId = r.format(n, "yyyy-MM");
|
|
3422
|
+
}
|
|
3423
|
+
/**
|
|
3424
|
+
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
3425
|
+
* date and the displayed month.
|
|
3426
|
+
*
|
|
3427
|
+
* @param day The `CalendarDay` to compare with.
|
|
3428
|
+
* @returns `true` if the days are equal, otherwise `false`.
|
|
3429
|
+
*/
|
|
3430
|
+
isEqualTo(n) {
|
|
3431
|
+
return this.dateLib.isSameDay(n.date, this.date) && this.dateLib.isSameMonth(n.displayMonth, this.displayMonth);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
class Os {
|
|
3435
|
+
constructor(n, e) {
|
|
3436
|
+
this.date = n, this.weeks = e;
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
class ps {
|
|
3440
|
+
constructor(n, e) {
|
|
3441
|
+
this.days = e, this.weekNumber = n;
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
function Ws(t) {
|
|
3445
|
+
return w.createElement("button", { ...t });
|
|
3446
|
+
}
|
|
3447
|
+
function Ts(t) {
|
|
3448
|
+
return w.createElement("span", { ...t });
|
|
3449
|
+
}
|
|
3450
|
+
function Ns(t) {
|
|
3451
|
+
const { size: n = 24, orientation: e = "left", className: r } = t;
|
|
3452
|
+
return (
|
|
3453
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
3454
|
+
w.createElement(
|
|
3455
|
+
"svg",
|
|
3456
|
+
{ className: r, width: n, height: n, viewBox: "0 0 24 24" },
|
|
3457
|
+
e === "up" && w.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
3458
|
+
e === "down" && w.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
3459
|
+
e === "left" && w.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
3460
|
+
e === "right" && w.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
3461
|
+
)
|
|
3462
|
+
);
|
|
3463
|
+
}
|
|
3464
|
+
function Ys(t) {
|
|
3465
|
+
const { day: n, modifiers: e, ...r } = t;
|
|
3466
|
+
return w.createElement("td", { ...r });
|
|
3467
|
+
}
|
|
3468
|
+
function Ps(t) {
|
|
3469
|
+
const { day: n, modifiers: e, ...r } = t, a = w.useRef(null);
|
|
3470
|
+
return w.useEffect(() => {
|
|
3471
|
+
var s;
|
|
3472
|
+
e.focused && ((s = a.current) == null || s.focus());
|
|
3473
|
+
}, [e.focused]), w.createElement("button", { ref: a, ...r });
|
|
3474
|
+
}
|
|
3475
|
+
var x;
|
|
3476
|
+
(function(t) {
|
|
3477
|
+
t.Root = "root", t.Chevron = "chevron", t.Day = "day", t.DayButton = "day_button", t.CaptionLabel = "caption_label", t.Dropdowns = "dropdowns", t.Dropdown = "dropdown", t.DropdownRoot = "dropdown_root", t.Footer = "footer", t.MonthGrid = "month_grid", t.MonthCaption = "month_caption", t.MonthsDropdown = "months_dropdown", t.Month = "month", t.Months = "months", t.Nav = "nav", t.NextMonthButton = "button_next", t.PreviousMonthButton = "button_previous", t.Week = "week", t.Weeks = "weeks", t.Weekday = "weekday", t.Weekdays = "weekdays", t.WeekNumber = "week_number", t.WeekNumberHeader = "week_number_header", t.YearsDropdown = "years_dropdown";
|
|
3478
|
+
})(x || (x = {}));
|
|
3479
|
+
var q;
|
|
3480
|
+
(function(t) {
|
|
3481
|
+
t.disabled = "disabled", t.hidden = "hidden", t.outside = "outside", t.focused = "focused", t.today = "today";
|
|
3482
|
+
})(q || (q = {}));
|
|
3483
|
+
var ce;
|
|
3484
|
+
(function(t) {
|
|
3485
|
+
t.range_end = "range_end", t.range_middle = "range_middle", t.range_start = "range_start", t.selected = "selected";
|
|
3486
|
+
})(ce || (ce = {}));
|
|
3487
|
+
var te;
|
|
3488
|
+
(function(t) {
|
|
3489
|
+
t.weeks_before_enter = "weeks_before_enter", t.weeks_before_exit = "weeks_before_exit", t.weeks_after_enter = "weeks_after_enter", t.weeks_after_exit = "weeks_after_exit", t.caption_after_enter = "caption_after_enter", t.caption_after_exit = "caption_after_exit", t.caption_before_enter = "caption_before_enter", t.caption_before_exit = "caption_before_exit";
|
|
3490
|
+
})(te || (te = {}));
|
|
3491
|
+
function Cs(t) {
|
|
3492
|
+
const { options: n, className: e, components: r, classNames: a, ...s } = t, o = [a[x.Dropdown], e].join(" "), i = n == null ? void 0 : n.find(({ value: c }) => c === s.value);
|
|
3493
|
+
return w.createElement(
|
|
3494
|
+
"span",
|
|
3495
|
+
{ "data-disabled": s.disabled, className: a[x.DropdownRoot] },
|
|
3496
|
+
w.createElement(r.Select, { className: o, ...s }, n == null ? void 0 : n.map(({ value: c, label: u, disabled: l }) => w.createElement(r.Option, { key: c, value: c, disabled: l }, u))),
|
|
3497
|
+
w.createElement(
|
|
3498
|
+
"span",
|
|
3499
|
+
{ className: a[x.CaptionLabel], "aria-hidden": !0 },
|
|
3500
|
+
i == null ? void 0 : i.label,
|
|
3501
|
+
w.createElement(r.Chevron, { orientation: "down", size: 18, className: a[x.Chevron] })
|
|
3502
|
+
)
|
|
3503
|
+
);
|
|
3504
|
+
}
|
|
3505
|
+
function _s(t) {
|
|
3506
|
+
return w.createElement("div", { ...t });
|
|
3507
|
+
}
|
|
3508
|
+
function Es(t) {
|
|
3509
|
+
return w.createElement("div", { ...t });
|
|
3510
|
+
}
|
|
3511
|
+
function Ss(t) {
|
|
3512
|
+
const { calendarMonth: n, displayIndex: e, ...r } = t;
|
|
3513
|
+
return w.createElement("div", { ...r }, t.children);
|
|
3514
|
+
}
|
|
3515
|
+
function Is(t) {
|
|
3516
|
+
const { calendarMonth: n, displayIndex: e, ...r } = t;
|
|
3517
|
+
return w.createElement("div", { ...r });
|
|
3518
|
+
}
|
|
3519
|
+
function Fs(t) {
|
|
3520
|
+
return w.createElement("table", { ...t });
|
|
3521
|
+
}
|
|
3522
|
+
function Bs(t) {
|
|
3523
|
+
return w.createElement("div", { ...t });
|
|
3524
|
+
}
|
|
3525
|
+
const un = er(void 0);
|
|
3526
|
+
function qe() {
|
|
3527
|
+
const t = tr(un);
|
|
3528
|
+
if (t === void 0)
|
|
3529
|
+
throw new Error("useDayPicker() must be used within a custom component.");
|
|
3530
|
+
return t;
|
|
3531
|
+
}
|
|
3532
|
+
function Hs(t) {
|
|
3533
|
+
const { components: n } = qe();
|
|
3534
|
+
return w.createElement(n.Dropdown, { ...t });
|
|
3535
|
+
}
|
|
3536
|
+
function qs(t) {
|
|
3537
|
+
const { onPreviousClick: n, onNextClick: e, previousMonth: r, nextMonth: a, ...s } = t, { components: o, classNames: i, labels: { labelPrevious: c, labelNext: u } } = qe(), l = ae((h) => {
|
|
3538
|
+
a && (e == null || e(h));
|
|
3539
|
+
}, [a, e]), f = ae((h) => {
|
|
3540
|
+
r && (n == null || n(h));
|
|
3541
|
+
}, [r, n]);
|
|
3542
|
+
return w.createElement(
|
|
3543
|
+
"nav",
|
|
3544
|
+
{ ...s },
|
|
3545
|
+
w.createElement(
|
|
3546
|
+
o.PreviousMonthButton,
|
|
3547
|
+
{ type: "button", className: i[x.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": c(r), onClick: f },
|
|
3548
|
+
w.createElement(o.Chevron, { disabled: r ? void 0 : !0, className: i[x.Chevron], orientation: "left" })
|
|
3549
|
+
),
|
|
3550
|
+
w.createElement(
|
|
3551
|
+
o.NextMonthButton,
|
|
3552
|
+
{ type: "button", className: i[x.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label": u(a), onClick: l },
|
|
3553
|
+
w.createElement(o.Chevron, { disabled: a ? void 0 : !0, orientation: "right", className: i[x.Chevron] })
|
|
3554
|
+
)
|
|
3555
|
+
);
|
|
3556
|
+
}
|
|
3557
|
+
function As(t) {
|
|
3558
|
+
const { components: n } = qe();
|
|
3559
|
+
return w.createElement(n.Button, { ...t });
|
|
3560
|
+
}
|
|
3561
|
+
function Rs(t) {
|
|
3562
|
+
return w.createElement("option", { ...t });
|
|
3563
|
+
}
|
|
3564
|
+
function js(t) {
|
|
3565
|
+
const { components: n } = qe();
|
|
3566
|
+
return w.createElement(n.Button, { ...t });
|
|
3567
|
+
}
|
|
3568
|
+
function Gs(t) {
|
|
3569
|
+
const { rootRef: n, ...e } = t;
|
|
3570
|
+
return w.createElement("div", { ...e, ref: n });
|
|
3571
|
+
}
|
|
3572
|
+
function Qs(t) {
|
|
3573
|
+
return w.createElement("select", { ...t });
|
|
3574
|
+
}
|
|
3575
|
+
function $s(t) {
|
|
3576
|
+
const { week: n, ...e } = t;
|
|
3577
|
+
return w.createElement("tr", { ...e });
|
|
3578
|
+
}
|
|
3579
|
+
function zs(t) {
|
|
3580
|
+
return w.createElement("th", { ...t });
|
|
3581
|
+
}
|
|
3582
|
+
function Xs(t) {
|
|
3583
|
+
return w.createElement(
|
|
3584
|
+
"thead",
|
|
3585
|
+
{ "aria-hidden": !0 },
|
|
3586
|
+
w.createElement("tr", { ...t })
|
|
3587
|
+
);
|
|
3588
|
+
}
|
|
3589
|
+
function Vs(t) {
|
|
3590
|
+
const { week: n, ...e } = t;
|
|
3591
|
+
return w.createElement("th", { ...e });
|
|
3592
|
+
}
|
|
3593
|
+
function Us(t) {
|
|
3594
|
+
return w.createElement("th", { ...t });
|
|
3595
|
+
}
|
|
3596
|
+
function Ks(t) {
|
|
3597
|
+
return w.createElement("tbody", { ...t });
|
|
3598
|
+
}
|
|
3599
|
+
function Zs(t) {
|
|
3600
|
+
const { components: n } = qe();
|
|
3601
|
+
return w.createElement(n.Dropdown, { ...t });
|
|
3602
|
+
}
|
|
3603
|
+
const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3604
|
+
__proto__: null,
|
|
3605
|
+
Button: Ws,
|
|
3606
|
+
CaptionLabel: Ts,
|
|
3607
|
+
Chevron: Ns,
|
|
3608
|
+
Day: Ys,
|
|
3609
|
+
DayButton: Ps,
|
|
3610
|
+
Dropdown: Cs,
|
|
3611
|
+
DropdownNav: _s,
|
|
3612
|
+
Footer: Es,
|
|
3613
|
+
Month: Ss,
|
|
3614
|
+
MonthCaption: Is,
|
|
3615
|
+
MonthGrid: Fs,
|
|
3616
|
+
Months: Bs,
|
|
3617
|
+
MonthsDropdown: Hs,
|
|
3618
|
+
Nav: qs,
|
|
3619
|
+
NextMonthButton: As,
|
|
3620
|
+
Option: Rs,
|
|
3621
|
+
PreviousMonthButton: js,
|
|
3622
|
+
Root: Gs,
|
|
3623
|
+
Select: Qs,
|
|
3624
|
+
Week: $s,
|
|
3625
|
+
WeekNumber: Vs,
|
|
3626
|
+
WeekNumberHeader: Us,
|
|
3627
|
+
Weekday: zs,
|
|
3628
|
+
Weekdays: Xs,
|
|
3629
|
+
Weeks: Ks,
|
|
3630
|
+
YearsDropdown: Zs
|
|
3631
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3632
|
+
function we(t, n, e = !1, r = me) {
|
|
3633
|
+
let { from: a, to: s } = t;
|
|
3634
|
+
const { differenceInCalendarDays: o, isSameDay: i } = r;
|
|
3635
|
+
return a && s ? (o(s, a) < 0 && ([a, s] = [s, a]), o(n, a) >= (e ? 1 : 0) && o(s, n) >= (e ? 1 : 0)) : !e && s ? i(s, n) : !e && a ? i(a, n) : !1;
|
|
3636
|
+
}
|
|
3637
|
+
function gt(t) {
|
|
3638
|
+
return !!(t && typeof t == "object" && "before" in t && "after" in t);
|
|
3639
|
+
}
|
|
3640
|
+
function Ze(t) {
|
|
3641
|
+
return !!(t && typeof t == "object" && "from" in t);
|
|
3642
|
+
}
|
|
3643
|
+
function kt(t) {
|
|
3644
|
+
return !!(t && typeof t == "object" && "after" in t);
|
|
3645
|
+
}
|
|
3646
|
+
function Mt(t) {
|
|
3647
|
+
return !!(t && typeof t == "object" && "before" in t);
|
|
3648
|
+
}
|
|
3649
|
+
function ln(t) {
|
|
3650
|
+
return !!(t && typeof t == "object" && "dayOfWeek" in t);
|
|
3651
|
+
}
|
|
3652
|
+
function dn(t, n) {
|
|
3653
|
+
return Array.isArray(t) && t.every(n.isDate);
|
|
3654
|
+
}
|
|
3655
|
+
function be(t, n, e = me) {
|
|
3656
|
+
const r = Array.isArray(n) ? n : [n], { isSameDay: a, differenceInCalendarDays: s, isAfter: o } = e;
|
|
3657
|
+
return r.some((i) => {
|
|
3658
|
+
if (typeof i == "boolean")
|
|
3659
|
+
return i;
|
|
3660
|
+
if (e.isDate(i))
|
|
3661
|
+
return a(t, i);
|
|
3662
|
+
if (dn(i, e))
|
|
3663
|
+
return i.some((c) => a(t, c));
|
|
3664
|
+
if (Ze(i))
|
|
3665
|
+
return we(i, t, !1, e);
|
|
3666
|
+
if (ln(i))
|
|
3667
|
+
return Array.isArray(i.dayOfWeek) ? i.dayOfWeek.includes(t.getDay()) : i.dayOfWeek === t.getDay();
|
|
3668
|
+
if (gt(i)) {
|
|
3669
|
+
const c = s(i.before, t), u = s(i.after, t), l = c > 0, f = u < 0;
|
|
3670
|
+
return o(i.before, i.after) ? f && l : l || f;
|
|
3671
|
+
}
|
|
3672
|
+
return kt(i) ? s(t, i.after) > 0 : Mt(i) ? s(i.before, t) > 0 : typeof i == "function" ? i(t) : !1;
|
|
3673
|
+
});
|
|
3674
|
+
}
|
|
3675
|
+
function Ls(t, n, e, r, a) {
|
|
3676
|
+
const { disabled: s, hidden: o, modifiers: i, showOutsideDays: c, broadcastCalendar: u, today: l = a.today() } = n, { isSameDay: f, isSameMonth: h, startOfMonth: b, isBefore: v, endOfMonth: p, isAfter: O } = a, k = e && b(e), D = r && p(r), M = {
|
|
3677
|
+
[q.focused]: [],
|
|
3678
|
+
[q.outside]: [],
|
|
3679
|
+
[q.disabled]: [],
|
|
3680
|
+
[q.hidden]: [],
|
|
3681
|
+
[q.today]: []
|
|
3682
|
+
}, y = {};
|
|
3683
|
+
for (const m of t) {
|
|
3684
|
+
const { date: d, displayMonth: T } = m, P = !!(T && !h(d, T)), H = !!(k && v(d, k)), S = !!(D && O(d, D)), U = !!(s && be(d, s, a)), oe = !!(o && be(d, o, a)) || H || S || // Broadcast calendar will show outside days as default
|
|
3685
|
+
!u && !c && P || u && c === !1 && P, J = f(d, l);
|
|
3686
|
+
P && M.outside.push(m), U && M.disabled.push(m), oe && M.hidden.push(m), J && M.today.push(m), i && Object.keys(i).forEach((K) => {
|
|
3687
|
+
const ke = i == null ? void 0 : i[K];
|
|
3688
|
+
ke && be(d, ke, a) && (y[K] ? y[K].push(m) : y[K] = [m]);
|
|
3689
|
+
});
|
|
3690
|
+
}
|
|
3691
|
+
return (m) => {
|
|
3692
|
+
const d = {
|
|
3693
|
+
[q.focused]: !1,
|
|
3694
|
+
[q.disabled]: !1,
|
|
3695
|
+
[q.hidden]: !1,
|
|
3696
|
+
[q.outside]: !1,
|
|
3697
|
+
[q.today]: !1
|
|
3698
|
+
}, T = {};
|
|
3699
|
+
for (const P in M) {
|
|
3700
|
+
const H = M[P];
|
|
3701
|
+
d[P] = H.some((S) => S === m);
|
|
3702
|
+
}
|
|
3703
|
+
for (const P in y)
|
|
3704
|
+
T[P] = y[P].some((H) => H === m);
|
|
3705
|
+
return {
|
|
3706
|
+
...d,
|
|
3707
|
+
// custom modifiers should override all the previous ones
|
|
3708
|
+
...T
|
|
3709
|
+
};
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
function eo(t, n, e = {}) {
|
|
3713
|
+
return Object.entries(t).filter(([, a]) => a === !0).reduce((a, [s]) => (e[s] ? a.push(e[s]) : n[q[s]] ? a.push(n[q[s]]) : n[ce[s]] && a.push(n[ce[s]]), a), [n[x.Day]]);
|
|
3714
|
+
}
|
|
3715
|
+
function to(t) {
|
|
3716
|
+
return {
|
|
3717
|
+
...Js,
|
|
3718
|
+
...t
|
|
3719
|
+
};
|
|
3720
|
+
}
|
|
3721
|
+
function no(t) {
|
|
3722
|
+
const n = {
|
|
3723
|
+
"data-mode": t.mode ?? void 0,
|
|
3724
|
+
"data-required": "required" in t ? t.required : void 0,
|
|
3725
|
+
"data-multiple-months": t.numberOfMonths && t.numberOfMonths > 1 || void 0,
|
|
3726
|
+
"data-week-numbers": t.showWeekNumber || void 0,
|
|
3727
|
+
"data-broadcast-calendar": t.broadcastCalendar || void 0,
|
|
3728
|
+
"data-nav-layout": t.navLayout || void 0
|
|
3729
|
+
};
|
|
3730
|
+
return Object.entries(t).forEach(([e, r]) => {
|
|
3731
|
+
e.startsWith("data-") && (n[e] = r);
|
|
3732
|
+
}), n;
|
|
3733
|
+
}
|
|
3734
|
+
function ro() {
|
|
3735
|
+
const t = {};
|
|
3736
|
+
for (const n in x)
|
|
3737
|
+
t[x[n]] = `rdp-${x[n]}`;
|
|
3738
|
+
for (const n in q)
|
|
3739
|
+
t[q[n]] = `rdp-${q[n]}`;
|
|
3740
|
+
for (const n in ce)
|
|
3741
|
+
t[ce[n]] = `rdp-${ce[n]}`;
|
|
3742
|
+
for (const n in te)
|
|
3743
|
+
t[te[n]] = `rdp-${te[n]}`;
|
|
3744
|
+
return t;
|
|
3745
|
+
}
|
|
3746
|
+
function fn(t, n, e) {
|
|
3747
|
+
return (e ?? new ne(n)).formatMonthYear(t);
|
|
3748
|
+
}
|
|
3749
|
+
const ao = fn;
|
|
3750
|
+
function so(t, n, e) {
|
|
3751
|
+
return (e ?? new ne(n)).format(t, "d");
|
|
3752
|
+
}
|
|
3753
|
+
function oo(t, n = me) {
|
|
3754
|
+
return n.format(t, "LLLL");
|
|
3755
|
+
}
|
|
3756
|
+
function io(t, n, e) {
|
|
3757
|
+
return (e ?? new ne(n)).format(t, "cccccc");
|
|
3758
|
+
}
|
|
3759
|
+
function co(t, n = me) {
|
|
3760
|
+
return t < 10 ? n.formatNumber(`0${t.toLocaleString()}`) : n.formatNumber(`${t.toLocaleString()}`);
|
|
3761
|
+
}
|
|
3762
|
+
function uo() {
|
|
3763
|
+
return "";
|
|
3764
|
+
}
|
|
3765
|
+
function hn(t, n = me) {
|
|
3766
|
+
return n.format(t, "yyyy");
|
|
3767
|
+
}
|
|
3768
|
+
const lo = hn, fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3769
|
+
__proto__: null,
|
|
3770
|
+
formatCaption: fn,
|
|
3771
|
+
formatDay: so,
|
|
3772
|
+
formatMonthCaption: ao,
|
|
3773
|
+
formatMonthDropdown: oo,
|
|
3774
|
+
formatWeekNumber: co,
|
|
3775
|
+
formatWeekNumberHeader: uo,
|
|
3776
|
+
formatWeekdayName: io,
|
|
3777
|
+
formatYearCaption: lo,
|
|
3778
|
+
formatYearDropdown: hn
|
|
3779
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3780
|
+
function ho(t) {
|
|
3781
|
+
return t != null && t.formatMonthCaption && !t.formatCaption && (t.formatCaption = t.formatMonthCaption), t != null && t.formatYearCaption && !t.formatYearDropdown && (t.formatYearDropdown = t.formatYearCaption), {
|
|
3782
|
+
...fo,
|
|
3783
|
+
...t
|
|
3784
|
+
};
|
|
3785
|
+
}
|
|
3786
|
+
function Dt(t, n, e, r) {
|
|
3787
|
+
let a = (r ?? new ne(e)).format(t, "PPPP");
|
|
3788
|
+
return n.today && (a = `Today, ${a}`), n.selected && (a = `${a}, selected`), a;
|
|
3789
|
+
}
|
|
3790
|
+
const mo = Dt;
|
|
3791
|
+
function xt(t, n, e) {
|
|
3792
|
+
return (e ?? new ne(n)).formatMonthYear(t);
|
|
3793
|
+
}
|
|
3794
|
+
const yo = xt;
|
|
3795
|
+
function mn(t, n, e, r) {
|
|
3796
|
+
let a = (r ?? new ne(e)).format(t, "PPPP");
|
|
3797
|
+
return n != null && n.today && (a = `Today, ${a}`), a;
|
|
3798
|
+
}
|
|
3799
|
+
function yn(t) {
|
|
3800
|
+
return "Choose the Month";
|
|
3801
|
+
}
|
|
3802
|
+
function wn() {
|
|
3803
|
+
return "";
|
|
3804
|
+
}
|
|
3805
|
+
const wo = "Go to the Next Month";
|
|
3806
|
+
function bn(t, n) {
|
|
3807
|
+
return wo;
|
|
3808
|
+
}
|
|
3809
|
+
function gn(t) {
|
|
3810
|
+
return "Go to the Previous Month";
|
|
3811
|
+
}
|
|
3812
|
+
function kn(t, n, e) {
|
|
3813
|
+
return (e ?? new ne(n)).format(t, "cccc");
|
|
3814
|
+
}
|
|
3815
|
+
function Mn(t, n) {
|
|
3816
|
+
return `Week ${t}`;
|
|
3817
|
+
}
|
|
3818
|
+
function Dn(t) {
|
|
3819
|
+
return "Week Number";
|
|
3820
|
+
}
|
|
3821
|
+
function xn(t) {
|
|
3822
|
+
return "Choose the Year";
|
|
3823
|
+
}
|
|
3824
|
+
const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3825
|
+
__proto__: null,
|
|
3826
|
+
labelCaption: yo,
|
|
3827
|
+
labelDay: mo,
|
|
3828
|
+
labelDayButton: Dt,
|
|
3829
|
+
labelGrid: xt,
|
|
3830
|
+
labelGridcell: mn,
|
|
3831
|
+
labelMonthDropdown: yn,
|
|
3832
|
+
labelNav: wn,
|
|
3833
|
+
labelNext: bn,
|
|
3834
|
+
labelPrevious: gn,
|
|
3835
|
+
labelWeekNumber: Mn,
|
|
3836
|
+
labelWeekNumberHeader: Dn,
|
|
3837
|
+
labelWeekday: kn,
|
|
3838
|
+
labelYearDropdown: xn
|
|
3839
|
+
}, Symbol.toStringTag, { value: "Module" })), ie = (t, n, e) => n || (e ? typeof e == "function" ? e : (...r) => e : t);
|
|
3840
|
+
function go(t, n) {
|
|
3841
|
+
var r;
|
|
3842
|
+
const e = ((r = n.locale) == null ? void 0 : r.labels) ?? {};
|
|
3843
|
+
return {
|
|
3844
|
+
...bo,
|
|
3845
|
+
...t ?? {},
|
|
3846
|
+
labelDayButton: ie(Dt, t == null ? void 0 : t.labelDayButton, e.labelDayButton),
|
|
3847
|
+
labelMonthDropdown: ie(yn, t == null ? void 0 : t.labelMonthDropdown, e.labelMonthDropdown),
|
|
3848
|
+
labelNext: ie(bn, t == null ? void 0 : t.labelNext, e.labelNext),
|
|
3849
|
+
labelPrevious: ie(gn, t == null ? void 0 : t.labelPrevious, e.labelPrevious),
|
|
3850
|
+
labelWeekNumber: ie(Mn, t == null ? void 0 : t.labelWeekNumber, e.labelWeekNumber),
|
|
3851
|
+
labelYearDropdown: ie(xn, t == null ? void 0 : t.labelYearDropdown, e.labelYearDropdown),
|
|
3852
|
+
labelGrid: ie(xt, t == null ? void 0 : t.labelGrid, e.labelGrid),
|
|
3853
|
+
labelGridcell: ie(mn, t == null ? void 0 : t.labelGridcell, e.labelGridcell),
|
|
3854
|
+
labelNav: ie(wn, t == null ? void 0 : t.labelNav, e.labelNav),
|
|
3855
|
+
labelWeekNumberHeader: ie(Dn, t == null ? void 0 : t.labelWeekNumberHeader, e.labelWeekNumberHeader),
|
|
3856
|
+
labelWeekday: ie(kn, t == null ? void 0 : t.labelWeekday, e.labelWeekday)
|
|
3857
|
+
};
|
|
3858
|
+
}
|
|
3859
|
+
function ko(t, n, e, r, a) {
|
|
3860
|
+
const { startOfMonth: s, startOfYear: o, endOfYear: i, eachMonthOfInterval: c, getMonth: u } = a;
|
|
3861
|
+
return c({
|
|
3862
|
+
start: o(t),
|
|
3863
|
+
end: i(t)
|
|
3864
|
+
}).map((h) => {
|
|
3865
|
+
const b = r.formatMonthDropdown(h, a), v = u(h), p = n && h < s(n) || e && h > s(e) || !1;
|
|
3866
|
+
return { value: v, label: b, disabled: p };
|
|
3867
|
+
});
|
|
3868
|
+
}
|
|
3869
|
+
function Mo(t, n = {}, e = {}) {
|
|
3870
|
+
let r = { ...n == null ? void 0 : n[x.Day] };
|
|
3871
|
+
return Object.entries(t).filter(([, a]) => a === !0).forEach(([a]) => {
|
|
3872
|
+
r = {
|
|
3873
|
+
...r,
|
|
3874
|
+
...e == null ? void 0 : e[a]
|
|
3875
|
+
};
|
|
3876
|
+
}), r;
|
|
3877
|
+
}
|
|
3878
|
+
function Do(t, n, e, r) {
|
|
3879
|
+
const a = r ?? t.today(), s = e ? t.startOfBroadcastWeek(a, t) : n ? t.startOfISOWeek(a) : t.startOfWeek(a), o = [];
|
|
3880
|
+
for (let i = 0; i < 7; i++) {
|
|
3881
|
+
const c = t.addDays(s, i);
|
|
3882
|
+
o.push(c);
|
|
3883
|
+
}
|
|
3884
|
+
return o;
|
|
3885
|
+
}
|
|
3886
|
+
function xo(t, n, e, r, a = !1) {
|
|
3887
|
+
if (!t || !n)
|
|
3888
|
+
return;
|
|
3889
|
+
const { startOfYear: s, endOfYear: o, eachYearOfInterval: i, getYear: c } = r, u = s(t), l = o(n), f = i({ start: u, end: l });
|
|
3890
|
+
return a && f.reverse(), f.map((h) => {
|
|
3891
|
+
const b = e.formatYearDropdown(h, r);
|
|
3892
|
+
return {
|
|
3893
|
+
value: c(h),
|
|
3894
|
+
label: b,
|
|
3895
|
+
disabled: !1
|
|
3896
|
+
};
|
|
3897
|
+
});
|
|
3898
|
+
}
|
|
3899
|
+
function vo(t, n = {}) {
|
|
3900
|
+
var i;
|
|
3901
|
+
const { weekStartsOn: e, locale: r } = n, a = e ?? ((i = r == null ? void 0 : r.options) == null ? void 0 : i.weekStartsOn) ?? 0, s = (c) => {
|
|
3902
|
+
const u = typeof c == "number" || typeof c == "string" ? new Date(c) : c;
|
|
3903
|
+
return new V(u.getFullYear(), u.getMonth(), u.getDate(), 12, 0, 0, t);
|
|
3904
|
+
}, o = (c) => {
|
|
3905
|
+
const u = s(c);
|
|
3906
|
+
return new Date(u.getFullYear(), u.getMonth(), u.getDate(), 0, 0, 0, 0);
|
|
3907
|
+
};
|
|
3908
|
+
return {
|
|
3909
|
+
today: () => s(V.tz(t)),
|
|
3910
|
+
newDate: (c, u, l) => new V(c, u, l, 12, 0, 0, t),
|
|
3911
|
+
startOfDay: (c) => s(c),
|
|
3912
|
+
startOfWeek: (c, u) => {
|
|
3913
|
+
const l = s(c), f = (u == null ? void 0 : u.weekStartsOn) ?? a, h = (l.getDay() - f + 7) % 7;
|
|
3914
|
+
return l.setDate(l.getDate() - h), l;
|
|
3915
|
+
},
|
|
3916
|
+
startOfISOWeek: (c) => {
|
|
3917
|
+
const u = s(c), l = (u.getDay() - 1 + 7) % 7;
|
|
3918
|
+
return u.setDate(u.getDate() - l), u;
|
|
3919
|
+
},
|
|
3920
|
+
startOfMonth: (c) => {
|
|
3921
|
+
const u = s(c);
|
|
3922
|
+
return u.setDate(1), u;
|
|
3923
|
+
},
|
|
3924
|
+
startOfYear: (c) => {
|
|
3925
|
+
const u = s(c);
|
|
3926
|
+
return u.setMonth(0, 1), u;
|
|
3927
|
+
},
|
|
3928
|
+
endOfWeek: (c, u) => {
|
|
3929
|
+
const l = s(c), b = ((((u == null ? void 0 : u.weekStartsOn) ?? a) + 6) % 7 - l.getDay() + 7) % 7;
|
|
3930
|
+
return l.setDate(l.getDate() + b), l;
|
|
3931
|
+
},
|
|
3932
|
+
endOfISOWeek: (c) => {
|
|
3933
|
+
const u = s(c), l = (7 - u.getDay()) % 7;
|
|
3934
|
+
return u.setDate(u.getDate() + l), u;
|
|
3935
|
+
},
|
|
3936
|
+
endOfMonth: (c) => {
|
|
3937
|
+
const u = s(c);
|
|
3938
|
+
return u.setMonth(u.getMonth() + 1, 0), u;
|
|
3939
|
+
},
|
|
3940
|
+
endOfYear: (c) => {
|
|
3941
|
+
const u = s(c);
|
|
3942
|
+
return u.setMonth(11, 31), u;
|
|
3943
|
+
},
|
|
3944
|
+
eachMonthOfInterval: (c) => {
|
|
3945
|
+
const u = s(c.start), l = s(c.end), f = [], h = new V(u.getFullYear(), u.getMonth(), 1, 12, 0, 0, t), b = l.getFullYear() * 12 + l.getMonth();
|
|
3946
|
+
for (; h.getFullYear() * 12 + h.getMonth() <= b; )
|
|
3947
|
+
f.push(new V(h, t)), h.setMonth(h.getMonth() + 1, 1);
|
|
3948
|
+
return f;
|
|
3949
|
+
},
|
|
3950
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
3951
|
+
// mutate the same TZDate, and return it.
|
|
3952
|
+
addDays: (c, u) => {
|
|
3953
|
+
const l = s(c);
|
|
3954
|
+
return l.setDate(l.getDate() + u), l;
|
|
3955
|
+
},
|
|
3956
|
+
addWeeks: (c, u) => {
|
|
3957
|
+
const l = s(c);
|
|
3958
|
+
return l.setDate(l.getDate() + u * 7), l;
|
|
3959
|
+
},
|
|
3960
|
+
addMonths: (c, u) => {
|
|
3961
|
+
const l = s(c);
|
|
3962
|
+
return l.setMonth(l.getMonth() + u), l;
|
|
3963
|
+
},
|
|
3964
|
+
addYears: (c, u) => {
|
|
3965
|
+
const l = s(c);
|
|
3966
|
+
return l.setFullYear(l.getFullYear() + u), l;
|
|
3967
|
+
},
|
|
3968
|
+
eachYearOfInterval: (c) => {
|
|
3969
|
+
const u = s(c.start), l = s(c.end), f = [], h = new V(u.getFullYear(), 0, 1, 12, 0, 0, t);
|
|
3970
|
+
for (; h.getFullYear() <= l.getFullYear(); )
|
|
3971
|
+
f.push(new V(h, t)), h.setFullYear(h.getFullYear() + 1, 0, 1);
|
|
3972
|
+
return f;
|
|
3973
|
+
},
|
|
3974
|
+
getWeek: (c, u) => {
|
|
3975
|
+
var f;
|
|
3976
|
+
const l = o(c);
|
|
3977
|
+
return Ke(l, {
|
|
3978
|
+
weekStartsOn: (u == null ? void 0 : u.weekStartsOn) ?? a,
|
|
3979
|
+
firstWeekContainsDate: (u == null ? void 0 : u.firstWeekContainsDate) ?? ((f = r == null ? void 0 : r.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1
|
|
3980
|
+
});
|
|
3981
|
+
},
|
|
3982
|
+
getISOWeek: (c) => {
|
|
3983
|
+
const u = o(c);
|
|
3984
|
+
return Ue(u);
|
|
3985
|
+
},
|
|
3986
|
+
differenceInCalendarDays: (c, u) => {
|
|
3987
|
+
const l = o(c), f = o(u);
|
|
3988
|
+
return mt(l, f);
|
|
3989
|
+
},
|
|
3990
|
+
differenceInCalendarMonths: (c, u) => {
|
|
3991
|
+
const l = o(c), f = o(u);
|
|
3992
|
+
return Vt(l, f);
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
}
|
|
3996
|
+
const Ae = (t) => t instanceof HTMLElement ? t : null, st = (t) => [
|
|
3997
|
+
...t.querySelectorAll("[data-animated-month]") ?? []
|
|
3998
|
+
], Oo = (t) => Ae(t.querySelector("[data-animated-month]")), ot = (t) => Ae(t.querySelector("[data-animated-caption]")), it = (t) => Ae(t.querySelector("[data-animated-weeks]")), po = (t) => Ae(t.querySelector("[data-animated-nav]")), Wo = (t) => Ae(t.querySelector("[data-animated-weekdays]"));
|
|
3999
|
+
function To(t, n, { classNames: e, months: r, focused: a, dateLib: s }) {
|
|
4000
|
+
const o = Qe(null), i = Qe(r), c = Qe(!1);
|
|
4001
|
+
nr(() => {
|
|
4002
|
+
const u = i.current;
|
|
4003
|
+
if (i.current = r, !n || !t.current || // safety check because the ref can be set to anything by consumers
|
|
4004
|
+
!(t.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
4005
|
+
r.length === 0 || u.length === 0 || r.length !== u.length)
|
|
4006
|
+
return;
|
|
4007
|
+
const l = s.isSameMonth(r[0].date, u[0].date), f = s.isAfter(r[0].date, u[0].date), h = f ? e[te.caption_after_enter] : e[te.caption_before_enter], b = f ? e[te.weeks_after_enter] : e[te.weeks_before_enter], v = o.current, p = t.current.cloneNode(!0);
|
|
4008
|
+
if (p instanceof HTMLElement ? (st(p).forEach((M) => {
|
|
4009
|
+
if (!(M instanceof HTMLElement))
|
|
4010
|
+
return;
|
|
4011
|
+
const y = Oo(M);
|
|
4012
|
+
y && M.contains(y) && M.removeChild(y);
|
|
4013
|
+
const m = ot(M);
|
|
4014
|
+
m && m.classList.remove(h);
|
|
4015
|
+
const d = it(M);
|
|
4016
|
+
d && d.classList.remove(b);
|
|
4017
|
+
}), o.current = p) : o.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
|
|
4018
|
+
a)
|
|
4019
|
+
return;
|
|
4020
|
+
const O = v instanceof HTMLElement ? st(v) : [], k = st(t.current);
|
|
4021
|
+
if (k != null && k.every((D) => D instanceof HTMLElement) && O && O.every((D) => D instanceof HTMLElement)) {
|
|
4022
|
+
c.current = !0, t.current.style.isolation = "isolate";
|
|
4023
|
+
const D = po(t.current);
|
|
4024
|
+
D && (D.style.zIndex = "1"), k.forEach((M, y) => {
|
|
4025
|
+
const m = O[y];
|
|
4026
|
+
if (!m)
|
|
4027
|
+
return;
|
|
4028
|
+
M.style.position = "relative", M.style.overflow = "hidden";
|
|
4029
|
+
const d = ot(M);
|
|
4030
|
+
d && d.classList.add(h);
|
|
4031
|
+
const T = it(M);
|
|
4032
|
+
T && T.classList.add(b);
|
|
4033
|
+
const P = () => {
|
|
4034
|
+
c.current = !1, t.current && (t.current.style.isolation = ""), D && (D.style.zIndex = ""), d && d.classList.remove(h), T && T.classList.remove(b), M.style.position = "", M.style.overflow = "", M.contains(m) && M.removeChild(m);
|
|
4035
|
+
};
|
|
4036
|
+
m.style.pointerEvents = "none", m.style.position = "absolute", m.style.overflow = "hidden", m.setAttribute("aria-hidden", "true");
|
|
4037
|
+
const H = Wo(m);
|
|
4038
|
+
H && (H.style.opacity = "0");
|
|
4039
|
+
const S = ot(m);
|
|
4040
|
+
S && (S.classList.add(f ? e[te.caption_before_exit] : e[te.caption_after_exit]), S.addEventListener("animationend", P));
|
|
4041
|
+
const U = it(m);
|
|
4042
|
+
U && U.classList.add(f ? e[te.weeks_before_exit] : e[te.weeks_after_exit]), M.insertBefore(m, M.firstChild);
|
|
4043
|
+
});
|
|
4044
|
+
}
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
4047
|
+
function No(t, n, e, r) {
|
|
4048
|
+
const a = t[0], s = t[t.length - 1], { ISOWeek: o, fixedWeeks: i, broadcastCalendar: c } = e ?? {}, { addDays: u, differenceInCalendarDays: l, differenceInCalendarMonths: f, endOfBroadcastWeek: h, endOfISOWeek: b, endOfMonth: v, endOfWeek: p, isAfter: O, startOfBroadcastWeek: k, startOfISOWeek: D, startOfWeek: M } = r, y = c ? k(a, r) : o ? D(a) : M(a), m = c ? h(s) : o ? b(v(s)) : p(v(s)), d = n && (c ? h(n) : o ? b(n) : p(n)), T = d && O(m, d) ? d : m, P = l(T, y), H = f(s, a) + 1, S = [];
|
|
4049
|
+
for (let J = 0; J <= P; J++) {
|
|
4050
|
+
const K = u(y, J);
|
|
4051
|
+
S.push(K);
|
|
4052
|
+
}
|
|
4053
|
+
const oe = (c ? 35 : 42) * H;
|
|
4054
|
+
if (i && S.length < oe) {
|
|
4055
|
+
const J = oe - S.length;
|
|
4056
|
+
for (let K = 0; K < J; K++) {
|
|
4057
|
+
const ke = u(S[S.length - 1], 1);
|
|
4058
|
+
S.push(ke);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
return S;
|
|
4062
|
+
}
|
|
4063
|
+
function Yo(t) {
|
|
4064
|
+
const n = [];
|
|
4065
|
+
return t.reduce((e, r) => {
|
|
4066
|
+
const a = r.weeks.reduce((s, o) => s.concat(o.days.slice()), n.slice());
|
|
4067
|
+
return e.concat(a.slice());
|
|
4068
|
+
}, n.slice());
|
|
4069
|
+
}
|
|
4070
|
+
function Po(t, n, e, r) {
|
|
4071
|
+
const { numberOfMonths: a = 1 } = e, s = [];
|
|
4072
|
+
for (let o = 0; o < a; o++) {
|
|
4073
|
+
const i = r.addMonths(t, o);
|
|
4074
|
+
if (n && i > n)
|
|
4075
|
+
break;
|
|
4076
|
+
s.push(i);
|
|
4077
|
+
}
|
|
4078
|
+
return s;
|
|
4079
|
+
}
|
|
4080
|
+
function Ht(t, n, e, r) {
|
|
4081
|
+
const { month: a, defaultMonth: s, today: o = r.today(), numberOfMonths: i = 1 } = t;
|
|
4082
|
+
let c = a || s || o;
|
|
4083
|
+
const { differenceInCalendarMonths: u, addMonths: l, startOfMonth: f } = r;
|
|
4084
|
+
if (e && u(e, c) < i - 1) {
|
|
4085
|
+
const h = -1 * (i - 1);
|
|
4086
|
+
c = l(e, h);
|
|
4087
|
+
}
|
|
4088
|
+
return n && u(c, n) < 0 && (c = n), f(c);
|
|
4089
|
+
}
|
|
4090
|
+
function Co(t, n, e, r) {
|
|
4091
|
+
const { addDays: a, endOfBroadcastWeek: s, endOfISOWeek: o, endOfMonth: i, endOfWeek: c, getISOWeek: u, getWeek: l, startOfBroadcastWeek: f, startOfISOWeek: h, startOfWeek: b } = r, v = t.reduce((p, O) => {
|
|
4092
|
+
const k = e.broadcastCalendar ? f(O, r) : e.ISOWeek ? h(O) : b(O), D = e.broadcastCalendar ? s(O) : e.ISOWeek ? o(i(O)) : c(i(O)), M = n.filter((T) => T >= k && T <= D), y = e.broadcastCalendar ? 35 : 42;
|
|
4093
|
+
if (e.fixedWeeks && M.length < y) {
|
|
4094
|
+
const T = n.filter((P) => {
|
|
4095
|
+
const H = y - M.length;
|
|
4096
|
+
return P > D && P <= a(D, H);
|
|
4097
|
+
});
|
|
4098
|
+
M.push(...T);
|
|
4099
|
+
}
|
|
4100
|
+
const m = M.reduce((T, P) => {
|
|
4101
|
+
const H = e.ISOWeek ? u(P) : l(P), S = T.find((oe) => oe.weekNumber === H), U = new cn(P, O, r);
|
|
4102
|
+
return S ? S.days.push(U) : T.push(new ps(H, [U])), T;
|
|
4103
|
+
}, []), d = new Os(O, m);
|
|
4104
|
+
return p.push(d), p;
|
|
4105
|
+
}, []);
|
|
4106
|
+
return e.reverseMonths ? v.reverse() : v;
|
|
4107
|
+
}
|
|
4108
|
+
function _o(t, n) {
|
|
4109
|
+
let { startMonth: e, endMonth: r } = t;
|
|
4110
|
+
const { startOfYear: a, startOfDay: s, startOfMonth: o, endOfMonth: i, addYears: c, endOfYear: u, newDate: l, today: f } = n, { fromYear: h, toYear: b, fromMonth: v, toMonth: p } = t;
|
|
4111
|
+
!e && v && (e = v), !e && h && (e = n.newDate(h, 0, 1)), !r && p && (r = p), !r && b && (r = l(b, 11, 31));
|
|
4112
|
+
const O = t.captionLayout === "dropdown" || t.captionLayout === "dropdown-years";
|
|
4113
|
+
return e ? e = o(e) : h ? e = l(h, 0, 1) : !e && O && (e = a(c(t.today ?? f(), -100))), r ? r = i(r) : b ? r = l(b, 11, 31) : !r && O && (r = u(t.today ?? f())), [
|
|
4114
|
+
e && s(e),
|
|
4115
|
+
r && s(r)
|
|
4116
|
+
];
|
|
4117
|
+
}
|
|
4118
|
+
function Eo(t, n, e, r) {
|
|
4119
|
+
if (e.disableNavigation)
|
|
4120
|
+
return;
|
|
4121
|
+
const { pagedNavigation: a, numberOfMonths: s = 1 } = e, { startOfMonth: o, addMonths: i, differenceInCalendarMonths: c } = r, u = a ? s : 1, l = o(t);
|
|
4122
|
+
if (!n)
|
|
4123
|
+
return i(l, u);
|
|
4124
|
+
if (!(c(n, t) < s))
|
|
4125
|
+
return i(l, u);
|
|
4126
|
+
}
|
|
4127
|
+
function So(t, n, e, r) {
|
|
4128
|
+
if (e.disableNavigation)
|
|
4129
|
+
return;
|
|
4130
|
+
const { pagedNavigation: a, numberOfMonths: s } = e, { startOfMonth: o, addMonths: i, differenceInCalendarMonths: c } = r, u = a ? s ?? 1 : 1, l = o(t);
|
|
4131
|
+
if (!n)
|
|
4132
|
+
return i(l, -u);
|
|
4133
|
+
if (!(c(l, n) <= 0))
|
|
4134
|
+
return i(l, -u);
|
|
4135
|
+
}
|
|
4136
|
+
function Io(t) {
|
|
4137
|
+
const n = [];
|
|
4138
|
+
return t.reduce((e, r) => e.concat(r.weeks.slice()), n.slice());
|
|
4139
|
+
}
|
|
4140
|
+
function Je(t, n) {
|
|
4141
|
+
const [e, r] = ut(t);
|
|
4142
|
+
return [n === void 0 ? e : n, r];
|
|
4143
|
+
}
|
|
4144
|
+
function Fo(t, n) {
|
|
4145
|
+
var y;
|
|
4146
|
+
const [e, r] = _o(t, n), { startOfMonth: a, endOfMonth: s } = n, o = Ht(t, e, r, n), [i, c] = Je(
|
|
4147
|
+
o,
|
|
4148
|
+
// initialMonth is always computed from props.month if provided
|
|
4149
|
+
t.month ? o : void 0
|
|
4150
|
+
);
|
|
4151
|
+
rr(() => {
|
|
4152
|
+
const m = Ht(t, e, r, n);
|
|
4153
|
+
c(m);
|
|
4154
|
+
}, [t.timeZone]);
|
|
4155
|
+
const { months: u, weeks: l, days: f, previousMonth: h, nextMonth: b } = $e(() => {
|
|
4156
|
+
const m = Po(i, r, { numberOfMonths: t.numberOfMonths }, n), d = No(m, t.endMonth ? s(t.endMonth) : void 0, {
|
|
4157
|
+
ISOWeek: t.ISOWeek,
|
|
4158
|
+
fixedWeeks: t.fixedWeeks,
|
|
4159
|
+
broadcastCalendar: t.broadcastCalendar
|
|
4160
|
+
}, n), T = Co(m, d, {
|
|
4161
|
+
broadcastCalendar: t.broadcastCalendar,
|
|
4162
|
+
fixedWeeks: t.fixedWeeks,
|
|
4163
|
+
ISOWeek: t.ISOWeek,
|
|
4164
|
+
reverseMonths: t.reverseMonths
|
|
4165
|
+
}, n), P = Io(T), H = Yo(T), S = So(i, e, t, n), U = Eo(i, r, t, n);
|
|
4166
|
+
return {
|
|
4167
|
+
months: T,
|
|
4168
|
+
weeks: P,
|
|
4169
|
+
days: H,
|
|
4170
|
+
previousMonth: S,
|
|
4171
|
+
nextMonth: U
|
|
4172
|
+
};
|
|
4173
|
+
}, [
|
|
4174
|
+
n,
|
|
4175
|
+
i.getTime(),
|
|
4176
|
+
r == null ? void 0 : r.getTime(),
|
|
4177
|
+
e == null ? void 0 : e.getTime(),
|
|
4178
|
+
t.disableNavigation,
|
|
4179
|
+
t.broadcastCalendar,
|
|
4180
|
+
(y = t.endMonth) == null ? void 0 : y.getTime(),
|
|
4181
|
+
t.fixedWeeks,
|
|
4182
|
+
t.ISOWeek,
|
|
4183
|
+
t.numberOfMonths,
|
|
4184
|
+
t.pagedNavigation,
|
|
4185
|
+
t.reverseMonths
|
|
4186
|
+
]), { disableNavigation: v, onMonthChange: p } = t, O = (m) => l.some((d) => d.days.some((T) => T.isEqualTo(m))), k = (m) => {
|
|
4187
|
+
if (v)
|
|
4188
|
+
return;
|
|
4189
|
+
let d = a(m);
|
|
4190
|
+
e && d < a(e) && (d = a(e)), r && d > a(r) && (d = a(r)), c(d), p == null || p(d);
|
|
4191
|
+
};
|
|
4192
|
+
return {
|
|
4193
|
+
months: u,
|
|
4194
|
+
weeks: l,
|
|
4195
|
+
days: f,
|
|
4196
|
+
navStart: e,
|
|
4197
|
+
navEnd: r,
|
|
4198
|
+
previousMonth: h,
|
|
4199
|
+
nextMonth: b,
|
|
4200
|
+
goToMonth: k,
|
|
4201
|
+
goToDay: (m) => {
|
|
4202
|
+
O(m) || k(m.date);
|
|
4203
|
+
}
|
|
4204
|
+
};
|
|
4205
|
+
}
|
|
4206
|
+
var le;
|
|
4207
|
+
(function(t) {
|
|
4208
|
+
t[t.Today = 0] = "Today", t[t.Selected = 1] = "Selected", t[t.LastFocused = 2] = "LastFocused", t[t.FocusedModifier = 3] = "FocusedModifier";
|
|
4209
|
+
})(le || (le = {}));
|
|
4210
|
+
function qt(t) {
|
|
4211
|
+
return !t[q.disabled] && !t[q.hidden] && !t[q.outside];
|
|
4212
|
+
}
|
|
4213
|
+
function Bo(t, n, e, r) {
|
|
4214
|
+
let a, s = -1;
|
|
4215
|
+
for (const o of t) {
|
|
4216
|
+
const i = n(o);
|
|
4217
|
+
qt(i) && (i[q.focused] && s < le.FocusedModifier ? (a = o, s = le.FocusedModifier) : r != null && r.isEqualTo(o) && s < le.LastFocused ? (a = o, s = le.LastFocused) : e(o.date) && s < le.Selected ? (a = o, s = le.Selected) : i[q.today] && s < le.Today && (a = o, s = le.Today));
|
|
4218
|
+
}
|
|
4219
|
+
return a || (a = t.find((o) => qt(n(o)))), a;
|
|
4220
|
+
}
|
|
4221
|
+
function Ho(t, n, e, r, a, s, o) {
|
|
4222
|
+
const { ISOWeek: i, broadcastCalendar: c } = s, { addDays: u, addMonths: l, addWeeks: f, addYears: h, endOfBroadcastWeek: b, endOfISOWeek: v, endOfWeek: p, max: O, min: k, startOfBroadcastWeek: D, startOfISOWeek: M, startOfWeek: y } = o;
|
|
4223
|
+
let d = {
|
|
4224
|
+
day: u,
|
|
4225
|
+
week: f,
|
|
4226
|
+
month: l,
|
|
4227
|
+
year: h,
|
|
4228
|
+
startOfWeek: (T) => c ? D(T, o) : i ? M(T) : y(T),
|
|
4229
|
+
endOfWeek: (T) => c ? b(T) : i ? v(T) : p(T)
|
|
4230
|
+
}[t](e, n === "after" ? 1 : -1);
|
|
4231
|
+
return n === "before" && r ? d = O([r, d]) : n === "after" && a && (d = k([a, d])), d;
|
|
4232
|
+
}
|
|
4233
|
+
function vn(t, n, e, r, a, s, o, i = 0) {
|
|
4234
|
+
if (i > 365)
|
|
4235
|
+
return;
|
|
4236
|
+
const c = Ho(t, n, e.date, r, a, s, o), u = !!(s.disabled && be(c, s.disabled, o)), l = !!(s.hidden && be(c, s.hidden, o)), f = c, h = new cn(c, f, o);
|
|
4237
|
+
return !u && !l ? h : vn(t, n, h, r, a, s, o, i + 1);
|
|
4238
|
+
}
|
|
4239
|
+
function qo(t, n, e, r, a) {
|
|
4240
|
+
const { autoFocus: s } = t, [o, i] = ut(), c = Bo(n.days, e, r || (() => !1), o), [u, l] = ut(s ? c : void 0);
|
|
4241
|
+
return {
|
|
4242
|
+
isFocusTarget: (p) => !!(c != null && c.isEqualTo(p)),
|
|
4243
|
+
setFocused: l,
|
|
4244
|
+
focused: u,
|
|
4245
|
+
blur: () => {
|
|
4246
|
+
i(u), l(void 0);
|
|
4247
|
+
},
|
|
4248
|
+
moveFocus: (p, O) => {
|
|
4249
|
+
if (!u)
|
|
4250
|
+
return;
|
|
4251
|
+
const k = vn(p, O, u, n.navStart, n.navEnd, t, a);
|
|
4252
|
+
k && (t.disableNavigation && !n.days.some((M) => M.isEqualTo(k)) || (n.goToDay(k), l(k)));
|
|
4253
|
+
}
|
|
4254
|
+
};
|
|
4255
|
+
}
|
|
4256
|
+
function Ao(t, n) {
|
|
4257
|
+
const { selected: e, required: r, onSelect: a } = t, [s, o] = Je(e, a ? e : void 0), i = a ? e : s, { isSameDay: c } = n, u = (b) => (i == null ? void 0 : i.some((v) => c(v, b))) ?? !1, { min: l, max: f } = t;
|
|
4258
|
+
return {
|
|
4259
|
+
selected: i,
|
|
4260
|
+
select: (b, v, p) => {
|
|
4261
|
+
let O = [...i ?? []];
|
|
4262
|
+
if (u(b)) {
|
|
4263
|
+
if ((i == null ? void 0 : i.length) === l || r && (i == null ? void 0 : i.length) === 1)
|
|
4264
|
+
return;
|
|
4265
|
+
O = i == null ? void 0 : i.filter((k) => !c(k, b));
|
|
4266
|
+
} else
|
|
4267
|
+
(i == null ? void 0 : i.length) === f ? O = [b] : O = [...O, b];
|
|
4268
|
+
return a || o(O), a == null || a(O, b, v, p), O;
|
|
4269
|
+
},
|
|
4270
|
+
isSelected: u
|
|
4271
|
+
};
|
|
4272
|
+
}
|
|
4273
|
+
function Ro(t, n, e = 0, r = 0, a = !1, s = me) {
|
|
4274
|
+
const { from: o, to: i } = n || {}, { isSameDay: c, isAfter: u, isBefore: l } = s;
|
|
4275
|
+
let f;
|
|
4276
|
+
if (!o && !i)
|
|
4277
|
+
f = { from: t, to: e > 0 ? void 0 : t };
|
|
4278
|
+
else if (o && !i)
|
|
4279
|
+
c(o, t) ? e === 0 ? f = { from: o, to: t } : a ? f = { from: o, to: void 0 } : f = void 0 : l(t, o) ? f = { from: t, to: o } : f = { from: o, to: t };
|
|
4280
|
+
else if (o && i)
|
|
4281
|
+
if (c(o, t) && c(i, t))
|
|
4282
|
+
a ? f = { from: o, to: i } : f = void 0;
|
|
4283
|
+
else if (c(o, t))
|
|
4284
|
+
f = { from: o, to: e > 0 ? void 0 : t };
|
|
4285
|
+
else if (c(i, t))
|
|
4286
|
+
f = { from: t, to: e > 0 ? void 0 : t };
|
|
4287
|
+
else if (l(t, o))
|
|
4288
|
+
f = { from: t, to: i };
|
|
4289
|
+
else if (u(t, o))
|
|
4290
|
+
f = { from: o, to: t };
|
|
4291
|
+
else if (u(t, i))
|
|
4292
|
+
f = { from: o, to: t };
|
|
4293
|
+
else
|
|
4294
|
+
throw new Error("Invalid range");
|
|
4295
|
+
if (f != null && f.from && (f != null && f.to)) {
|
|
4296
|
+
const h = s.differenceInCalendarDays(f.to, f.from);
|
|
4297
|
+
r > 0 && h > r ? f = { from: t, to: void 0 } : e > 1 && h < e && (f = { from: t, to: void 0 });
|
|
4298
|
+
}
|
|
4299
|
+
return f;
|
|
4300
|
+
}
|
|
4301
|
+
function jo(t, n, e = me) {
|
|
4302
|
+
const r = Array.isArray(n) ? n : [n];
|
|
4303
|
+
let a = t.from;
|
|
4304
|
+
const s = e.differenceInCalendarDays(t.to, t.from), o = Math.min(s, 6);
|
|
4305
|
+
for (let i = 0; i <= o; i++) {
|
|
4306
|
+
if (r.includes(a.getDay()))
|
|
4307
|
+
return !0;
|
|
4308
|
+
a = e.addDays(a, 1);
|
|
4309
|
+
}
|
|
4310
|
+
return !1;
|
|
4311
|
+
}
|
|
4312
|
+
function At(t, n, e = me) {
|
|
4313
|
+
return we(t, n.from, !1, e) || we(t, n.to, !1, e) || we(n, t.from, !1, e) || we(n, t.to, !1, e);
|
|
4314
|
+
}
|
|
4315
|
+
function Go(t, n, e = me) {
|
|
4316
|
+
const r = Array.isArray(n) ? n : [n];
|
|
4317
|
+
if (r.filter((i) => typeof i != "function").some((i) => typeof i == "boolean" ? i : e.isDate(i) ? we(t, i, !1, e) : dn(i, e) ? i.some((c) => we(t, c, !1, e)) : Ze(i) ? i.from && i.to ? At(t, { from: i.from, to: i.to }, e) : !1 : ln(i) ? jo(t, i.dayOfWeek, e) : gt(i) ? e.isAfter(i.before, i.after) ? At(t, {
|
|
4318
|
+
from: e.addDays(i.after, 1),
|
|
4319
|
+
to: e.addDays(i.before, -1)
|
|
4320
|
+
}, e) : be(t.from, i, e) || be(t.to, i, e) : kt(i) || Mt(i) ? be(t.from, i, e) || be(t.to, i, e) : !1))
|
|
4321
|
+
return !0;
|
|
4322
|
+
const o = r.filter((i) => typeof i == "function");
|
|
4323
|
+
if (o.length) {
|
|
4324
|
+
let i = t.from;
|
|
4325
|
+
const c = e.differenceInCalendarDays(t.to, t.from);
|
|
4326
|
+
for (let u = 0; u <= c; u++) {
|
|
4327
|
+
if (o.some((l) => l(i)))
|
|
4328
|
+
return !0;
|
|
4329
|
+
i = e.addDays(i, 1);
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
return !1;
|
|
4333
|
+
}
|
|
4334
|
+
function Qo(t, n) {
|
|
4335
|
+
const { disabled: e, excludeDisabled: r, selected: a, required: s, onSelect: o } = t, [i, c] = Je(a, o ? a : void 0), u = o ? a : i;
|
|
4336
|
+
return {
|
|
4337
|
+
selected: u,
|
|
4338
|
+
select: (h, b, v) => {
|
|
4339
|
+
const { min: p, max: O } = t, k = h ? Ro(h, u, p, O, s, n) : void 0;
|
|
4340
|
+
return r && e && (k != null && k.from) && k.to && Go({ from: k.from, to: k.to }, e, n) && (k.from = h, k.to = void 0), o || c(k), o == null || o(k, h, b, v), k;
|
|
4341
|
+
},
|
|
4342
|
+
isSelected: (h) => u && we(u, h, !1, n)
|
|
4343
|
+
};
|
|
4344
|
+
}
|
|
4345
|
+
function $o(t, n) {
|
|
4346
|
+
const { selected: e, required: r, onSelect: a } = t, [s, o] = Je(e, a ? e : void 0), i = a ? e : s, { isSameDay: c } = n;
|
|
4347
|
+
return {
|
|
4348
|
+
selected: i,
|
|
4349
|
+
select: (f, h, b) => {
|
|
4350
|
+
let v = f;
|
|
4351
|
+
return !r && i && i && c(f, i) && (v = void 0), a || o(v), a == null || a(v, f, h, b), v;
|
|
4352
|
+
},
|
|
4353
|
+
isSelected: (f) => i ? c(i, f) : !1
|
|
4354
|
+
};
|
|
4355
|
+
}
|
|
4356
|
+
function zo(t, n) {
|
|
4357
|
+
const e = $o(t, n), r = Ao(t, n), a = Qo(t, n);
|
|
4358
|
+
switch (t.mode) {
|
|
4359
|
+
case "single":
|
|
4360
|
+
return e;
|
|
4361
|
+
case "multiple":
|
|
4362
|
+
return r;
|
|
4363
|
+
case "range":
|
|
4364
|
+
return a;
|
|
4365
|
+
default:
|
|
4366
|
+
return;
|
|
4367
|
+
}
|
|
4368
|
+
}
|
|
4369
|
+
function se(t, n) {
|
|
4370
|
+
return t instanceof V && t.timeZone === n ? t : new V(t, n);
|
|
4371
|
+
}
|
|
4372
|
+
function Ce(t, n, e) {
|
|
4373
|
+
return se(t, n);
|
|
4374
|
+
}
|
|
4375
|
+
function Rt(t, n, e) {
|
|
4376
|
+
return typeof t == "boolean" || typeof t == "function" ? t : t instanceof Date ? Ce(t, n) : Array.isArray(t) ? t.map((r) => r instanceof Date ? Ce(r, n) : r) : Ze(t) ? {
|
|
4377
|
+
...t,
|
|
4378
|
+
from: t.from ? se(t.from, n) : t.from,
|
|
4379
|
+
to: t.to ? se(t.to, n) : t.to
|
|
4380
|
+
} : gt(t) ? {
|
|
4381
|
+
before: Ce(t.before, n),
|
|
4382
|
+
after: Ce(t.after, n)
|
|
4383
|
+
} : kt(t) ? {
|
|
4384
|
+
after: Ce(t.after, n)
|
|
4385
|
+
} : Mt(t) ? {
|
|
4386
|
+
before: Ce(t.before, n)
|
|
4387
|
+
} : t;
|
|
4388
|
+
}
|
|
4389
|
+
function ct(t, n, e) {
|
|
4390
|
+
return t && (Array.isArray(t) ? t.map((r) => Rt(r, n)) : Rt(t, n));
|
|
4391
|
+
}
|
|
4392
|
+
function Xo(t) {
|
|
4393
|
+
var Nt;
|
|
4394
|
+
let n = t;
|
|
4395
|
+
const e = n.timeZone;
|
|
4396
|
+
if (e && (n = {
|
|
4397
|
+
...t,
|
|
4398
|
+
timeZone: e
|
|
4399
|
+
}, n.today && (n.today = se(n.today, e)), n.month && (n.month = se(n.month, e)), n.defaultMonth && (n.defaultMonth = se(n.defaultMonth, e)), n.startMonth && (n.startMonth = se(n.startMonth, e)), n.endMonth && (n.endMonth = se(n.endMonth, e)), n.mode === "single" && n.selected ? n.selected = se(n.selected, e) : n.mode === "multiple" && n.selected ? n.selected = (Nt = n.selected) == null ? void 0 : Nt.map((N) => se(N, e)) : n.mode === "range" && n.selected && (n.selected = {
|
|
4400
|
+
from: n.selected.from ? se(n.selected.from, e) : n.selected.from,
|
|
4401
|
+
to: n.selected.to ? se(n.selected.to, e) : n.selected.to
|
|
4402
|
+
}), n.disabled !== void 0 && (n.disabled = ct(n.disabled, e)), n.hidden !== void 0 && (n.hidden = ct(n.hidden, e)), n.modifiers)) {
|
|
4403
|
+
const N = {};
|
|
4404
|
+
Object.keys(n.modifiers).forEach((I) => {
|
|
4405
|
+
var W;
|
|
4406
|
+
N[I] = ct((W = n.modifiers) == null ? void 0 : W[I], e);
|
|
4407
|
+
}), n.modifiers = N;
|
|
4408
|
+
}
|
|
4409
|
+
const { components: r, formatters: a, labels: s, dateLib: o, locale: i, classNames: c } = $e(() => {
|
|
4410
|
+
const N = { ...on, ...n.locale }, I = n.broadcastCalendar ? 1 : n.weekStartsOn, W = n.noonSafe && n.timeZone ? vo(n.timeZone, {
|
|
4411
|
+
weekStartsOn: I,
|
|
4412
|
+
locale: N
|
|
4413
|
+
}) : void 0, _ = n.dateLib && W ? { ...W, ...n.dateLib } : n.dateLib ?? W, ee = new ne({
|
|
4414
|
+
locale: N,
|
|
4415
|
+
weekStartsOn: I,
|
|
4416
|
+
firstWeekContainsDate: n.firstWeekContainsDate,
|
|
4417
|
+
useAdditionalWeekYearTokens: n.useAdditionalWeekYearTokens,
|
|
4418
|
+
useAdditionalDayOfYearTokens: n.useAdditionalDayOfYearTokens,
|
|
4419
|
+
timeZone: n.timeZone,
|
|
4420
|
+
numerals: n.numerals
|
|
4421
|
+
}, _);
|
|
4422
|
+
return {
|
|
4423
|
+
dateLib: ee,
|
|
4424
|
+
components: to(n.components),
|
|
4425
|
+
formatters: ho(n.formatters),
|
|
4426
|
+
labels: go(n.labels, ee.options),
|
|
4427
|
+
locale: N,
|
|
4428
|
+
classNames: { ...ro(), ...n.classNames }
|
|
4429
|
+
};
|
|
4430
|
+
}, [
|
|
4431
|
+
n.locale,
|
|
4432
|
+
n.broadcastCalendar,
|
|
4433
|
+
n.weekStartsOn,
|
|
4434
|
+
n.firstWeekContainsDate,
|
|
4435
|
+
n.useAdditionalWeekYearTokens,
|
|
4436
|
+
n.useAdditionalDayOfYearTokens,
|
|
4437
|
+
n.timeZone,
|
|
4438
|
+
n.numerals,
|
|
4439
|
+
n.dateLib,
|
|
4440
|
+
n.noonSafe,
|
|
4441
|
+
n.components,
|
|
4442
|
+
n.formatters,
|
|
4443
|
+
n.labels,
|
|
4444
|
+
n.classNames
|
|
4445
|
+
]);
|
|
4446
|
+
n.today || (n = { ...n, today: o.today() });
|
|
4447
|
+
const { captionLayout: u, mode: l, navLayout: f, numberOfMonths: h = 1, onDayBlur: b, onDayClick: v, onDayFocus: p, onDayKeyDown: O, onDayMouseEnter: k, onDayMouseLeave: D, onNextClick: M, onPrevClick: y, showWeekNumber: m, styles: d } = n, { formatCaption: T, formatDay: P, formatMonthDropdown: H, formatWeekNumber: S, formatWeekNumberHeader: U, formatWeekdayName: oe, formatYearDropdown: J } = a, K = Fo(n, o), { days: ke, months: Ne, navStart: Ee, navEnd: Ye, previousMonth: L, nextMonth: z, goToMonth: re } = K, $ = Ls(ke, n, Ee, Ye, o), { isSelected: j, select: Se, selected: Re } = zo(n, o) ?? {}, { blur: vt, focused: je, isFocusTarget: On, moveFocus: Ot, setFocused: Ge } = qo(n, K, $, j ?? (() => !1), o), { labelDayButton: pn, labelGridcell: Wn, labelGrid: Tn, labelMonthDropdown: Nn, labelNav: pt, labelPrevious: Yn, labelNext: Pn, labelWeekday: Cn, labelWeekNumber: _n, labelWeekNumberHeader: En, labelYearDropdown: Sn } = s, In = $e(() => Do(o, n.ISOWeek, n.broadcastCalendar, n.today), [o, n.ISOWeek, n.broadcastCalendar, n.today]), Wt = l !== void 0 || v !== void 0, Le = ae(() => {
|
|
4448
|
+
L && (re(L), y == null || y(L));
|
|
4449
|
+
}, [L, re, y]), et = ae(() => {
|
|
4450
|
+
z && (re(z), M == null || M(z));
|
|
4451
|
+
}, [re, z, M]), Fn = ae((N, I) => (W) => {
|
|
4452
|
+
W.preventDefault(), W.stopPropagation(), Ge(N), !I.disabled && (Se == null || Se(N.date, I, W), v == null || v(N.date, I, W));
|
|
4453
|
+
}, [Se, v, Ge]), Bn = ae((N, I) => (W) => {
|
|
4454
|
+
Ge(N), p == null || p(N.date, I, W);
|
|
4455
|
+
}, [p, Ge]), Hn = ae((N, I) => (W) => {
|
|
4456
|
+
vt(), b == null || b(N.date, I, W);
|
|
4457
|
+
}, [vt, b]), qn = ae((N, I) => (W) => {
|
|
4458
|
+
const _ = {
|
|
4459
|
+
ArrowLeft: [
|
|
4460
|
+
W.shiftKey ? "month" : "day",
|
|
4461
|
+
n.dir === "rtl" ? "after" : "before"
|
|
4462
|
+
],
|
|
4463
|
+
ArrowRight: [
|
|
4464
|
+
W.shiftKey ? "month" : "day",
|
|
4465
|
+
n.dir === "rtl" ? "before" : "after"
|
|
4466
|
+
],
|
|
4467
|
+
ArrowDown: [W.shiftKey ? "year" : "week", "after"],
|
|
4468
|
+
ArrowUp: [W.shiftKey ? "year" : "week", "before"],
|
|
4469
|
+
PageUp: [W.shiftKey ? "year" : "month", "before"],
|
|
4470
|
+
PageDown: [W.shiftKey ? "year" : "month", "after"],
|
|
4471
|
+
Home: ["startOfWeek", "before"],
|
|
4472
|
+
End: ["endOfWeek", "after"]
|
|
4473
|
+
};
|
|
4474
|
+
if (_[W.key]) {
|
|
4475
|
+
W.preventDefault(), W.stopPropagation();
|
|
4476
|
+
const [ee, C] = _[W.key];
|
|
4477
|
+
Ot(ee, C);
|
|
4478
|
+
}
|
|
4479
|
+
O == null || O(N.date, I, W);
|
|
4480
|
+
}, [Ot, O, n.dir]), An = ae((N, I) => (W) => {
|
|
4481
|
+
k == null || k(N.date, I, W);
|
|
4482
|
+
}, [k]), Rn = ae((N, I) => (W) => {
|
|
4483
|
+
D == null || D(N.date, I, W);
|
|
4484
|
+
}, [D]), jn = ae((N) => (I) => {
|
|
4485
|
+
const W = Number(I.target.value), _ = o.setMonth(o.startOfMonth(N), W);
|
|
4486
|
+
re(_);
|
|
4487
|
+
}, [o, re]), Gn = ae((N) => (I) => {
|
|
4488
|
+
const W = Number(I.target.value), _ = o.setYear(o.startOfMonth(N), W);
|
|
4489
|
+
re(_);
|
|
4490
|
+
}, [o, re]), { className: Qn, style: $n } = $e(() => ({
|
|
4491
|
+
className: [c[x.Root], n.className].filter(Boolean).join(" "),
|
|
4492
|
+
style: { ...d == null ? void 0 : d[x.Root], ...n.style }
|
|
4493
|
+
}), [c, n.className, n.style, d]), zn = no(n), Tt = Qe(null);
|
|
4494
|
+
To(Tt, !!n.animate, {
|
|
4495
|
+
classNames: c,
|
|
4496
|
+
months: Ne,
|
|
4497
|
+
focused: je,
|
|
4498
|
+
dateLib: o
|
|
4499
|
+
});
|
|
4500
|
+
const Xn = {
|
|
4501
|
+
dayPickerProps: n,
|
|
4502
|
+
selected: Re,
|
|
4503
|
+
select: Se,
|
|
4504
|
+
isSelected: j,
|
|
4505
|
+
months: Ne,
|
|
4506
|
+
nextMonth: z,
|
|
4507
|
+
previousMonth: L,
|
|
4508
|
+
goToMonth: re,
|
|
4509
|
+
getModifiers: $,
|
|
4510
|
+
components: r,
|
|
4511
|
+
classNames: c,
|
|
4512
|
+
styles: d,
|
|
4513
|
+
labels: s,
|
|
4514
|
+
formatters: a
|
|
4515
|
+
};
|
|
4516
|
+
return w.createElement(
|
|
4517
|
+
un.Provider,
|
|
4518
|
+
{ value: Xn },
|
|
4519
|
+
w.createElement(
|
|
4520
|
+
r.Root,
|
|
4521
|
+
{ rootRef: n.animate ? Tt : void 0, className: Qn, style: $n, dir: n.dir, id: n.id, lang: n.lang, nonce: n.nonce, title: n.title, role: n.role, "aria-label": n["aria-label"], "aria-labelledby": n["aria-labelledby"], ...zn },
|
|
4522
|
+
w.createElement(
|
|
4523
|
+
r.Months,
|
|
4524
|
+
{ className: c[x.Months], style: d == null ? void 0 : d[x.Months] },
|
|
4525
|
+
!n.hideNavigation && !f && w.createElement(r.Nav, { "data-animated-nav": n.animate ? "true" : void 0, className: c[x.Nav], style: d == null ? void 0 : d[x.Nav], "aria-label": pt(), onPreviousClick: Le, onNextClick: et, previousMonth: L, nextMonth: z }),
|
|
4526
|
+
Ne.map((N, I) => w.createElement(
|
|
4527
|
+
r.Month,
|
|
4528
|
+
{
|
|
4529
|
+
"data-animated-month": n.animate ? "true" : void 0,
|
|
4530
|
+
className: c[x.Month],
|
|
4531
|
+
style: d == null ? void 0 : d[x.Month],
|
|
4532
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
4533
|
+
key: I,
|
|
4534
|
+
displayIndex: I,
|
|
4535
|
+
calendarMonth: N
|
|
4536
|
+
},
|
|
4537
|
+
f === "around" && !n.hideNavigation && I === 0 && w.createElement(
|
|
4538
|
+
r.PreviousMonthButton,
|
|
4539
|
+
{ type: "button", className: c[x.PreviousMonthButton], tabIndex: L ? void 0 : -1, "aria-disabled": L ? void 0 : !0, "aria-label": Yn(L), onClick: Le, "data-animated-button": n.animate ? "true" : void 0 },
|
|
4540
|
+
w.createElement(r.Chevron, { disabled: L ? void 0 : !0, className: c[x.Chevron], orientation: n.dir === "rtl" ? "right" : "left" })
|
|
4541
|
+
),
|
|
4542
|
+
w.createElement(r.MonthCaption, { "data-animated-caption": n.animate ? "true" : void 0, className: c[x.MonthCaption], style: d == null ? void 0 : d[x.MonthCaption], calendarMonth: N, displayIndex: I }, u != null && u.startsWith("dropdown") ? w.createElement(
|
|
4543
|
+
r.DropdownNav,
|
|
4544
|
+
{ className: c[x.Dropdowns], style: d == null ? void 0 : d[x.Dropdowns] },
|
|
4545
|
+
(() => {
|
|
4546
|
+
const W = u === "dropdown" || u === "dropdown-months" ? w.createElement(r.MonthsDropdown, { key: "month", className: c[x.MonthsDropdown], "aria-label": Nn(), classNames: c, components: r, disabled: !!n.disableNavigation, onChange: jn(N.date), options: ko(N.date, Ee, Ye, a, o), style: d == null ? void 0 : d[x.Dropdown], value: o.getMonth(N.date) }) : w.createElement("span", { key: "month" }, H(N.date, o)), _ = u === "dropdown" || u === "dropdown-years" ? w.createElement(r.YearsDropdown, { key: "year", className: c[x.YearsDropdown], "aria-label": Sn(o.options), classNames: c, components: r, disabled: !!n.disableNavigation, onChange: Gn(N.date), options: xo(Ee, Ye, a, o, !!n.reverseYears), style: d == null ? void 0 : d[x.Dropdown], value: o.getYear(N.date) }) : w.createElement("span", { key: "year" }, J(N.date, o));
|
|
4547
|
+
return o.getMonthYearOrder() === "year-first" ? [_, W] : [W, _];
|
|
4548
|
+
})(),
|
|
4549
|
+
w.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
4550
|
+
border: 0,
|
|
4551
|
+
clip: "rect(0 0 0 0)",
|
|
4552
|
+
height: "1px",
|
|
4553
|
+
margin: "-1px",
|
|
4554
|
+
overflow: "hidden",
|
|
4555
|
+
padding: 0,
|
|
4556
|
+
position: "absolute",
|
|
4557
|
+
width: "1px",
|
|
4558
|
+
whiteSpace: "nowrap",
|
|
4559
|
+
wordWrap: "normal"
|
|
4560
|
+
} }, T(N.date, o.options, o))
|
|
4561
|
+
) : w.createElement(r.CaptionLabel, { className: c[x.CaptionLabel], role: "status", "aria-live": "polite" }, T(N.date, o.options, o))),
|
|
4562
|
+
f === "around" && !n.hideNavigation && I === h - 1 && w.createElement(
|
|
4563
|
+
r.NextMonthButton,
|
|
4564
|
+
{ type: "button", className: c[x.NextMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label": Pn(z), onClick: et, "data-animated-button": n.animate ? "true" : void 0 },
|
|
4565
|
+
w.createElement(r.Chevron, { disabled: z ? void 0 : !0, className: c[x.Chevron], orientation: n.dir === "rtl" ? "left" : "right" })
|
|
4566
|
+
),
|
|
4567
|
+
I === h - 1 && f === "after" && !n.hideNavigation && w.createElement(r.Nav, { "data-animated-nav": n.animate ? "true" : void 0, className: c[x.Nav], style: d == null ? void 0 : d[x.Nav], "aria-label": pt(), onPreviousClick: Le, onNextClick: et, previousMonth: L, nextMonth: z }),
|
|
4568
|
+
w.createElement(
|
|
4569
|
+
r.MonthGrid,
|
|
4570
|
+
{ role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": Tn(N.date, o.options, o) || void 0, className: c[x.MonthGrid], style: d == null ? void 0 : d[x.MonthGrid] },
|
|
4571
|
+
!n.hideWeekdays && w.createElement(
|
|
4572
|
+
r.Weekdays,
|
|
4573
|
+
{ "data-animated-weekdays": n.animate ? "true" : void 0, className: c[x.Weekdays], style: d == null ? void 0 : d[x.Weekdays] },
|
|
4574
|
+
m && w.createElement(r.WeekNumberHeader, { "aria-label": En(o.options), className: c[x.WeekNumberHeader], style: d == null ? void 0 : d[x.WeekNumberHeader], scope: "col" }, U()),
|
|
4575
|
+
In.map((W) => w.createElement(r.Weekday, { "aria-label": Cn(W, o.options, o), className: c[x.Weekday], key: String(W), style: d == null ? void 0 : d[x.Weekday], scope: "col" }, oe(W, o.options, o)))
|
|
4576
|
+
),
|
|
4577
|
+
w.createElement(r.Weeks, { "data-animated-weeks": n.animate ? "true" : void 0, className: c[x.Weeks], style: d == null ? void 0 : d[x.Weeks] }, N.weeks.map((W) => w.createElement(
|
|
4578
|
+
r.Week,
|
|
4579
|
+
{ className: c[x.Week], key: W.weekNumber, style: d == null ? void 0 : d[x.Week], week: W },
|
|
4580
|
+
m && w.createElement(r.WeekNumber, { week: W, style: d == null ? void 0 : d[x.WeekNumber], "aria-label": _n(W.weekNumber, {
|
|
4581
|
+
locale: i
|
|
4582
|
+
}), className: c[x.WeekNumber], scope: "row", role: "rowheader" }, S(W.weekNumber, o)),
|
|
4583
|
+
W.days.map((_) => {
|
|
4584
|
+
const { date: ee } = _, C = $(_);
|
|
4585
|
+
if (C[q.focused] = !C.hidden && !!(je != null && je.isEqualTo(_)), C[ce.selected] = (j == null ? void 0 : j(ee)) || C.selected, Ze(Re)) {
|
|
4586
|
+
const { from: tt, to: nt } = Re;
|
|
4587
|
+
C[ce.range_start] = !!(tt && nt && o.isSameDay(ee, tt)), C[ce.range_end] = !!(tt && nt && o.isSameDay(ee, nt)), C[ce.range_middle] = we(Re, ee, !0, o);
|
|
4588
|
+
}
|
|
4589
|
+
const Vn = Mo(C, d, n.modifiersStyles), Un = eo(C, c, n.modifiersClassNames), Kn = !Wt && !C.hidden ? Wn(ee, C, o.options, o) : void 0;
|
|
4590
|
+
return w.createElement(r.Day, { key: `${_.isoDate}_${_.displayMonthId}`, day: _, modifiers: C, className: Un.join(" "), style: Vn, role: "gridcell", "aria-selected": C.selected || void 0, "aria-label": Kn, "data-day": _.isoDate, "data-month": _.outside ? _.dateMonthId : void 0, "data-selected": C.selected || void 0, "data-disabled": C.disabled || void 0, "data-hidden": C.hidden || void 0, "data-outside": _.outside || void 0, "data-focused": C.focused || void 0, "data-today": C.today || void 0 }, !C.hidden && Wt ? w.createElement(r.DayButton, { className: c[x.DayButton], style: d == null ? void 0 : d[x.DayButton], type: "button", day: _, modifiers: C, disabled: !C.focused && C.disabled || void 0, "aria-disabled": C.focused && C.disabled || void 0, tabIndex: On(_) ? 0 : -1, "aria-label": pn(ee, C, o.options, o), onClick: Fn(_, C), onBlur: Hn(_, C), onFocus: Bn(_, C), onKeyDown: qn(_, C), onMouseEnter: An(_, C), onMouseLeave: Rn(_, C) }, P(ee, o.options, o)) : !C.hidden && P(_.date, o.options, o));
|
|
4591
|
+
})
|
|
4592
|
+
)))
|
|
4593
|
+
)
|
|
4594
|
+
))
|
|
4595
|
+
),
|
|
4596
|
+
n.footer && w.createElement(r.Footer, { className: c[x.Footer], style: d == null ? void 0 : d[x.Footer], role: "status", "aria-live": "polite" }, n.footer)
|
|
4597
|
+
)
|
|
4598
|
+
);
|
|
4599
|
+
}
|
|
4600
|
+
const Vo = We(
|
|
4601
|
+
[
|
|
4602
|
+
"inline-flex",
|
|
4603
|
+
"items-center",
|
|
4604
|
+
"gap-2",
|
|
4605
|
+
"rounded-lg",
|
|
4606
|
+
"border",
|
|
4607
|
+
"border-border-primary",
|
|
4608
|
+
"bg-bg-primary",
|
|
4609
|
+
"text-text-primary",
|
|
4610
|
+
"text-sm",
|
|
4611
|
+
"font-medium",
|
|
4612
|
+
"shadow-xs",
|
|
4613
|
+
"cursor-pointer",
|
|
4614
|
+
"transition-colors",
|
|
4615
|
+
"outline-none",
|
|
4616
|
+
"px-3.5",
|
|
4617
|
+
"py-2.5",
|
|
4618
|
+
"hover:bg-bg-primary_hover",
|
|
4619
|
+
"focus-visible:ring-4",
|
|
4620
|
+
"focus-visible:ring-focus-ring/24",
|
|
4621
|
+
"focus-visible:border-brand-300"
|
|
4622
|
+
],
|
|
4623
|
+
{
|
|
4624
|
+
variants: {
|
|
4625
|
+
open: {
|
|
4626
|
+
false: null,
|
|
4627
|
+
true: ["ring-4", "ring-focus-ring/24", "border-brand-300"]
|
|
4628
|
+
},
|
|
4629
|
+
disabled: {
|
|
4630
|
+
false: null,
|
|
4631
|
+
true: [
|
|
4632
|
+
"bg-bg-disabled",
|
|
4633
|
+
"border-border-disabled",
|
|
4634
|
+
"text-text-disabled",
|
|
4635
|
+
"cursor-not-allowed",
|
|
4636
|
+
"pointer-events-none",
|
|
4637
|
+
"shadow-none"
|
|
4638
|
+
]
|
|
4639
|
+
},
|
|
4640
|
+
hasValue: {
|
|
4641
|
+
false: ["text-text-placeholder"],
|
|
4642
|
+
true: null
|
|
4643
|
+
}
|
|
4644
|
+
},
|
|
4645
|
+
defaultVariants: { open: !1, disabled: !1, hasValue: !1 }
|
|
4646
|
+
}
|
|
4647
|
+
), Uo = We([
|
|
4648
|
+
"size-5",
|
|
4649
|
+
"shrink-0",
|
|
4650
|
+
"text-fg-quaternary"
|
|
4651
|
+
]), Ko = We(
|
|
4652
|
+
[
|
|
4653
|
+
"absolute",
|
|
4654
|
+
"z-50",
|
|
4655
|
+
"mt-1",
|
|
4656
|
+
"flex",
|
|
4657
|
+
"flex-col",
|
|
4658
|
+
"bg-bg-primary",
|
|
4659
|
+
"border",
|
|
4660
|
+
"border-border-secondary",
|
|
4661
|
+
"rounded-xl",
|
|
4662
|
+
"shadow-lg",
|
|
4663
|
+
"overflow-hidden"
|
|
4664
|
+
],
|
|
4665
|
+
{
|
|
4666
|
+
variants: {
|
|
4667
|
+
align: {
|
|
4668
|
+
start: ["left-0"],
|
|
4669
|
+
center: ["left-1/2", "-translate-x-1/2"],
|
|
4670
|
+
end: ["right-0"]
|
|
4671
|
+
}
|
|
4672
|
+
},
|
|
4673
|
+
defaultVariants: { align: "start" }
|
|
4674
|
+
}
|
|
4675
|
+
), Zo = We([
|
|
4676
|
+
"flex",
|
|
4677
|
+
"items-center",
|
|
4678
|
+
"gap-2",
|
|
4679
|
+
"px-4",
|
|
4680
|
+
"py-3",
|
|
4681
|
+
"border-t",
|
|
4682
|
+
"border-border-secondary"
|
|
4683
|
+
]), jt = We(
|
|
4684
|
+
[
|
|
4685
|
+
"flex",
|
|
4686
|
+
"w-full",
|
|
4687
|
+
"rounded-lg",
|
|
4688
|
+
"border",
|
|
4689
|
+
"border-border-primary",
|
|
4690
|
+
"bg-bg-primary",
|
|
4691
|
+
"text-text-primary",
|
|
4692
|
+
"text-sm",
|
|
4693
|
+
"shadow-xs",
|
|
4694
|
+
"outline-none",
|
|
4695
|
+
"transition-colors",
|
|
4696
|
+
"px-3",
|
|
4697
|
+
"py-2",
|
|
4698
|
+
"h-10",
|
|
4699
|
+
"placeholder:text-text-placeholder",
|
|
4700
|
+
"focus:border-brand-300",
|
|
4701
|
+
"focus:ring-4",
|
|
4702
|
+
"focus:ring-focus-ring/24"
|
|
4703
|
+
],
|
|
4704
|
+
{
|
|
4705
|
+
variants: {
|
|
4706
|
+
hasError: {
|
|
4707
|
+
false: null,
|
|
4708
|
+
true: [
|
|
4709
|
+
"border-error-300",
|
|
4710
|
+
"focus:border-error-300",
|
|
4711
|
+
"focus:ring-error-100/24"
|
|
4712
|
+
]
|
|
4713
|
+
}
|
|
4714
|
+
},
|
|
4715
|
+
defaultVariants: { hasError: !1 }
|
|
4716
|
+
}
|
|
4717
|
+
), Jo = We([
|
|
4718
|
+
"text-text-quaternary",
|
|
4719
|
+
"text-sm",
|
|
4720
|
+
"shrink-0"
|
|
4721
|
+
]), Lo = We([
|
|
4722
|
+
"flex",
|
|
4723
|
+
"items-center",
|
|
4724
|
+
"justify-end",
|
|
4725
|
+
"gap-3",
|
|
4726
|
+
"px-4",
|
|
4727
|
+
"py-3",
|
|
4728
|
+
"border-t",
|
|
4729
|
+
"border-border-secondary"
|
|
4730
|
+
]), ei = "MMM d, yyyy", ti = "M / d / yyyy";
|
|
4731
|
+
function ni(t, n) {
|
|
4732
|
+
if (!(t != null && t.from)) return null;
|
|
4733
|
+
const e = ye(t.from, n);
|
|
4734
|
+
return t.to ? `${e} – ${ye(t.to, n)}` : e;
|
|
4735
|
+
}
|
|
4736
|
+
const ri = ue.forwardRef(
|
|
4737
|
+
({
|
|
4738
|
+
value: t,
|
|
4739
|
+
onChange: n,
|
|
4740
|
+
placeholder: e = "Select date range",
|
|
4741
|
+
displayFormat: r = ei,
|
|
4742
|
+
inputFormat: a = ti,
|
|
4743
|
+
numberOfMonths: s = 2,
|
|
4744
|
+
minDate: o,
|
|
4745
|
+
maxDate: i,
|
|
4746
|
+
disabled: c = !1,
|
|
4747
|
+
className: u,
|
|
4748
|
+
align: l = "start",
|
|
4749
|
+
cancelLabel: f = "Cancel",
|
|
4750
|
+
applyLabel: h = "Apply",
|
|
4751
|
+
onOpenChange: b
|
|
4752
|
+
}, v) => {
|
|
4753
|
+
const [p, O] = ue.useState(!1), [k, D] = ue.useState(t), [M, y] = ue.useState(""), [m, d] = ue.useState(""), [T, P] = ue.useState(!1), [H, S] = ue.useState(!1);
|
|
4754
|
+
ue.useEffect(() => {
|
|
4755
|
+
y(k != null && k.from ? ye(k.from, a) : ""), P(!1);
|
|
4756
|
+
}, [k == null ? void 0 : k.from, a]), ue.useEffect(() => {
|
|
4757
|
+
d(k != null && k.to ? ye(k.to, a) : ""), S(!1);
|
|
4758
|
+
}, [k == null ? void 0 : k.to, a]);
|
|
4759
|
+
const U = () => {
|
|
4760
|
+
c || (D(t), O(!0), b == null || b(!0));
|
|
4761
|
+
}, oe = () => {
|
|
4762
|
+
O(!1), b == null || b(!1);
|
|
4763
|
+
}, J = () => {
|
|
4764
|
+
D(t), oe();
|
|
4765
|
+
}, K = () => {
|
|
4766
|
+
n == null || n(k), oe();
|
|
4767
|
+
}, ke = ($) => {
|
|
4768
|
+
D($);
|
|
4769
|
+
}, Ne = () => {
|
|
4770
|
+
if (!M.trim()) {
|
|
4771
|
+
D((j) => j ? { ...j, from: void 0 } : void 0), P(!1);
|
|
4772
|
+
return;
|
|
4773
|
+
}
|
|
4774
|
+
const $ = Ft(M, a, /* @__PURE__ */ new Date());
|
|
4775
|
+
dt($) ? (D((j) => ({ from: $, to: j == null ? void 0 : j.to })), P(!1)) : P(!0);
|
|
4776
|
+
}, Ee = () => {
|
|
4777
|
+
if (!m.trim()) {
|
|
4778
|
+
D((j) => j ? { ...j, to: void 0 } : void 0), S(!1);
|
|
4779
|
+
return;
|
|
4780
|
+
}
|
|
4781
|
+
const $ = Ft(m, a, /* @__PURE__ */ new Date());
|
|
4782
|
+
dt($) ? (D((j) => ({ from: j == null ? void 0 : j.from, to: $ })), S(!1)) : S(!0);
|
|
4783
|
+
};
|
|
4784
|
+
ue.useEffect(() => {
|
|
4785
|
+
if (!p) return;
|
|
4786
|
+
const $ = (j) => {
|
|
4787
|
+
j.key === "Escape" && J();
|
|
4788
|
+
};
|
|
4789
|
+
return document.addEventListener("keydown", $), () => document.removeEventListener("keydown", $);
|
|
4790
|
+
}, [p, t]);
|
|
4791
|
+
const Ye = ni(t, r), L = !!Ye, z = [];
|
|
4792
|
+
o && z.push({ before: o }), i && z.push({ after: i });
|
|
4793
|
+
const re = /* @__PURE__ */ new Date();
|
|
4794
|
+
return /* @__PURE__ */ De("div", { ref: v, className: "relative inline-block", children: [
|
|
4795
|
+
/* @__PURE__ */ De(
|
|
4796
|
+
"button",
|
|
4797
|
+
{
|
|
4798
|
+
type: "button",
|
|
4799
|
+
onClick: U,
|
|
4800
|
+
className: Z(
|
|
4801
|
+
Vo({
|
|
4802
|
+
open: p,
|
|
4803
|
+
disabled: c,
|
|
4804
|
+
hasValue: L
|
|
4805
|
+
}),
|
|
4806
|
+
u
|
|
4807
|
+
),
|
|
4808
|
+
"aria-haspopup": "dialog",
|
|
4809
|
+
"aria-expanded": p,
|
|
4810
|
+
disabled: c,
|
|
4811
|
+
children: [
|
|
4812
|
+
/* @__PURE__ */ X(oi, {}),
|
|
4813
|
+
/* @__PURE__ */ X("span", { children: Ye ?? e })
|
|
4814
|
+
]
|
|
4815
|
+
}
|
|
4816
|
+
),
|
|
4817
|
+
p && /* @__PURE__ */ De(Ln, { children: [
|
|
4818
|
+
/* @__PURE__ */ X(
|
|
4819
|
+
"div",
|
|
4820
|
+
{
|
|
4821
|
+
className: "fixed inset-0 z-40",
|
|
4822
|
+
onClick: J,
|
|
4823
|
+
"aria-hidden": "true",
|
|
4824
|
+
"data-testid": "datepicker-overlay"
|
|
4825
|
+
}
|
|
4826
|
+
),
|
|
4827
|
+
/* @__PURE__ */ De(
|
|
4828
|
+
"div",
|
|
4829
|
+
{
|
|
4830
|
+
role: "dialog",
|
|
4831
|
+
"aria-label": "Date range picker",
|
|
4832
|
+
className: Z(Ko({ align: l })),
|
|
4833
|
+
children: [
|
|
4834
|
+
/* @__PURE__ */ X(
|
|
4835
|
+
Xo,
|
|
4836
|
+
{
|
|
4837
|
+
mode: "range",
|
|
4838
|
+
selected: k,
|
|
4839
|
+
onSelect: ke,
|
|
4840
|
+
numberOfMonths: s,
|
|
4841
|
+
showOutsideDays: !1,
|
|
4842
|
+
disabled: z.length > 0 ? z : void 0,
|
|
4843
|
+
today: re,
|
|
4844
|
+
classNames: {
|
|
4845
|
+
root: "p-4",
|
|
4846
|
+
months: "flex gap-4",
|
|
4847
|
+
month: "flex flex-col gap-2",
|
|
4848
|
+
month_caption: "flex items-center justify-center px-1 mb-2",
|
|
4849
|
+
caption_label: "text-sm font-semibold text-text-primary",
|
|
4850
|
+
nav: "absolute top-4 flex w-[calc(100%-2rem)] justify-between px-0 z-10",
|
|
4851
|
+
button_previous: Z(
|
|
4852
|
+
"inline-flex items-center justify-center size-8 rounded-lg",
|
|
4853
|
+
"text-fg-quaternary cursor-pointer transition-colors outline-none",
|
|
4854
|
+
"hover:bg-bg-primary_hover hover:text-fg-secondary"
|
|
4855
|
+
),
|
|
4856
|
+
button_next: Z(
|
|
4857
|
+
"inline-flex items-center justify-center size-8 rounded-lg",
|
|
4858
|
+
"text-fg-quaternary cursor-pointer transition-colors outline-none",
|
|
4859
|
+
"hover:bg-bg-primary_hover hover:text-fg-secondary"
|
|
4860
|
+
),
|
|
4861
|
+
weekdays: "flex",
|
|
4862
|
+
weekday: "w-10 h-10 flex items-center justify-center text-xs font-medium text-text-quaternary",
|
|
4863
|
+
week: "flex",
|
|
4864
|
+
day: "relative w-10 h-10 flex items-center justify-center text-sm font-medium",
|
|
4865
|
+
day_button: "w-full h-full flex items-center justify-center rounded-full outline-none cursor-pointer transition-colors",
|
|
4866
|
+
selected: "",
|
|
4867
|
+
range_start: "bg-brand-50 rounded-l-full",
|
|
4868
|
+
range_end: "bg-brand-50 rounded-r-full",
|
|
4869
|
+
range_middle: "bg-brand-50 rounded-none",
|
|
4870
|
+
today: "font-bold",
|
|
4871
|
+
outside: "text-text-disabled pointer-events-none opacity-0",
|
|
4872
|
+
disabled: "text-text-disabled cursor-not-allowed pointer-events-none"
|
|
4873
|
+
},
|
|
4874
|
+
components: {
|
|
4875
|
+
Chevron: ai,
|
|
4876
|
+
DayButton: si
|
|
4877
|
+
},
|
|
4878
|
+
modifiers: {
|
|
4879
|
+
today: re
|
|
4880
|
+
}
|
|
4881
|
+
}
|
|
4882
|
+
),
|
|
4883
|
+
/* @__PURE__ */ De("div", { className: Z(Zo()), children: [
|
|
4884
|
+
/* @__PURE__ */ X(
|
|
4885
|
+
"input",
|
|
4886
|
+
{
|
|
4887
|
+
type: "text",
|
|
4888
|
+
value: M,
|
|
4889
|
+
onChange: ($) => y($.target.value),
|
|
4890
|
+
onBlur: Ne,
|
|
4891
|
+
placeholder: a.toLowerCase(),
|
|
4892
|
+
className: Z(jt({ hasError: T })),
|
|
4893
|
+
"aria-label": "Start date"
|
|
4894
|
+
}
|
|
4895
|
+
),
|
|
4896
|
+
/* @__PURE__ */ X("span", { className: Z(Jo()), children: "–" }),
|
|
4897
|
+
/* @__PURE__ */ X(
|
|
4898
|
+
"input",
|
|
4899
|
+
{
|
|
4900
|
+
type: "text",
|
|
4901
|
+
value: m,
|
|
4902
|
+
onChange: ($) => d($.target.value),
|
|
4903
|
+
onBlur: Ee,
|
|
4904
|
+
placeholder: a.toLowerCase(),
|
|
4905
|
+
className: Z(jt({ hasError: H })),
|
|
4906
|
+
"aria-label": "End date"
|
|
4907
|
+
}
|
|
4908
|
+
)
|
|
4909
|
+
] }),
|
|
4910
|
+
/* @__PURE__ */ De("div", { className: Z(Lo()), children: [
|
|
4911
|
+
/* @__PURE__ */ X(
|
|
4912
|
+
"button",
|
|
4913
|
+
{
|
|
4914
|
+
type: "button",
|
|
4915
|
+
onClick: J,
|
|
4916
|
+
className: Z(
|
|
4917
|
+
"inline-flex items-center justify-center rounded-lg border border-border-primary",
|
|
4918
|
+
"bg-bg-primary text-text-secondary text-sm font-semibold",
|
|
4919
|
+
"shadow-xs px-4 py-2.5 transition-colors",
|
|
4920
|
+
"hover:bg-bg-primary_hover hover:text-text-secondary_hover",
|
|
4921
|
+
"focus-visible:ring-4 focus-visible:ring-focus-ring/24 outline-none"
|
|
4922
|
+
),
|
|
4923
|
+
children: f
|
|
4924
|
+
}
|
|
4925
|
+
),
|
|
4926
|
+
/* @__PURE__ */ X(
|
|
4927
|
+
"button",
|
|
4928
|
+
{
|
|
4929
|
+
type: "button",
|
|
4930
|
+
onClick: K,
|
|
4931
|
+
className: Z(
|
|
4932
|
+
"inline-flex items-center justify-center rounded-lg border border-brand-600",
|
|
4933
|
+
"bg-brand-600 text-white text-sm font-semibold",
|
|
4934
|
+
"shadow-xs px-4 py-2.5 transition-colors",
|
|
4935
|
+
"hover:bg-brand-700 hover:border-brand-700",
|
|
4936
|
+
"focus-visible:ring-4 focus-visible:ring-focus-ring/24 outline-none"
|
|
4937
|
+
),
|
|
4938
|
+
children: h
|
|
4939
|
+
}
|
|
4940
|
+
)
|
|
4941
|
+
] })
|
|
4942
|
+
]
|
|
4943
|
+
}
|
|
4944
|
+
)
|
|
4945
|
+
] })
|
|
4946
|
+
] });
|
|
4947
|
+
}
|
|
4948
|
+
);
|
|
4949
|
+
ri.displayName = "DatePickerRange";
|
|
4950
|
+
function ai({
|
|
4951
|
+
orientation: t,
|
|
4952
|
+
...n
|
|
4953
|
+
}) {
|
|
4954
|
+
return /* @__PURE__ */ X(
|
|
4955
|
+
"svg",
|
|
4956
|
+
{
|
|
4957
|
+
width: "20",
|
|
4958
|
+
height: "20",
|
|
4959
|
+
viewBox: "0 0 24 24",
|
|
4960
|
+
fill: "none",
|
|
4961
|
+
stroke: "currentColor",
|
|
4962
|
+
strokeWidth: "2",
|
|
4963
|
+
strokeLinecap: "round",
|
|
4964
|
+
strokeLinejoin: "round",
|
|
4965
|
+
"aria-hidden": "true",
|
|
4966
|
+
style: { transform: t === "right" ? "rotate(0)" : t === "left" ? "rotate(180deg)" : t === "up" ? "rotate(90deg)" : "rotate(-90deg)" },
|
|
4967
|
+
...n,
|
|
4968
|
+
children: /* @__PURE__ */ X("polyline", { points: "9 18 15 12 9 6" })
|
|
4969
|
+
}
|
|
4970
|
+
);
|
|
4971
|
+
}
|
|
4972
|
+
function si(t) {
|
|
4973
|
+
const { children: n, day: e, modifiers: r, className: a, ...s } = t, o = r.today, i = r.range_start || r.range_end, c = r.range_middle;
|
|
4974
|
+
return /* @__PURE__ */ De(
|
|
4975
|
+
"button",
|
|
4976
|
+
{
|
|
4977
|
+
type: "button",
|
|
4978
|
+
className: Z(
|
|
4979
|
+
a,
|
|
4980
|
+
i ? "bg-brand-600 text-white hover:bg-brand-700" : c ? "text-brand-800 hover:bg-brand-100" : "hover:bg-bg-secondary"
|
|
4981
|
+
),
|
|
4982
|
+
...s,
|
|
4983
|
+
children: [
|
|
4984
|
+
n,
|
|
4985
|
+
o && /* @__PURE__ */ X(
|
|
4986
|
+
"span",
|
|
4987
|
+
{
|
|
4988
|
+
className: Z(
|
|
4989
|
+
"absolute bottom-1 left-1/2 -translate-x-1/2 size-1 rounded-full",
|
|
4990
|
+
i ? "bg-white" : "bg-brand-600"
|
|
4991
|
+
),
|
|
4992
|
+
"data-testid": "today-dot"
|
|
4993
|
+
}
|
|
4994
|
+
)
|
|
4995
|
+
]
|
|
4996
|
+
}
|
|
4997
|
+
);
|
|
4998
|
+
}
|
|
4999
|
+
function oi() {
|
|
5000
|
+
return /* @__PURE__ */ De(
|
|
5001
|
+
"svg",
|
|
5002
|
+
{
|
|
5003
|
+
className: Z(Uo()),
|
|
5004
|
+
viewBox: "0 0 24 24",
|
|
5005
|
+
fill: "none",
|
|
5006
|
+
stroke: "currentColor",
|
|
5007
|
+
strokeWidth: "2",
|
|
5008
|
+
strokeLinecap: "round",
|
|
5009
|
+
strokeLinejoin: "round",
|
|
5010
|
+
"aria-hidden": "true",
|
|
5011
|
+
children: [
|
|
5012
|
+
/* @__PURE__ */ X("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
5013
|
+
/* @__PURE__ */ X("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
5014
|
+
/* @__PURE__ */ X("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
5015
|
+
/* @__PURE__ */ X("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
5016
|
+
]
|
|
5017
|
+
}
|
|
5018
|
+
);
|
|
5019
|
+
}
|
|
5020
|
+
export {
|
|
5021
|
+
ri as D,
|
|
5022
|
+
Lo as a,
|
|
5023
|
+
Zo as b,
|
|
5024
|
+
Jo as c,
|
|
5025
|
+
jt as d,
|
|
5026
|
+
Ko as e,
|
|
5027
|
+
Uo as f,
|
|
5028
|
+
Vo as g
|
|
5029
|
+
};
|