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