@konstructio/ui 0.1.0-alpha.25 → 0.1.0-alpha.27
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/DatePicker.css +1 -1
- package/dist/{chevron-down-3QGcvbP_.js → chevron-down-B0zEhjSZ.js} +2 -2
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Datepicker/DatePicker.js +882 -859
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Typography/Typography.js +26 -31
- package/dist/{createLucideIcon-B7yPYScZ.js → createLucideIcon-Zzp102Nb.js} +4 -4
- package/dist/index.d.ts +4 -3
- package/dist/package.json +5 -5
- package/package.json +5 -5
|
@@ -1,102 +1,115 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import m, { createContext as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { datePickerVariants as
|
|
5
|
-
import { c as
|
|
1
|
+
import { jsx as _e } from "react/jsx-runtime";
|
|
2
|
+
import m, { createContext as cn, useContext as un, useCallback as A, useRef as We, useLayoutEffect as fn, useState as Se, useEffect as dn, useMemo as Pe } from "react";
|
|
3
|
+
import { cn as de } from "../../utils/index.js";
|
|
4
|
+
import { datePickerVariants as ln } from "./DatePicker.variants.js";
|
|
5
|
+
import { c as it } from "../../createLucideIcon-Zzp102Nb.js";
|
|
6
6
|
import '../../DatePicker.css';/**
|
|
7
|
-
* @license lucide-react v0.
|
|
7
|
+
* @license lucide-react v0.540.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
const
|
|
12
|
+
const hn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], mn = it("chevron-left", hn);
|
|
13
13
|
/**
|
|
14
|
-
* @license lucide-react v0.
|
|
14
|
+
* @license lucide-react v0.540.0 - ISC
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the ISC license.
|
|
17
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
20
|
-
function
|
|
19
|
+
const yn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], gn = it("chevron-right", yn);
|
|
20
|
+
function wn(t, e, n = "long") {
|
|
21
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
22
|
+
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
23
|
+
hour: "numeric",
|
|
24
|
+
timeZone: t,
|
|
25
|
+
timeZoneName: n
|
|
26
|
+
}).format(e).split(/\s/g).slice(2).join(" ");
|
|
27
|
+
}
|
|
28
|
+
const Fe = {}, me = {};
|
|
29
|
+
function ne(t, e) {
|
|
21
30
|
try {
|
|
22
|
-
const r = (
|
|
31
|
+
const r = (Fe[t] || (Fe[t] = new Intl.DateTimeFormat("en-US", {
|
|
23
32
|
timeZone: t,
|
|
24
|
-
hour: "numeric",
|
|
25
33
|
timeZoneName: "longOffset"
|
|
26
|
-
}).format))(e).split("GMT")[1]
|
|
27
|
-
return r in
|
|
34
|
+
}).format))(e).split("GMT")[1];
|
|
35
|
+
return r in me ? me[r] : Ue(r, r.split(":"));
|
|
28
36
|
} catch {
|
|
29
|
-
if (t in
|
|
30
|
-
const n = t == null ? void 0 : t.match(
|
|
31
|
-
return n ?
|
|
37
|
+
if (t in me) return me[t];
|
|
38
|
+
const n = t == null ? void 0 : t.match(bn);
|
|
39
|
+
return n ? Ue(t, n.slice(1)) : NaN;
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
const n = +e[0], r = +(e[1] || 0);
|
|
37
|
-
return
|
|
42
|
+
const bn = /([+-]\d\d):?(\d\d)?/;
|
|
43
|
+
function Ue(t, e) {
|
|
44
|
+
const n = +(e[0] || 0), r = +(e[1] || 0), a = +(e[2] || 0) / 60;
|
|
45
|
+
return me[t] = n * 60 + r > 0 ? n * 60 + r + a : n * 60 - r - a;
|
|
38
46
|
}
|
|
39
|
-
class
|
|
47
|
+
class X extends Date {
|
|
40
48
|
//#region static
|
|
41
49
|
constructor(...e) {
|
|
42
|
-
super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(
|
|
50
|
+
super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ne(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), ct(this), Ae(this)) : this.setTime(Date.now());
|
|
43
51
|
}
|
|
44
52
|
static tz(e, ...n) {
|
|
45
|
-
return n.length ? new
|
|
53
|
+
return n.length ? new X(...n, e) : new X(Date.now(), e);
|
|
46
54
|
}
|
|
47
55
|
//#endregion
|
|
48
56
|
//#region time zone
|
|
49
57
|
withTimeZone(e) {
|
|
50
|
-
return new
|
|
58
|
+
return new X(+this, e);
|
|
51
59
|
}
|
|
52
60
|
getTimezoneOffset() {
|
|
53
|
-
|
|
61
|
+
const e = -ne(this.timeZone, this);
|
|
62
|
+
return e > 0 ? Math.floor(e) : Math.ceil(e);
|
|
54
63
|
}
|
|
55
64
|
//#endregion
|
|
56
65
|
//#region time
|
|
57
66
|
setTime(e) {
|
|
58
|
-
return Date.prototype.setTime.apply(this, arguments),
|
|
67
|
+
return Date.prototype.setTime.apply(this, arguments), Ae(this), +this;
|
|
59
68
|
}
|
|
60
69
|
//#endregion
|
|
61
70
|
//#region date-fns integration
|
|
62
71
|
[Symbol.for("constructDateFrom")](e) {
|
|
63
|
-
return new
|
|
72
|
+
return new X(+new Date(e), this.timeZone);
|
|
64
73
|
}
|
|
65
74
|
//#endregion
|
|
66
75
|
}
|
|
67
|
-
const
|
|
76
|
+
const Le = /^(get|set)(?!UTC)/;
|
|
68
77
|
Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
|
|
69
|
-
if (!
|
|
70
|
-
const e = t.replace(
|
|
71
|
-
|
|
78
|
+
if (!Le.test(t)) return;
|
|
79
|
+
const e = t.replace(Le, "$1UTC");
|
|
80
|
+
X.prototype[e] && (t.startsWith("get") ? X.prototype[t] = function() {
|
|
72
81
|
return this.internal[e]();
|
|
73
|
-
} : (
|
|
74
|
-
return Date.prototype[e].apply(this.internal, arguments),
|
|
75
|
-
},
|
|
76
|
-
return Date.prototype[e].apply(this, arguments),
|
|
82
|
+
} : (X.prototype[t] = function() {
|
|
83
|
+
return Date.prototype[e].apply(this.internal, arguments), Mn(this), +this;
|
|
84
|
+
}, X.prototype[e] = function() {
|
|
85
|
+
return Date.prototype[e].apply(this, arguments), Ae(this), +this;
|
|
77
86
|
}));
|
|
78
87
|
});
|
|
79
|
-
function
|
|
80
|
-
t.internal.setTime(+t), t.internal.
|
|
81
|
-
}
|
|
82
|
-
function
|
|
83
|
-
Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()),
|
|
84
|
-
}
|
|
85
|
-
function
|
|
86
|
-
const e =
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
function Ae(t) {
|
|
89
|
+
t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() - Math.round(-ne(t.timeZone, t) * 60));
|
|
90
|
+
}
|
|
91
|
+
function Mn(t) {
|
|
92
|
+
Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), ct(t);
|
|
93
|
+
}
|
|
94
|
+
function ct(t) {
|
|
95
|
+
const e = ne(t.timeZone, t), n = e > 0 ? Math.floor(e) : Math.ceil(e), r = /* @__PURE__ */ new Date(+t);
|
|
96
|
+
r.setUTCHours(r.getUTCHours() - 1);
|
|
97
|
+
const a = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), o = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), i = a - o, s = Date.prototype.getHours.apply(t) !== t.internal.getUTCHours();
|
|
98
|
+
i && s && t.internal.setUTCMinutes(t.internal.getUTCMinutes() + i);
|
|
99
|
+
const c = a - n;
|
|
100
|
+
c && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + c);
|
|
101
|
+
const f = /* @__PURE__ */ new Date(+t);
|
|
102
|
+
f.setUTCSeconds(0);
|
|
103
|
+
const l = a > 0 ? f.getSeconds() : (f.getSeconds() - 60) % 60, u = Math.round(-(ne(t.timeZone, t) * 60)) % 60;
|
|
104
|
+
(u || l) && (t.internal.setUTCSeconds(t.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(t, Date.prototype.getUTCSeconds.call(t) + u + l));
|
|
105
|
+
const h = ne(t.timeZone, t), w = h > 0 ? Math.floor(h) : Math.ceil(h), O = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - w, M = w !== n, k = O - c;
|
|
106
|
+
if (M && k) {
|
|
107
|
+
Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + k);
|
|
108
|
+
const D = ne(t.timeZone, t), y = D > 0 ? Math.floor(D) : Math.ceil(D), N = w - y;
|
|
109
|
+
N && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + N), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + N));
|
|
97
110
|
}
|
|
98
111
|
}
|
|
99
|
-
class I extends
|
|
112
|
+
class I extends X {
|
|
100
113
|
//#region static
|
|
101
114
|
static tz(e, ...n) {
|
|
102
115
|
return n.length ? new I(...n, e) : new I(Date.now(), e);
|
|
@@ -116,7 +129,7 @@ class I extends L {
|
|
|
116
129
|
}
|
|
117
130
|
toTimeString() {
|
|
118
131
|
const e = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
|
|
119
|
-
return `${e} GMT${n}${r}${a} (${
|
|
132
|
+
return `${e} GMT${n}${r}${a} (${wn(this.timeZone, this)})`;
|
|
120
133
|
}
|
|
121
134
|
toLocaleString(e, n) {
|
|
122
135
|
return Date.prototype.toLocaleString.call(this, e, {
|
|
@@ -152,45 +165,23 @@ class I extends L {
|
|
|
152
165
|
}
|
|
153
166
|
//#endregion
|
|
154
167
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
timeZoneName: "long"
|
|
159
|
-
}).format(e).slice(12);
|
|
160
|
-
}
|
|
161
|
-
var g;
|
|
162
|
-
(function(t) {
|
|
163
|
-
t.Root = "root", t.Chevron = "chevron", t.Day = "day", t.DayButton = "day_button", t.CaptionLabel = "caption_label", t.Dropdowns = "dropdowns", t.Dropdown = "dropdown", t.DropdownRoot = "dropdown_root", t.Footer = "footer", t.MonthGrid = "month_grid", t.MonthCaption = "month_caption", t.MonthsDropdown = "months_dropdown", t.Month = "month", t.Months = "months", t.Nav = "nav", t.NextMonthButton = "button_next", t.PreviousMonthButton = "button_previous", t.Week = "week", t.Weeks = "weeks", t.Weekday = "weekday", t.Weekdays = "weekdays", t.WeekNumber = "week_number", t.WeekNumberHeader = "week_number_header", t.YearsDropdown = "years_dropdown";
|
|
164
|
-
})(g || (g = {}));
|
|
165
|
-
var P;
|
|
166
|
-
(function(t) {
|
|
167
|
-
t.disabled = "disabled", t.hidden = "hidden", t.outside = "outside", t.focused = "focused", t.today = "today";
|
|
168
|
-
})(P || (P = {}));
|
|
169
|
-
var Z;
|
|
170
|
-
(function(t) {
|
|
171
|
-
t.range_end = "range_end", t.range_middle = "range_middle", t.range_start = "range_start", t.selected = "selected";
|
|
172
|
-
})(Z || (Z = {}));
|
|
173
|
-
var j;
|
|
174
|
-
(function(t) {
|
|
175
|
-
t.weeks_before_enter = "weeks_before_enter", t.weeks_before_exit = "weeks_before_exit", t.weeks_after_enter = "weeks_after_enter", t.weeks_after_exit = "weeks_after_exit", t.caption_after_enter = "caption_after_enter", t.caption_after_exit = "caption_after_exit", t.caption_before_enter = "caption_before_enter", t.caption_before_exit = "caption_before_exit";
|
|
176
|
-
})(j || (j = {}));
|
|
177
|
-
const lt = 6048e5, On = 864e5, et = Symbol.for("constructDateFrom");
|
|
178
|
-
function _(t, e) {
|
|
179
|
-
return typeof t == "function" ? t(e) : t && typeof t == "object" && et in t ? t[et](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
168
|
+
const ut = 6048e5, kn = 864e5, Ve = Symbol.for("constructDateFrom");
|
|
169
|
+
function F(t, e) {
|
|
170
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && Ve in t ? t[Ve](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
180
171
|
}
|
|
181
172
|
function Y(t, e) {
|
|
182
|
-
return
|
|
173
|
+
return F(e || t, t);
|
|
183
174
|
}
|
|
184
|
-
function
|
|
175
|
+
function ft(t, e, n) {
|
|
185
176
|
const r = Y(t, n == null ? void 0 : n.in);
|
|
186
|
-
return isNaN(e) ?
|
|
177
|
+
return isNaN(e) ? F(t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
187
178
|
}
|
|
188
|
-
function
|
|
179
|
+
function dt(t, e, n) {
|
|
189
180
|
const r = Y(t, n == null ? void 0 : n.in);
|
|
190
|
-
if (isNaN(e)) return
|
|
181
|
+
if (isNaN(e)) return F(t, NaN);
|
|
191
182
|
if (!e)
|
|
192
183
|
return r;
|
|
193
|
-
const a = r.getDate(), o =
|
|
184
|
+
const a = r.getDate(), o = F(t, r.getTime());
|
|
194
185
|
o.setMonth(r.getMonth() + e + 1, 0);
|
|
195
186
|
const i = o.getDate();
|
|
196
187
|
return a >= i ? o : (r.setFullYear(
|
|
@@ -199,27 +190,27 @@ function mt(t, e, n) {
|
|
|
199
190
|
a
|
|
200
191
|
), r);
|
|
201
192
|
}
|
|
202
|
-
let
|
|
203
|
-
function
|
|
204
|
-
return
|
|
193
|
+
let Dn = {};
|
|
194
|
+
function we() {
|
|
195
|
+
return Dn;
|
|
205
196
|
}
|
|
206
|
-
function
|
|
207
|
-
var s, c,
|
|
208
|
-
const n =
|
|
197
|
+
function ie(t, e) {
|
|
198
|
+
var s, c, f, l;
|
|
199
|
+
const n = we(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, e == null ? void 0 : e.in), o = a.getDay(), i = (o < r ? 7 : 0) + o - r;
|
|
209
200
|
return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
|
|
210
201
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
202
|
+
function ye(t, e) {
|
|
203
|
+
return ie(t, { ...e, weekStartsOn: 1 });
|
|
213
204
|
}
|
|
214
|
-
function
|
|
215
|
-
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a =
|
|
205
|
+
function lt(t, e) {
|
|
206
|
+
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = F(n, 0);
|
|
216
207
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
217
|
-
const o =
|
|
208
|
+
const o = ye(a), i = F(n, 0);
|
|
218
209
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
219
|
-
const s =
|
|
210
|
+
const s = ye(i);
|
|
220
211
|
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
|
|
221
212
|
}
|
|
222
|
-
function
|
|
213
|
+
function Ke(t) {
|
|
223
214
|
const e = Y(t), n = new Date(
|
|
224
215
|
Date.UTC(
|
|
225
216
|
e.getFullYear(),
|
|
@@ -233,113 +224,113 @@ function tt(t) {
|
|
|
233
224
|
);
|
|
234
225
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
235
226
|
}
|
|
236
|
-
function
|
|
237
|
-
const n =
|
|
227
|
+
function ce(t, ...e) {
|
|
228
|
+
const n = F.bind(
|
|
238
229
|
null,
|
|
239
230
|
e.find((r) => typeof r == "object")
|
|
240
231
|
);
|
|
241
232
|
return e.map(n);
|
|
242
233
|
}
|
|
243
|
-
function
|
|
234
|
+
function ge(t, e) {
|
|
244
235
|
const n = Y(t, e == null ? void 0 : e.in);
|
|
245
236
|
return n.setHours(0, 0, 0, 0), n;
|
|
246
237
|
}
|
|
247
|
-
function
|
|
248
|
-
const [r, a] =
|
|
238
|
+
function ht(t, e, n) {
|
|
239
|
+
const [r, a] = ce(
|
|
249
240
|
n == null ? void 0 : n.in,
|
|
250
241
|
t,
|
|
251
242
|
e
|
|
252
|
-
), o =
|
|
253
|
-
return Math.round((s - c) /
|
|
243
|
+
), o = ge(r), i = ge(a), s = +o - Ke(o), c = +i - Ke(i);
|
|
244
|
+
return Math.round((s - c) / kn);
|
|
254
245
|
}
|
|
255
|
-
function
|
|
256
|
-
const n =
|
|
257
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
246
|
+
function vn(t, e) {
|
|
247
|
+
const n = lt(t, e), r = F(t, 0);
|
|
248
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), ye(r);
|
|
258
249
|
}
|
|
259
|
-
function
|
|
260
|
-
return
|
|
250
|
+
function On(t, e, n) {
|
|
251
|
+
return ft(t, e * 7, n);
|
|
261
252
|
}
|
|
262
|
-
function
|
|
263
|
-
return
|
|
253
|
+
function Wn(t, e, n) {
|
|
254
|
+
return dt(t, e * 12, n);
|
|
264
255
|
}
|
|
265
|
-
function
|
|
256
|
+
function Sn(t, e) {
|
|
266
257
|
let n, r = e == null ? void 0 : e.in;
|
|
267
258
|
return t.forEach((a) => {
|
|
268
|
-
!r && typeof a == "object" && (r =
|
|
259
|
+
!r && typeof a == "object" && (r = F.bind(null, a));
|
|
269
260
|
const o = Y(a, r);
|
|
270
261
|
(!n || n < o || isNaN(+o)) && (n = o);
|
|
271
|
-
}),
|
|
262
|
+
}), F(r, n || NaN);
|
|
272
263
|
}
|
|
273
|
-
function
|
|
264
|
+
function pn(t, e) {
|
|
274
265
|
let n, r = e == null ? void 0 : e.in;
|
|
275
266
|
return t.forEach((a) => {
|
|
276
|
-
!r && typeof a == "object" && (r =
|
|
267
|
+
!r && typeof a == "object" && (r = F.bind(null, a));
|
|
277
268
|
const o = Y(a, r);
|
|
278
269
|
(!n || n > o || isNaN(+o)) && (n = o);
|
|
279
|
-
}),
|
|
270
|
+
}), F(r, n || NaN);
|
|
280
271
|
}
|
|
281
|
-
function
|
|
282
|
-
const [r, a] =
|
|
272
|
+
function Nn(t, e, n) {
|
|
273
|
+
const [r, a] = ce(
|
|
283
274
|
n == null ? void 0 : n.in,
|
|
284
275
|
t,
|
|
285
276
|
e
|
|
286
277
|
);
|
|
287
|
-
return +
|
|
278
|
+
return +ge(r) == +ge(a);
|
|
288
279
|
}
|
|
289
|
-
function
|
|
280
|
+
function mt(t) {
|
|
290
281
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
291
282
|
}
|
|
292
|
-
function
|
|
293
|
-
return !(!
|
|
283
|
+
function Cn(t) {
|
|
284
|
+
return !(!mt(t) && typeof t != "number" || isNaN(+Y(t)));
|
|
294
285
|
}
|
|
295
|
-
function
|
|
296
|
-
const [r, a] =
|
|
286
|
+
function xn(t, e, n) {
|
|
287
|
+
const [r, a] = ce(
|
|
297
288
|
n == null ? void 0 : n.in,
|
|
298
289
|
t,
|
|
299
290
|
e
|
|
300
291
|
), o = r.getFullYear() - a.getFullYear(), i = r.getMonth() - a.getMonth();
|
|
301
292
|
return o * 12 + i;
|
|
302
293
|
}
|
|
303
|
-
function
|
|
294
|
+
function Tn(t, e) {
|
|
304
295
|
const n = Y(t, e == null ? void 0 : e.in), r = n.getMonth();
|
|
305
296
|
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
306
297
|
}
|
|
307
|
-
function
|
|
308
|
-
const [n, r] =
|
|
298
|
+
function Yn(t, e) {
|
|
299
|
+
const [n, r] = ce(t, e.start, e.end);
|
|
309
300
|
return { start: n, end: r };
|
|
310
301
|
}
|
|
311
|
-
function
|
|
312
|
-
const { start: n, end: r } =
|
|
302
|
+
function En(t, e) {
|
|
303
|
+
const { start: n, end: r } = Yn(e == null ? void 0 : e.in, t);
|
|
313
304
|
let a = +n > +r;
|
|
314
305
|
const o = a ? +n : +r, i = a ? r : n;
|
|
315
306
|
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
316
307
|
let s = 1;
|
|
317
308
|
const c = [];
|
|
318
309
|
for (; +i <= o; )
|
|
319
|
-
c.push(
|
|
310
|
+
c.push(F(n, i)), i.setMonth(i.getMonth() + s);
|
|
320
311
|
return a ? c.reverse() : c;
|
|
321
312
|
}
|
|
322
|
-
function
|
|
313
|
+
function _n(t, e) {
|
|
323
314
|
const n = Y(t, e == null ? void 0 : e.in);
|
|
324
315
|
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
325
316
|
}
|
|
326
|
-
function
|
|
317
|
+
function Pn(t, e) {
|
|
327
318
|
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear();
|
|
328
319
|
return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
329
320
|
}
|
|
330
|
-
function
|
|
321
|
+
function yt(t, e) {
|
|
331
322
|
const n = Y(t, e == null ? void 0 : e.in);
|
|
332
323
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
333
324
|
}
|
|
334
|
-
function
|
|
335
|
-
var s, c,
|
|
336
|
-
const n =
|
|
325
|
+
function gt(t, e) {
|
|
326
|
+
var s, c, f, l;
|
|
327
|
+
const n = we(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = Y(t, e == null ? void 0 : e.in), o = a.getDay(), i = (o < r ? -7 : 0) + 6 - (o - r);
|
|
337
328
|
return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
|
|
338
329
|
}
|
|
339
|
-
function
|
|
340
|
-
return
|
|
330
|
+
function Fn(t, e) {
|
|
331
|
+
return gt(t, { ...e, weekStartsOn: 1 });
|
|
341
332
|
}
|
|
342
|
-
const
|
|
333
|
+
const Bn = {
|
|
343
334
|
lessThanXSeconds: {
|
|
344
335
|
one: "less than a second",
|
|
345
336
|
other: "less than {{count}} seconds"
|
|
@@ -401,54 +392,54 @@ const qn = {
|
|
|
401
392
|
one: "almost 1 year",
|
|
402
393
|
other: "almost {{count}} years"
|
|
403
394
|
}
|
|
404
|
-
},
|
|
395
|
+
}, In = (t, e, n) => {
|
|
405
396
|
let r;
|
|
406
|
-
const a =
|
|
397
|
+
const a = Bn[t];
|
|
407
398
|
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
408
399
|
};
|
|
409
|
-
function
|
|
400
|
+
function Be(t) {
|
|
410
401
|
return (e = {}) => {
|
|
411
402
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
412
403
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
413
404
|
};
|
|
414
405
|
}
|
|
415
|
-
const
|
|
406
|
+
const Hn = {
|
|
416
407
|
full: "EEEE, MMMM do, y",
|
|
417
408
|
long: "MMMM do, y",
|
|
418
409
|
medium: "MMM d, y",
|
|
419
410
|
short: "MM/dd/yyyy"
|
|
420
|
-
},
|
|
411
|
+
}, qn = {
|
|
421
412
|
full: "h:mm:ss a zzzz",
|
|
422
413
|
long: "h:mm:ss a z",
|
|
423
414
|
medium: "h:mm:ss a",
|
|
424
415
|
short: "h:mm a"
|
|
425
|
-
},
|
|
416
|
+
}, An = {
|
|
426
417
|
full: "{{date}} 'at' {{time}}",
|
|
427
418
|
long: "{{date}} 'at' {{time}}",
|
|
428
419
|
medium: "{{date}}, {{time}}",
|
|
429
420
|
short: "{{date}}, {{time}}"
|
|
430
|
-
},
|
|
431
|
-
date:
|
|
432
|
-
formats:
|
|
421
|
+
}, jn = {
|
|
422
|
+
date: Be({
|
|
423
|
+
formats: Hn,
|
|
433
424
|
defaultWidth: "full"
|
|
434
425
|
}),
|
|
435
|
-
time:
|
|
436
|
-
formats:
|
|
426
|
+
time: Be({
|
|
427
|
+
formats: qn,
|
|
437
428
|
defaultWidth: "full"
|
|
438
429
|
}),
|
|
439
|
-
dateTime:
|
|
440
|
-
formats:
|
|
430
|
+
dateTime: Be({
|
|
431
|
+
formats: An,
|
|
441
432
|
defaultWidth: "full"
|
|
442
433
|
})
|
|
443
|
-
},
|
|
434
|
+
}, $n = {
|
|
444
435
|
lastWeek: "'last' eeee 'at' p",
|
|
445
436
|
yesterday: "'yesterday at' p",
|
|
446
437
|
today: "'today at' p",
|
|
447
438
|
tomorrow: "'tomorrow at' p",
|
|
448
439
|
nextWeek: "eeee 'at' p",
|
|
449
440
|
other: "P"
|
|
450
|
-
},
|
|
451
|
-
function
|
|
441
|
+
}, Gn = (t, e, n, r) => $n[t];
|
|
442
|
+
function le(t) {
|
|
452
443
|
return (e, n) => {
|
|
453
444
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
454
445
|
let a;
|
|
@@ -463,15 +454,15 @@ function he(t) {
|
|
|
463
454
|
return a[o];
|
|
464
455
|
};
|
|
465
456
|
}
|
|
466
|
-
const
|
|
457
|
+
const Rn = {
|
|
467
458
|
narrow: ["B", "A"],
|
|
468
459
|
abbreviated: ["BC", "AD"],
|
|
469
460
|
wide: ["Before Christ", "Anno Domini"]
|
|
470
|
-
},
|
|
461
|
+
}, Zn = {
|
|
471
462
|
narrow: ["1", "2", "3", "4"],
|
|
472
463
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
473
464
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
474
|
-
},
|
|
465
|
+
}, zn = {
|
|
475
466
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
476
467
|
abbreviated: [
|
|
477
468
|
"Jan",
|
|
@@ -501,7 +492,7 @@ const Qn = {
|
|
|
501
492
|
"November",
|
|
502
493
|
"December"
|
|
503
494
|
]
|
|
504
|
-
},
|
|
495
|
+
}, Qn = {
|
|
505
496
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
506
497
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
507
498
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -514,7 +505,7 @@ const Qn = {
|
|
|
514
505
|
"Friday",
|
|
515
506
|
"Saturday"
|
|
516
507
|
]
|
|
517
|
-
},
|
|
508
|
+
}, Xn = {
|
|
518
509
|
narrow: {
|
|
519
510
|
am: "a",
|
|
520
511
|
pm: "p",
|
|
@@ -545,7 +536,7 @@ const Qn = {
|
|
|
545
536
|
evening: "evening",
|
|
546
537
|
night: "night"
|
|
547
538
|
}
|
|
548
|
-
},
|
|
539
|
+
}, Un = {
|
|
549
540
|
narrow: {
|
|
550
541
|
am: "a",
|
|
551
542
|
pm: "p",
|
|
@@ -576,7 +567,7 @@ const Qn = {
|
|
|
576
567
|
evening: "in the evening",
|
|
577
568
|
night: "at night"
|
|
578
569
|
}
|
|
579
|
-
},
|
|
570
|
+
}, Ln = (t, e) => {
|
|
580
571
|
const n = Number(t), r = n % 100;
|
|
581
572
|
if (r > 20 || r < 10)
|
|
582
573
|
switch (r % 10) {
|
|
@@ -588,61 +579,61 @@ const Qn = {
|
|
|
588
579
|
return n + "rd";
|
|
589
580
|
}
|
|
590
581
|
return n + "th";
|
|
591
|
-
},
|
|
592
|
-
ordinalNumber:
|
|
593
|
-
era:
|
|
594
|
-
values:
|
|
582
|
+
}, Vn = {
|
|
583
|
+
ordinalNumber: Ln,
|
|
584
|
+
era: le({
|
|
585
|
+
values: Rn,
|
|
595
586
|
defaultWidth: "wide"
|
|
596
587
|
}),
|
|
597
|
-
quarter:
|
|
598
|
-
values:
|
|
588
|
+
quarter: le({
|
|
589
|
+
values: Zn,
|
|
599
590
|
defaultWidth: "wide",
|
|
600
591
|
argumentCallback: (t) => t - 1
|
|
601
592
|
}),
|
|
602
|
-
month:
|
|
603
|
-
values:
|
|
593
|
+
month: le({
|
|
594
|
+
values: zn,
|
|
604
595
|
defaultWidth: "wide"
|
|
605
596
|
}),
|
|
606
|
-
day:
|
|
607
|
-
values:
|
|
597
|
+
day: le({
|
|
598
|
+
values: Qn,
|
|
608
599
|
defaultWidth: "wide"
|
|
609
600
|
}),
|
|
610
|
-
dayPeriod:
|
|
611
|
-
values:
|
|
601
|
+
dayPeriod: le({
|
|
602
|
+
values: Xn,
|
|
612
603
|
defaultWidth: "wide",
|
|
613
|
-
formattingValues:
|
|
604
|
+
formattingValues: Un,
|
|
614
605
|
defaultFormattingWidth: "wide"
|
|
615
606
|
})
|
|
616
607
|
};
|
|
617
|
-
function
|
|
608
|
+
function he(t) {
|
|
618
609
|
return (e, n = {}) => {
|
|
619
610
|
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
|
|
620
611
|
if (!o)
|
|
621
612
|
return null;
|
|
622
|
-
const i = o[0], s = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(s) ?
|
|
613
|
+
const i = o[0], s = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(s) ? Jn(s, (u) => u.test(i)) : (
|
|
623
614
|
// [TODO] -- I challenge you to fix the type
|
|
624
|
-
|
|
615
|
+
Kn(s, (u) => u.test(i))
|
|
625
616
|
);
|
|
626
|
-
let
|
|
627
|
-
|
|
617
|
+
let f;
|
|
618
|
+
f = t.valueCallback ? t.valueCallback(c) : c, f = n.valueCallback ? (
|
|
628
619
|
// [TODO] -- I challenge you to fix the type
|
|
629
|
-
n.valueCallback(
|
|
630
|
-
) :
|
|
620
|
+
n.valueCallback(f)
|
|
621
|
+
) : f;
|
|
631
622
|
const l = e.slice(i.length);
|
|
632
|
-
return { value:
|
|
623
|
+
return { value: f, rest: l };
|
|
633
624
|
};
|
|
634
625
|
}
|
|
635
|
-
function
|
|
626
|
+
function Kn(t, e) {
|
|
636
627
|
for (const n in t)
|
|
637
628
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
638
629
|
return n;
|
|
639
630
|
}
|
|
640
|
-
function
|
|
631
|
+
function Jn(t, e) {
|
|
641
632
|
for (let n = 0; n < t.length; n++)
|
|
642
633
|
if (e(t[n]))
|
|
643
634
|
return n;
|
|
644
635
|
}
|
|
645
|
-
function
|
|
636
|
+
function er(t) {
|
|
646
637
|
return (e, n = {}) => {
|
|
647
638
|
const r = e.match(t.matchPattern);
|
|
648
639
|
if (!r) return null;
|
|
@@ -654,23 +645,23 @@ function rr(t) {
|
|
|
654
645
|
return { value: i, rest: s };
|
|
655
646
|
};
|
|
656
647
|
}
|
|
657
|
-
const
|
|
648
|
+
const tr = /^(\d+)(th|st|nd|rd)?/i, nr = /\d+/i, rr = {
|
|
658
649
|
narrow: /^(b|a)/i,
|
|
659
650
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
660
651
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
661
|
-
},
|
|
652
|
+
}, ar = {
|
|
662
653
|
any: [/^b/i, /^(a|c)/i]
|
|
663
|
-
},
|
|
654
|
+
}, or = {
|
|
664
655
|
narrow: /^[1234]/i,
|
|
665
656
|
abbreviated: /^q[1234]/i,
|
|
666
657
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
667
|
-
},
|
|
658
|
+
}, sr = {
|
|
668
659
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
669
|
-
},
|
|
660
|
+
}, ir = {
|
|
670
661
|
narrow: /^[jfmasond]/i,
|
|
671
662
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
672
663
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
673
|
-
},
|
|
664
|
+
}, cr = {
|
|
674
665
|
narrow: [
|
|
675
666
|
/^j/i,
|
|
676
667
|
/^f/i,
|
|
@@ -699,18 +690,18 @@ const ar = /^(\d+)(th|st|nd|rd)?/i, or = /\d+/i, sr = {
|
|
|
699
690
|
/^n/i,
|
|
700
691
|
/^d/i
|
|
701
692
|
]
|
|
702
|
-
},
|
|
693
|
+
}, ur = {
|
|
703
694
|
narrow: /^[smtwf]/i,
|
|
704
695
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
705
696
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
706
697
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
707
|
-
},
|
|
698
|
+
}, fr = {
|
|
708
699
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
709
700
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
710
|
-
},
|
|
701
|
+
}, dr = {
|
|
711
702
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
712
703
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
713
|
-
},
|
|
704
|
+
}, lr = {
|
|
714
705
|
any: {
|
|
715
706
|
am: /^a/i,
|
|
716
707
|
pm: /^p/i,
|
|
@@ -721,99 +712,99 @@ const ar = /^(\d+)(th|st|nd|rd)?/i, or = /\d+/i, sr = {
|
|
|
721
712
|
evening: /evening/i,
|
|
722
713
|
night: /night/i
|
|
723
714
|
}
|
|
724
|
-
},
|
|
725
|
-
ordinalNumber:
|
|
726
|
-
matchPattern:
|
|
727
|
-
parsePattern:
|
|
715
|
+
}, hr = {
|
|
716
|
+
ordinalNumber: er({
|
|
717
|
+
matchPattern: tr,
|
|
718
|
+
parsePattern: nr,
|
|
728
719
|
valueCallback: (t) => parseInt(t, 10)
|
|
729
720
|
}),
|
|
730
|
-
era:
|
|
731
|
-
matchPatterns:
|
|
721
|
+
era: he({
|
|
722
|
+
matchPatterns: rr,
|
|
732
723
|
defaultMatchWidth: "wide",
|
|
733
|
-
parsePatterns:
|
|
724
|
+
parsePatterns: ar,
|
|
734
725
|
defaultParseWidth: "any"
|
|
735
726
|
}),
|
|
736
|
-
quarter:
|
|
737
|
-
matchPatterns:
|
|
727
|
+
quarter: he({
|
|
728
|
+
matchPatterns: or,
|
|
738
729
|
defaultMatchWidth: "wide",
|
|
739
|
-
parsePatterns:
|
|
730
|
+
parsePatterns: sr,
|
|
740
731
|
defaultParseWidth: "any",
|
|
741
732
|
valueCallback: (t) => t + 1
|
|
742
733
|
}),
|
|
743
|
-
month:
|
|
744
|
-
matchPatterns:
|
|
734
|
+
month: he({
|
|
735
|
+
matchPatterns: ir,
|
|
745
736
|
defaultMatchWidth: "wide",
|
|
746
|
-
parsePatterns:
|
|
737
|
+
parsePatterns: cr,
|
|
747
738
|
defaultParseWidth: "any"
|
|
748
739
|
}),
|
|
749
|
-
day:
|
|
750
|
-
matchPatterns:
|
|
740
|
+
day: he({
|
|
741
|
+
matchPatterns: ur,
|
|
751
742
|
defaultMatchWidth: "wide",
|
|
752
|
-
parsePatterns:
|
|
743
|
+
parsePatterns: fr,
|
|
753
744
|
defaultParseWidth: "any"
|
|
754
745
|
}),
|
|
755
|
-
dayPeriod:
|
|
756
|
-
matchPatterns:
|
|
746
|
+
dayPeriod: he({
|
|
747
|
+
matchPatterns: dr,
|
|
757
748
|
defaultMatchWidth: "any",
|
|
758
|
-
parsePatterns:
|
|
749
|
+
parsePatterns: lr,
|
|
759
750
|
defaultParseWidth: "any"
|
|
760
751
|
})
|
|
761
|
-
},
|
|
752
|
+
}, je = {
|
|
762
753
|
code: "en-US",
|
|
763
|
-
formatDistance:
|
|
764
|
-
formatLong:
|
|
765
|
-
formatRelative:
|
|
766
|
-
localize:
|
|
767
|
-
match:
|
|
754
|
+
formatDistance: In,
|
|
755
|
+
formatLong: jn,
|
|
756
|
+
formatRelative: Gn,
|
|
757
|
+
localize: Vn,
|
|
758
|
+
match: hr,
|
|
768
759
|
options: {
|
|
769
760
|
weekStartsOn: 0,
|
|
770
761
|
firstWeekContainsDate: 1
|
|
771
762
|
}
|
|
772
763
|
};
|
|
773
|
-
function
|
|
764
|
+
function mr(t, e) {
|
|
774
765
|
const n = Y(t, e == null ? void 0 : e.in);
|
|
775
|
-
return
|
|
766
|
+
return ht(n, yt(n)) + 1;
|
|
776
767
|
}
|
|
777
|
-
function
|
|
778
|
-
const n = Y(t, e == null ? void 0 : e.in), r = +
|
|
779
|
-
return Math.round(r /
|
|
768
|
+
function wt(t, e) {
|
|
769
|
+
const n = Y(t, e == null ? void 0 : e.in), r = +ye(n) - +vn(n);
|
|
770
|
+
return Math.round(r / ut) + 1;
|
|
780
771
|
}
|
|
781
|
-
function
|
|
772
|
+
function bt(t, e) {
|
|
782
773
|
var l, u, h, w;
|
|
783
|
-
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a =
|
|
774
|
+
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = we(), o = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((u = (l = e == null ? void 0 : e.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((w = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, i = F((e == null ? void 0 : e.in) || t, 0);
|
|
784
775
|
i.setFullYear(r + 1, 0, o), i.setHours(0, 0, 0, 0);
|
|
785
|
-
const s =
|
|
776
|
+
const s = ie(i, e), c = F((e == null ? void 0 : e.in) || t, 0);
|
|
786
777
|
c.setFullYear(r, 0, o), c.setHours(0, 0, 0, 0);
|
|
787
|
-
const
|
|
788
|
-
return +n >= +s ? r + 1 : +n >= +
|
|
778
|
+
const f = ie(c, e);
|
|
779
|
+
return +n >= +s ? r + 1 : +n >= +f ? r : r - 1;
|
|
789
780
|
}
|
|
790
|
-
function
|
|
791
|
-
var s, c,
|
|
792
|
-
const n =
|
|
793
|
-
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0),
|
|
781
|
+
function yr(t, e) {
|
|
782
|
+
var s, c, f, l;
|
|
783
|
+
const n = we(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = bt(t, e), o = F((e == null ? void 0 : e.in) || t, 0);
|
|
784
|
+
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), ie(o, e);
|
|
794
785
|
}
|
|
795
|
-
function
|
|
796
|
-
const n = Y(t, e == null ? void 0 : e.in), r = +
|
|
797
|
-
return Math.round(r /
|
|
786
|
+
function Mt(t, e) {
|
|
787
|
+
const n = Y(t, e == null ? void 0 : e.in), r = +ie(n, e) - +yr(n, e);
|
|
788
|
+
return Math.round(r / ut) + 1;
|
|
798
789
|
}
|
|
799
|
-
function
|
|
790
|
+
function T(t, e) {
|
|
800
791
|
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
801
792
|
return n + r;
|
|
802
793
|
}
|
|
803
|
-
const
|
|
794
|
+
const ee = {
|
|
804
795
|
// Year
|
|
805
796
|
y(t, e) {
|
|
806
797
|
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
807
|
-
return
|
|
798
|
+
return T(e === "yy" ? r % 100 : r, e.length);
|
|
808
799
|
},
|
|
809
800
|
// Month
|
|
810
801
|
M(t, e) {
|
|
811
802
|
const n = t.getMonth();
|
|
812
|
-
return e === "M" ? String(n + 1) :
|
|
803
|
+
return e === "M" ? String(n + 1) : T(n + 1, 2);
|
|
813
804
|
},
|
|
814
805
|
// Day of the month
|
|
815
806
|
d(t, e) {
|
|
816
|
-
return
|
|
807
|
+
return T(t.getDate(), e.length);
|
|
817
808
|
},
|
|
818
809
|
// AM or PM
|
|
819
810
|
a(t, e) {
|
|
@@ -833,35 +824,35 @@ const ne = {
|
|
|
833
824
|
},
|
|
834
825
|
// Hour [1-12]
|
|
835
826
|
h(t, e) {
|
|
836
|
-
return
|
|
827
|
+
return T(t.getHours() % 12 || 12, e.length);
|
|
837
828
|
},
|
|
838
829
|
// Hour [0-23]
|
|
839
830
|
H(t, e) {
|
|
840
|
-
return
|
|
831
|
+
return T(t.getHours(), e.length);
|
|
841
832
|
},
|
|
842
833
|
// Minute
|
|
843
834
|
m(t, e) {
|
|
844
|
-
return
|
|
835
|
+
return T(t.getMinutes(), e.length);
|
|
845
836
|
},
|
|
846
837
|
// Second
|
|
847
838
|
s(t, e) {
|
|
848
|
-
return
|
|
839
|
+
return T(t.getSeconds(), e.length);
|
|
849
840
|
},
|
|
850
841
|
// Fraction of second
|
|
851
842
|
S(t, e) {
|
|
852
843
|
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
853
844
|
r * Math.pow(10, n - 3)
|
|
854
845
|
);
|
|
855
|
-
return
|
|
846
|
+
return T(a, e.length);
|
|
856
847
|
}
|
|
857
|
-
},
|
|
848
|
+
}, se = {
|
|
858
849
|
midnight: "midnight",
|
|
859
850
|
noon: "noon",
|
|
860
851
|
morning: "morning",
|
|
861
852
|
afternoon: "afternoon",
|
|
862
853
|
evening: "evening",
|
|
863
854
|
night: "night"
|
|
864
|
-
},
|
|
855
|
+
}, Je = {
|
|
865
856
|
// Era
|
|
866
857
|
G: function(t, e, n) {
|
|
867
858
|
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
@@ -886,21 +877,21 @@ const ne = {
|
|
|
886
877
|
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
887
878
|
return n.ordinalNumber(a, { unit: "year" });
|
|
888
879
|
}
|
|
889
|
-
return
|
|
880
|
+
return ee.y(t, e);
|
|
890
881
|
},
|
|
891
882
|
// Local week-numbering year
|
|
892
883
|
Y: function(t, e, n, r) {
|
|
893
|
-
const a =
|
|
884
|
+
const a = bt(t, r), o = a > 0 ? a : 1 - a;
|
|
894
885
|
if (e === "YY") {
|
|
895
886
|
const i = o % 100;
|
|
896
|
-
return
|
|
887
|
+
return T(i, 2);
|
|
897
888
|
}
|
|
898
|
-
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) :
|
|
889
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : T(o, e.length);
|
|
899
890
|
},
|
|
900
891
|
// ISO week-numbering year
|
|
901
892
|
R: function(t, e) {
|
|
902
|
-
const n =
|
|
903
|
-
return
|
|
893
|
+
const n = lt(t);
|
|
894
|
+
return T(n, e.length);
|
|
904
895
|
},
|
|
905
896
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
906
897
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -913,7 +904,7 @@ const ne = {
|
|
|
913
904
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
914
905
|
u: function(t, e) {
|
|
915
906
|
const n = t.getFullYear();
|
|
916
|
-
return
|
|
907
|
+
return T(n, e.length);
|
|
917
908
|
},
|
|
918
909
|
// Quarter
|
|
919
910
|
Q: function(t, e, n) {
|
|
@@ -924,7 +915,7 @@ const ne = {
|
|
|
924
915
|
return String(r);
|
|
925
916
|
// 01, 02, 03, 04
|
|
926
917
|
case "QQ":
|
|
927
|
-
return
|
|
918
|
+
return T(r, 2);
|
|
928
919
|
// 1st, 2nd, 3rd, 4th
|
|
929
920
|
case "Qo":
|
|
930
921
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -958,7 +949,7 @@ const ne = {
|
|
|
958
949
|
return String(r);
|
|
959
950
|
// 01, 02, 03, 04
|
|
960
951
|
case "qq":
|
|
961
|
-
return
|
|
952
|
+
return T(r, 2);
|
|
962
953
|
// 1st, 2nd, 3rd, 4th
|
|
963
954
|
case "qo":
|
|
964
955
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -989,7 +980,7 @@ const ne = {
|
|
|
989
980
|
switch (e) {
|
|
990
981
|
case "M":
|
|
991
982
|
case "MM":
|
|
992
|
-
return
|
|
983
|
+
return ee.M(t, e);
|
|
993
984
|
// 1st, 2nd, ..., 12th
|
|
994
985
|
case "Mo":
|
|
995
986
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -1020,7 +1011,7 @@ const ne = {
|
|
|
1020
1011
|
return String(r + 1);
|
|
1021
1012
|
// 01, 02, ..., 12
|
|
1022
1013
|
case "LL":
|
|
1023
|
-
return
|
|
1014
|
+
return T(r + 1, 2);
|
|
1024
1015
|
// 1st, 2nd, ..., 12th
|
|
1025
1016
|
case "Lo":
|
|
1026
1017
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -1044,22 +1035,22 @@ const ne = {
|
|
|
1044
1035
|
},
|
|
1045
1036
|
// Local week of year
|
|
1046
1037
|
w: function(t, e, n, r) {
|
|
1047
|
-
const a =
|
|
1048
|
-
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) :
|
|
1038
|
+
const a = Mt(t, r);
|
|
1039
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : T(a, e.length);
|
|
1049
1040
|
},
|
|
1050
1041
|
// ISO week of year
|
|
1051
1042
|
I: function(t, e, n) {
|
|
1052
|
-
const r =
|
|
1053
|
-
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
1043
|
+
const r = wt(t);
|
|
1044
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : T(r, e.length);
|
|
1054
1045
|
},
|
|
1055
1046
|
// Day of the month
|
|
1056
1047
|
d: function(t, e, n) {
|
|
1057
|
-
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) :
|
|
1048
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : ee.d(t, e);
|
|
1058
1049
|
},
|
|
1059
1050
|
// Day of year
|
|
1060
1051
|
D: function(t, e, n) {
|
|
1061
|
-
const r =
|
|
1062
|
-
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) :
|
|
1052
|
+
const r = mr(t);
|
|
1053
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : T(r, e.length);
|
|
1063
1054
|
},
|
|
1064
1055
|
// Day of week
|
|
1065
1056
|
E: function(t, e, n) {
|
|
@@ -1103,7 +1094,7 @@ const ne = {
|
|
|
1103
1094
|
return String(o);
|
|
1104
1095
|
// Padded numerical value
|
|
1105
1096
|
case "ee":
|
|
1106
|
-
return
|
|
1097
|
+
return T(o, 2);
|
|
1107
1098
|
// 1st, 2nd, ..., 7th
|
|
1108
1099
|
case "eo":
|
|
1109
1100
|
return n.ordinalNumber(o, { unit: "day" });
|
|
@@ -1142,7 +1133,7 @@ const ne = {
|
|
|
1142
1133
|
return String(o);
|
|
1143
1134
|
// Padded numerical value
|
|
1144
1135
|
case "cc":
|
|
1145
|
-
return
|
|
1136
|
+
return T(o, e.length);
|
|
1146
1137
|
// 1st, 2nd, ..., 7th
|
|
1147
1138
|
case "co":
|
|
1148
1139
|
return n.ordinalNumber(o, { unit: "day" });
|
|
@@ -1181,7 +1172,7 @@ const ne = {
|
|
|
1181
1172
|
return String(a);
|
|
1182
1173
|
// 02
|
|
1183
1174
|
case "ii":
|
|
1184
|
-
return
|
|
1175
|
+
return T(a, e.length);
|
|
1185
1176
|
// 2nd
|
|
1186
1177
|
case "io":
|
|
1187
1178
|
return n.ordinalNumber(a, { unit: "day" });
|
|
@@ -1244,7 +1235,7 @@ const ne = {
|
|
|
1244
1235
|
b: function(t, e, n) {
|
|
1245
1236
|
const r = t.getHours();
|
|
1246
1237
|
let a;
|
|
1247
|
-
switch (r === 12 ? a =
|
|
1238
|
+
switch (r === 12 ? a = se.noon : r === 0 ? a = se.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1248
1239
|
case "b":
|
|
1249
1240
|
case "bb":
|
|
1250
1241
|
return n.dayPeriod(a, {
|
|
@@ -1273,7 +1264,7 @@ const ne = {
|
|
|
1273
1264
|
B: function(t, e, n) {
|
|
1274
1265
|
const r = t.getHours();
|
|
1275
1266
|
let a;
|
|
1276
|
-
switch (r >= 17 ? a =
|
|
1267
|
+
switch (r >= 17 ? a = se.evening : r >= 12 ? a = se.afternoon : r >= 4 ? a = se.morning : a = se.night, e) {
|
|
1277
1268
|
case "B":
|
|
1278
1269
|
case "BB":
|
|
1279
1270
|
case "BBB":
|
|
@@ -1300,33 +1291,33 @@ const ne = {
|
|
|
1300
1291
|
let r = t.getHours() % 12;
|
|
1301
1292
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1302
1293
|
}
|
|
1303
|
-
return
|
|
1294
|
+
return ee.h(t, e);
|
|
1304
1295
|
},
|
|
1305
1296
|
// Hour [0-23]
|
|
1306
1297
|
H: function(t, e, n) {
|
|
1307
|
-
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) :
|
|
1298
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : ee.H(t, e);
|
|
1308
1299
|
},
|
|
1309
1300
|
// Hour [0-11]
|
|
1310
1301
|
K: function(t, e, n) {
|
|
1311
1302
|
const r = t.getHours() % 12;
|
|
1312
|
-
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1303
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : T(r, e.length);
|
|
1313
1304
|
},
|
|
1314
1305
|
// Hour [1-24]
|
|
1315
1306
|
k: function(t, e, n) {
|
|
1316
1307
|
let r = t.getHours();
|
|
1317
|
-
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1308
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : T(r, e.length);
|
|
1318
1309
|
},
|
|
1319
1310
|
// Minute
|
|
1320
1311
|
m: function(t, e, n) {
|
|
1321
|
-
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) :
|
|
1312
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : ee.m(t, e);
|
|
1322
1313
|
},
|
|
1323
1314
|
// Second
|
|
1324
1315
|
s: function(t, e, n) {
|
|
1325
|
-
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) :
|
|
1316
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : ee.s(t, e);
|
|
1326
1317
|
},
|
|
1327
1318
|
// Fraction of second
|
|
1328
1319
|
S: function(t, e) {
|
|
1329
|
-
return
|
|
1320
|
+
return ee.S(t, e);
|
|
1330
1321
|
},
|
|
1331
1322
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1332
1323
|
X: function(t, e, n) {
|
|
@@ -1336,13 +1327,13 @@ const ne = {
|
|
|
1336
1327
|
switch (e) {
|
|
1337
1328
|
// Hours and optional minutes
|
|
1338
1329
|
case "X":
|
|
1339
|
-
return
|
|
1330
|
+
return tt(r);
|
|
1340
1331
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1341
1332
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1342
1333
|
// so this token always has the same output as `XX`
|
|
1343
1334
|
case "XXXX":
|
|
1344
1335
|
case "XX":
|
|
1345
|
-
return
|
|
1336
|
+
return te(r);
|
|
1346
1337
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1347
1338
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1348
1339
|
// so this token always has the same output as `XXX`
|
|
@@ -1350,7 +1341,7 @@ const ne = {
|
|
|
1350
1341
|
case "XXX":
|
|
1351
1342
|
// Hours and minutes with `:` delimiter
|
|
1352
1343
|
default:
|
|
1353
|
-
return
|
|
1344
|
+
return te(r, ":");
|
|
1354
1345
|
}
|
|
1355
1346
|
},
|
|
1356
1347
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1359,13 +1350,13 @@ const ne = {
|
|
|
1359
1350
|
switch (e) {
|
|
1360
1351
|
// Hours and optional minutes
|
|
1361
1352
|
case "x":
|
|
1362
|
-
return
|
|
1353
|
+
return tt(r);
|
|
1363
1354
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1364
1355
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1365
1356
|
// so this token always has the same output as `xx`
|
|
1366
1357
|
case "xxxx":
|
|
1367
1358
|
case "xx":
|
|
1368
|
-
return
|
|
1359
|
+
return te(r);
|
|
1369
1360
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
1370
1361
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1371
1362
|
// so this token always has the same output as `xxx`
|
|
@@ -1373,7 +1364,7 @@ const ne = {
|
|
|
1373
1364
|
case "xxx":
|
|
1374
1365
|
// Hours and minutes with `:` delimiter
|
|
1375
1366
|
default:
|
|
1376
|
-
return
|
|
1367
|
+
return te(r, ":");
|
|
1377
1368
|
}
|
|
1378
1369
|
},
|
|
1379
1370
|
// Timezone (GMT)
|
|
@@ -1384,11 +1375,11 @@ const ne = {
|
|
|
1384
1375
|
case "O":
|
|
1385
1376
|
case "OO":
|
|
1386
1377
|
case "OOO":
|
|
1387
|
-
return "GMT" +
|
|
1378
|
+
return "GMT" + et(r, ":");
|
|
1388
1379
|
// Long
|
|
1389
1380
|
case "OOOO":
|
|
1390
1381
|
default:
|
|
1391
|
-
return "GMT" +
|
|
1382
|
+
return "GMT" + te(r, ":");
|
|
1392
1383
|
}
|
|
1393
1384
|
},
|
|
1394
1385
|
// Timezone (specific non-location)
|
|
@@ -1399,35 +1390,35 @@ const ne = {
|
|
|
1399
1390
|
case "z":
|
|
1400
1391
|
case "zz":
|
|
1401
1392
|
case "zzz":
|
|
1402
|
-
return "GMT" +
|
|
1393
|
+
return "GMT" + et(r, ":");
|
|
1403
1394
|
// Long
|
|
1404
1395
|
case "zzzz":
|
|
1405
1396
|
default:
|
|
1406
|
-
return "GMT" +
|
|
1397
|
+
return "GMT" + te(r, ":");
|
|
1407
1398
|
}
|
|
1408
1399
|
},
|
|
1409
1400
|
// Seconds timestamp
|
|
1410
1401
|
t: function(t, e, n) {
|
|
1411
1402
|
const r = Math.trunc(+t / 1e3);
|
|
1412
|
-
return
|
|
1403
|
+
return T(r, e.length);
|
|
1413
1404
|
},
|
|
1414
1405
|
// Milliseconds timestamp
|
|
1415
1406
|
T: function(t, e, n) {
|
|
1416
|
-
return
|
|
1407
|
+
return T(+t, e.length);
|
|
1417
1408
|
}
|
|
1418
1409
|
};
|
|
1419
|
-
function
|
|
1410
|
+
function et(t, e = "") {
|
|
1420
1411
|
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
|
|
1421
|
-
return o === 0 ? n + String(a) : n + String(a) + e +
|
|
1412
|
+
return o === 0 ? n + String(a) : n + String(a) + e + T(o, 2);
|
|
1422
1413
|
}
|
|
1423
|
-
function
|
|
1424
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1414
|
+
function tt(t, e) {
|
|
1415
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + T(Math.abs(t) / 60, 2) : te(t, e);
|
|
1425
1416
|
}
|
|
1426
|
-
function
|
|
1427
|
-
const n = t > 0 ? "-" : "+", r = Math.abs(t), a =
|
|
1417
|
+
function te(t, e = "") {
|
|
1418
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = T(Math.trunc(r / 60), 2), o = T(r % 60, 2);
|
|
1428
1419
|
return n + a + e + o;
|
|
1429
1420
|
}
|
|
1430
|
-
const
|
|
1421
|
+
const nt = (t, e) => {
|
|
1431
1422
|
switch (t) {
|
|
1432
1423
|
case "P":
|
|
1433
1424
|
return e.date({ width: "short" });
|
|
@@ -1439,7 +1430,7 @@ const ot = (t, e) => {
|
|
|
1439
1430
|
default:
|
|
1440
1431
|
return e.date({ width: "full" });
|
|
1441
1432
|
}
|
|
1442
|
-
},
|
|
1433
|
+
}, kt = (t, e) => {
|
|
1443
1434
|
switch (t) {
|
|
1444
1435
|
case "p":
|
|
1445
1436
|
return e.time({ width: "short" });
|
|
@@ -1451,10 +1442,10 @@ const ot = (t, e) => {
|
|
|
1451
1442
|
default:
|
|
1452
1443
|
return e.time({ width: "full" });
|
|
1453
1444
|
}
|
|
1454
|
-
},
|
|
1445
|
+
}, gr = (t, e) => {
|
|
1455
1446
|
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1456
1447
|
if (!a)
|
|
1457
|
-
return
|
|
1448
|
+
return nt(t, e);
|
|
1458
1449
|
let o;
|
|
1459
1450
|
switch (r) {
|
|
1460
1451
|
case "P":
|
|
@@ -1471,54 +1462,54 @@ const ot = (t, e) => {
|
|
|
1471
1462
|
o = e.dateTime({ width: "full" });
|
|
1472
1463
|
break;
|
|
1473
1464
|
}
|
|
1474
|
-
return o.replace("{{date}}",
|
|
1475
|
-
},
|
|
1476
|
-
p:
|
|
1477
|
-
P:
|
|
1478
|
-
},
|
|
1479
|
-
function
|
|
1480
|
-
return
|
|
1481
|
-
}
|
|
1482
|
-
function
|
|
1483
|
-
return
|
|
1484
|
-
}
|
|
1485
|
-
function
|
|
1486
|
-
const r =
|
|
1487
|
-
if (console.warn(r),
|
|
1488
|
-
}
|
|
1489
|
-
function
|
|
1465
|
+
return o.replace("{{date}}", nt(r, e)).replace("{{time}}", kt(a, e));
|
|
1466
|
+
}, wr = {
|
|
1467
|
+
p: kt,
|
|
1468
|
+
P: gr
|
|
1469
|
+
}, br = /^D+$/, Mr = /^Y+$/, kr = ["D", "DD", "YY", "YYYY"];
|
|
1470
|
+
function Dr(t) {
|
|
1471
|
+
return br.test(t);
|
|
1472
|
+
}
|
|
1473
|
+
function vr(t) {
|
|
1474
|
+
return Mr.test(t);
|
|
1475
|
+
}
|
|
1476
|
+
function Or(t, e, n) {
|
|
1477
|
+
const r = Wr(t, e, n);
|
|
1478
|
+
if (console.warn(r), kr.includes(t)) throw new RangeError(r);
|
|
1479
|
+
}
|
|
1480
|
+
function Wr(t, e, n) {
|
|
1490
1481
|
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1491
1482
|
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1492
1483
|
}
|
|
1493
|
-
const
|
|
1494
|
-
function
|
|
1495
|
-
var l, u, h, w, b,
|
|
1496
|
-
const r =
|
|
1497
|
-
if (!
|
|
1484
|
+
const Sr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, pr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Nr = /^'([^]*?)'?$/, Cr = /''/g, xr = /[a-zA-Z]/;
|
|
1485
|
+
function Tr(t, e, n) {
|
|
1486
|
+
var l, u, h, w, b, O, M, k;
|
|
1487
|
+
const r = we(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? je, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((u = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : u.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((w = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((O = (b = n == null ? void 0 : n.locale) == null ? void 0 : b.options) == null ? void 0 : O.weekStartsOn) ?? r.weekStartsOn ?? ((k = (M = r.locale) == null ? void 0 : M.options) == null ? void 0 : k.weekStartsOn) ?? 0, s = Y(t, n == null ? void 0 : n.in);
|
|
1488
|
+
if (!Cn(s))
|
|
1498
1489
|
throw new RangeError("Invalid time value");
|
|
1499
|
-
let c = e.match(
|
|
1490
|
+
let c = e.match(pr).map((D) => {
|
|
1500
1491
|
const y = D[0];
|
|
1501
1492
|
if (y === "p" || y === "P") {
|
|
1502
|
-
const
|
|
1503
|
-
return
|
|
1493
|
+
const N = wr[y];
|
|
1494
|
+
return N(D, a.formatLong);
|
|
1504
1495
|
}
|
|
1505
1496
|
return D;
|
|
1506
|
-
}).join("").match(
|
|
1497
|
+
}).join("").match(Sr).map((D) => {
|
|
1507
1498
|
if (D === "''")
|
|
1508
1499
|
return { isToken: !1, value: "'" };
|
|
1509
1500
|
const y = D[0];
|
|
1510
1501
|
if (y === "'")
|
|
1511
|
-
return { isToken: !1, value:
|
|
1512
|
-
if (
|
|
1502
|
+
return { isToken: !1, value: Yr(D) };
|
|
1503
|
+
if (Je[y])
|
|
1513
1504
|
return { isToken: !0, value: D };
|
|
1514
|
-
if (y.match(
|
|
1505
|
+
if (y.match(xr))
|
|
1515
1506
|
throw new RangeError(
|
|
1516
1507
|
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
1517
1508
|
);
|
|
1518
1509
|
return { isToken: !1, value: D };
|
|
1519
1510
|
});
|
|
1520
1511
|
a.localize.preprocessor && (c = a.localize.preprocessor(s, c));
|
|
1521
|
-
const
|
|
1512
|
+
const f = {
|
|
1522
1513
|
firstWeekContainsDate: o,
|
|
1523
1514
|
weekStartsOn: i,
|
|
1524
1515
|
locale: a
|
|
@@ -1526,71 +1517,71 @@ function Pr(t, e, n) {
|
|
|
1526
1517
|
return c.map((D) => {
|
|
1527
1518
|
if (!D.isToken) return D.value;
|
|
1528
1519
|
const y = D.value;
|
|
1529
|
-
(!(n != null && n.useAdditionalWeekYearTokens) &&
|
|
1530
|
-
const
|
|
1531
|
-
return
|
|
1520
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && vr(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Dr(y)) && Or(y, e, String(t));
|
|
1521
|
+
const N = Je[y[0]];
|
|
1522
|
+
return N(s, y, a.localize, f);
|
|
1532
1523
|
}).join("");
|
|
1533
1524
|
}
|
|
1534
|
-
function
|
|
1535
|
-
const e = t.match(
|
|
1536
|
-
return e ? e[1].replace(
|
|
1525
|
+
function Yr(t) {
|
|
1526
|
+
const e = t.match(Nr);
|
|
1527
|
+
return e ? e[1].replace(Cr, "'") : t;
|
|
1537
1528
|
}
|
|
1538
|
-
function
|
|
1539
|
-
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = n.getMonth(), o =
|
|
1529
|
+
function Er(t, e) {
|
|
1530
|
+
const n = Y(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = n.getMonth(), o = F(n, 0);
|
|
1540
1531
|
return o.setFullYear(r, a + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
|
|
1541
1532
|
}
|
|
1542
|
-
function
|
|
1533
|
+
function _r(t, e) {
|
|
1543
1534
|
return Y(t, e == null ? void 0 : e.in).getMonth();
|
|
1544
1535
|
}
|
|
1545
|
-
function
|
|
1536
|
+
function Pr(t, e) {
|
|
1546
1537
|
return Y(t, e == null ? void 0 : e.in).getFullYear();
|
|
1547
1538
|
}
|
|
1548
|
-
function
|
|
1539
|
+
function Fr(t, e) {
|
|
1549
1540
|
return +Y(t) > +Y(e);
|
|
1550
1541
|
}
|
|
1551
|
-
function
|
|
1542
|
+
function Br(t, e) {
|
|
1552
1543
|
return +Y(t) < +Y(e);
|
|
1553
1544
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const [r, a] =
|
|
1545
|
+
function Ir(t, e, n) {
|
|
1546
|
+
const [r, a] = ce(
|
|
1556
1547
|
n == null ? void 0 : n.in,
|
|
1557
1548
|
t,
|
|
1558
1549
|
e
|
|
1559
1550
|
);
|
|
1560
1551
|
return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
|
|
1561
1552
|
}
|
|
1562
|
-
function
|
|
1563
|
-
const [r, a] =
|
|
1553
|
+
function Hr(t, e, n) {
|
|
1554
|
+
const [r, a] = ce(
|
|
1564
1555
|
n == null ? void 0 : n.in,
|
|
1565
1556
|
t,
|
|
1566
1557
|
e
|
|
1567
1558
|
);
|
|
1568
1559
|
return r.getFullYear() === a.getFullYear();
|
|
1569
1560
|
}
|
|
1570
|
-
function
|
|
1571
|
-
const r = Y(t, n == null ? void 0 : n.in), a = r.getFullYear(), o = r.getDate(), i =
|
|
1561
|
+
function qr(t, e, n) {
|
|
1562
|
+
const r = Y(t, n == null ? void 0 : n.in), a = r.getFullYear(), o = r.getDate(), i = F(t, 0);
|
|
1572
1563
|
i.setFullYear(a, e, 15), i.setHours(0, 0, 0, 0);
|
|
1573
|
-
const s =
|
|
1564
|
+
const s = Er(i);
|
|
1574
1565
|
return r.setMonth(e, Math.min(o, s)), r;
|
|
1575
1566
|
}
|
|
1576
|
-
function
|
|
1567
|
+
function Ar(t, e, n) {
|
|
1577
1568
|
const r = Y(t, n == null ? void 0 : n.in);
|
|
1578
|
-
return isNaN(+r) ?
|
|
1569
|
+
return isNaN(+r) ? F(t, NaN) : (r.setFullYear(e), r);
|
|
1579
1570
|
}
|
|
1580
|
-
const
|
|
1581
|
-
function
|
|
1582
|
-
const n = e.startOfMonth(t), r = n.getDay() > 0 ? n.getDay() : 7, a = e.addDays(t, -r + 1), o = e.addDays(a,
|
|
1583
|
-
return e.getMonth(t) === e.getMonth(o) ?
|
|
1571
|
+
const rt = 5, jr = 4;
|
|
1572
|
+
function $r(t, e) {
|
|
1573
|
+
const n = e.startOfMonth(t), r = n.getDay() > 0 ? n.getDay() : 7, a = e.addDays(t, -r + 1), o = e.addDays(a, rt * 7 - 1);
|
|
1574
|
+
return e.getMonth(t) === e.getMonth(o) ? rt : jr;
|
|
1584
1575
|
}
|
|
1585
|
-
function
|
|
1576
|
+
function Dt(t, e) {
|
|
1586
1577
|
const n = e.startOfMonth(t), r = n.getDay();
|
|
1587
1578
|
return r === 1 ? n : r === 0 ? e.addDays(n, -1 * 6) : e.addDays(n, -1 * (r - 1));
|
|
1588
1579
|
}
|
|
1589
|
-
function
|
|
1590
|
-
const n =
|
|
1580
|
+
function Gr(t, e) {
|
|
1581
|
+
const n = Dt(t, e), r = $r(t, e);
|
|
1591
1582
|
return e.addDays(n, r * 7 - 1);
|
|
1592
1583
|
}
|
|
1593
|
-
class
|
|
1584
|
+
class J {
|
|
1594
1585
|
/**
|
|
1595
1586
|
* Creates an instance of `DateLib`.
|
|
1596
1587
|
*
|
|
@@ -1606,105 +1597,105 @@ class ee {
|
|
|
1606
1597
|
return (i = this.overrides) != null && i.newDate ? this.overrides.newDate(r, a, o) : this.options.timeZone ? new I(r, a, o, this.options.timeZone) : new Date(r, a, o);
|
|
1607
1598
|
}, this.addDays = (r, a) => {
|
|
1608
1599
|
var o;
|
|
1609
|
-
return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, a) :
|
|
1600
|
+
return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, a) : ft(r, a);
|
|
1610
1601
|
}, this.addMonths = (r, a) => {
|
|
1611
1602
|
var o;
|
|
1612
|
-
return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, a) :
|
|
1603
|
+
return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, a) : dt(r, a);
|
|
1613
1604
|
}, this.addWeeks = (r, a) => {
|
|
1614
1605
|
var o;
|
|
1615
|
-
return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, a) :
|
|
1606
|
+
return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, a) : On(r, a);
|
|
1616
1607
|
}, this.addYears = (r, a) => {
|
|
1617
1608
|
var o;
|
|
1618
|
-
return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, a) :
|
|
1609
|
+
return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, a) : Wn(r, a);
|
|
1619
1610
|
}, this.differenceInCalendarDays = (r, a) => {
|
|
1620
1611
|
var o;
|
|
1621
|
-
return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) :
|
|
1612
|
+
return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : ht(r, a);
|
|
1622
1613
|
}, this.differenceInCalendarMonths = (r, a) => {
|
|
1623
1614
|
var o;
|
|
1624
|
-
return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) :
|
|
1615
|
+
return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : xn(r, a);
|
|
1625
1616
|
}, this.eachMonthOfInterval = (r) => {
|
|
1626
1617
|
var a;
|
|
1627
|
-
return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) :
|
|
1618
|
+
return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : En(r);
|
|
1628
1619
|
}, this.endOfBroadcastWeek = (r) => {
|
|
1629
1620
|
var a;
|
|
1630
|
-
return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) :
|
|
1621
|
+
return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : Gr(r, this);
|
|
1631
1622
|
}, this.endOfISOWeek = (r) => {
|
|
1632
1623
|
var a;
|
|
1633
|
-
return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) :
|
|
1624
|
+
return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : Fn(r);
|
|
1634
1625
|
}, this.endOfMonth = (r) => {
|
|
1635
1626
|
var a;
|
|
1636
|
-
return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) :
|
|
1627
|
+
return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : Tn(r);
|
|
1637
1628
|
}, this.endOfWeek = (r, a) => {
|
|
1638
1629
|
var o;
|
|
1639
|
-
return (o = this.overrides) != null && o.endOfWeek ? this.overrides.endOfWeek(r, a) :
|
|
1630
|
+
return (o = this.overrides) != null && o.endOfWeek ? this.overrides.endOfWeek(r, a) : gt(r, this.options);
|
|
1640
1631
|
}, this.endOfYear = (r) => {
|
|
1641
1632
|
var a;
|
|
1642
|
-
return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) :
|
|
1633
|
+
return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : Pn(r);
|
|
1643
1634
|
}, this.format = (r, a, o) => {
|
|
1644
1635
|
var s;
|
|
1645
|
-
const i = (s = this.overrides) != null && s.format ? this.overrides.format(r, a, this.options) :
|
|
1636
|
+
const i = (s = this.overrides) != null && s.format ? this.overrides.format(r, a, this.options) : Tr(r, a, this.options);
|
|
1646
1637
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1647
1638
|
}, this.getISOWeek = (r) => {
|
|
1648
1639
|
var a;
|
|
1649
|
-
return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) :
|
|
1640
|
+
return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : wt(r);
|
|
1650
1641
|
}, this.getMonth = (r, a) => {
|
|
1651
1642
|
var o;
|
|
1652
|
-
return (o = this.overrides) != null && o.getMonth ? this.overrides.getMonth(r, this.options) :
|
|
1643
|
+
return (o = this.overrides) != null && o.getMonth ? this.overrides.getMonth(r, this.options) : _r(r, this.options);
|
|
1653
1644
|
}, this.getYear = (r, a) => {
|
|
1654
1645
|
var o;
|
|
1655
|
-
return (o = this.overrides) != null && o.getYear ? this.overrides.getYear(r, this.options) :
|
|
1646
|
+
return (o = this.overrides) != null && o.getYear ? this.overrides.getYear(r, this.options) : Pr(r, this.options);
|
|
1656
1647
|
}, this.getWeek = (r, a) => {
|
|
1657
1648
|
var o;
|
|
1658
|
-
return (o = this.overrides) != null && o.getWeek ? this.overrides.getWeek(r, this.options) :
|
|
1649
|
+
return (o = this.overrides) != null && o.getWeek ? this.overrides.getWeek(r, this.options) : Mt(r, this.options);
|
|
1659
1650
|
}, this.isAfter = (r, a) => {
|
|
1660
1651
|
var o;
|
|
1661
|
-
return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, a) :
|
|
1652
|
+
return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, a) : Fr(r, a);
|
|
1662
1653
|
}, this.isBefore = (r, a) => {
|
|
1663
1654
|
var o;
|
|
1664
|
-
return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, a) :
|
|
1655
|
+
return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, a) : Br(r, a);
|
|
1665
1656
|
}, this.isDate = (r) => {
|
|
1666
1657
|
var a;
|
|
1667
|
-
return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) :
|
|
1658
|
+
return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : mt(r);
|
|
1668
1659
|
}, this.isSameDay = (r, a) => {
|
|
1669
1660
|
var o;
|
|
1670
|
-
return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, a) :
|
|
1661
|
+
return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, a) : Nn(r, a);
|
|
1671
1662
|
}, this.isSameMonth = (r, a) => {
|
|
1672
1663
|
var o;
|
|
1673
|
-
return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, a) :
|
|
1664
|
+
return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, a) : Ir(r, a);
|
|
1674
1665
|
}, this.isSameYear = (r, a) => {
|
|
1675
1666
|
var o;
|
|
1676
|
-
return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, a) :
|
|
1667
|
+
return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, a) : Hr(r, a);
|
|
1677
1668
|
}, this.max = (r) => {
|
|
1678
1669
|
var a;
|
|
1679
|
-
return (a = this.overrides) != null && a.max ? this.overrides.max(r) :
|
|
1670
|
+
return (a = this.overrides) != null && a.max ? this.overrides.max(r) : Sn(r);
|
|
1680
1671
|
}, this.min = (r) => {
|
|
1681
1672
|
var a;
|
|
1682
|
-
return (a = this.overrides) != null && a.min ? this.overrides.min(r) :
|
|
1673
|
+
return (a = this.overrides) != null && a.min ? this.overrides.min(r) : pn(r);
|
|
1683
1674
|
}, this.setMonth = (r, a) => {
|
|
1684
1675
|
var o;
|
|
1685
|
-
return (o = this.overrides) != null && o.setMonth ? this.overrides.setMonth(r, a) :
|
|
1676
|
+
return (o = this.overrides) != null && o.setMonth ? this.overrides.setMonth(r, a) : qr(r, a);
|
|
1686
1677
|
}, this.setYear = (r, a) => {
|
|
1687
1678
|
var o;
|
|
1688
|
-
return (o = this.overrides) != null && o.setYear ? this.overrides.setYear(r, a) :
|
|
1679
|
+
return (o = this.overrides) != null && o.setYear ? this.overrides.setYear(r, a) : Ar(r, a);
|
|
1689
1680
|
}, this.startOfBroadcastWeek = (r, a) => {
|
|
1690
1681
|
var o;
|
|
1691
|
-
return (o = this.overrides) != null && o.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) :
|
|
1682
|
+
return (o = this.overrides) != null && o.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : Dt(r, this);
|
|
1692
1683
|
}, this.startOfDay = (r) => {
|
|
1693
1684
|
var a;
|
|
1694
|
-
return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) :
|
|
1685
|
+
return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) : ge(r);
|
|
1695
1686
|
}, this.startOfISOWeek = (r) => {
|
|
1696
1687
|
var a;
|
|
1697
|
-
return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) :
|
|
1688
|
+
return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) : ye(r);
|
|
1698
1689
|
}, this.startOfMonth = (r) => {
|
|
1699
1690
|
var a;
|
|
1700
|
-
return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) :
|
|
1691
|
+
return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) : _n(r);
|
|
1701
1692
|
}, this.startOfWeek = (r, a) => {
|
|
1702
1693
|
var o;
|
|
1703
|
-
return (o = this.overrides) != null && o.startOfWeek ? this.overrides.startOfWeek(r, this.options) :
|
|
1694
|
+
return (o = this.overrides) != null && o.startOfWeek ? this.overrides.startOfWeek(r, this.options) : ie(r, this.options);
|
|
1704
1695
|
}, this.startOfYear = (r) => {
|
|
1705
1696
|
var a;
|
|
1706
|
-
return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) :
|
|
1707
|
-
}, this.options = { locale:
|
|
1697
|
+
return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) : yt(r);
|
|
1698
|
+
}, this.options = { locale: je, ...e }, this.overrides = n;
|
|
1708
1699
|
}
|
|
1709
1700
|
/**
|
|
1710
1701
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1743,9 +1734,9 @@ class ee {
|
|
|
1743
1734
|
return this.replaceDigits(e.toString());
|
|
1744
1735
|
}
|
|
1745
1736
|
}
|
|
1746
|
-
const
|
|
1747
|
-
class
|
|
1748
|
-
constructor(e, n, r =
|
|
1737
|
+
const U = new J();
|
|
1738
|
+
class vt {
|
|
1739
|
+
constructor(e, n, r = U) {
|
|
1749
1740
|
this.date = e, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(e, n)), this.dateLib = r;
|
|
1750
1741
|
}
|
|
1751
1742
|
/**
|
|
@@ -1759,133 +1750,69 @@ class pt {
|
|
|
1759
1750
|
return this.dateLib.isSameDay(e.date, this.date) && this.dateLib.isSameMonth(e.displayMonth, this.displayMonth);
|
|
1760
1751
|
}
|
|
1761
1752
|
}
|
|
1762
|
-
class
|
|
1753
|
+
class Rr {
|
|
1763
1754
|
constructor(e, n) {
|
|
1764
1755
|
this.date = e, this.weeks = n;
|
|
1765
1756
|
}
|
|
1766
1757
|
}
|
|
1767
|
-
class
|
|
1758
|
+
class Zr {
|
|
1768
1759
|
constructor(e, n) {
|
|
1769
1760
|
this.days = n, this.weekNumber = e;
|
|
1770
1761
|
}
|
|
1771
1762
|
}
|
|
1772
|
-
function
|
|
1773
|
-
let { from: a, to: o } = t;
|
|
1774
|
-
const { differenceInCalendarDays: i, isSameDay: s } = r;
|
|
1775
|
-
return a && o ? (i(o, a) < 0 && ([a, o] = [o, a]), i(e, a) >= (n ? 1 : 0) && i(o, e) >= (n ? 1 : 0)) : !n && o ? s(o, e) : !n && a ? s(a, e) : !1;
|
|
1776
|
-
}
|
|
1777
|
-
function Nt(t) {
|
|
1778
|
-
return !!(t && typeof t == "object" && "before" in t && "after" in t);
|
|
1779
|
-
}
|
|
1780
|
-
function ze(t) {
|
|
1781
|
-
return !!(t && typeof t == "object" && "from" in t);
|
|
1782
|
-
}
|
|
1783
|
-
function St(t) {
|
|
1784
|
-
return !!(t && typeof t == "object" && "after" in t);
|
|
1785
|
-
}
|
|
1786
|
-
function Ct(t) {
|
|
1787
|
-
return !!(t && typeof t == "object" && "before" in t);
|
|
1788
|
-
}
|
|
1789
|
-
function xt(t) {
|
|
1790
|
-
return !!(t && typeof t == "object" && "dayOfWeek" in t);
|
|
1791
|
-
}
|
|
1792
|
-
function Yt(t, e) {
|
|
1793
|
-
return Array.isArray(t) && t.every(e.isDate);
|
|
1794
|
-
}
|
|
1795
|
-
function J(t, e, n = V) {
|
|
1796
|
-
const r = Array.isArray(e) ? e : [e], { isSameDay: a, differenceInCalendarDays: o, isAfter: i } = n;
|
|
1797
|
-
return r.some((s) => {
|
|
1798
|
-
if (typeof s == "boolean")
|
|
1799
|
-
return s;
|
|
1800
|
-
if (n.isDate(s))
|
|
1801
|
-
return a(t, s);
|
|
1802
|
-
if (Yt(s, n))
|
|
1803
|
-
return s.includes(t);
|
|
1804
|
-
if (ze(s))
|
|
1805
|
-
return K(s, t, !1, n);
|
|
1806
|
-
if (xt(s))
|
|
1807
|
-
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(t.getDay()) : s.dayOfWeek === t.getDay();
|
|
1808
|
-
if (Nt(s)) {
|
|
1809
|
-
const c = o(s.before, t), d = o(s.after, t), l = c > 0, u = d < 0;
|
|
1810
|
-
return i(s.before, s.after) ? u && l : l || u;
|
|
1811
|
-
}
|
|
1812
|
-
return St(s) ? o(t, s.after) > 0 : Ct(s) ? o(s.before, t) > 0 : typeof s == "function" ? s(t) : !1;
|
|
1813
|
-
});
|
|
1814
|
-
}
|
|
1815
|
-
function Lr(t, e, n, r, a) {
|
|
1816
|
-
const { disabled: o, hidden: i, modifiers: s, showOutsideDays: c, broadcastCalendar: d, today: l } = e, { isSameDay: u, isSameMonth: h, startOfMonth: w, isBefore: b, endOfMonth: W, isAfter: M } = a, k = n && w(n), D = r && W(r), y = {
|
|
1817
|
-
[P.focused]: [],
|
|
1818
|
-
[P.outside]: [],
|
|
1819
|
-
[P.disabled]: [],
|
|
1820
|
-
[P.hidden]: [],
|
|
1821
|
-
[P.today]: []
|
|
1822
|
-
}, T = {};
|
|
1823
|
-
for (const f of t) {
|
|
1824
|
-
const { date: O, displayMonth: v } = f, N = !!(v && !h(O, v)), F = !!(k && b(O, k)), H = !!(D && M(O, D)), q = !!(o && J(O, o, a)), $ = !!(i && J(O, i, a)) || F || H || // Broadcast calendar will show outside days as default
|
|
1825
|
-
!d && !c && N || d && c === !1 && N, ae = u(O, l ?? a.today());
|
|
1826
|
-
N && y.outside.push(f), q && y.disabled.push(f), $ && y.hidden.push(f), ae && y.today.push(f), s && Object.keys(s).forEach((oe) => {
|
|
1827
|
-
const se = s == null ? void 0 : s[oe];
|
|
1828
|
-
se && J(O, se, a) && (T[oe] ? T[oe].push(f) : T[oe] = [f]);
|
|
1829
|
-
});
|
|
1830
|
-
}
|
|
1831
|
-
return (f) => {
|
|
1832
|
-
const O = {
|
|
1833
|
-
[P.focused]: !1,
|
|
1834
|
-
[P.disabled]: !1,
|
|
1835
|
-
[P.hidden]: !1,
|
|
1836
|
-
[P.outside]: !1,
|
|
1837
|
-
[P.today]: !1
|
|
1838
|
-
}, v = {};
|
|
1839
|
-
for (const N in y) {
|
|
1840
|
-
const F = y[N];
|
|
1841
|
-
O[N] = F.some((H) => H === f);
|
|
1842
|
-
}
|
|
1843
|
-
for (const N in T)
|
|
1844
|
-
v[N] = T[N].some((F) => F === f);
|
|
1845
|
-
return {
|
|
1846
|
-
...O,
|
|
1847
|
-
// custom modifiers should override all the previous ones
|
|
1848
|
-
...v
|
|
1849
|
-
};
|
|
1850
|
-
};
|
|
1851
|
-
}
|
|
1852
|
-
function Vr(t, e, n = {}) {
|
|
1853
|
-
return Object.entries(t).filter(([, a]) => a === !0).reduce((a, [o]) => (n[o] ? a.push(n[o]) : e[P[o]] ? a.push(e[P[o]]) : e[Z[o]] && a.push(e[Z[o]]), a), [e[g.Day]]);
|
|
1854
|
-
}
|
|
1855
|
-
function Ur(t) {
|
|
1763
|
+
function zr(t) {
|
|
1856
1764
|
return m.createElement("button", { ...t });
|
|
1857
1765
|
}
|
|
1858
|
-
function
|
|
1766
|
+
function Qr(t) {
|
|
1859
1767
|
return m.createElement("span", { ...t });
|
|
1860
1768
|
}
|
|
1861
|
-
function
|
|
1769
|
+
function Xr(t) {
|
|
1862
1770
|
const { size: e = 24, orientation: n = "left", className: r } = t;
|
|
1863
|
-
return
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1771
|
+
return (
|
|
1772
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
1773
|
+
m.createElement(
|
|
1774
|
+
"svg",
|
|
1775
|
+
{ className: r, width: e, height: e, viewBox: "0 0 24 24" },
|
|
1776
|
+
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" }),
|
|
1777
|
+
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" }),
|
|
1778
|
+
n === "left" && m.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
1779
|
+
n === "right" && m.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
1780
|
+
)
|
|
1870
1781
|
);
|
|
1871
1782
|
}
|
|
1872
|
-
function
|
|
1783
|
+
function Ur(t) {
|
|
1873
1784
|
const { day: e, modifiers: n, ...r } = t;
|
|
1874
1785
|
return m.createElement("td", { ...r });
|
|
1875
1786
|
}
|
|
1876
|
-
function
|
|
1787
|
+
function Lr(t) {
|
|
1877
1788
|
const { day: e, modifiers: n, ...r } = t, a = m.useRef(null);
|
|
1878
1789
|
return m.useEffect(() => {
|
|
1879
1790
|
var o;
|
|
1880
1791
|
n.focused && ((o = a.current) == null || o.focus());
|
|
1881
1792
|
}, [n.focused]), m.createElement("button", { ref: a, ...r });
|
|
1882
1793
|
}
|
|
1883
|
-
|
|
1794
|
+
var g;
|
|
1795
|
+
(function(t) {
|
|
1796
|
+
t.Root = "root", t.Chevron = "chevron", t.Day = "day", t.DayButton = "day_button", t.CaptionLabel = "caption_label", t.Dropdowns = "dropdowns", t.Dropdown = "dropdown", t.DropdownRoot = "dropdown_root", t.Footer = "footer", t.MonthGrid = "month_grid", t.MonthCaption = "month_caption", t.MonthsDropdown = "months_dropdown", t.Month = "month", t.Months = "months", t.Nav = "nav", t.NextMonthButton = "button_next", t.PreviousMonthButton = "button_previous", t.Week = "week", t.Weeks = "weeks", t.Weekday = "weekday", t.Weekdays = "weekdays", t.WeekNumber = "week_number", t.WeekNumberHeader = "week_number_header", t.YearsDropdown = "years_dropdown";
|
|
1797
|
+
})(g || (g = {}));
|
|
1798
|
+
var P;
|
|
1799
|
+
(function(t) {
|
|
1800
|
+
t.disabled = "disabled", t.hidden = "hidden", t.outside = "outside", t.focused = "focused", t.today = "today";
|
|
1801
|
+
})(P || (P = {}));
|
|
1802
|
+
var z;
|
|
1803
|
+
(function(t) {
|
|
1804
|
+
t.range_end = "range_end", t.range_middle = "range_middle", t.range_start = "range_start", t.selected = "selected";
|
|
1805
|
+
})(z || (z = {}));
|
|
1806
|
+
var j;
|
|
1807
|
+
(function(t) {
|
|
1808
|
+
t.weeks_before_enter = "weeks_before_enter", t.weeks_before_exit = "weeks_before_exit", t.weeks_after_enter = "weeks_after_enter", t.weeks_after_exit = "weeks_after_exit", t.caption_after_enter = "caption_after_enter", t.caption_after_exit = "caption_after_exit", t.caption_before_enter = "caption_before_enter", t.caption_before_exit = "caption_before_exit";
|
|
1809
|
+
})(j || (j = {}));
|
|
1810
|
+
function Vr(t) {
|
|
1884
1811
|
const { options: e, className: n, components: r, classNames: a, ...o } = t, i = [a[g.Dropdown], n].join(" "), s = e == null ? void 0 : e.find(({ value: c }) => c === o.value);
|
|
1885
1812
|
return m.createElement(
|
|
1886
1813
|
"span",
|
|
1887
1814
|
{ "data-disabled": o.disabled, className: a[g.DropdownRoot] },
|
|
1888
|
-
m.createElement(r.Select, { className: i, ...o }, e == null ? void 0 : e.map(({ value: c, label:
|
|
1815
|
+
m.createElement(r.Select, { className: i, ...o }, e == null ? void 0 : e.map(({ value: c, label: f, disabled: l }) => m.createElement(r.Option, { key: c, value: c, disabled: l }, f))),
|
|
1889
1816
|
m.createElement(
|
|
1890
1817
|
"span",
|
|
1891
1818
|
{ className: a[g.CaptionLabel], "aria-hidden": !0 },
|
|
@@ -1894,39 +1821,39 @@ function na(t) {
|
|
|
1894
1821
|
)
|
|
1895
1822
|
);
|
|
1896
1823
|
}
|
|
1897
|
-
function
|
|
1824
|
+
function Kr(t) {
|
|
1898
1825
|
return m.createElement("div", { ...t });
|
|
1899
1826
|
}
|
|
1900
|
-
function
|
|
1827
|
+
function Jr(t) {
|
|
1901
1828
|
return m.createElement("div", { ...t });
|
|
1902
1829
|
}
|
|
1903
|
-
function
|
|
1830
|
+
function ea(t) {
|
|
1904
1831
|
const { calendarMonth: e, displayIndex: n, ...r } = t;
|
|
1905
1832
|
return m.createElement("div", { ...r }, t.children);
|
|
1906
1833
|
}
|
|
1907
|
-
function
|
|
1834
|
+
function ta(t) {
|
|
1908
1835
|
const { calendarMonth: e, displayIndex: n, ...r } = t;
|
|
1909
1836
|
return m.createElement("div", { ...r });
|
|
1910
1837
|
}
|
|
1911
|
-
function
|
|
1838
|
+
function na(t) {
|
|
1912
1839
|
return m.createElement("table", { ...t });
|
|
1913
1840
|
}
|
|
1914
|
-
function
|
|
1841
|
+
function ra(t) {
|
|
1915
1842
|
return m.createElement("div", { ...t });
|
|
1916
1843
|
}
|
|
1917
|
-
const
|
|
1918
|
-
function
|
|
1919
|
-
const t =
|
|
1844
|
+
const Ot = cn(void 0);
|
|
1845
|
+
function be() {
|
|
1846
|
+
const t = un(Ot);
|
|
1920
1847
|
if (t === void 0)
|
|
1921
1848
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
1922
1849
|
return t;
|
|
1923
1850
|
}
|
|
1924
|
-
function
|
|
1925
|
-
const { components: e } =
|
|
1851
|
+
function aa(t) {
|
|
1852
|
+
const { components: e } = be();
|
|
1926
1853
|
return m.createElement(e.Dropdown, { ...t });
|
|
1927
1854
|
}
|
|
1928
|
-
function
|
|
1929
|
-
const { onPreviousClick: e, onNextClick: n, previousMonth: r, nextMonth: a, ...o } = t, { components: i, classNames: s, labels: { labelPrevious: c, labelNext:
|
|
1855
|
+
function oa(t) {
|
|
1856
|
+
const { onPreviousClick: e, onNextClick: n, previousMonth: r, nextMonth: a, ...o } = t, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: f } } = be(), l = A((h) => {
|
|
1930
1857
|
a && (n == null || n(h));
|
|
1931
1858
|
}, [a, n]), u = A((h) => {
|
|
1932
1859
|
r && (e == null || e(h));
|
|
@@ -1941,65 +1868,148 @@ function fa(t) {
|
|
|
1941
1868
|
),
|
|
1942
1869
|
m.createElement(
|
|
1943
1870
|
i.NextMonthButton,
|
|
1944
|
-
{ type: "button", className: s[g.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label":
|
|
1871
|
+
{ type: "button", className: s[g.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label": f(a), onClick: l },
|
|
1945
1872
|
m.createElement(i.Chevron, { disabled: a ? void 0 : !0, orientation: "right", className: s[g.Chevron] })
|
|
1946
1873
|
)
|
|
1947
1874
|
);
|
|
1948
1875
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const { components: e } =
|
|
1876
|
+
function sa(t) {
|
|
1877
|
+
const { components: e } = be();
|
|
1951
1878
|
return m.createElement(e.Button, { ...t });
|
|
1952
1879
|
}
|
|
1953
|
-
function
|
|
1880
|
+
function ia(t) {
|
|
1954
1881
|
return m.createElement("option", { ...t });
|
|
1955
1882
|
}
|
|
1956
|
-
function
|
|
1957
|
-
const { components: e } =
|
|
1883
|
+
function ca(t) {
|
|
1884
|
+
const { components: e } = be();
|
|
1958
1885
|
return m.createElement(e.Button, { ...t });
|
|
1959
1886
|
}
|
|
1960
|
-
function
|
|
1887
|
+
function ua(t) {
|
|
1961
1888
|
const { rootRef: e, ...n } = t;
|
|
1962
1889
|
return m.createElement("div", { ...n, ref: e });
|
|
1963
1890
|
}
|
|
1964
|
-
function
|
|
1891
|
+
function fa(t) {
|
|
1965
1892
|
return m.createElement("select", { ...t });
|
|
1966
1893
|
}
|
|
1967
|
-
function
|
|
1894
|
+
function da(t) {
|
|
1968
1895
|
const { week: e, ...n } = t;
|
|
1969
1896
|
return m.createElement("tr", { ...n });
|
|
1970
1897
|
}
|
|
1971
|
-
function
|
|
1898
|
+
function la(t) {
|
|
1972
1899
|
return m.createElement("th", { ...t });
|
|
1973
1900
|
}
|
|
1974
|
-
function
|
|
1901
|
+
function ha(t) {
|
|
1975
1902
|
return m.createElement(
|
|
1976
1903
|
"thead",
|
|
1977
1904
|
{ "aria-hidden": !0 },
|
|
1978
1905
|
m.createElement("tr", { ...t })
|
|
1979
1906
|
);
|
|
1980
1907
|
}
|
|
1981
|
-
function
|
|
1908
|
+
function ma(t) {
|
|
1982
1909
|
const { week: e, ...n } = t;
|
|
1983
1910
|
return m.createElement("th", { ...n });
|
|
1984
1911
|
}
|
|
1985
|
-
function
|
|
1912
|
+
function ya(t) {
|
|
1986
1913
|
return m.createElement("th", { ...t });
|
|
1987
1914
|
}
|
|
1988
|
-
function
|
|
1915
|
+
function ga(t) {
|
|
1989
1916
|
return m.createElement("tbody", { ...t });
|
|
1990
1917
|
}
|
|
1991
|
-
function
|
|
1992
|
-
const { components: e } =
|
|
1918
|
+
function wa(t) {
|
|
1919
|
+
const { components: e } = be();
|
|
1993
1920
|
return m.createElement(e.Dropdown, { ...t });
|
|
1994
1921
|
}
|
|
1995
|
-
const
|
|
1996
|
-
function
|
|
1922
|
+
const ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Button: zr, CaptionLabel: Qr, Chevron: Xr, Day: Ur, DayButton: Lr, Dropdown: Vr, DropdownNav: Kr, Footer: Jr, Month: ea, MonthCaption: ta, MonthGrid: na, Months: ra, MonthsDropdown: aa, Nav: oa, NextMonthButton: sa, Option: ia, PreviousMonthButton: ca, Root: ua, Select: fa, Week: da, WeekNumber: ma, WeekNumberHeader: ya, Weekday: la, Weekdays: ha, Weeks: ga, YearsDropdown: wa }, Symbol.toStringTag, { value: "Module" }));
|
|
1923
|
+
function V(t, e, n = !1, r = U) {
|
|
1924
|
+
let { from: a, to: o } = t;
|
|
1925
|
+
const { differenceInCalendarDays: i, isSameDay: s } = r;
|
|
1926
|
+
return a && o ? (i(o, a) < 0 && ([a, o] = [o, a]), i(e, a) >= (n ? 1 : 0) && i(o, e) >= (n ? 1 : 0)) : !n && o ? s(o, e) : !n && a ? s(a, e) : !1;
|
|
1927
|
+
}
|
|
1928
|
+
function Wt(t) {
|
|
1929
|
+
return !!(t && typeof t == "object" && "before" in t && "after" in t);
|
|
1930
|
+
}
|
|
1931
|
+
function $e(t) {
|
|
1932
|
+
return !!(t && typeof t == "object" && "from" in t);
|
|
1933
|
+
}
|
|
1934
|
+
function St(t) {
|
|
1935
|
+
return !!(t && typeof t == "object" && "after" in t);
|
|
1936
|
+
}
|
|
1937
|
+
function pt(t) {
|
|
1938
|
+
return !!(t && typeof t == "object" && "before" in t);
|
|
1939
|
+
}
|
|
1940
|
+
function Nt(t) {
|
|
1941
|
+
return !!(t && typeof t == "object" && "dayOfWeek" in t);
|
|
1942
|
+
}
|
|
1943
|
+
function Ct(t, e) {
|
|
1944
|
+
return Array.isArray(t) && t.every(e.isDate);
|
|
1945
|
+
}
|
|
1946
|
+
function K(t, e, n = U) {
|
|
1947
|
+
const r = Array.isArray(e) ? e : [e], { isSameDay: a, differenceInCalendarDays: o, isAfter: i } = n;
|
|
1948
|
+
return r.some((s) => {
|
|
1949
|
+
if (typeof s == "boolean")
|
|
1950
|
+
return s;
|
|
1951
|
+
if (n.isDate(s))
|
|
1952
|
+
return a(t, s);
|
|
1953
|
+
if (Ct(s, n))
|
|
1954
|
+
return s.includes(t);
|
|
1955
|
+
if ($e(s))
|
|
1956
|
+
return V(s, t, !1, n);
|
|
1957
|
+
if (Nt(s))
|
|
1958
|
+
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(t.getDay()) : s.dayOfWeek === t.getDay();
|
|
1959
|
+
if (Wt(s)) {
|
|
1960
|
+
const c = o(s.before, t), f = o(s.after, t), l = c > 0, u = f < 0;
|
|
1961
|
+
return i(s.before, s.after) ? u && l : l || u;
|
|
1962
|
+
}
|
|
1963
|
+
return St(s) ? o(t, s.after) > 0 : pt(s) ? o(s.before, t) > 0 : typeof s == "function" ? s(t) : !1;
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
function Ma(t, e, n, r, a) {
|
|
1967
|
+
const { disabled: o, hidden: i, modifiers: s, showOutsideDays: c, broadcastCalendar: f, today: l } = e, { isSameDay: u, isSameMonth: h, startOfMonth: w, isBefore: b, endOfMonth: O, isAfter: M } = a, k = n && w(n), D = r && O(r), y = {
|
|
1968
|
+
[P.focused]: [],
|
|
1969
|
+
[P.outside]: [],
|
|
1970
|
+
[P.disabled]: [],
|
|
1971
|
+
[P.hidden]: [],
|
|
1972
|
+
[P.today]: []
|
|
1973
|
+
}, N = {};
|
|
1974
|
+
for (const d of t) {
|
|
1975
|
+
const { date: W, displayMonth: v } = d, x = !!(v && !h(W, v)), B = !!(k && b(W, k)), H = !!(D && M(W, D)), q = !!(o && K(W, o, a)), G = !!(i && K(W, i, a)) || B || H || // Broadcast calendar will show outside days as default
|
|
1976
|
+
!f && !c && x || f && c === !1 && x, re = u(W, l ?? a.today());
|
|
1977
|
+
x && y.outside.push(d), q && y.disabled.push(d), G && y.hidden.push(d), re && y.today.push(d), s && Object.keys(s).forEach((ae) => {
|
|
1978
|
+
const oe = s == null ? void 0 : s[ae];
|
|
1979
|
+
oe && K(W, oe, a) && (N[ae] ? N[ae].push(d) : N[ae] = [d]);
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1982
|
+
return (d) => {
|
|
1983
|
+
const W = {
|
|
1984
|
+
[P.focused]: !1,
|
|
1985
|
+
[P.disabled]: !1,
|
|
1986
|
+
[P.hidden]: !1,
|
|
1987
|
+
[P.outside]: !1,
|
|
1988
|
+
[P.today]: !1
|
|
1989
|
+
}, v = {};
|
|
1990
|
+
for (const x in y) {
|
|
1991
|
+
const B = y[x];
|
|
1992
|
+
W[x] = B.some((H) => H === d);
|
|
1993
|
+
}
|
|
1994
|
+
for (const x in N)
|
|
1995
|
+
v[x] = N[x].some((B) => B === d);
|
|
1996
|
+
return {
|
|
1997
|
+
...W,
|
|
1998
|
+
// custom modifiers should override all the previous ones
|
|
1999
|
+
...v
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
}
|
|
2003
|
+
function ka(t, e, n = {}) {
|
|
2004
|
+
return Object.entries(t).filter(([, a]) => a === !0).reduce((a, [o]) => (n[o] ? a.push(n[o]) : e[P[o]] ? a.push(e[P[o]]) : e[z[o]] && a.push(e[z[o]]), a), [e[g.Day]]);
|
|
2005
|
+
}
|
|
2006
|
+
function Da(t) {
|
|
1997
2007
|
return {
|
|
1998
|
-
...
|
|
2008
|
+
...ba,
|
|
1999
2009
|
...t
|
|
2000
2010
|
};
|
|
2001
2011
|
}
|
|
2002
|
-
function
|
|
2012
|
+
function va(t) {
|
|
2003
2013
|
const e = {
|
|
2004
2014
|
"data-mode": t.mode ?? void 0,
|
|
2005
2015
|
"data-required": "required" in t ? t.required : void 0,
|
|
@@ -2012,58 +2022,58 @@ function pa(t) {
|
|
|
2012
2022
|
n.startsWith("data-") && (e[n] = r);
|
|
2013
2023
|
}), e;
|
|
2014
2024
|
}
|
|
2015
|
-
function
|
|
2025
|
+
function Oa() {
|
|
2016
2026
|
const t = {};
|
|
2017
2027
|
for (const e in g)
|
|
2018
2028
|
t[g[e]] = `rdp-${g[e]}`;
|
|
2019
2029
|
for (const e in P)
|
|
2020
2030
|
t[P[e]] = `rdp-${P[e]}`;
|
|
2021
|
-
for (const e in
|
|
2022
|
-
t[
|
|
2031
|
+
for (const e in z)
|
|
2032
|
+
t[z[e]] = `rdp-${z[e]}`;
|
|
2023
2033
|
for (const e in j)
|
|
2024
2034
|
t[j[e]] = `rdp-${j[e]}`;
|
|
2025
2035
|
return t;
|
|
2026
2036
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return (n ?? new
|
|
2037
|
+
function xt(t, e, n) {
|
|
2038
|
+
return (n ?? new J(e)).format(t, "LLLL y");
|
|
2029
2039
|
}
|
|
2030
|
-
const
|
|
2031
|
-
function
|
|
2032
|
-
return (n ?? new
|
|
2040
|
+
const Wa = xt;
|
|
2041
|
+
function Sa(t, e, n) {
|
|
2042
|
+
return (n ?? new J(e)).format(t, "d");
|
|
2033
2043
|
}
|
|
2034
|
-
function
|
|
2044
|
+
function pa(t, e = U) {
|
|
2035
2045
|
return e.format(t, "LLLL");
|
|
2036
2046
|
}
|
|
2037
|
-
function
|
|
2047
|
+
function Na(t, e, n) {
|
|
2048
|
+
return (n ?? new J(e)).format(t, "cccccc");
|
|
2049
|
+
}
|
|
2050
|
+
function Ca(t, e = U) {
|
|
2038
2051
|
return t < 10 ? e.formatNumber(`0${t.toLocaleString()}`) : e.formatNumber(`${t.toLocaleString()}`);
|
|
2039
2052
|
}
|
|
2040
|
-
function
|
|
2053
|
+
function xa() {
|
|
2041
2054
|
return "";
|
|
2042
2055
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return (n ?? new ee(e)).format(t, "cccccc");
|
|
2045
|
-
}
|
|
2046
|
-
function Pt(t, e = V) {
|
|
2056
|
+
function Tt(t, e = U) {
|
|
2047
2057
|
return e.format(t, "yyyy");
|
|
2048
2058
|
}
|
|
2049
|
-
const
|
|
2050
|
-
function
|
|
2059
|
+
const Ta = Tt, Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, formatCaption: xt, formatDay: Sa, formatMonthCaption: Wa, formatMonthDropdown: pa, formatWeekNumber: Ca, formatWeekNumberHeader: xa, formatWeekdayName: Na, formatYearCaption: Ta, formatYearDropdown: Tt }, Symbol.toStringTag, { value: "Module" }));
|
|
2060
|
+
function Ea(t) {
|
|
2051
2061
|
return t != null && t.formatMonthCaption && !t.formatCaption && (t.formatCaption = t.formatMonthCaption), t != null && t.formatYearCaption && !t.formatYearDropdown && (t.formatYearDropdown = t.formatYearCaption), {
|
|
2052
|
-
...
|
|
2062
|
+
...Ya,
|
|
2053
2063
|
...t
|
|
2054
2064
|
};
|
|
2055
2065
|
}
|
|
2056
|
-
function
|
|
2057
|
-
const { startOfMonth: o, startOfYear: i, endOfYear: s, eachMonthOfInterval: c, getMonth:
|
|
2066
|
+
function _a(t, e, n, r, a) {
|
|
2067
|
+
const { startOfMonth: o, startOfYear: i, endOfYear: s, eachMonthOfInterval: c, getMonth: f } = a;
|
|
2058
2068
|
return c({
|
|
2059
2069
|
start: i(t),
|
|
2060
2070
|
end: s(t)
|
|
2061
2071
|
}).map((h) => {
|
|
2062
|
-
const w = r.formatMonthDropdown(h, a), b =
|
|
2063
|
-
return { value: b, label: w, disabled:
|
|
2072
|
+
const w = r.formatMonthDropdown(h, a), b = f(h), O = e && h < o(e) || n && h > o(n) || !1;
|
|
2073
|
+
return { value: b, label: w, disabled: O };
|
|
2064
2074
|
});
|
|
2065
2075
|
}
|
|
2066
|
-
function
|
|
2076
|
+
function Pa(t, e = {}, n = {}) {
|
|
2067
2077
|
let r = { ...e == null ? void 0 : e[g.Day] };
|
|
2068
2078
|
return Object.entries(t).filter(([, a]) => a === !0).forEach(([a]) => {
|
|
2069
2079
|
r = {
|
|
@@ -2072,7 +2082,7 @@ function Ia(t, e = {}, n = {}) {
|
|
|
2072
2082
|
};
|
|
2073
2083
|
}), r;
|
|
2074
2084
|
}
|
|
2075
|
-
function
|
|
2085
|
+
function Fa(t, e, n) {
|
|
2076
2086
|
const r = t.today(), a = e ? t.startOfISOWeek(r) : t.startOfWeek(r), o = [];
|
|
2077
2087
|
for (let i = 0; i < 7; i++) {
|
|
2078
2088
|
const s = t.addDays(a, i);
|
|
@@ -2080,136 +2090,136 @@ function Ha(t, e, n) {
|
|
|
2080
2090
|
}
|
|
2081
2091
|
return o;
|
|
2082
2092
|
}
|
|
2083
|
-
function
|
|
2093
|
+
function Ba(t, e, n, r, a = !1) {
|
|
2084
2094
|
if (!t || !e)
|
|
2085
2095
|
return;
|
|
2086
|
-
const { startOfYear:
|
|
2087
|
-
let
|
|
2088
|
-
for (;
|
|
2089
|
-
|
|
2090
|
-
return
|
|
2091
|
-
const
|
|
2096
|
+
const { startOfYear: o, endOfYear: i, addYears: s, getYear: c, isBefore: f, isSameYear: l } = r, u = o(t), h = i(e), w = [];
|
|
2097
|
+
let b = u;
|
|
2098
|
+
for (; f(b, h) || l(b, h); )
|
|
2099
|
+
w.push(b), b = s(b, 1);
|
|
2100
|
+
return a && w.reverse(), w.map((O) => {
|
|
2101
|
+
const M = n.formatYearDropdown(O, r);
|
|
2092
2102
|
return {
|
|
2093
|
-
value:
|
|
2094
|
-
label:
|
|
2103
|
+
value: c(O),
|
|
2104
|
+
label: M,
|
|
2095
2105
|
disabled: !1
|
|
2096
2106
|
};
|
|
2097
2107
|
});
|
|
2098
2108
|
}
|
|
2099
|
-
function
|
|
2100
|
-
|
|
2109
|
+
function Yt(t, e, n, r) {
|
|
2110
|
+
let a = (r ?? new J(n)).format(t, "PPPP");
|
|
2111
|
+
return e.today && (a = `Today, ${a}`), e.selected && (a = `${a}, selected`), a;
|
|
2112
|
+
}
|
|
2113
|
+
const Ia = Yt;
|
|
2114
|
+
function Et(t, e, n) {
|
|
2115
|
+
return (n ?? new J(e)).format(t, "LLLL y");
|
|
2101
2116
|
}
|
|
2102
|
-
const
|
|
2103
|
-
function
|
|
2104
|
-
let a = (r ?? new
|
|
2117
|
+
const Ha = Et;
|
|
2118
|
+
function qa(t, e, n, r) {
|
|
2119
|
+
let a = (r ?? new J(n)).format(t, "PPPP");
|
|
2105
2120
|
return e != null && e.today && (a = `Today, ${a}`), a;
|
|
2106
2121
|
}
|
|
2107
|
-
function
|
|
2108
|
-
|
|
2109
|
-
return e.today && (a = `Today, ${a}`), e.selected && (a = `${a}, selected`), a;
|
|
2122
|
+
function Aa(t) {
|
|
2123
|
+
return "Choose the Month";
|
|
2110
2124
|
}
|
|
2111
|
-
|
|
2112
|
-
function Ga() {
|
|
2125
|
+
function ja() {
|
|
2113
2126
|
return "";
|
|
2114
2127
|
}
|
|
2115
|
-
function
|
|
2116
|
-
return "Choose the Month";
|
|
2117
|
-
}
|
|
2118
|
-
function za(t) {
|
|
2128
|
+
function $a(t) {
|
|
2119
2129
|
return "Go to the Next Month";
|
|
2120
2130
|
}
|
|
2121
|
-
function
|
|
2131
|
+
function Ga(t) {
|
|
2122
2132
|
return "Go to the Previous Month";
|
|
2123
2133
|
}
|
|
2124
|
-
function
|
|
2125
|
-
return (n ?? new
|
|
2134
|
+
function Ra(t, e, n) {
|
|
2135
|
+
return (n ?? new J(e)).format(t, "cccc");
|
|
2126
2136
|
}
|
|
2127
|
-
function
|
|
2137
|
+
function Za(t, e) {
|
|
2128
2138
|
return `Week ${t}`;
|
|
2129
2139
|
}
|
|
2130
|
-
function
|
|
2140
|
+
function za(t) {
|
|
2131
2141
|
return "Week Number";
|
|
2132
2142
|
}
|
|
2133
|
-
function
|
|
2143
|
+
function Qa(t) {
|
|
2134
2144
|
return "Choose the Year";
|
|
2135
2145
|
}
|
|
2136
|
-
const
|
|
2146
|
+
const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, labelCaption: Ha, labelDay: Ia, labelDayButton: Yt, labelGrid: Et, labelGridcell: qa, labelMonthDropdown: Aa, labelNav: ja, labelNext: $a, labelPrevious: Ga, labelWeekNumber: Za, labelWeekNumberHeader: za, labelWeekday: Ra, labelYearDropdown: Qa }, Symbol.toStringTag, { value: "Module" })), Me = (t) => t instanceof HTMLElement ? t : null, Ie = (t) => [
|
|
2137
2147
|
...t.querySelectorAll("[data-animated-month]") ?? []
|
|
2138
|
-
],
|
|
2139
|
-
function
|
|
2140
|
-
const i =
|
|
2141
|
-
|
|
2142
|
-
const
|
|
2148
|
+
], Ua = (t) => Me(t.querySelector("[data-animated-month]")), He = (t) => Me(t.querySelector("[data-animated-caption]")), qe = (t) => Me(t.querySelector("[data-animated-weeks]")), La = (t) => Me(t.querySelector("[data-animated-nav]")), Va = (t) => Me(t.querySelector("[data-animated-weekdays]"));
|
|
2149
|
+
function Ka(t, e, { classNames: n, months: r, focused: a, dateLib: o }) {
|
|
2150
|
+
const i = We(null), s = We(r), c = We(!1);
|
|
2151
|
+
fn(() => {
|
|
2152
|
+
const f = s.current;
|
|
2143
2153
|
if (s.current = r, !e || !t.current || // safety check because the ref can be set to anything by consumers
|
|
2144
2154
|
!(t.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2145
|
-
r.length === 0 ||
|
|
2155
|
+
r.length === 0 || f.length === 0 || r.length !== f.length)
|
|
2146
2156
|
return;
|
|
2147
|
-
const l = o.isSameMonth(r[0].date,
|
|
2148
|
-
if (
|
|
2157
|
+
const l = o.isSameMonth(r[0].date, f[0].date), u = o.isAfter(r[0].date, f[0].date), h = u ? n[j.caption_after_enter] : n[j.caption_before_enter], w = u ? n[j.weeks_after_enter] : n[j.weeks_before_enter], b = i.current, O = t.current.cloneNode(!0);
|
|
2158
|
+
if (O instanceof HTMLElement ? (Ie(O).forEach((y) => {
|
|
2149
2159
|
if (!(y instanceof HTMLElement))
|
|
2150
2160
|
return;
|
|
2151
|
-
const
|
|
2152
|
-
|
|
2153
|
-
const
|
|
2154
|
-
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2157
|
-
}), i.current =
|
|
2161
|
+
const N = Ua(y);
|
|
2162
|
+
N && y.contains(N) && y.removeChild(N);
|
|
2163
|
+
const d = He(y);
|
|
2164
|
+
d && d.classList.remove(h);
|
|
2165
|
+
const W = qe(y);
|
|
2166
|
+
W && W.classList.remove(w);
|
|
2167
|
+
}), i.current = O) : i.current = null, c.current || l || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2158
2168
|
a)
|
|
2159
2169
|
return;
|
|
2160
|
-
const M = b instanceof HTMLElement ?
|
|
2161
|
-
if (k && k.every((D) => D instanceof HTMLElement) && M && M.every((D) => D instanceof HTMLElement)) {
|
|
2170
|
+
const M = b instanceof HTMLElement ? Ie(b) : [], k = Ie(t.current);
|
|
2171
|
+
if (k != null && k.every((D) => D instanceof HTMLElement) && M && M.every((D) => D instanceof HTMLElement)) {
|
|
2162
2172
|
c.current = !0, t.current.style.isolation = "isolate";
|
|
2163
|
-
const D =
|
|
2164
|
-
D && (D.style.zIndex = "1"), k.forEach((y,
|
|
2165
|
-
const
|
|
2166
|
-
if (!
|
|
2173
|
+
const D = La(t.current);
|
|
2174
|
+
D && (D.style.zIndex = "1"), k.forEach((y, N) => {
|
|
2175
|
+
const d = M[N];
|
|
2176
|
+
if (!d)
|
|
2167
2177
|
return;
|
|
2168
2178
|
y.style.position = "relative", y.style.overflow = "hidden";
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2171
|
-
const v =
|
|
2179
|
+
const W = He(y);
|
|
2180
|
+
W && W.classList.add(h);
|
|
2181
|
+
const v = qe(y);
|
|
2172
2182
|
v && v.classList.add(w);
|
|
2173
|
-
const
|
|
2174
|
-
c.current = !1, t.current && (t.current.style.isolation = ""), D && (D.style.zIndex = ""),
|
|
2183
|
+
const x = () => {
|
|
2184
|
+
c.current = !1, t.current && (t.current.style.isolation = ""), D && (D.style.zIndex = ""), W && W.classList.remove(h), v && v.classList.remove(w), y.style.position = "", y.style.overflow = "", y.contains(d) && y.removeChild(d);
|
|
2175
2185
|
};
|
|
2176
|
-
|
|
2177
|
-
const
|
|
2178
|
-
|
|
2179
|
-
const H =
|
|
2180
|
-
H && (H.classList.add(u ? n[j.caption_before_exit] : n[j.caption_after_exit]), H.addEventListener("animationend",
|
|
2181
|
-
const q =
|
|
2182
|
-
q && q.classList.add(u ? n[j.weeks_before_exit] : n[j.weeks_after_exit]), y.insertBefore(
|
|
2186
|
+
d.style.pointerEvents = "none", d.style.position = "absolute", d.style.overflow = "hidden", d.setAttribute("aria-hidden", "true");
|
|
2187
|
+
const B = Va(d);
|
|
2188
|
+
B && (B.style.opacity = "0");
|
|
2189
|
+
const H = He(d);
|
|
2190
|
+
H && (H.classList.add(u ? n[j.caption_before_exit] : n[j.caption_after_exit]), H.addEventListener("animationend", x));
|
|
2191
|
+
const q = qe(d);
|
|
2192
|
+
q && q.classList.add(u ? n[j.weeks_before_exit] : n[j.weeks_after_exit]), y.insertBefore(d, y.firstChild);
|
|
2183
2193
|
});
|
|
2184
2194
|
}
|
|
2185
2195
|
});
|
|
2186
2196
|
}
|
|
2187
|
-
function
|
|
2188
|
-
const a = t[0], o = t[t.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = n ?? {}, { addDays:
|
|
2189
|
-
for (let q = 0; q <=
|
|
2190
|
-
const
|
|
2191
|
-
if (e && M(
|
|
2197
|
+
function Ja(t, e, n, r) {
|
|
2198
|
+
const a = t[0], o = t[t.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = n ?? {}, { addDays: f, differenceInCalendarDays: l, differenceInCalendarMonths: u, endOfBroadcastWeek: h, endOfISOWeek: w, endOfMonth: b, endOfWeek: O, isAfter: M, startOfBroadcastWeek: k, startOfISOWeek: D, startOfWeek: y } = r, N = c ? k(a, r) : i ? D(a) : y(a), d = c ? h(o) : i ? w(b(o)) : O(b(o)), W = l(d, N), v = u(o, a) + 1, x = [];
|
|
2199
|
+
for (let q = 0; q <= W; q++) {
|
|
2200
|
+
const G = f(N, q);
|
|
2201
|
+
if (e && M(G, e))
|
|
2192
2202
|
break;
|
|
2193
|
-
|
|
2203
|
+
x.push(G);
|
|
2194
2204
|
}
|
|
2195
2205
|
const H = (c ? 35 : 42) * v;
|
|
2196
|
-
if (s &&
|
|
2197
|
-
const q = H -
|
|
2198
|
-
for (let
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2206
|
+
if (s && x.length < H) {
|
|
2207
|
+
const q = H - x.length;
|
|
2208
|
+
for (let G = 0; G < q; G++) {
|
|
2209
|
+
const re = f(x[x.length - 1], 1);
|
|
2210
|
+
x.push(re);
|
|
2201
2211
|
}
|
|
2202
2212
|
}
|
|
2203
|
-
return
|
|
2213
|
+
return x;
|
|
2204
2214
|
}
|
|
2205
|
-
function
|
|
2215
|
+
function eo(t) {
|
|
2206
2216
|
const e = [];
|
|
2207
2217
|
return t.reduce((n, r) => {
|
|
2208
|
-
const a = r.weeks.reduce((o, i) =>
|
|
2209
|
-
return
|
|
2210
|
-
}, e);
|
|
2218
|
+
const a = r.weeks.reduce((o, i) => o.concat(i.days.slice()), e.slice());
|
|
2219
|
+
return n.concat(a.slice());
|
|
2220
|
+
}, e.slice());
|
|
2211
2221
|
}
|
|
2212
|
-
function
|
|
2222
|
+
function to(t, e, n, r) {
|
|
2213
2223
|
const { numberOfMonths: a = 1 } = n, o = [];
|
|
2214
2224
|
for (let i = 0; i < a; i++) {
|
|
2215
2225
|
const s = r.addMonths(t, i);
|
|
@@ -2219,84 +2229,84 @@ function ao(t, e, n, r) {
|
|
|
2219
2229
|
}
|
|
2220
2230
|
return o;
|
|
2221
2231
|
}
|
|
2222
|
-
function
|
|
2232
|
+
function at(t, e, n, r) {
|
|
2223
2233
|
const { month: a, defaultMonth: o, today: i = r.today(), numberOfMonths: s = 1 } = t;
|
|
2224
2234
|
let c = a || o || i;
|
|
2225
|
-
const { differenceInCalendarMonths:
|
|
2226
|
-
if (n &&
|
|
2235
|
+
const { differenceInCalendarMonths: f, addMonths: l, startOfMonth: u } = r;
|
|
2236
|
+
if (n && f(n, c) < s - 1) {
|
|
2227
2237
|
const h = -1 * (s - 1);
|
|
2228
2238
|
c = l(n, h);
|
|
2229
2239
|
}
|
|
2230
|
-
return e &&
|
|
2240
|
+
return e && f(c, e) < 0 && (c = e), u(c);
|
|
2231
2241
|
}
|
|
2232
|
-
function
|
|
2233
|
-
const { addDays: a, endOfBroadcastWeek: o, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek:
|
|
2234
|
-
const k = n.broadcastCalendar ? u(M, r) : n.ISOWeek ? h(M) : w(M), D = n.broadcastCalendar ? o(M) : n.ISOWeek ? i(s(M)) : c(s(M)), y = e.filter((v) => v >= k && v <= D),
|
|
2235
|
-
if (n.fixedWeeks && y.length <
|
|
2236
|
-
const v = e.filter((
|
|
2237
|
-
const
|
|
2238
|
-
return
|
|
2242
|
+
function no(t, e, n, r) {
|
|
2243
|
+
const { addDays: a, endOfBroadcastWeek: o, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: f, getWeek: l, startOfBroadcastWeek: u, startOfISOWeek: h, startOfWeek: w } = r, b = t.reduce((O, M) => {
|
|
2244
|
+
const k = n.broadcastCalendar ? u(M, r) : n.ISOWeek ? h(M) : w(M), D = n.broadcastCalendar ? o(M) : n.ISOWeek ? i(s(M)) : c(s(M)), y = e.filter((v) => v >= k && v <= D), N = n.broadcastCalendar ? 35 : 42;
|
|
2245
|
+
if (n.fixedWeeks && y.length < N) {
|
|
2246
|
+
const v = e.filter((x) => {
|
|
2247
|
+
const B = N - y.length;
|
|
2248
|
+
return x > D && x <= a(D, B);
|
|
2239
2249
|
});
|
|
2240
2250
|
y.push(...v);
|
|
2241
2251
|
}
|
|
2242
|
-
const
|
|
2243
|
-
const
|
|
2244
|
-
return H ? H.days.push(q) : v.push(new
|
|
2245
|
-
}, []),
|
|
2246
|
-
return
|
|
2252
|
+
const d = y.reduce((v, x) => {
|
|
2253
|
+
const B = n.ISOWeek ? f(x) : l(x), H = v.find((G) => G.weekNumber === B), q = new vt(x, M, r);
|
|
2254
|
+
return H ? H.days.push(q) : v.push(new Zr(B, [q])), v;
|
|
2255
|
+
}, []), W = new Rr(M, d);
|
|
2256
|
+
return O.push(W), O;
|
|
2247
2257
|
}, []);
|
|
2248
2258
|
return n.reverseMonths ? b.reverse() : b;
|
|
2249
2259
|
}
|
|
2250
|
-
function
|
|
2260
|
+
function ro(t, e) {
|
|
2251
2261
|
let { startMonth: n, endMonth: r } = t;
|
|
2252
|
-
const { startOfYear: a, startOfDay: o, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear:
|
|
2253
|
-
!n && b && (n = b), !n && h && (n = e.newDate(h, 0, 1)), !r &&
|
|
2262
|
+
const { startOfYear: a, startOfDay: o, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear: f, newDate: l, today: u } = e, { fromYear: h, toYear: w, fromMonth: b, toMonth: O } = t;
|
|
2263
|
+
!n && b && (n = b), !n && h && (n = e.newDate(h, 0, 1)), !r && O && (r = O), !r && w && (r = l(w, 11, 31));
|
|
2254
2264
|
const M = t.captionLayout === "dropdown" || t.captionLayout === "dropdown-years";
|
|
2255
|
-
return n ? n = i(n) : h ? n = l(h, 0, 1) : !n && M && (n = a(c(t.today ?? u(), -100))), r ? r = s(r) : w ? r = l(w, 11, 31) : !r && M && (r =
|
|
2265
|
+
return n ? n = i(n) : h ? n = l(h, 0, 1) : !n && M && (n = a(c(t.today ?? u(), -100))), r ? r = s(r) : w ? r = l(w, 11, 31) : !r && M && (r = f(t.today ?? u())), [
|
|
2256
2266
|
n && o(n),
|
|
2257
2267
|
r && o(r)
|
|
2258
2268
|
];
|
|
2259
2269
|
}
|
|
2260
|
-
function
|
|
2270
|
+
function ao(t, e, n, r) {
|
|
2261
2271
|
if (n.disableNavigation)
|
|
2262
2272
|
return;
|
|
2263
|
-
const { pagedNavigation: a, numberOfMonths: o = 1 } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = r,
|
|
2273
|
+
const { pagedNavigation: a, numberOfMonths: o = 1 } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = r, f = a ? o : 1, l = i(t);
|
|
2264
2274
|
if (!e)
|
|
2265
|
-
return s(l,
|
|
2275
|
+
return s(l, f);
|
|
2266
2276
|
if (!(c(e, t) < o))
|
|
2267
|
-
return s(l,
|
|
2277
|
+
return s(l, f);
|
|
2268
2278
|
}
|
|
2269
|
-
function
|
|
2279
|
+
function oo(t, e, n, r) {
|
|
2270
2280
|
if (n.disableNavigation)
|
|
2271
2281
|
return;
|
|
2272
|
-
const { pagedNavigation: a, numberOfMonths: o } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = r,
|
|
2282
|
+
const { pagedNavigation: a, numberOfMonths: o } = n, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = r, f = a ? o ?? 1 : 1, l = i(t);
|
|
2273
2283
|
if (!e)
|
|
2274
|
-
return s(l, -
|
|
2284
|
+
return s(l, -f);
|
|
2275
2285
|
if (!(c(l, e) <= 0))
|
|
2276
|
-
return s(l, -
|
|
2286
|
+
return s(l, -f);
|
|
2277
2287
|
}
|
|
2278
|
-
function
|
|
2288
|
+
function so(t) {
|
|
2279
2289
|
const e = [];
|
|
2280
|
-
return t.reduce((n, r) =>
|
|
2290
|
+
return t.reduce((n, r) => n.concat(r.weeks.slice()), e.slice());
|
|
2281
2291
|
}
|
|
2282
|
-
function
|
|
2283
|
-
const [n, r] =
|
|
2292
|
+
function pe(t, e) {
|
|
2293
|
+
const [n, r] = Se(t);
|
|
2284
2294
|
return [e === void 0 ? n : e, r];
|
|
2285
2295
|
}
|
|
2286
|
-
function
|
|
2287
|
-
const [n, r] =
|
|
2296
|
+
function io(t, e) {
|
|
2297
|
+
const [n, r] = ro(t, e), { startOfMonth: a, endOfMonth: o } = e, i = at(t, n, r, e), [s, c] = pe(
|
|
2288
2298
|
i,
|
|
2289
2299
|
// initialMonth is always computed from props.month if provided
|
|
2290
2300
|
t.month ? i : void 0
|
|
2291
2301
|
);
|
|
2292
|
-
|
|
2293
|
-
const
|
|
2294
|
-
c(
|
|
2302
|
+
dn(() => {
|
|
2303
|
+
const W = at(t, n, r, e);
|
|
2304
|
+
c(W);
|
|
2295
2305
|
}, [t.timeZone]);
|
|
2296
|
-
const
|
|
2306
|
+
const f = to(s, r, t, e), l = Ja(f, t.endMonth ? o(t.endMonth) : void 0, t, e), u = no(f, l, t, e), h = so(u), w = eo(u), b = oo(s, n, t, e), O = ao(s, r, t, e), { disableNavigation: M, onMonthChange: k } = t, D = (W) => h.some((v) => v.days.some((x) => x.isEqualTo(W))), y = (W) => {
|
|
2297
2307
|
if (M)
|
|
2298
2308
|
return;
|
|
2299
|
-
let v = a(
|
|
2309
|
+
let v = a(W);
|
|
2300
2310
|
n && v < a(n) && (v = a(n)), r && v > a(r) && (v = a(r)), c(v), k == null || k(v);
|
|
2301
2311
|
};
|
|
2302
2312
|
return {
|
|
@@ -2306,87 +2316,87 @@ function fo(t, e) {
|
|
|
2306
2316
|
navStart: n,
|
|
2307
2317
|
navEnd: r,
|
|
2308
2318
|
previousMonth: b,
|
|
2309
|
-
nextMonth:
|
|
2319
|
+
nextMonth: O,
|
|
2310
2320
|
goToMonth: y,
|
|
2311
|
-
goToDay: (
|
|
2312
|
-
D(
|
|
2321
|
+
goToDay: (W) => {
|
|
2322
|
+
D(W) || y(W.date);
|
|
2313
2323
|
}
|
|
2314
2324
|
};
|
|
2315
2325
|
}
|
|
2316
|
-
var
|
|
2326
|
+
var Q;
|
|
2317
2327
|
(function(t) {
|
|
2318
2328
|
t[t.Today = 0] = "Today", t[t.Selected = 1] = "Selected", t[t.LastFocused = 2] = "LastFocused", t[t.FocusedModifier = 3] = "FocusedModifier";
|
|
2319
|
-
})(
|
|
2320
|
-
function
|
|
2329
|
+
})(Q || (Q = {}));
|
|
2330
|
+
function ot(t) {
|
|
2321
2331
|
return !t[P.disabled] && !t[P.hidden] && !t[P.outside];
|
|
2322
2332
|
}
|
|
2323
|
-
function
|
|
2333
|
+
function co(t, e, n, r) {
|
|
2324
2334
|
let a, o = -1;
|
|
2325
2335
|
for (const i of t) {
|
|
2326
2336
|
const s = e(i);
|
|
2327
|
-
|
|
2337
|
+
ot(s) && (s[P.focused] && o < Q.FocusedModifier ? (a = i, o = Q.FocusedModifier) : r != null && r.isEqualTo(i) && o < Q.LastFocused ? (a = i, o = Q.LastFocused) : n(i.date) && o < Q.Selected ? (a = i, o = Q.Selected) : s[P.today] && o < Q.Today && (a = i, o = Q.Today));
|
|
2328
2338
|
}
|
|
2329
|
-
return a || (a = t.find((i) =>
|
|
2339
|
+
return a || (a = t.find((i) => ot(e(i)))), a;
|
|
2330
2340
|
}
|
|
2331
|
-
function
|
|
2332
|
-
const { ISOWeek: s, broadcastCalendar: c } = o, { addDays:
|
|
2333
|
-
let
|
|
2334
|
-
day:
|
|
2341
|
+
function uo(t, e, n, r, a, o, i) {
|
|
2342
|
+
const { ISOWeek: s, broadcastCalendar: c } = o, { addDays: f, addMonths: l, addWeeks: u, addYears: h, endOfBroadcastWeek: w, endOfISOWeek: b, endOfWeek: O, max: M, min: k, startOfBroadcastWeek: D, startOfISOWeek: y, startOfWeek: N } = i;
|
|
2343
|
+
let W = {
|
|
2344
|
+
day: f,
|
|
2335
2345
|
week: u,
|
|
2336
2346
|
month: l,
|
|
2337
2347
|
year: h,
|
|
2338
|
-
startOfWeek: (v) => c ? D(v, i) : s ? y(v) :
|
|
2339
|
-
endOfWeek: (v) => c ? w(v) : s ? b(v) :
|
|
2348
|
+
startOfWeek: (v) => c ? D(v, i) : s ? y(v) : N(v),
|
|
2349
|
+
endOfWeek: (v) => c ? w(v) : s ? b(v) : O(v)
|
|
2340
2350
|
}[t](n, e === "after" ? 1 : -1);
|
|
2341
|
-
return e === "before" && r ?
|
|
2351
|
+
return e === "before" && r ? W = M([r, W]) : e === "after" && a && (W = k([a, W])), W;
|
|
2342
2352
|
}
|
|
2343
|
-
function
|
|
2353
|
+
function _t(t, e, n, r, a, o, i, s = 0) {
|
|
2344
2354
|
if (s > 365)
|
|
2345
2355
|
return;
|
|
2346
|
-
const c =
|
|
2347
|
-
return !
|
|
2356
|
+
const c = uo(t, e, n.date, r, a, o, i), f = !!(o.disabled && K(c, o.disabled, i)), l = !!(o.hidden && K(c, o.hidden, i)), u = c, h = new vt(c, u, i);
|
|
2357
|
+
return !f && !l ? h : _t(t, e, h, r, a, o, i, s + 1);
|
|
2348
2358
|
}
|
|
2349
|
-
function
|
|
2350
|
-
const { autoFocus: o } = t, [i, s] =
|
|
2359
|
+
function fo(t, e, n, r, a) {
|
|
2360
|
+
const { autoFocus: o } = t, [i, s] = Se(), c = co(e.days, n, r || (() => !1), i), [f, l] = Se(o ? c : void 0);
|
|
2351
2361
|
return {
|
|
2352
|
-
isFocusTarget: (
|
|
2362
|
+
isFocusTarget: (O) => !!(c != null && c.isEqualTo(O)),
|
|
2353
2363
|
setFocused: l,
|
|
2354
|
-
focused:
|
|
2364
|
+
focused: f,
|
|
2355
2365
|
blur: () => {
|
|
2356
|
-
s(
|
|
2366
|
+
s(f), l(void 0);
|
|
2357
2367
|
},
|
|
2358
|
-
moveFocus: (
|
|
2359
|
-
if (!
|
|
2368
|
+
moveFocus: (O, M) => {
|
|
2369
|
+
if (!f)
|
|
2360
2370
|
return;
|
|
2361
|
-
const k =
|
|
2371
|
+
const k = _t(O, M, f, e.navStart, e.navEnd, t, a);
|
|
2362
2372
|
k && (e.goToDay(k), l(k));
|
|
2363
2373
|
}
|
|
2364
2374
|
};
|
|
2365
2375
|
}
|
|
2366
|
-
function
|
|
2367
|
-
const { selected: n, required: r, onSelect: a } = t, [o, i] =
|
|
2376
|
+
function lo(t, e) {
|
|
2377
|
+
const { selected: n, required: r, onSelect: a } = t, [o, i] = pe(n, a ? n : void 0), s = a ? n : o, { isSameDay: c } = e, f = (w) => (s == null ? void 0 : s.some((b) => c(b, w))) ?? !1, { min: l, max: u } = t;
|
|
2368
2378
|
return {
|
|
2369
2379
|
selected: s,
|
|
2370
|
-
select: (w, b,
|
|
2380
|
+
select: (w, b, O) => {
|
|
2371
2381
|
let M = [...s ?? []];
|
|
2372
|
-
if (
|
|
2382
|
+
if (f(w)) {
|
|
2373
2383
|
if ((s == null ? void 0 : s.length) === l || r && (s == null ? void 0 : s.length) === 1)
|
|
2374
2384
|
return;
|
|
2375
2385
|
M = s == null ? void 0 : s.filter((k) => !c(k, w));
|
|
2376
2386
|
} else
|
|
2377
2387
|
(s == null ? void 0 : s.length) === u ? M = [w] : M = [...M, w];
|
|
2378
|
-
return a || i(M), a == null || a(M, w, b,
|
|
2388
|
+
return a || i(M), a == null || a(M, w, b, O), M;
|
|
2379
2389
|
},
|
|
2380
|
-
isSelected:
|
|
2390
|
+
isSelected: f
|
|
2381
2391
|
};
|
|
2382
2392
|
}
|
|
2383
|
-
function
|
|
2384
|
-
const { from: i, to: s } = e || {}, { isSameDay: c, isAfter:
|
|
2393
|
+
function ho(t, e, n = 0, r = 0, a = !1, o = U) {
|
|
2394
|
+
const { from: i, to: s } = e || {}, { isSameDay: c, isAfter: f, isBefore: l } = o;
|
|
2385
2395
|
let u;
|
|
2386
2396
|
if (!i && !s)
|
|
2387
2397
|
u = { from: t, to: n > 0 ? void 0 : t };
|
|
2388
2398
|
else if (i && !s)
|
|
2389
|
-
c(i, t) ? a ? u = { from: i, to: void 0 } : u = void 0 : l(t, i) ? u = { from: t, to: i } : u = { from: i, to: t };
|
|
2399
|
+
c(i, t) ? n === 0 ? u = { from: i, to: t } : a ? u = { from: i, to: void 0 } : u = void 0 : l(t, i) ? u = { from: t, to: i } : u = { from: i, to: t };
|
|
2390
2400
|
else if (i && s)
|
|
2391
2401
|
if (c(i, t) && c(s, t))
|
|
2392
2402
|
a ? u = { from: i, to: s } : u = void 0;
|
|
@@ -2396,9 +2406,9 @@ function go(t, e, n = 0, r = 0, a = !1, o = V) {
|
|
|
2396
2406
|
u = { from: t, to: n > 0 ? void 0 : t };
|
|
2397
2407
|
else if (l(t, i))
|
|
2398
2408
|
u = { from: t, to: s };
|
|
2399
|
-
else if (
|
|
2409
|
+
else if (f(t, i))
|
|
2400
2410
|
u = { from: i, to: t };
|
|
2401
|
-
else if (
|
|
2411
|
+
else if (f(t, s))
|
|
2402
2412
|
u = { from: i, to: t };
|
|
2403
2413
|
else
|
|
2404
2414
|
throw new Error("Invalid range");
|
|
@@ -2408,7 +2418,7 @@ function go(t, e, n = 0, r = 0, a = !1, o = V) {
|
|
|
2408
2418
|
}
|
|
2409
2419
|
return u;
|
|
2410
2420
|
}
|
|
2411
|
-
function
|
|
2421
|
+
function mo(t, e, n = U) {
|
|
2412
2422
|
const r = Array.isArray(e) ? e : [e];
|
|
2413
2423
|
let a = t.from;
|
|
2414
2424
|
const o = n.differenceInCalendarDays(t.to, t.from), i = Math.min(o, 6);
|
|
@@ -2419,21 +2429,21 @@ function wo(t, e, n = V) {
|
|
|
2419
2429
|
}
|
|
2420
2430
|
return !1;
|
|
2421
2431
|
}
|
|
2422
|
-
function
|
|
2423
|
-
return
|
|
2432
|
+
function st(t, e, n = U) {
|
|
2433
|
+
return V(t, e.from, !1, n) || V(t, e.to, !1, n) || V(e, t.from, !1, n) || V(e, t.to, !1, n);
|
|
2424
2434
|
}
|
|
2425
|
-
function
|
|
2435
|
+
function yo(t, e, n = U) {
|
|
2426
2436
|
const r = Array.isArray(e) ? e : [e];
|
|
2427
|
-
if (r.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ?
|
|
2437
|
+
if (r.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? V(t, s, !1, n) : Ct(s, n) ? s.some((c) => V(t, c, !1, n)) : $e(s) ? s.from && s.to ? st(t, { from: s.from, to: s.to }, n) : !1 : Nt(s) ? mo(t, s.dayOfWeek, n) : Wt(s) ? n.isAfter(s.before, s.after) ? st(t, {
|
|
2428
2438
|
from: n.addDays(s.after, 1),
|
|
2429
2439
|
to: n.addDays(s.before, -1)
|
|
2430
|
-
}, n) :
|
|
2440
|
+
}, n) : K(t.from, s, n) || K(t.to, s, n) : St(s) || pt(s) ? K(t.from, s, n) || K(t.to, s, n) : !1))
|
|
2431
2441
|
return !0;
|
|
2432
2442
|
const i = r.filter((s) => typeof s == "function");
|
|
2433
2443
|
if (i.length) {
|
|
2434
2444
|
let s = t.from;
|
|
2435
2445
|
const c = n.differenceInCalendarDays(t.to, t.from);
|
|
2436
|
-
for (let
|
|
2446
|
+
for (let f = 0; f <= c; f++) {
|
|
2437
2447
|
if (i.some((l) => l(s)))
|
|
2438
2448
|
return !0;
|
|
2439
2449
|
s = n.addDays(s, 1);
|
|
@@ -2441,19 +2451,19 @@ function bo(t, e, n = V) {
|
|
|
2441
2451
|
}
|
|
2442
2452
|
return !1;
|
|
2443
2453
|
}
|
|
2444
|
-
function
|
|
2445
|
-
const { disabled: n, excludeDisabled: r, selected: a, required: o, onSelect: i } = t, [s, c] =
|
|
2454
|
+
function go(t, e) {
|
|
2455
|
+
const { disabled: n, excludeDisabled: r, selected: a, required: o, onSelect: i } = t, [s, c] = pe(a, i ? a : void 0), f = i ? a : s;
|
|
2446
2456
|
return {
|
|
2447
|
-
selected:
|
|
2457
|
+
selected: f,
|
|
2448
2458
|
select: (h, w, b) => {
|
|
2449
|
-
const { min:
|
|
2450
|
-
return r && n && (k != null && k.from) && k.to &&
|
|
2459
|
+
const { min: O, max: M } = t, k = h ? ho(h, f, O, M, o, e) : void 0;
|
|
2460
|
+
return r && n && (k != null && k.from) && k.to && yo({ from: k.from, to: k.to }, n, e) && (k.from = h, k.to = void 0), i || c(k), i == null || i(k, h, w, b), k;
|
|
2451
2461
|
},
|
|
2452
|
-
isSelected: (h) =>
|
|
2462
|
+
isSelected: (h) => f && V(f, h, !1, e)
|
|
2453
2463
|
};
|
|
2454
2464
|
}
|
|
2455
|
-
function
|
|
2456
|
-
const { selected: n, required: r, onSelect: a } = t, [o, i] =
|
|
2465
|
+
function wo(t, e) {
|
|
2466
|
+
const { selected: n, required: r, onSelect: a } = t, [o, i] = pe(n, a ? n : void 0), s = a ? n : o, { isSameDay: c } = e;
|
|
2457
2467
|
return {
|
|
2458
2468
|
selected: s,
|
|
2459
2469
|
select: (u, h, w) => {
|
|
@@ -2463,8 +2473,8 @@ function ko(t, e) {
|
|
|
2463
2473
|
isSelected: (u) => s ? c(s, u) : !1
|
|
2464
2474
|
};
|
|
2465
2475
|
}
|
|
2466
|
-
function
|
|
2467
|
-
const n =
|
|
2476
|
+
function bo(t, e) {
|
|
2477
|
+
const n = wo(t, e), r = lo(t, e), a = go(t, e);
|
|
2468
2478
|
switch (t.mode) {
|
|
2469
2479
|
case "single":
|
|
2470
2480
|
return n;
|
|
@@ -2476,19 +2486,19 @@ function Do(t, e) {
|
|
|
2476
2486
|
return;
|
|
2477
2487
|
}
|
|
2478
2488
|
}
|
|
2479
|
-
function
|
|
2480
|
-
var
|
|
2489
|
+
function Mo(t) {
|
|
2490
|
+
var Xe;
|
|
2481
2491
|
let e = t;
|
|
2482
2492
|
e.timeZone && (e = {
|
|
2483
2493
|
...t
|
|
2484
|
-
}, e.today && (e.today = new I(e.today, e.timeZone)), e.month && (e.month = new I(e.month, e.timeZone)), e.defaultMonth && (e.defaultMonth = new I(e.defaultMonth, e.timeZone)), e.startMonth && (e.startMonth = new I(e.startMonth, e.timeZone)), e.endMonth && (e.endMonth = new I(e.endMonth, e.timeZone)), e.mode === "single" && e.selected ? e.selected = new I(e.selected, e.timeZone) : e.mode === "multiple" && e.selected ? e.selected = (
|
|
2494
|
+
}, e.today && (e.today = new I(e.today, e.timeZone)), e.month && (e.month = new I(e.month, e.timeZone)), e.defaultMonth && (e.defaultMonth = new I(e.defaultMonth, e.timeZone)), e.startMonth && (e.startMonth = new I(e.startMonth, e.timeZone)), e.endMonth && (e.endMonth = new I(e.endMonth, e.timeZone)), e.mode === "single" && e.selected ? e.selected = new I(e.selected, e.timeZone) : e.mode === "multiple" && e.selected ? e.selected = (Xe = e.selected) == null ? void 0 : Xe.map((p) => new I(p, e.timeZone)) : e.mode === "range" && e.selected && (e.selected = {
|
|
2485
2495
|
from: e.selected.from ? new I(e.selected.from, e.timeZone) : void 0,
|
|
2486
2496
|
to: e.selected.to ? new I(e.selected.to, e.timeZone) : void 0
|
|
2487
2497
|
}));
|
|
2488
|
-
const { components: n, formatters: r, labels: a, dateLib: o, locale: i, classNames: s } =
|
|
2489
|
-
const p = { ...
|
|
2498
|
+
const { components: n, formatters: r, labels: a, dateLib: o, locale: i, classNames: s } = Pe(() => {
|
|
2499
|
+
const p = { ...je, ...e.locale };
|
|
2490
2500
|
return {
|
|
2491
|
-
dateLib: new
|
|
2501
|
+
dateLib: new J({
|
|
2492
2502
|
locale: p,
|
|
2493
2503
|
weekStartsOn: e.broadcastCalendar ? 1 : e.weekStartsOn,
|
|
2494
2504
|
firstWeekContainsDate: e.firstWeekContainsDate,
|
|
@@ -2497,11 +2507,11 @@ function vo(t) {
|
|
|
2497
2507
|
timeZone: e.timeZone,
|
|
2498
2508
|
numerals: e.numerals
|
|
2499
2509
|
}, e.dateLib),
|
|
2500
|
-
components:
|
|
2501
|
-
formatters:
|
|
2502
|
-
labels: { ...
|
|
2510
|
+
components: Da(e.components),
|
|
2511
|
+
formatters: Ea(e.formatters),
|
|
2512
|
+
labels: { ...Xa, ...e.labels },
|
|
2503
2513
|
locale: p,
|
|
2504
|
-
classNames: { ...
|
|
2514
|
+
classNames: { ...Oa(), ...e.classNames }
|
|
2505
2515
|
};
|
|
2506
2516
|
}, [
|
|
2507
2517
|
e.locale,
|
|
@@ -2517,18 +2527,18 @@ function vo(t) {
|
|
|
2517
2527
|
e.formatters,
|
|
2518
2528
|
e.labels,
|
|
2519
2529
|
e.classNames
|
|
2520
|
-
]), { captionLayout: c, mode:
|
|
2521
|
-
|
|
2522
|
-
}, [
|
|
2523
|
-
|
|
2524
|
-
}, [
|
|
2525
|
-
S.preventDefault(), S.stopPropagation(),
|
|
2526
|
-
}, [
|
|
2527
|
-
|
|
2528
|
-
}, [b,
|
|
2529
|
-
|
|
2530
|
-
}, [
|
|
2531
|
-
const
|
|
2530
|
+
]), { captionLayout: c, mode: f, navLayout: l, numberOfMonths: u = 1, onDayBlur: h, onDayClick: w, onDayFocus: b, onDayKeyDown: O, onDayMouseEnter: M, onDayMouseLeave: k, onNextClick: D, onPrevClick: y, showWeekNumber: N, styles: d } = e, { formatCaption: W, formatDay: v, formatMonthDropdown: x, formatWeekNumber: B, formatWeekNumberHeader: H, formatWeekdayName: q, formatYearDropdown: G } = r, re = io(e, o), { days: ae, months: oe, navStart: ke, navEnd: Ne, previousMonth: R, nextMonth: Z, goToMonth: L } = re, Ce = Ma(ae, e, ke, Ne, o), { isSelected: ue, select: fe, selected: De } = bo(e, o) ?? {}, { blur: Ge, focused: ve, isFocusTarget: Pt, moveFocus: Re, setFocused: Oe } = fo(e, re, Ce, ue ?? (() => !1), o), { labelDayButton: Ft, labelGridcell: Bt, labelGrid: It, labelMonthDropdown: Ht, labelNav: Ze, labelPrevious: qt, labelNext: At, labelWeekday: jt, labelWeekNumber: $t, labelWeekNumberHeader: Gt, labelYearDropdown: Rt } = a, Zt = Pe(() => Fa(o, e.ISOWeek), [o, e.ISOWeek]), ze = f !== void 0 || w !== void 0, xe = A(() => {
|
|
2531
|
+
R && (L(R), y == null || y(R));
|
|
2532
|
+
}, [R, L, y]), Te = A(() => {
|
|
2533
|
+
Z && (L(Z), D == null || D(Z));
|
|
2534
|
+
}, [L, Z, D]), zt = A((p, E) => (S) => {
|
|
2535
|
+
S.preventDefault(), S.stopPropagation(), Oe(p), fe == null || fe(p.date, E, S), w == null || w(p.date, E, S);
|
|
2536
|
+
}, [fe, w, Oe]), Qt = A((p, E) => (S) => {
|
|
2537
|
+
Oe(p), b == null || b(p.date, E, S);
|
|
2538
|
+
}, [b, Oe]), Xt = A((p, E) => (S) => {
|
|
2539
|
+
Ge(), h == null || h(p.date, E, S);
|
|
2540
|
+
}, [Ge, h]), Ut = A((p, E) => (S) => {
|
|
2541
|
+
const _ = {
|
|
2532
2542
|
ArrowLeft: [
|
|
2533
2543
|
S.shiftKey ? "month" : "day",
|
|
2534
2544
|
e.dir === "rtl" ? "after" : "before"
|
|
@@ -2544,126 +2554,139 @@ function vo(t) {
|
|
|
2544
2554
|
Home: ["startOfWeek", "before"],
|
|
2545
2555
|
End: ["endOfWeek", "after"]
|
|
2546
2556
|
};
|
|
2547
|
-
if (
|
|
2557
|
+
if (_[S.key]) {
|
|
2548
2558
|
S.preventDefault(), S.stopPropagation();
|
|
2549
|
-
const [
|
|
2550
|
-
|
|
2559
|
+
const [$, C] = _[S.key];
|
|
2560
|
+
Re($, C);
|
|
2551
2561
|
}
|
|
2552
|
-
|
|
2553
|
-
}, [
|
|
2562
|
+
O == null || O(p.date, E, S);
|
|
2563
|
+
}, [Re, O, e.dir]), Lt = A((p, E) => (S) => {
|
|
2554
2564
|
M == null || M(p.date, E, S);
|
|
2555
|
-
}, [M]),
|
|
2565
|
+
}, [M]), Vt = A((p, E) => (S) => {
|
|
2556
2566
|
k == null || k(p.date, E, S);
|
|
2557
|
-
}, [k]),
|
|
2558
|
-
const S = Number(E.target.value),
|
|
2559
|
-
|
|
2560
|
-
}, [o,
|
|
2561
|
-
const S = Number(E.target.value),
|
|
2562
|
-
|
|
2563
|
-
}, [o,
|
|
2567
|
+
}, [k]), Kt = A((p) => (E) => {
|
|
2568
|
+
const S = Number(E.target.value), _ = o.setMonth(o.startOfMonth(p), S);
|
|
2569
|
+
L(_);
|
|
2570
|
+
}, [o, L]), Jt = A((p) => (E) => {
|
|
2571
|
+
const S = Number(E.target.value), _ = o.setYear(o.startOfMonth(p), S);
|
|
2572
|
+
L(_);
|
|
2573
|
+
}, [o, L]), { className: en, style: tn } = Pe(() => ({
|
|
2564
2574
|
className: [s[g.Root], e.className].filter(Boolean).join(" "),
|
|
2565
|
-
style: { ...
|
|
2566
|
-
}), [s, e.className, e.style,
|
|
2567
|
-
|
|
2575
|
+
style: { ...d == null ? void 0 : d[g.Root], ...e.style }
|
|
2576
|
+
}), [s, e.className, e.style, d]), nn = va(e), Qe = We(null);
|
|
2577
|
+
Ka(Qe, !!e.animate, {
|
|
2568
2578
|
classNames: s,
|
|
2569
|
-
months:
|
|
2570
|
-
focused:
|
|
2579
|
+
months: oe,
|
|
2580
|
+
focused: ve,
|
|
2571
2581
|
dateLib: o
|
|
2572
2582
|
});
|
|
2573
|
-
const
|
|
2583
|
+
const rn = {
|
|
2574
2584
|
dayPickerProps: e,
|
|
2575
|
-
selected:
|
|
2576
|
-
select:
|
|
2577
|
-
isSelected:
|
|
2578
|
-
months:
|
|
2579
|
-
nextMonth:
|
|
2580
|
-
previousMonth:
|
|
2581
|
-
goToMonth:
|
|
2582
|
-
getModifiers:
|
|
2585
|
+
selected: De,
|
|
2586
|
+
select: fe,
|
|
2587
|
+
isSelected: ue,
|
|
2588
|
+
months: oe,
|
|
2589
|
+
nextMonth: Z,
|
|
2590
|
+
previousMonth: R,
|
|
2591
|
+
goToMonth: L,
|
|
2592
|
+
getModifiers: Ce,
|
|
2583
2593
|
components: n,
|
|
2584
2594
|
classNames: s,
|
|
2585
|
-
styles:
|
|
2595
|
+
styles: d,
|
|
2586
2596
|
labels: a,
|
|
2587
2597
|
formatters: r
|
|
2588
2598
|
};
|
|
2589
2599
|
return m.createElement(
|
|
2590
|
-
|
|
2591
|
-
{ value:
|
|
2600
|
+
Ot.Provider,
|
|
2601
|
+
{ value: rn },
|
|
2592
2602
|
m.createElement(
|
|
2593
2603
|
n.Root,
|
|
2594
|
-
{ rootRef: e.animate ?
|
|
2604
|
+
{ rootRef: e.animate ? Qe : void 0, className: en, style: tn, dir: e.dir, id: e.id, lang: e.lang, nonce: e.nonce, title: e.title, role: e.role, "aria-label": e["aria-label"], ...nn },
|
|
2595
2605
|
m.createElement(
|
|
2596
2606
|
n.Months,
|
|
2597
|
-
{ className: s[g.Months], style:
|
|
2598
|
-
!e.hideNavigation && !l && m.createElement(n.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: s[g.Nav], style:
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2607
|
+
{ className: s[g.Months], style: d == null ? void 0 : d[g.Months] },
|
|
2608
|
+
!e.hideNavigation && !l && m.createElement(n.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: s[g.Nav], style: d == null ? void 0 : d[g.Nav], "aria-label": Ze(), onPreviousClick: xe, onNextClick: Te, previousMonth: R, nextMonth: Z }),
|
|
2609
|
+
oe.map((p, E) => m.createElement(
|
|
2610
|
+
n.Month,
|
|
2611
|
+
{
|
|
2612
|
+
"data-animated-month": e.animate ? "true" : void 0,
|
|
2613
|
+
className: s[g.Month],
|
|
2614
|
+
style: d == null ? void 0 : d[g.Month],
|
|
2615
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
2616
|
+
key: E,
|
|
2617
|
+
displayIndex: E,
|
|
2618
|
+
calendarMonth: p
|
|
2619
|
+
},
|
|
2620
|
+
l === "around" && !e.hideNavigation && E === 0 && m.createElement(
|
|
2621
|
+
n.PreviousMonthButton,
|
|
2622
|
+
{ type: "button", className: s[g.PreviousMonthButton], tabIndex: R ? void 0 : -1, "aria-disabled": R ? void 0 : !0, "aria-label": qt(R), onClick: xe, "data-animated-button": e.animate ? "true" : void 0 },
|
|
2623
|
+
m.createElement(n.Chevron, { disabled: R ? void 0 : !0, className: s[g.Chevron], orientation: e.dir === "rtl" ? "right" : "left" })
|
|
2624
|
+
),
|
|
2625
|
+
m.createElement(n.MonthCaption, { "data-animated-caption": e.animate ? "true" : void 0, className: s[g.MonthCaption], style: d == null ? void 0 : d[g.MonthCaption], calendarMonth: p, displayIndex: E }, c != null && c.startsWith("dropdown") ? m.createElement(
|
|
2626
|
+
n.DropdownNav,
|
|
2627
|
+
{ className: s[g.Dropdowns], style: d == null ? void 0 : d[g.Dropdowns] },
|
|
2628
|
+
c === "dropdown" || c === "dropdown-months" ? m.createElement(n.MonthsDropdown, { className: s[g.MonthsDropdown], "aria-label": Ht(), classNames: s, components: n, disabled: !!e.disableNavigation, onChange: Kt(p.date), options: _a(p.date, ke, Ne, r, o), style: d == null ? void 0 : d[g.Dropdown], value: o.getMonth(p.date) }) : m.createElement("span", null, x(p.date, o)),
|
|
2629
|
+
c === "dropdown" || c === "dropdown-years" ? m.createElement(n.YearsDropdown, { className: s[g.YearsDropdown], "aria-label": Rt(o.options), classNames: s, components: n, disabled: !!e.disableNavigation, onChange: Jt(p.date), options: Ba(ke, Ne, r, o, !!e.reverseYears), style: d == null ? void 0 : d[g.Dropdown], value: o.getYear(p.date) }) : m.createElement("span", null, G(p.date, o)),
|
|
2630
|
+
m.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
2631
|
+
border: 0,
|
|
2632
|
+
clip: "rect(0 0 0 0)",
|
|
2633
|
+
height: "1px",
|
|
2634
|
+
margin: "-1px",
|
|
2635
|
+
overflow: "hidden",
|
|
2636
|
+
padding: 0,
|
|
2637
|
+
position: "absolute",
|
|
2638
|
+
width: "1px",
|
|
2639
|
+
whiteSpace: "nowrap",
|
|
2640
|
+
wordWrap: "normal"
|
|
2641
|
+
} }, W(p.date, o.options, o))
|
|
2642
|
+
) : (
|
|
2643
|
+
// biome-ignore lint/a11y/useSemanticElements: breaking change
|
|
2644
|
+
m.createElement(n.CaptionLabel, { className: s[g.CaptionLabel], role: "status", "aria-live": "polite" }, W(p.date, o.options, o))
|
|
2645
|
+
)),
|
|
2646
|
+
l === "around" && !e.hideNavigation && E === u - 1 && m.createElement(
|
|
2647
|
+
n.NextMonthButton,
|
|
2648
|
+
{ type: "button", className: s[g.NextMonthButton], tabIndex: Z ? void 0 : -1, "aria-disabled": Z ? void 0 : !0, "aria-label": At(Z), onClick: Te, "data-animated-button": e.animate ? "true" : void 0 },
|
|
2649
|
+
m.createElement(n.Chevron, { disabled: Z ? void 0 : !0, className: s[g.Chevron], orientation: e.dir === "rtl" ? "left" : "right" })
|
|
2650
|
+
),
|
|
2651
|
+
E === u - 1 && l === "after" && !e.hideNavigation && m.createElement(n.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: s[g.Nav], style: d == null ? void 0 : d[g.Nav], "aria-label": Ze(), onPreviousClick: xe, onNextClick: Te, previousMonth: R, nextMonth: Z }),
|
|
2652
|
+
m.createElement(
|
|
2653
|
+
n.MonthGrid,
|
|
2654
|
+
{ role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": It(p.date, o.options, o) || void 0, className: s[g.MonthGrid], style: d == null ? void 0 : d[g.MonthGrid] },
|
|
2655
|
+
!e.hideWeekdays && m.createElement(
|
|
2656
|
+
n.Weekdays,
|
|
2657
|
+
{ "data-animated-weekdays": e.animate ? "true" : void 0, className: s[g.Weekdays], style: d == null ? void 0 : d[g.Weekdays] },
|
|
2658
|
+
N && m.createElement(n.WeekNumberHeader, { "aria-label": Gt(o.options), className: s[g.WeekNumberHeader], style: d == null ? void 0 : d[g.WeekNumberHeader], scope: "col" }, H()),
|
|
2659
|
+
Zt.map((S) => m.createElement(n.Weekday, { "aria-label": jt(S, o.options, o), className: s[g.Weekday], key: String(S), style: d == null ? void 0 : d[g.Weekday], scope: "col" }, q(S, o.options, o)))
|
|
2631
2660
|
),
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
const cn = Ia(C, f, e.modifiersStyles), un = Vr(C, s, e.modifiersClassNames), fn = !Le && !C.hidden ? qt(Q, C, o.options, o) : void 0;
|
|
2655
|
-
return m.createElement(n.Day, { key: `${o.format(Q, "yyyy-MM-dd")}_${o.format(B.displayMonth, "yyyy-MM")}`, day: B, modifiers: C, className: un.join(" "), style: cn, role: "gridcell", "aria-selected": C.selected || void 0, "aria-label": fn, "data-day": o.format(Q, "yyyy-MM-dd"), "data-month": B.outside ? o.format(Q, "yyyy-MM") : void 0, "data-selected": C.selected || void 0, "data-disabled": C.disabled || void 0, "data-hidden": C.hidden || void 0, "data-outside": B.outside || void 0, "data-focused": C.focused || void 0, "data-today": C.today || void 0 }, !C.hidden && Le ? m.createElement(n.DayButton, { className: s[g.DayButton], style: f == null ? void 0 : f[g.DayButton], type: "button", day: B, modifiers: C, disabled: C.disabled || void 0, tabIndex: It(B) ? 0 : -1, "aria-label": Ht(Q, C, o.options, o), onClick: Lt(B, C), onBlur: Ut(B, C), onFocus: Vt(B, C), onKeyDown: Kt(B, C), onMouseEnter: Jt(B, C), onMouseLeave: en(B, C) }, v(Q, o.options, o)) : !C.hidden && v(B.date, o.options, o));
|
|
2656
|
-
})
|
|
2657
|
-
)))
|
|
2658
|
-
)
|
|
2659
|
-
);
|
|
2660
|
-
})
|
|
2661
|
+
m.createElement(n.Weeks, { "data-animated-weeks": e.animate ? "true" : void 0, className: s[g.Weeks], style: d == null ? void 0 : d[g.Weeks] }, p.weeks.map((S) => m.createElement(
|
|
2662
|
+
n.Week,
|
|
2663
|
+
{ className: s[g.Week], key: S.weekNumber, style: d == null ? void 0 : d[g.Week], week: S },
|
|
2664
|
+
N && // biome-ignore lint/a11y/useSemanticElements: react component
|
|
2665
|
+
m.createElement(n.WeekNumber, { week: S, style: d == null ? void 0 : d[g.WeekNumber], "aria-label": $t(S.weekNumber, {
|
|
2666
|
+
locale: i
|
|
2667
|
+
}), className: s[g.WeekNumber], scope: "row", role: "rowheader" }, B(S.weekNumber, o)),
|
|
2668
|
+
S.days.map((_) => {
|
|
2669
|
+
const { date: $ } = _, C = Ce(_);
|
|
2670
|
+
if (C[P.focused] = !C.hidden && !!(ve != null && ve.isEqualTo(_)), C[z.selected] = (ue == null ? void 0 : ue($)) || C.selected, $e(De)) {
|
|
2671
|
+
const { from: Ye, to: Ee } = De;
|
|
2672
|
+
C[z.range_start] = !!(Ye && Ee && o.isSameDay($, Ye)), C[z.range_end] = !!(Ye && Ee && o.isSameDay($, Ee)), C[z.range_middle] = V(De, $, !0, o);
|
|
2673
|
+
}
|
|
2674
|
+
const an = Pa(C, d, e.modifiersStyles), on = ka(C, s, e.modifiersClassNames), sn = !ze && !C.hidden ? Bt($, C, o.options, o) : void 0;
|
|
2675
|
+
return (
|
|
2676
|
+
// biome-ignore lint/a11y/useSemanticElements: react component
|
|
2677
|
+
m.createElement(n.Day, { key: `${o.format($, "yyyy-MM-dd")}_${o.format(_.displayMonth, "yyyy-MM")}`, day: _, modifiers: C, className: on.join(" "), style: an, role: "gridcell", "aria-selected": C.selected || void 0, "aria-label": sn, "data-day": o.format($, "yyyy-MM-dd"), "data-month": _.outside ? o.format($, "yyyy-MM") : void 0, "data-selected": C.selected || void 0, "data-disabled": C.disabled || void 0, "data-hidden": C.hidden || void 0, "data-outside": _.outside || void 0, "data-focused": C.focused || void 0, "data-today": C.today || void 0 }, !C.hidden && ze ? m.createElement(n.DayButton, { className: s[g.DayButton], style: d == null ? void 0 : d[g.DayButton], type: "button", day: _, modifiers: C, disabled: C.disabled || void 0, tabIndex: Pt(_) ? 0 : -1, "aria-label": Ft($, C, o.options, o), onClick: zt(_, C), onBlur: Xt(_, C), onFocus: Qt(_, C), onKeyDown: Ut(_, C), onMouseEnter: Lt(_, C), onMouseLeave: Vt(_, C) }, v($, o.options, o)) : !C.hidden && v(_.date, o.options, o))
|
|
2678
|
+
);
|
|
2679
|
+
})
|
|
2680
|
+
)))
|
|
2681
|
+
)
|
|
2682
|
+
))
|
|
2661
2683
|
),
|
|
2662
|
-
e.footer &&
|
|
2684
|
+
e.footer && // biome-ignore lint/a11y/useSemanticElements: react component
|
|
2685
|
+
m.createElement(n.Footer, { className: s[g.Footer], style: d == null ? void 0 : d[g.Footer], role: "status", "aria-live": "polite" }, e.footer)
|
|
2663
2686
|
)
|
|
2664
2687
|
);
|
|
2665
2688
|
}
|
|
2666
|
-
const
|
|
2689
|
+
const ko = ({
|
|
2667
2690
|
className: t,
|
|
2668
2691
|
showOutsideDays: e = !0,
|
|
2669
2692
|
animate: n = !0,
|
|
@@ -2673,18 +2696,18 @@ const Oo = ({
|
|
|
2673
2696
|
onSelect: i,
|
|
2674
2697
|
...s
|
|
2675
2698
|
}) => {
|
|
2676
|
-
const [c,
|
|
2699
|
+
const [c, f] = Se(
|
|
2677
2700
|
() => o
|
|
2678
2701
|
), l = A(
|
|
2679
2702
|
(u) => {
|
|
2680
|
-
u && (
|
|
2703
|
+
u && (f(u), i == null || i(u));
|
|
2681
2704
|
},
|
|
2682
2705
|
[i]
|
|
2683
2706
|
);
|
|
2684
|
-
return /* @__PURE__ */
|
|
2685
|
-
|
|
2707
|
+
return /* @__PURE__ */ _e(
|
|
2708
|
+
Mo,
|
|
2686
2709
|
{
|
|
2687
|
-
className:
|
|
2710
|
+
className: de(ln({ className: t })),
|
|
2688
2711
|
animate: n,
|
|
2689
2712
|
mode: "single",
|
|
2690
2713
|
selected: c,
|
|
@@ -2697,12 +2720,12 @@ const Oo = ({
|
|
|
2697
2720
|
day_button: "h-[30px] aria-selected:opacity-100 font-semibold hover:rounded-full cursor-pointer rounded-full w-[30px]",
|
|
2698
2721
|
day: "text-center text-[14px] leading-[20px]",
|
|
2699
2722
|
month_caption: "text-slate-700 font-semibold text-sm pl-1 h-[32px] flex items-center",
|
|
2700
|
-
months:
|
|
2723
|
+
months: de(
|
|
2701
2724
|
"flex flex-col relative px-5 py-4 rounded-lg shadow-md px-6 py-4 w-[307px] justify-center items-center",
|
|
2702
2725
|
a
|
|
2703
2726
|
),
|
|
2704
2727
|
month: "flex flex-col gap-4",
|
|
2705
|
-
nav:
|
|
2728
|
+
nav: de(
|
|
2706
2729
|
"absolute right-4 top-3.5 flex justify-center items-center gap-[4px]",
|
|
2707
2730
|
r
|
|
2708
2731
|
),
|
|
@@ -2716,13 +2739,13 @@ const Oo = ({
|
|
|
2716
2739
|
month_grid: '[&>thead]:table-header-group [&>thead]:relative [&>thead]:after:block [&>thead]:after:content-[" "] [&>thead]:after:h-4'
|
|
2717
2740
|
},
|
|
2718
2741
|
components: {
|
|
2719
|
-
Chevron: ({ className: u, ...h }) => h.orientation === "left" ? /* @__PURE__ */
|
|
2742
|
+
Chevron: ({ className: u, ...h }) => h.orientation === "left" ? /* @__PURE__ */ _e(mn, { className: de(u), ...h }) : /* @__PURE__ */ _e(gn, { className: de(u), ...h })
|
|
2720
2743
|
},
|
|
2721
2744
|
...s
|
|
2722
2745
|
}
|
|
2723
2746
|
);
|
|
2724
2747
|
};
|
|
2725
|
-
|
|
2748
|
+
ko.displayName = "DatePicker";
|
|
2726
2749
|
export {
|
|
2727
|
-
|
|
2750
|
+
ko as DatePicker
|
|
2728
2751
|
};
|