@situaction/traq-ui-ste 1.2.26 → 1.2.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/components/calendar/Calendar.js +228 -1428
- package/dist/components/input/Input.d.ts +18 -1
- package/dist/components/input/Input.js +1758 -67
- package/dist/components/input-label/InputLabel.d.ts +2 -0
- package/dist/components/input-label/InputLabel.js +43 -33
- package/dist/format-BQI_Gp2i.mjs +1227 -0
- package/dist/styles/Input.css +1 -1
- package/package.json +1 -1
|
@@ -1,85 +1,1776 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"input-style
|
|
9
|
-
"input-style-
|
|
10
|
-
"input-
|
|
11
|
-
"input-style-
|
|
12
|
-
"input-style-
|
|
13
|
-
"input-style-
|
|
14
|
-
"input-
|
|
15
|
-
"input-style-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import '../../styles/Input.css';var Ae = Object.defineProperty;
|
|
2
|
+
var Be = (s, n, e) => n in s ? Ae(s, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[n] = e;
|
|
3
|
+
var i = (s, n, e) => Be(s, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { jsxs as ue, jsx as F, Fragment as ce } from "react/jsx-runtime";
|
|
5
|
+
import { useState as le, useRef as U, useEffect as We, useMemo as de } from "react";
|
|
6
|
+
import { i as xe, t as K, c as H, m as Ge, j as $e, k as Xe, l as je, f as ne, n as be, o as Ke, p as Ze, h as me, q as _e, r as Ve, u as fe, v as Fe, w as we, x as Ue, y as ke, g as Je } from "../../format-BQI_Gp2i.mjs";
|
|
7
|
+
const Ce = "_fullWidth_mv9zl_143", Se = "_flexHorizontalBetween_mv9zl_147", et = "_flexHorizontal_mv9zl_147", P = {
|
|
8
|
+
"input-style": "_input-style_mv9zl_30",
|
|
9
|
+
"input-style-disabled": "_input-style-disabled_mv9zl_59",
|
|
10
|
+
"input-style-focused": "_input-style-focused_mv9zl_70",
|
|
11
|
+
"input-style-secondary": "_input-style-secondary_mv9zl_77",
|
|
12
|
+
"input-style-ghost": "_input-style-ghost_mv9zl_91",
|
|
13
|
+
"input-style-error": "_input-style-error_mv9zl_94",
|
|
14
|
+
"input-container": "_input-container_mv9zl_104",
|
|
15
|
+
"input-style-size-xl": "_input-style-size-xl_mv9zl_111",
|
|
16
|
+
"input-style-size-l": "_input-style-size-l_mv9zl_118",
|
|
17
|
+
"input-style-size-m": "_input-style-size-m_mv9zl_125",
|
|
18
|
+
"input-style-size-s": "_input-style-size-s_mv9zl_132",
|
|
19
|
+
"input-style-radius": "_input-style-radius_mv9zl_139",
|
|
20
|
+
fullWidth: Ce,
|
|
21
|
+
flexHorizontalBetween: Se,
|
|
22
|
+
flexHorizontal: et,
|
|
23
|
+
"input-time-placeholder": "_input-time-placeholder_mv9zl_161"
|
|
24
|
+
};
|
|
25
|
+
function tt() {
|
|
26
|
+
return Object.assign({}, xe());
|
|
27
|
+
}
|
|
28
|
+
function rt(s) {
|
|
29
|
+
let e = K(s).getDay();
|
|
30
|
+
return e === 0 && (e = 7), e;
|
|
31
|
+
}
|
|
32
|
+
function st(s, n) {
|
|
33
|
+
const e = n instanceof Date ? H(n, 0) : new n(0);
|
|
34
|
+
return e.setFullYear(
|
|
35
|
+
s.getFullYear(),
|
|
36
|
+
s.getMonth(),
|
|
37
|
+
s.getDate()
|
|
38
|
+
), e.setHours(
|
|
39
|
+
s.getHours(),
|
|
40
|
+
s.getMinutes(),
|
|
41
|
+
s.getSeconds(),
|
|
42
|
+
s.getMilliseconds()
|
|
43
|
+
), e;
|
|
44
|
+
}
|
|
45
|
+
const nt = 10;
|
|
46
|
+
class ge {
|
|
47
|
+
constructor() {
|
|
48
|
+
i(this, "subPriority", 0);
|
|
49
|
+
}
|
|
50
|
+
validate(n, e) {
|
|
51
|
+
return !0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
class ot extends ge {
|
|
55
|
+
constructor(n, e, r, t, o) {
|
|
56
|
+
super(), this.value = n, this.validateValue = e, this.setValue = r, this.priority = t, o && (this.subPriority = o);
|
|
57
|
+
}
|
|
58
|
+
validate(n, e) {
|
|
59
|
+
return this.validateValue(n, this.value, e);
|
|
60
|
+
}
|
|
61
|
+
set(n, e, r) {
|
|
62
|
+
return this.setValue(n, e, this.value, r);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
class it extends ge {
|
|
66
|
+
constructor() {
|
|
67
|
+
super(...arguments);
|
|
68
|
+
i(this, "priority", nt);
|
|
69
|
+
i(this, "subPriority", -1);
|
|
70
|
+
}
|
|
71
|
+
set(e, r) {
|
|
72
|
+
return r.timestampIsSet ? e : H(e, st(e, Date));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class f {
|
|
76
|
+
run(n, e, r, t) {
|
|
77
|
+
const o = this.parse(n, e, r, t);
|
|
78
|
+
return o ? {
|
|
79
|
+
setter: new ot(
|
|
80
|
+
o.value,
|
|
81
|
+
this.validate,
|
|
82
|
+
this.set,
|
|
83
|
+
this.priority,
|
|
84
|
+
this.subPriority
|
|
85
|
+
),
|
|
86
|
+
rest: o.rest
|
|
87
|
+
} : null;
|
|
88
|
+
}
|
|
89
|
+
validate(n, e, r) {
|
|
90
|
+
return !0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
class at extends f {
|
|
94
|
+
constructor() {
|
|
95
|
+
super(...arguments);
|
|
96
|
+
i(this, "priority", 140);
|
|
97
|
+
i(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
98
|
+
}
|
|
99
|
+
parse(e, r, t) {
|
|
100
|
+
switch (r) {
|
|
101
|
+
case "G":
|
|
102
|
+
case "GG":
|
|
103
|
+
case "GGG":
|
|
104
|
+
return t.era(e, { width: "abbreviated" }) || t.era(e, { width: "narrow" });
|
|
105
|
+
case "GGGGG":
|
|
106
|
+
return t.era(e, { width: "narrow" });
|
|
107
|
+
case "GGGG":
|
|
108
|
+
default:
|
|
109
|
+
return t.era(e, { width: "wide" }) || t.era(e, { width: "abbreviated" }) || t.era(e, { width: "narrow" });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
set(e, r, t) {
|
|
113
|
+
return r.era = t, e.setFullYear(t, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const b = {
|
|
117
|
+
month: /^(1[0-2]|0?\d)/,
|
|
118
|
+
// 0 to 12
|
|
119
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
120
|
+
// 0 to 31
|
|
121
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
122
|
+
// 0 to 366
|
|
123
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
124
|
+
// 0 to 53
|
|
125
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
126
|
+
// 0 to 23
|
|
127
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
128
|
+
// 0 to 24
|
|
129
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
130
|
+
// 0 to 11
|
|
131
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
132
|
+
// 0 to 12
|
|
133
|
+
minute: /^[0-5]?\d/,
|
|
134
|
+
// 0 to 59
|
|
135
|
+
second: /^[0-5]?\d/,
|
|
136
|
+
// 0 to 59
|
|
137
|
+
singleDigit: /^\d/,
|
|
138
|
+
// 0 to 9
|
|
139
|
+
twoDigits: /^\d{1,2}/,
|
|
140
|
+
// 0 to 99
|
|
141
|
+
threeDigits: /^\d{1,3}/,
|
|
142
|
+
// 0 to 999
|
|
143
|
+
fourDigits: /^\d{1,4}/,
|
|
144
|
+
// 0 to 9999
|
|
145
|
+
anyDigitsSigned: /^-?\d+/,
|
|
146
|
+
singleDigitSigned: /^-?\d/,
|
|
147
|
+
// 0 to 9, -0 to -9
|
|
148
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
149
|
+
// 0 to 99, -0 to -99
|
|
150
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
151
|
+
// 0 to 999, -0 to -999
|
|
152
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
153
|
+
// 0 to 9999, -0 to -9999
|
|
154
|
+
}, q = {
|
|
155
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
156
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
157
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
158
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
159
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
160
|
+
};
|
|
161
|
+
function m(s, n) {
|
|
162
|
+
return s && {
|
|
163
|
+
value: n(s.value),
|
|
164
|
+
rest: s.rest
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function y(s, n) {
|
|
168
|
+
const e = n.match(s);
|
|
169
|
+
return e ? {
|
|
170
|
+
value: parseInt(e[0], 10),
|
|
171
|
+
rest: n.slice(e[0].length)
|
|
172
|
+
} : null;
|
|
173
|
+
}
|
|
174
|
+
function N(s, n) {
|
|
175
|
+
const e = n.match(s);
|
|
176
|
+
if (!e)
|
|
177
|
+
return null;
|
|
178
|
+
if (e[0] === "Z")
|
|
179
|
+
return {
|
|
180
|
+
value: 0,
|
|
181
|
+
rest: n.slice(1)
|
|
182
|
+
};
|
|
183
|
+
const r = e[1] === "+" ? 1 : -1, t = e[2] ? parseInt(e[2], 10) : 0, o = e[3] ? parseInt(e[3], 10) : 0, u = e[5] ? parseInt(e[5], 10) : 0;
|
|
184
|
+
return {
|
|
185
|
+
value: r * (t * Ge + o * $e + u * Xe),
|
|
186
|
+
rest: n.slice(e[0].length)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function De(s) {
|
|
190
|
+
return y(b.anyDigitsSigned, s);
|
|
191
|
+
}
|
|
192
|
+
function x(s, n) {
|
|
193
|
+
switch (s) {
|
|
194
|
+
case 1:
|
|
195
|
+
return y(b.singleDigit, n);
|
|
196
|
+
case 2:
|
|
197
|
+
return y(b.twoDigits, n);
|
|
198
|
+
case 3:
|
|
199
|
+
return y(b.threeDigits, n);
|
|
200
|
+
case 4:
|
|
201
|
+
return y(b.fourDigits, n);
|
|
202
|
+
default:
|
|
203
|
+
return y(new RegExp("^\\d{1," + s + "}"), n);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function ee(s, n) {
|
|
207
|
+
switch (s) {
|
|
208
|
+
case 1:
|
|
209
|
+
return y(b.singleDigitSigned, n);
|
|
210
|
+
case 2:
|
|
211
|
+
return y(b.twoDigitsSigned, n);
|
|
212
|
+
case 3:
|
|
213
|
+
return y(b.threeDigitsSigned, n);
|
|
214
|
+
case 4:
|
|
215
|
+
return y(b.fourDigitsSigned, n);
|
|
216
|
+
default:
|
|
217
|
+
return y(new RegExp("^-?\\d{1," + s + "}"), n);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function oe(s) {
|
|
221
|
+
switch (s) {
|
|
222
|
+
case "morning":
|
|
223
|
+
return 4;
|
|
224
|
+
case "evening":
|
|
225
|
+
return 17;
|
|
226
|
+
case "pm":
|
|
227
|
+
case "noon":
|
|
228
|
+
case "afternoon":
|
|
229
|
+
return 12;
|
|
230
|
+
case "am":
|
|
231
|
+
case "midnight":
|
|
232
|
+
case "night":
|
|
233
|
+
default:
|
|
234
|
+
return 0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function Me(s, n) {
|
|
238
|
+
const e = n > 0, r = e ? n : 1 - n;
|
|
239
|
+
let t;
|
|
240
|
+
if (r <= 50)
|
|
241
|
+
t = s || 100;
|
|
242
|
+
else {
|
|
243
|
+
const o = r + 50, u = Math.trunc(o / 100) * 100, p = s >= o % 100;
|
|
244
|
+
t = s + u - (p ? 100 : 0);
|
|
245
|
+
}
|
|
246
|
+
return e ? t : 1 - t;
|
|
247
|
+
}
|
|
248
|
+
function Pe(s) {
|
|
249
|
+
return s % 400 === 0 || s % 4 === 0 && s % 100 !== 0;
|
|
250
|
+
}
|
|
251
|
+
class ut extends f {
|
|
252
|
+
constructor() {
|
|
253
|
+
super(...arguments);
|
|
254
|
+
i(this, "priority", 130);
|
|
255
|
+
i(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
256
|
+
}
|
|
257
|
+
parse(e, r, t) {
|
|
258
|
+
const o = (u) => ({
|
|
259
|
+
year: u,
|
|
260
|
+
isTwoDigitYear: r === "yy"
|
|
261
|
+
});
|
|
262
|
+
switch (r) {
|
|
263
|
+
case "y":
|
|
264
|
+
return m(x(4, e), o);
|
|
265
|
+
case "yo":
|
|
266
|
+
return m(
|
|
267
|
+
t.ordinalNumber(e, {
|
|
268
|
+
unit: "year"
|
|
269
|
+
}),
|
|
270
|
+
o
|
|
271
|
+
);
|
|
272
|
+
default:
|
|
273
|
+
return m(x(r.length, e), o);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
validate(e, r) {
|
|
277
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
278
|
+
}
|
|
279
|
+
set(e, r, t) {
|
|
280
|
+
const o = e.getFullYear();
|
|
281
|
+
if (t.isTwoDigitYear) {
|
|
282
|
+
const p = Me(
|
|
283
|
+
t.year,
|
|
284
|
+
o
|
|
285
|
+
);
|
|
286
|
+
return e.setFullYear(p, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
287
|
+
}
|
|
288
|
+
const u = !("era" in r) || r.era === 1 ? t.year : 1 - t.year;
|
|
289
|
+
return e.setFullYear(u, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
class ct extends f {
|
|
293
|
+
constructor() {
|
|
294
|
+
super(...arguments);
|
|
295
|
+
i(this, "priority", 130);
|
|
296
|
+
i(this, "incompatibleTokens", [
|
|
297
|
+
"y",
|
|
298
|
+
"R",
|
|
299
|
+
"u",
|
|
300
|
+
"Q",
|
|
301
|
+
"q",
|
|
302
|
+
"M",
|
|
303
|
+
"L",
|
|
304
|
+
"I",
|
|
305
|
+
"d",
|
|
306
|
+
"D",
|
|
307
|
+
"i",
|
|
308
|
+
"t",
|
|
309
|
+
"T"
|
|
310
|
+
]);
|
|
311
|
+
}
|
|
312
|
+
parse(e, r, t) {
|
|
313
|
+
const o = (u) => ({
|
|
314
|
+
year: u,
|
|
315
|
+
isTwoDigitYear: r === "YY"
|
|
316
|
+
});
|
|
317
|
+
switch (r) {
|
|
318
|
+
case "Y":
|
|
319
|
+
return m(x(4, e), o);
|
|
320
|
+
case "Yo":
|
|
321
|
+
return m(
|
|
322
|
+
t.ordinalNumber(e, {
|
|
323
|
+
unit: "year"
|
|
324
|
+
}),
|
|
325
|
+
o
|
|
326
|
+
);
|
|
327
|
+
default:
|
|
328
|
+
return m(x(r.length, e), o);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
validate(e, r) {
|
|
332
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
333
|
+
}
|
|
334
|
+
set(e, r, t, o) {
|
|
335
|
+
const u = je(e, o);
|
|
336
|
+
if (t.isTwoDigitYear) {
|
|
337
|
+
const v = Me(
|
|
338
|
+
t.year,
|
|
339
|
+
u
|
|
340
|
+
);
|
|
341
|
+
return e.setFullYear(
|
|
342
|
+
v,
|
|
343
|
+
0,
|
|
344
|
+
o.firstWeekContainsDate
|
|
345
|
+
), e.setHours(0, 0, 0, 0), ne(e, o);
|
|
346
|
+
}
|
|
347
|
+
const p = !("era" in r) || r.era === 1 ? t.year : 1 - t.year;
|
|
348
|
+
return e.setFullYear(p, 0, o.firstWeekContainsDate), e.setHours(0, 0, 0, 0), ne(e, o);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
class lt extends f {
|
|
352
|
+
constructor() {
|
|
353
|
+
super(...arguments);
|
|
354
|
+
i(this, "priority", 130);
|
|
355
|
+
i(this, "incompatibleTokens", [
|
|
356
|
+
"G",
|
|
357
|
+
"y",
|
|
358
|
+
"Y",
|
|
359
|
+
"u",
|
|
360
|
+
"Q",
|
|
361
|
+
"q",
|
|
362
|
+
"M",
|
|
363
|
+
"L",
|
|
364
|
+
"w",
|
|
365
|
+
"d",
|
|
366
|
+
"D",
|
|
367
|
+
"e",
|
|
368
|
+
"c",
|
|
369
|
+
"t",
|
|
370
|
+
"T"
|
|
371
|
+
]);
|
|
372
|
+
}
|
|
373
|
+
parse(e, r) {
|
|
374
|
+
return ee(r === "R" ? 4 : r.length, e);
|
|
375
|
+
}
|
|
376
|
+
set(e, r, t) {
|
|
377
|
+
const o = H(e, 0);
|
|
378
|
+
return o.setFullYear(t, 0, 4), o.setHours(0, 0, 0, 0), be(o);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
class dt extends f {
|
|
382
|
+
constructor() {
|
|
383
|
+
super(...arguments);
|
|
384
|
+
i(this, "priority", 130);
|
|
385
|
+
i(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
386
|
+
}
|
|
387
|
+
parse(e, r) {
|
|
388
|
+
return ee(r === "u" ? 4 : r.length, e);
|
|
389
|
+
}
|
|
390
|
+
set(e, r, t) {
|
|
391
|
+
return e.setFullYear(t, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
class ft extends f {
|
|
395
|
+
constructor() {
|
|
396
|
+
super(...arguments);
|
|
397
|
+
i(this, "priority", 120);
|
|
398
|
+
i(this, "incompatibleTokens", [
|
|
399
|
+
"Y",
|
|
400
|
+
"R",
|
|
401
|
+
"q",
|
|
402
|
+
"M",
|
|
403
|
+
"L",
|
|
404
|
+
"w",
|
|
405
|
+
"I",
|
|
406
|
+
"d",
|
|
407
|
+
"D",
|
|
408
|
+
"i",
|
|
409
|
+
"e",
|
|
410
|
+
"c",
|
|
411
|
+
"t",
|
|
412
|
+
"T"
|
|
413
|
+
]);
|
|
414
|
+
}
|
|
415
|
+
parse(e, r, t) {
|
|
416
|
+
switch (r) {
|
|
417
|
+
case "Q":
|
|
418
|
+
case "QQ":
|
|
419
|
+
return x(r.length, e);
|
|
420
|
+
case "Qo":
|
|
421
|
+
return t.ordinalNumber(e, { unit: "quarter" });
|
|
422
|
+
case "QQQ":
|
|
423
|
+
return t.quarter(e, {
|
|
424
|
+
width: "abbreviated",
|
|
425
|
+
context: "formatting"
|
|
426
|
+
}) || t.quarter(e, {
|
|
427
|
+
width: "narrow",
|
|
428
|
+
context: "formatting"
|
|
429
|
+
});
|
|
430
|
+
case "QQQQQ":
|
|
431
|
+
return t.quarter(e, {
|
|
432
|
+
width: "narrow",
|
|
433
|
+
context: "formatting"
|
|
434
|
+
});
|
|
435
|
+
case "QQQQ":
|
|
436
|
+
default:
|
|
437
|
+
return t.quarter(e, {
|
|
438
|
+
width: "wide",
|
|
439
|
+
context: "formatting"
|
|
440
|
+
}) || t.quarter(e, {
|
|
441
|
+
width: "abbreviated",
|
|
442
|
+
context: "formatting"
|
|
443
|
+
}) || t.quarter(e, {
|
|
444
|
+
width: "narrow",
|
|
445
|
+
context: "formatting"
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
validate(e, r) {
|
|
450
|
+
return r >= 1 && r <= 4;
|
|
451
|
+
}
|
|
452
|
+
set(e, r, t) {
|
|
453
|
+
return e.setMonth((t - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
class wt extends f {
|
|
457
|
+
constructor() {
|
|
458
|
+
super(...arguments);
|
|
459
|
+
i(this, "priority", 120);
|
|
460
|
+
i(this, "incompatibleTokens", [
|
|
461
|
+
"Y",
|
|
462
|
+
"R",
|
|
463
|
+
"Q",
|
|
464
|
+
"M",
|
|
465
|
+
"L",
|
|
466
|
+
"w",
|
|
467
|
+
"I",
|
|
468
|
+
"d",
|
|
469
|
+
"D",
|
|
470
|
+
"i",
|
|
471
|
+
"e",
|
|
472
|
+
"c",
|
|
473
|
+
"t",
|
|
474
|
+
"T"
|
|
475
|
+
]);
|
|
476
|
+
}
|
|
477
|
+
parse(e, r, t) {
|
|
478
|
+
switch (r) {
|
|
479
|
+
case "q":
|
|
480
|
+
case "qq":
|
|
481
|
+
return x(r.length, e);
|
|
482
|
+
case "qo":
|
|
483
|
+
return t.ordinalNumber(e, { unit: "quarter" });
|
|
484
|
+
case "qqq":
|
|
485
|
+
return t.quarter(e, {
|
|
486
|
+
width: "abbreviated",
|
|
487
|
+
context: "standalone"
|
|
488
|
+
}) || t.quarter(e, {
|
|
489
|
+
width: "narrow",
|
|
490
|
+
context: "standalone"
|
|
491
|
+
});
|
|
492
|
+
case "qqqqq":
|
|
493
|
+
return t.quarter(e, {
|
|
494
|
+
width: "narrow",
|
|
495
|
+
context: "standalone"
|
|
496
|
+
});
|
|
497
|
+
case "qqqq":
|
|
498
|
+
default:
|
|
499
|
+
return t.quarter(e, {
|
|
500
|
+
width: "wide",
|
|
501
|
+
context: "standalone"
|
|
502
|
+
}) || t.quarter(e, {
|
|
503
|
+
width: "abbreviated",
|
|
504
|
+
context: "standalone"
|
|
505
|
+
}) || t.quarter(e, {
|
|
506
|
+
width: "narrow",
|
|
507
|
+
context: "standalone"
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
validate(e, r) {
|
|
512
|
+
return r >= 1 && r <= 4;
|
|
513
|
+
}
|
|
514
|
+
set(e, r, t) {
|
|
515
|
+
return e.setMonth((t - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
class pt extends f {
|
|
519
|
+
constructor() {
|
|
520
|
+
super(...arguments);
|
|
521
|
+
i(this, "incompatibleTokens", [
|
|
522
|
+
"Y",
|
|
523
|
+
"R",
|
|
524
|
+
"q",
|
|
525
|
+
"Q",
|
|
526
|
+
"L",
|
|
527
|
+
"w",
|
|
528
|
+
"I",
|
|
529
|
+
"D",
|
|
530
|
+
"i",
|
|
531
|
+
"e",
|
|
532
|
+
"c",
|
|
533
|
+
"t",
|
|
534
|
+
"T"
|
|
535
|
+
]);
|
|
536
|
+
i(this, "priority", 110);
|
|
537
|
+
}
|
|
538
|
+
parse(e, r, t) {
|
|
539
|
+
const o = (u) => u - 1;
|
|
540
|
+
switch (r) {
|
|
541
|
+
case "M":
|
|
542
|
+
return m(
|
|
543
|
+
y(b.month, e),
|
|
544
|
+
o
|
|
545
|
+
);
|
|
546
|
+
case "MM":
|
|
547
|
+
return m(x(2, e), o);
|
|
548
|
+
case "Mo":
|
|
549
|
+
return m(
|
|
550
|
+
t.ordinalNumber(e, {
|
|
551
|
+
unit: "month"
|
|
552
|
+
}),
|
|
553
|
+
o
|
|
554
|
+
);
|
|
555
|
+
case "MMM":
|
|
556
|
+
return t.month(e, {
|
|
557
|
+
width: "abbreviated",
|
|
558
|
+
context: "formatting"
|
|
559
|
+
}) || t.month(e, { width: "narrow", context: "formatting" });
|
|
560
|
+
case "MMMMM":
|
|
561
|
+
return t.month(e, {
|
|
562
|
+
width: "narrow",
|
|
563
|
+
context: "formatting"
|
|
564
|
+
});
|
|
565
|
+
case "MMMM":
|
|
566
|
+
default:
|
|
567
|
+
return t.month(e, { width: "wide", context: "formatting" }) || t.month(e, {
|
|
568
|
+
width: "abbreviated",
|
|
569
|
+
context: "formatting"
|
|
570
|
+
}) || t.month(e, { width: "narrow", context: "formatting" });
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
validate(e, r) {
|
|
574
|
+
return r >= 0 && r <= 11;
|
|
575
|
+
}
|
|
576
|
+
set(e, r, t) {
|
|
577
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
class yt extends f {
|
|
581
|
+
constructor() {
|
|
582
|
+
super(...arguments);
|
|
583
|
+
i(this, "priority", 110);
|
|
584
|
+
i(this, "incompatibleTokens", [
|
|
585
|
+
"Y",
|
|
586
|
+
"R",
|
|
587
|
+
"q",
|
|
588
|
+
"Q",
|
|
589
|
+
"M",
|
|
590
|
+
"w",
|
|
591
|
+
"I",
|
|
592
|
+
"D",
|
|
593
|
+
"i",
|
|
594
|
+
"e",
|
|
595
|
+
"c",
|
|
596
|
+
"t",
|
|
597
|
+
"T"
|
|
598
|
+
]);
|
|
599
|
+
}
|
|
600
|
+
parse(e, r, t) {
|
|
601
|
+
const o = (u) => u - 1;
|
|
602
|
+
switch (r) {
|
|
603
|
+
case "L":
|
|
604
|
+
return m(
|
|
605
|
+
y(b.month, e),
|
|
606
|
+
o
|
|
607
|
+
);
|
|
608
|
+
case "LL":
|
|
609
|
+
return m(x(2, e), o);
|
|
610
|
+
case "Lo":
|
|
611
|
+
return m(
|
|
612
|
+
t.ordinalNumber(e, {
|
|
613
|
+
unit: "month"
|
|
614
|
+
}),
|
|
615
|
+
o
|
|
616
|
+
);
|
|
617
|
+
case "LLL":
|
|
618
|
+
return t.month(e, {
|
|
619
|
+
width: "abbreviated",
|
|
620
|
+
context: "standalone"
|
|
621
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
622
|
+
case "LLLLL":
|
|
623
|
+
return t.month(e, {
|
|
624
|
+
width: "narrow",
|
|
625
|
+
context: "standalone"
|
|
626
|
+
});
|
|
627
|
+
case "LLLL":
|
|
628
|
+
default:
|
|
629
|
+
return t.month(e, { width: "wide", context: "standalone" }) || t.month(e, {
|
|
630
|
+
width: "abbreviated",
|
|
631
|
+
context: "standalone"
|
|
632
|
+
}) || t.month(e, { width: "narrow", context: "standalone" });
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
validate(e, r) {
|
|
636
|
+
return r >= 0 && r <= 11;
|
|
637
|
+
}
|
|
638
|
+
set(e, r, t) {
|
|
639
|
+
return e.setMonth(t, 1), e.setHours(0, 0, 0, 0), e;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function ht(s, n, e) {
|
|
643
|
+
const r = K(s), t = Ke(r, e) - n;
|
|
644
|
+
return r.setDate(r.getDate() - t * 7), r;
|
|
645
|
+
}
|
|
646
|
+
class xt extends f {
|
|
647
|
+
constructor() {
|
|
648
|
+
super(...arguments);
|
|
649
|
+
i(this, "priority", 100);
|
|
650
|
+
i(this, "incompatibleTokens", [
|
|
651
|
+
"y",
|
|
652
|
+
"R",
|
|
653
|
+
"u",
|
|
654
|
+
"q",
|
|
655
|
+
"Q",
|
|
656
|
+
"M",
|
|
657
|
+
"L",
|
|
658
|
+
"I",
|
|
659
|
+
"d",
|
|
660
|
+
"D",
|
|
661
|
+
"i",
|
|
662
|
+
"t",
|
|
663
|
+
"T"
|
|
664
|
+
]);
|
|
665
|
+
}
|
|
666
|
+
parse(e, r, t) {
|
|
667
|
+
switch (r) {
|
|
668
|
+
case "w":
|
|
669
|
+
return y(b.week, e);
|
|
670
|
+
case "wo":
|
|
671
|
+
return t.ordinalNumber(e, { unit: "week" });
|
|
672
|
+
default:
|
|
673
|
+
return x(r.length, e);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
validate(e, r) {
|
|
677
|
+
return r >= 1 && r <= 53;
|
|
678
|
+
}
|
|
679
|
+
set(e, r, t, o) {
|
|
680
|
+
return ne(ht(e, t, o), o);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function bt(s, n) {
|
|
684
|
+
const e = K(s), r = Ze(e) - n;
|
|
685
|
+
return e.setDate(e.getDate() - r * 7), e;
|
|
686
|
+
}
|
|
687
|
+
class mt extends f {
|
|
688
|
+
constructor() {
|
|
689
|
+
super(...arguments);
|
|
690
|
+
i(this, "priority", 100);
|
|
691
|
+
i(this, "incompatibleTokens", [
|
|
692
|
+
"y",
|
|
693
|
+
"Y",
|
|
694
|
+
"u",
|
|
695
|
+
"q",
|
|
696
|
+
"Q",
|
|
697
|
+
"M",
|
|
698
|
+
"L",
|
|
699
|
+
"w",
|
|
700
|
+
"d",
|
|
701
|
+
"D",
|
|
702
|
+
"e",
|
|
703
|
+
"c",
|
|
704
|
+
"t",
|
|
705
|
+
"T"
|
|
706
|
+
]);
|
|
707
|
+
}
|
|
708
|
+
parse(e, r, t) {
|
|
709
|
+
switch (r) {
|
|
710
|
+
case "I":
|
|
711
|
+
return y(b.week, e);
|
|
712
|
+
case "Io":
|
|
713
|
+
return t.ordinalNumber(e, { unit: "week" });
|
|
714
|
+
default:
|
|
715
|
+
return x(r.length, e);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
validate(e, r) {
|
|
719
|
+
return r >= 1 && r <= 53;
|
|
720
|
+
}
|
|
721
|
+
set(e, r, t) {
|
|
722
|
+
return be(bt(e, t));
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
const _t = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], kt = [
|
|
726
|
+
31,
|
|
727
|
+
29,
|
|
728
|
+
31,
|
|
729
|
+
30,
|
|
730
|
+
31,
|
|
731
|
+
30,
|
|
732
|
+
31,
|
|
733
|
+
31,
|
|
734
|
+
30,
|
|
735
|
+
31,
|
|
736
|
+
30,
|
|
737
|
+
31
|
|
738
|
+
];
|
|
739
|
+
class gt extends f {
|
|
740
|
+
constructor() {
|
|
741
|
+
super(...arguments);
|
|
742
|
+
i(this, "priority", 90);
|
|
743
|
+
i(this, "subPriority", 1);
|
|
744
|
+
i(this, "incompatibleTokens", [
|
|
745
|
+
"Y",
|
|
746
|
+
"R",
|
|
747
|
+
"q",
|
|
748
|
+
"Q",
|
|
749
|
+
"w",
|
|
750
|
+
"I",
|
|
751
|
+
"D",
|
|
752
|
+
"i",
|
|
753
|
+
"e",
|
|
754
|
+
"c",
|
|
755
|
+
"t",
|
|
756
|
+
"T"
|
|
757
|
+
]);
|
|
758
|
+
}
|
|
759
|
+
parse(e, r, t) {
|
|
760
|
+
switch (r) {
|
|
761
|
+
case "d":
|
|
762
|
+
return y(b.date, e);
|
|
763
|
+
case "do":
|
|
764
|
+
return t.ordinalNumber(e, { unit: "date" });
|
|
765
|
+
default:
|
|
766
|
+
return x(r.length, e);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
validate(e, r) {
|
|
770
|
+
const t = e.getFullYear(), o = Pe(t), u = e.getMonth();
|
|
771
|
+
return o ? r >= 1 && r <= kt[u] : r >= 1 && r <= _t[u];
|
|
772
|
+
}
|
|
773
|
+
set(e, r, t) {
|
|
774
|
+
return e.setDate(t), e.setHours(0, 0, 0, 0), e;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
class Dt extends f {
|
|
778
|
+
constructor() {
|
|
779
|
+
super(...arguments);
|
|
780
|
+
i(this, "priority", 90);
|
|
781
|
+
i(this, "subpriority", 1);
|
|
782
|
+
i(this, "incompatibleTokens", [
|
|
783
|
+
"Y",
|
|
784
|
+
"R",
|
|
785
|
+
"q",
|
|
786
|
+
"Q",
|
|
787
|
+
"M",
|
|
788
|
+
"L",
|
|
789
|
+
"w",
|
|
790
|
+
"I",
|
|
791
|
+
"d",
|
|
792
|
+
"E",
|
|
793
|
+
"i",
|
|
794
|
+
"e",
|
|
795
|
+
"c",
|
|
796
|
+
"t",
|
|
797
|
+
"T"
|
|
798
|
+
]);
|
|
799
|
+
}
|
|
800
|
+
parse(e, r, t) {
|
|
801
|
+
switch (r) {
|
|
802
|
+
case "D":
|
|
803
|
+
case "DD":
|
|
804
|
+
return y(b.dayOfYear, e);
|
|
805
|
+
case "Do":
|
|
806
|
+
return t.ordinalNumber(e, { unit: "date" });
|
|
807
|
+
default:
|
|
808
|
+
return x(r.length, e);
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
validate(e, r) {
|
|
812
|
+
const t = e.getFullYear();
|
|
813
|
+
return Pe(t) ? r >= 1 && r <= 366 : r >= 1 && r <= 365;
|
|
814
|
+
}
|
|
815
|
+
set(e, r, t) {
|
|
816
|
+
return e.setMonth(0, t), e.setHours(0, 0, 0, 0), e;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
function ie(s, n, e) {
|
|
820
|
+
var c, Q, Y, X;
|
|
821
|
+
const r = xe(), t = (e == null ? void 0 : e.weekStartsOn) ?? ((Q = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : Q.weekStartsOn) ?? r.weekStartsOn ?? ((X = (Y = r.locale) == null ? void 0 : Y.options) == null ? void 0 : X.weekStartsOn) ?? 0, o = K(s), u = o.getDay(), v = (n % 7 + 7) % 7, _ = 7 - t, l = n < 0 || n > 6 ? n - (u + _) % 7 : (v + _) % 7 - (u + _) % 7;
|
|
822
|
+
return me(o, l);
|
|
823
|
+
}
|
|
824
|
+
class Mt extends f {
|
|
825
|
+
constructor() {
|
|
826
|
+
super(...arguments);
|
|
827
|
+
i(this, "priority", 90);
|
|
828
|
+
i(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
829
|
+
}
|
|
830
|
+
parse(e, r, t) {
|
|
831
|
+
switch (r) {
|
|
832
|
+
case "E":
|
|
833
|
+
case "EE":
|
|
834
|
+
case "EEE":
|
|
835
|
+
return t.day(e, {
|
|
836
|
+
width: "abbreviated",
|
|
837
|
+
context: "formatting"
|
|
838
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
839
|
+
case "EEEEE":
|
|
840
|
+
return t.day(e, {
|
|
841
|
+
width: "narrow",
|
|
842
|
+
context: "formatting"
|
|
843
|
+
});
|
|
844
|
+
case "EEEEEE":
|
|
845
|
+
return t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
846
|
+
case "EEEE":
|
|
847
|
+
default:
|
|
848
|
+
return t.day(e, { width: "wide", context: "formatting" }) || t.day(e, {
|
|
849
|
+
width: "abbreviated",
|
|
850
|
+
context: "formatting"
|
|
851
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
validate(e, r) {
|
|
855
|
+
return r >= 0 && r <= 6;
|
|
856
|
+
}
|
|
857
|
+
set(e, r, t, o) {
|
|
858
|
+
return e = ie(e, t, o), e.setHours(0, 0, 0, 0), e;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
class Pt extends f {
|
|
862
|
+
constructor() {
|
|
863
|
+
super(...arguments);
|
|
864
|
+
i(this, "priority", 90);
|
|
865
|
+
i(this, "incompatibleTokens", [
|
|
866
|
+
"y",
|
|
867
|
+
"R",
|
|
868
|
+
"u",
|
|
869
|
+
"q",
|
|
870
|
+
"Q",
|
|
871
|
+
"M",
|
|
872
|
+
"L",
|
|
873
|
+
"I",
|
|
874
|
+
"d",
|
|
875
|
+
"D",
|
|
876
|
+
"E",
|
|
877
|
+
"i",
|
|
878
|
+
"c",
|
|
879
|
+
"t",
|
|
880
|
+
"T"
|
|
881
|
+
]);
|
|
882
|
+
}
|
|
883
|
+
parse(e, r, t, o) {
|
|
884
|
+
const u = (p) => {
|
|
885
|
+
const v = Math.floor((p - 1) / 7) * 7;
|
|
886
|
+
return (p + o.weekStartsOn + 6) % 7 + v;
|
|
887
|
+
};
|
|
888
|
+
switch (r) {
|
|
889
|
+
case "e":
|
|
890
|
+
case "ee":
|
|
891
|
+
return m(x(r.length, e), u);
|
|
892
|
+
case "eo":
|
|
893
|
+
return m(
|
|
894
|
+
t.ordinalNumber(e, {
|
|
895
|
+
unit: "day"
|
|
896
|
+
}),
|
|
897
|
+
u
|
|
898
|
+
);
|
|
899
|
+
case "eee":
|
|
900
|
+
return t.day(e, {
|
|
901
|
+
width: "abbreviated",
|
|
902
|
+
context: "formatting"
|
|
903
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
904
|
+
case "eeeee":
|
|
905
|
+
return t.day(e, {
|
|
906
|
+
width: "narrow",
|
|
907
|
+
context: "formatting"
|
|
908
|
+
});
|
|
909
|
+
case "eeeeee":
|
|
910
|
+
return t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
911
|
+
case "eeee":
|
|
912
|
+
default:
|
|
913
|
+
return t.day(e, { width: "wide", context: "formatting" }) || t.day(e, {
|
|
914
|
+
width: "abbreviated",
|
|
915
|
+
context: "formatting"
|
|
916
|
+
}) || t.day(e, { width: "short", context: "formatting" }) || t.day(e, { width: "narrow", context: "formatting" });
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
validate(e, r) {
|
|
920
|
+
return r >= 0 && r <= 6;
|
|
921
|
+
}
|
|
922
|
+
set(e, r, t, o) {
|
|
923
|
+
return e = ie(e, t, o), e.setHours(0, 0, 0, 0), e;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
class Ht extends f {
|
|
927
|
+
constructor() {
|
|
928
|
+
super(...arguments);
|
|
929
|
+
i(this, "priority", 90);
|
|
930
|
+
i(this, "incompatibleTokens", [
|
|
931
|
+
"y",
|
|
932
|
+
"R",
|
|
933
|
+
"u",
|
|
934
|
+
"q",
|
|
935
|
+
"Q",
|
|
936
|
+
"M",
|
|
937
|
+
"L",
|
|
938
|
+
"I",
|
|
939
|
+
"d",
|
|
940
|
+
"D",
|
|
941
|
+
"E",
|
|
942
|
+
"i",
|
|
943
|
+
"e",
|
|
944
|
+
"t",
|
|
945
|
+
"T"
|
|
946
|
+
]);
|
|
947
|
+
}
|
|
948
|
+
parse(e, r, t, o) {
|
|
949
|
+
const u = (p) => {
|
|
950
|
+
const v = Math.floor((p - 1) / 7) * 7;
|
|
951
|
+
return (p + o.weekStartsOn + 6) % 7 + v;
|
|
952
|
+
};
|
|
953
|
+
switch (r) {
|
|
954
|
+
case "c":
|
|
955
|
+
case "cc":
|
|
956
|
+
return m(x(r.length, e), u);
|
|
957
|
+
case "co":
|
|
958
|
+
return m(
|
|
959
|
+
t.ordinalNumber(e, {
|
|
960
|
+
unit: "day"
|
|
961
|
+
}),
|
|
962
|
+
u
|
|
963
|
+
);
|
|
964
|
+
case "ccc":
|
|
965
|
+
return t.day(e, {
|
|
966
|
+
width: "abbreviated",
|
|
967
|
+
context: "standalone"
|
|
968
|
+
}) || t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
969
|
+
case "ccccc":
|
|
970
|
+
return t.day(e, {
|
|
971
|
+
width: "narrow",
|
|
972
|
+
context: "standalone"
|
|
973
|
+
});
|
|
974
|
+
case "cccccc":
|
|
975
|
+
return t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
976
|
+
case "cccc":
|
|
977
|
+
default:
|
|
978
|
+
return t.day(e, { width: "wide", context: "standalone" }) || t.day(e, {
|
|
979
|
+
width: "abbreviated",
|
|
980
|
+
context: "standalone"
|
|
981
|
+
}) || t.day(e, { width: "short", context: "standalone" }) || t.day(e, { width: "narrow", context: "standalone" });
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
validate(e, r) {
|
|
985
|
+
return r >= 0 && r <= 6;
|
|
986
|
+
}
|
|
987
|
+
set(e, r, t, o) {
|
|
988
|
+
return e = ie(e, t, o), e.setHours(0, 0, 0, 0), e;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function vt(s, n) {
|
|
992
|
+
const e = K(s), r = rt(e), t = n - r;
|
|
993
|
+
return me(e, t);
|
|
994
|
+
}
|
|
995
|
+
class Tt extends f {
|
|
996
|
+
constructor() {
|
|
997
|
+
super(...arguments);
|
|
998
|
+
i(this, "priority", 90);
|
|
999
|
+
i(this, "incompatibleTokens", [
|
|
1000
|
+
"y",
|
|
1001
|
+
"Y",
|
|
1002
|
+
"u",
|
|
1003
|
+
"q",
|
|
1004
|
+
"Q",
|
|
1005
|
+
"M",
|
|
1006
|
+
"L",
|
|
1007
|
+
"w",
|
|
1008
|
+
"d",
|
|
1009
|
+
"D",
|
|
1010
|
+
"E",
|
|
1011
|
+
"e",
|
|
1012
|
+
"c",
|
|
1013
|
+
"t",
|
|
1014
|
+
"T"
|
|
1015
|
+
]);
|
|
1016
|
+
}
|
|
1017
|
+
parse(e, r, t) {
|
|
1018
|
+
const o = (u) => u === 0 ? 7 : u;
|
|
1019
|
+
switch (r) {
|
|
1020
|
+
case "i":
|
|
1021
|
+
case "ii":
|
|
1022
|
+
return x(r.length, e);
|
|
1023
|
+
case "io":
|
|
1024
|
+
return t.ordinalNumber(e, { unit: "day" });
|
|
1025
|
+
case "iii":
|
|
1026
|
+
return m(
|
|
1027
|
+
t.day(e, {
|
|
1028
|
+
width: "abbreviated",
|
|
1029
|
+
context: "formatting"
|
|
1030
|
+
}) || t.day(e, {
|
|
1031
|
+
width: "short",
|
|
1032
|
+
context: "formatting"
|
|
1033
|
+
}) || t.day(e, {
|
|
1034
|
+
width: "narrow",
|
|
1035
|
+
context: "formatting"
|
|
1036
|
+
}),
|
|
1037
|
+
o
|
|
1038
|
+
);
|
|
1039
|
+
case "iiiii":
|
|
1040
|
+
return m(
|
|
1041
|
+
t.day(e, {
|
|
1042
|
+
width: "narrow",
|
|
1043
|
+
context: "formatting"
|
|
1044
|
+
}),
|
|
1045
|
+
o
|
|
1046
|
+
);
|
|
1047
|
+
case "iiiiii":
|
|
1048
|
+
return m(
|
|
1049
|
+
t.day(e, {
|
|
1050
|
+
width: "short",
|
|
1051
|
+
context: "formatting"
|
|
1052
|
+
}) || t.day(e, {
|
|
1053
|
+
width: "narrow",
|
|
1054
|
+
context: "formatting"
|
|
1055
|
+
}),
|
|
1056
|
+
o
|
|
1057
|
+
);
|
|
1058
|
+
case "iiii":
|
|
1059
|
+
default:
|
|
1060
|
+
return m(
|
|
1061
|
+
t.day(e, {
|
|
1062
|
+
width: "wide",
|
|
1063
|
+
context: "formatting"
|
|
1064
|
+
}) || t.day(e, {
|
|
1065
|
+
width: "abbreviated",
|
|
1066
|
+
context: "formatting"
|
|
1067
|
+
}) || t.day(e, {
|
|
1068
|
+
width: "short",
|
|
1069
|
+
context: "formatting"
|
|
1070
|
+
}) || t.day(e, {
|
|
1071
|
+
width: "narrow",
|
|
1072
|
+
context: "formatting"
|
|
1073
|
+
}),
|
|
1074
|
+
o
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
validate(e, r) {
|
|
1079
|
+
return r >= 1 && r <= 7;
|
|
1080
|
+
}
|
|
1081
|
+
set(e, r, t) {
|
|
1082
|
+
return e = vt(e, t), e.setHours(0, 0, 0, 0), e;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
class Yt extends f {
|
|
1086
|
+
constructor() {
|
|
1087
|
+
super(...arguments);
|
|
1088
|
+
i(this, "priority", 80);
|
|
1089
|
+
i(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
1090
|
+
}
|
|
1091
|
+
parse(e, r, t) {
|
|
1092
|
+
switch (r) {
|
|
1093
|
+
case "a":
|
|
1094
|
+
case "aa":
|
|
1095
|
+
case "aaa":
|
|
1096
|
+
return t.dayPeriod(e, {
|
|
1097
|
+
width: "abbreviated",
|
|
1098
|
+
context: "formatting"
|
|
1099
|
+
}) || t.dayPeriod(e, {
|
|
1100
|
+
width: "narrow",
|
|
1101
|
+
context: "formatting"
|
|
1102
|
+
});
|
|
1103
|
+
case "aaaaa":
|
|
1104
|
+
return t.dayPeriod(e, {
|
|
1105
|
+
width: "narrow",
|
|
1106
|
+
context: "formatting"
|
|
1107
|
+
});
|
|
1108
|
+
case "aaaa":
|
|
1109
|
+
default:
|
|
1110
|
+
return t.dayPeriod(e, {
|
|
1111
|
+
width: "wide",
|
|
1112
|
+
context: "formatting"
|
|
1113
|
+
}) || t.dayPeriod(e, {
|
|
1114
|
+
width: "abbreviated",
|
|
1115
|
+
context: "formatting"
|
|
1116
|
+
}) || t.dayPeriod(e, {
|
|
1117
|
+
width: "narrow",
|
|
1118
|
+
context: "formatting"
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
set(e, r, t) {
|
|
1123
|
+
return e.setHours(oe(t), 0, 0, 0), e;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
class Et extends f {
|
|
1127
|
+
constructor() {
|
|
1128
|
+
super(...arguments);
|
|
1129
|
+
i(this, "priority", 80);
|
|
1130
|
+
i(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
1131
|
+
}
|
|
1132
|
+
parse(e, r, t) {
|
|
1133
|
+
switch (r) {
|
|
1134
|
+
case "b":
|
|
1135
|
+
case "bb":
|
|
1136
|
+
case "bbb":
|
|
1137
|
+
return t.dayPeriod(e, {
|
|
1138
|
+
width: "abbreviated",
|
|
1139
|
+
context: "formatting"
|
|
1140
|
+
}) || t.dayPeriod(e, {
|
|
1141
|
+
width: "narrow",
|
|
1142
|
+
context: "formatting"
|
|
1143
|
+
});
|
|
1144
|
+
case "bbbbb":
|
|
1145
|
+
return t.dayPeriod(e, {
|
|
1146
|
+
width: "narrow",
|
|
1147
|
+
context: "formatting"
|
|
1148
|
+
});
|
|
1149
|
+
case "bbbb":
|
|
1150
|
+
default:
|
|
1151
|
+
return t.dayPeriod(e, {
|
|
1152
|
+
width: "wide",
|
|
1153
|
+
context: "formatting"
|
|
1154
|
+
}) || t.dayPeriod(e, {
|
|
1155
|
+
width: "abbreviated",
|
|
1156
|
+
context: "formatting"
|
|
1157
|
+
}) || t.dayPeriod(e, {
|
|
1158
|
+
width: "narrow",
|
|
1159
|
+
context: "formatting"
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
set(e, r, t) {
|
|
1164
|
+
return e.setHours(oe(t), 0, 0, 0), e;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
class It extends f {
|
|
1168
|
+
constructor() {
|
|
1169
|
+
super(...arguments);
|
|
1170
|
+
i(this, "priority", 80);
|
|
1171
|
+
i(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
1172
|
+
}
|
|
1173
|
+
parse(e, r, t) {
|
|
1174
|
+
switch (r) {
|
|
1175
|
+
case "B":
|
|
1176
|
+
case "BB":
|
|
1177
|
+
case "BBB":
|
|
1178
|
+
return t.dayPeriod(e, {
|
|
1179
|
+
width: "abbreviated",
|
|
1180
|
+
context: "formatting"
|
|
1181
|
+
}) || t.dayPeriod(e, {
|
|
1182
|
+
width: "narrow",
|
|
1183
|
+
context: "formatting"
|
|
1184
|
+
});
|
|
1185
|
+
case "BBBBB":
|
|
1186
|
+
return t.dayPeriod(e, {
|
|
1187
|
+
width: "narrow",
|
|
1188
|
+
context: "formatting"
|
|
1189
|
+
});
|
|
1190
|
+
case "BBBB":
|
|
1191
|
+
default:
|
|
1192
|
+
return t.dayPeriod(e, {
|
|
1193
|
+
width: "wide",
|
|
1194
|
+
context: "formatting"
|
|
1195
|
+
}) || t.dayPeriod(e, {
|
|
1196
|
+
width: "abbreviated",
|
|
1197
|
+
context: "formatting"
|
|
1198
|
+
}) || t.dayPeriod(e, {
|
|
1199
|
+
width: "narrow",
|
|
1200
|
+
context: "formatting"
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
set(e, r, t) {
|
|
1205
|
+
return e.setHours(oe(t), 0, 0, 0), e;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
class Ot extends f {
|
|
1209
|
+
constructor() {
|
|
1210
|
+
super(...arguments);
|
|
1211
|
+
i(this, "priority", 70);
|
|
1212
|
+
i(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
1213
|
+
}
|
|
1214
|
+
parse(e, r, t) {
|
|
1215
|
+
switch (r) {
|
|
1216
|
+
case "h":
|
|
1217
|
+
return y(b.hour12h, e);
|
|
1218
|
+
case "ho":
|
|
1219
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
1220
|
+
default:
|
|
1221
|
+
return x(r.length, e);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
validate(e, r) {
|
|
1225
|
+
return r >= 1 && r <= 12;
|
|
1226
|
+
}
|
|
1227
|
+
set(e, r, t) {
|
|
1228
|
+
const o = e.getHours() >= 12;
|
|
1229
|
+
return o && t < 12 ? e.setHours(t + 12, 0, 0, 0) : !o && t === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(t, 0, 0, 0), e;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
class qt extends f {
|
|
1233
|
+
constructor() {
|
|
1234
|
+
super(...arguments);
|
|
1235
|
+
i(this, "priority", 70);
|
|
1236
|
+
i(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
1237
|
+
}
|
|
1238
|
+
parse(e, r, t) {
|
|
1239
|
+
switch (r) {
|
|
1240
|
+
case "H":
|
|
1241
|
+
return y(b.hour23h, e);
|
|
1242
|
+
case "Ho":
|
|
1243
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
1244
|
+
default:
|
|
1245
|
+
return x(r.length, e);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
validate(e, r) {
|
|
1249
|
+
return r >= 0 && r <= 23;
|
|
1250
|
+
}
|
|
1251
|
+
set(e, r, t) {
|
|
1252
|
+
return e.setHours(t, 0, 0, 0), e;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
class Nt extends f {
|
|
1256
|
+
constructor() {
|
|
1257
|
+
super(...arguments);
|
|
1258
|
+
i(this, "priority", 70);
|
|
1259
|
+
i(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
1260
|
+
}
|
|
1261
|
+
parse(e, r, t) {
|
|
1262
|
+
switch (r) {
|
|
1263
|
+
case "K":
|
|
1264
|
+
return y(b.hour11h, e);
|
|
1265
|
+
case "Ko":
|
|
1266
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
1267
|
+
default:
|
|
1268
|
+
return x(r.length, e);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
validate(e, r) {
|
|
1272
|
+
return r >= 0 && r <= 11;
|
|
1273
|
+
}
|
|
1274
|
+
set(e, r, t) {
|
|
1275
|
+
return e.getHours() >= 12 && t < 12 ? e.setHours(t + 12, 0, 0, 0) : e.setHours(t, 0, 0, 0), e;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
class zt extends f {
|
|
1279
|
+
constructor() {
|
|
1280
|
+
super(...arguments);
|
|
1281
|
+
i(this, "priority", 70);
|
|
1282
|
+
i(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
1283
|
+
}
|
|
1284
|
+
parse(e, r, t) {
|
|
1285
|
+
switch (r) {
|
|
1286
|
+
case "k":
|
|
1287
|
+
return y(b.hour24h, e);
|
|
1288
|
+
case "ko":
|
|
1289
|
+
return t.ordinalNumber(e, { unit: "hour" });
|
|
1290
|
+
default:
|
|
1291
|
+
return x(r.length, e);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
validate(e, r) {
|
|
1295
|
+
return r >= 1 && r <= 24;
|
|
1296
|
+
}
|
|
1297
|
+
set(e, r, t) {
|
|
1298
|
+
const o = t <= 24 ? t % 24 : t;
|
|
1299
|
+
return e.setHours(o, 0, 0, 0), e;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
class Lt extends f {
|
|
1303
|
+
constructor() {
|
|
1304
|
+
super(...arguments);
|
|
1305
|
+
i(this, "priority", 60);
|
|
1306
|
+
i(this, "incompatibleTokens", ["t", "T"]);
|
|
1307
|
+
}
|
|
1308
|
+
parse(e, r, t) {
|
|
1309
|
+
switch (r) {
|
|
1310
|
+
case "m":
|
|
1311
|
+
return y(b.minute, e);
|
|
1312
|
+
case "mo":
|
|
1313
|
+
return t.ordinalNumber(e, { unit: "minute" });
|
|
1314
|
+
default:
|
|
1315
|
+
return x(r.length, e);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
validate(e, r) {
|
|
1319
|
+
return r >= 0 && r <= 59;
|
|
1320
|
+
}
|
|
1321
|
+
set(e, r, t) {
|
|
1322
|
+
return e.setMinutes(t, 0, 0), e;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
class Rt extends f {
|
|
1326
|
+
constructor() {
|
|
1327
|
+
super(...arguments);
|
|
1328
|
+
i(this, "priority", 50);
|
|
1329
|
+
i(this, "incompatibleTokens", ["t", "T"]);
|
|
1330
|
+
}
|
|
1331
|
+
parse(e, r, t) {
|
|
1332
|
+
switch (r) {
|
|
1333
|
+
case "s":
|
|
1334
|
+
return y(b.second, e);
|
|
1335
|
+
case "so":
|
|
1336
|
+
return t.ordinalNumber(e, { unit: "second" });
|
|
1337
|
+
default:
|
|
1338
|
+
return x(r.length, e);
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
validate(e, r) {
|
|
1342
|
+
return r >= 0 && r <= 59;
|
|
1343
|
+
}
|
|
1344
|
+
set(e, r, t) {
|
|
1345
|
+
return e.setSeconds(t, 0), e;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
class Qt extends f {
|
|
1349
|
+
constructor() {
|
|
1350
|
+
super(...arguments);
|
|
1351
|
+
i(this, "priority", 30);
|
|
1352
|
+
i(this, "incompatibleTokens", ["t", "T"]);
|
|
1353
|
+
}
|
|
1354
|
+
parse(e, r) {
|
|
1355
|
+
const t = (o) => Math.trunc(o * Math.pow(10, -r.length + 3));
|
|
1356
|
+
return m(x(r.length, e), t);
|
|
1357
|
+
}
|
|
1358
|
+
set(e, r, t) {
|
|
1359
|
+
return e.setMilliseconds(t), e;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
class At extends f {
|
|
1363
|
+
constructor() {
|
|
1364
|
+
super(...arguments);
|
|
1365
|
+
i(this, "priority", 10);
|
|
1366
|
+
i(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
1367
|
+
}
|
|
1368
|
+
parse(e, r) {
|
|
1369
|
+
switch (r) {
|
|
1370
|
+
case "X":
|
|
1371
|
+
return N(
|
|
1372
|
+
q.basicOptionalMinutes,
|
|
1373
|
+
e
|
|
1374
|
+
);
|
|
1375
|
+
case "XX":
|
|
1376
|
+
return N(q.basic, e);
|
|
1377
|
+
case "XXXX":
|
|
1378
|
+
return N(
|
|
1379
|
+
q.basicOptionalSeconds,
|
|
1380
|
+
e
|
|
1381
|
+
);
|
|
1382
|
+
case "XXXXX":
|
|
1383
|
+
return N(
|
|
1384
|
+
q.extendedOptionalSeconds,
|
|
1385
|
+
e
|
|
1386
|
+
);
|
|
1387
|
+
case "XXX":
|
|
1388
|
+
default:
|
|
1389
|
+
return N(q.extended, e);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
set(e, r, t) {
|
|
1393
|
+
return r.timestampIsSet ? e : H(
|
|
1394
|
+
e,
|
|
1395
|
+
e.getTime() - _e(e) - t
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
class Bt extends f {
|
|
1400
|
+
constructor() {
|
|
1401
|
+
super(...arguments);
|
|
1402
|
+
i(this, "priority", 10);
|
|
1403
|
+
i(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
1404
|
+
}
|
|
1405
|
+
parse(e, r) {
|
|
1406
|
+
switch (r) {
|
|
1407
|
+
case "x":
|
|
1408
|
+
return N(
|
|
1409
|
+
q.basicOptionalMinutes,
|
|
1410
|
+
e
|
|
1411
|
+
);
|
|
1412
|
+
case "xx":
|
|
1413
|
+
return N(q.basic, e);
|
|
1414
|
+
case "xxxx":
|
|
1415
|
+
return N(
|
|
1416
|
+
q.basicOptionalSeconds,
|
|
1417
|
+
e
|
|
1418
|
+
);
|
|
1419
|
+
case "xxxxx":
|
|
1420
|
+
return N(
|
|
1421
|
+
q.extendedOptionalSeconds,
|
|
1422
|
+
e
|
|
1423
|
+
);
|
|
1424
|
+
case "xxx":
|
|
1425
|
+
default:
|
|
1426
|
+
return N(q.extended, e);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
set(e, r, t) {
|
|
1430
|
+
return r.timestampIsSet ? e : H(
|
|
1431
|
+
e,
|
|
1432
|
+
e.getTime() - _e(e) - t
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
class Wt extends f {
|
|
1437
|
+
constructor() {
|
|
1438
|
+
super(...arguments);
|
|
1439
|
+
i(this, "priority", 40);
|
|
1440
|
+
i(this, "incompatibleTokens", "*");
|
|
1441
|
+
}
|
|
1442
|
+
parse(e) {
|
|
1443
|
+
return De(e);
|
|
1444
|
+
}
|
|
1445
|
+
set(e, r, t) {
|
|
1446
|
+
return [H(e, t * 1e3), { timestampIsSet: !0 }];
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
class Gt extends f {
|
|
1450
|
+
constructor() {
|
|
1451
|
+
super(...arguments);
|
|
1452
|
+
i(this, "priority", 20);
|
|
1453
|
+
i(this, "incompatibleTokens", "*");
|
|
1454
|
+
}
|
|
1455
|
+
parse(e) {
|
|
1456
|
+
return De(e);
|
|
1457
|
+
}
|
|
1458
|
+
set(e, r, t) {
|
|
1459
|
+
return [H(e, t), { timestampIsSet: !0 }];
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
const $t = {
|
|
1463
|
+
G: new at(),
|
|
1464
|
+
y: new ut(),
|
|
1465
|
+
Y: new ct(),
|
|
1466
|
+
R: new lt(),
|
|
1467
|
+
u: new dt(),
|
|
1468
|
+
Q: new ft(),
|
|
1469
|
+
q: new wt(),
|
|
1470
|
+
M: new pt(),
|
|
1471
|
+
L: new yt(),
|
|
1472
|
+
w: new xt(),
|
|
1473
|
+
I: new mt(),
|
|
1474
|
+
d: new gt(),
|
|
1475
|
+
D: new Dt(),
|
|
1476
|
+
E: new Mt(),
|
|
1477
|
+
e: new Pt(),
|
|
1478
|
+
c: new Ht(),
|
|
1479
|
+
i: new Tt(),
|
|
1480
|
+
a: new Yt(),
|
|
1481
|
+
b: new Et(),
|
|
1482
|
+
B: new It(),
|
|
1483
|
+
h: new Ot(),
|
|
1484
|
+
H: new qt(),
|
|
1485
|
+
K: new Nt(),
|
|
1486
|
+
k: new zt(),
|
|
1487
|
+
m: new Lt(),
|
|
1488
|
+
s: new Rt(),
|
|
1489
|
+
S: new Qt(),
|
|
1490
|
+
X: new At(),
|
|
1491
|
+
x: new Bt(),
|
|
1492
|
+
t: new Wt(),
|
|
1493
|
+
T: new Gt()
|
|
1494
|
+
}, Xt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, jt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Kt = /^'([^]*?)'?$/, Zt = /''/g, Vt = /\S/, Ft = /[a-zA-Z]/;
|
|
1495
|
+
function He(s, n, e, r) {
|
|
1496
|
+
var Z, M, D, J;
|
|
1497
|
+
const t = tt(), o = t.locale ?? Ve, u = t.firstWeekContainsDate ?? ((M = (Z = t.locale) == null ? void 0 : Z.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, p = t.weekStartsOn ?? ((J = (D = t.locale) == null ? void 0 : D.options) == null ? void 0 : J.weekStartsOn) ?? 0;
|
|
1498
|
+
if (n === "")
|
|
1499
|
+
return s === "" ? K(e) : H(e, NaN);
|
|
1500
|
+
const v = {
|
|
1501
|
+
firstWeekContainsDate: u,
|
|
1502
|
+
weekStartsOn: p,
|
|
1503
|
+
locale: o
|
|
1504
|
+
}, _ = [new it()], l = n.match(jt).map((a) => {
|
|
1505
|
+
const w = a[0];
|
|
1506
|
+
if (w in fe) {
|
|
1507
|
+
const h = fe[w];
|
|
1508
|
+
return h(a, o.formatLong);
|
|
1509
|
+
}
|
|
1510
|
+
return a;
|
|
1511
|
+
}).join("").match(Xt), c = [];
|
|
1512
|
+
for (let a of l) {
|
|
1513
|
+
Fe(a) && we(a, n, s), Ue(a) && we(a, n, s);
|
|
1514
|
+
const w = a[0], h = $t[w];
|
|
1515
|
+
if (h) {
|
|
1516
|
+
const { incompatibleTokens: O } = h;
|
|
1517
|
+
if (Array.isArray(O)) {
|
|
1518
|
+
const C = c.find(
|
|
1519
|
+
(B) => O.includes(B.token) || B.token === w
|
|
1520
|
+
);
|
|
1521
|
+
if (C)
|
|
1522
|
+
throw new RangeError(
|
|
1523
|
+
`The format string mustn't contain \`${C.fullToken}\` and \`${a}\` at the same time`
|
|
1524
|
+
);
|
|
1525
|
+
} else if (h.incompatibleTokens === "*" && c.length > 0)
|
|
1526
|
+
throw new RangeError(
|
|
1527
|
+
`The format string mustn't contain \`${a}\` and any other token at the same time`
|
|
1528
|
+
);
|
|
1529
|
+
c.push({ token: w, fullToken: a });
|
|
1530
|
+
const A = h.run(
|
|
1531
|
+
s,
|
|
1532
|
+
a,
|
|
1533
|
+
o.match,
|
|
1534
|
+
v
|
|
1535
|
+
);
|
|
1536
|
+
if (!A)
|
|
1537
|
+
return H(e, NaN);
|
|
1538
|
+
_.push(A.setter), s = A.rest;
|
|
1539
|
+
} else {
|
|
1540
|
+
if (w.match(Ft))
|
|
1541
|
+
throw new RangeError(
|
|
1542
|
+
"Format string contains an unescaped latin alphabet character `" + w + "`"
|
|
1543
|
+
);
|
|
1544
|
+
if (a === "''" ? a = "'" : w === "'" && (a = Ut(a)), s.indexOf(a) === 0)
|
|
1545
|
+
s = s.slice(a.length);
|
|
1546
|
+
else
|
|
1547
|
+
return H(e, NaN);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
if (s.length > 0 && Vt.test(s))
|
|
1551
|
+
return H(e, NaN);
|
|
1552
|
+
const Q = _.map((a) => a.priority).sort((a, w) => w - a).filter((a, w, h) => h.indexOf(a) === w).map(
|
|
1553
|
+
(a) => _.filter((w) => w.priority === a).sort((w, h) => h.subPriority - w.subPriority)
|
|
1554
|
+
).map((a) => a[0]);
|
|
1555
|
+
let Y = K(e);
|
|
1556
|
+
if (isNaN(Y.getTime()))
|
|
1557
|
+
return H(e, NaN);
|
|
1558
|
+
const X = {};
|
|
1559
|
+
for (const a of Q) {
|
|
1560
|
+
if (!a.validate(Y, v))
|
|
1561
|
+
return H(e, NaN);
|
|
1562
|
+
const w = a.set(Y, X, v);
|
|
1563
|
+
Array.isArray(w) ? (Y = w[0], Object.assign(X, w[1])) : Y = w;
|
|
1564
|
+
}
|
|
1565
|
+
return H(e, Y);
|
|
1566
|
+
}
|
|
1567
|
+
function Ut(s) {
|
|
1568
|
+
return s.match(Kt)[1].replace(Zt, "'");
|
|
1569
|
+
}
|
|
1570
|
+
const R = (s) => (s ?? "").replace(/\D/g, ""), Jt = (s) => s === "HH:mm:ss" ? 6 : 4, ae = (s) => s === "HH:mm:ss" ? [
|
|
1571
|
+
{ start: 0, end: 2, max: 23 },
|
|
1572
|
+
// HH
|
|
1573
|
+
{ start: 3, end: 5, max: 59 },
|
|
1574
|
+
// mm
|
|
1575
|
+
{ start: 6, end: 8, max: 59 }
|
|
1576
|
+
// ss
|
|
1577
|
+
] : [
|
|
1578
|
+
{ start: 0, end: 2, max: 23 },
|
|
1579
|
+
// HH
|
|
1580
|
+
{ start: 3, end: 5, max: 59 }
|
|
1581
|
+
// mm
|
|
1582
|
+
], Ct = (s, n) => {
|
|
1583
|
+
const e = Number(s), r = Number.isFinite(e) ? Math.max(0, Math.min(n, e)) : 0;
|
|
1584
|
+
return String(r).padStart(2, "0");
|
|
1585
|
+
}, St = (s) => s === "HH:mm:ss" ? "--:--:--" : "--:--", G = (s, n) => {
|
|
1586
|
+
const e = R(s), r = Jt(n), t = e.slice(0, r).padEnd(r, "0"), o = t.slice(0, 2), u = t.slice(2, 4), p = n === "HH:mm:ss" ? t.slice(4, 6) : "";
|
|
1587
|
+
return n === "HH:mm:ss" ? `${o}:${u}:${p}` : `${o}:${u}`;
|
|
1588
|
+
}, pe = (s, n) => n === "HH:mm:ss" ? s <= 2 ? 0 : s <= 5 ? 1 : 2 : s <= 2 ? 0 : 1, S = (s, n, e, r) => {
|
|
1589
|
+
const t = ae(e), o = t[Math.max(0, Math.min(n, t.length - 1))], u = Ct(r, o.max), p = s.split("");
|
|
1590
|
+
return p[o.start] = u[0], p[o.start + 1] = u[1], p.join("");
|
|
1591
|
+
}, $ = (s, n, e) => {
|
|
1592
|
+
const r = ae(e), t = r[Math.max(0, Math.min(n, r.length - 1))];
|
|
1593
|
+
s.setSelectionRange(t.start, t.end);
|
|
1594
|
+
}, ye = (s, n) => {
|
|
1595
|
+
const e = He(s, n, /* @__PURE__ */ new Date(0));
|
|
1596
|
+
return ke(e) ? Je(e, n) : null;
|
|
1597
|
+
}, he = (s, n) => {
|
|
1598
|
+
const e = He(s, n, /* @__PURE__ */ new Date(0));
|
|
1599
|
+
return ke(e) ? e.getHours() * 36e5 + e.getMinutes() * 6e4 + e.getSeconds() * 1e3 : null;
|
|
1600
|
+
}, nr = ({
|
|
1601
|
+
sizeStyle: s = "m",
|
|
1602
|
+
labelUnit: n,
|
|
1603
|
+
status: e = "default",
|
|
1604
|
+
childrenLeft: r,
|
|
1605
|
+
childrenRight: t,
|
|
1606
|
+
round: o,
|
|
26
1607
|
disabled: u,
|
|
27
|
-
defaultValue:
|
|
28
|
-
fullWidth:
|
|
29
|
-
|
|
1608
|
+
defaultValue: p,
|
|
1609
|
+
fullWidth: v = !1,
|
|
1610
|
+
mode: _ = "default",
|
|
1611
|
+
timeFormat: l = "HH:mm",
|
|
1612
|
+
onTimeChange: c,
|
|
1613
|
+
placeholder: Q,
|
|
1614
|
+
...Y
|
|
30
1615
|
}) => {
|
|
31
|
-
const [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1616
|
+
const [X, Z] = le(!1), [M, D] = le(p || ""), J = U(null), a = U(null), w = U(0), h = U(""), O = U(!1);
|
|
1617
|
+
We(() => {
|
|
1618
|
+
D(p || ""), O.current = R(p || "").length > 0;
|
|
1619
|
+
}, [p]);
|
|
1620
|
+
const A = _ === "time" && R(M || "").length === 0, C = _ === "time" && A, B = (d) => {
|
|
1621
|
+
if (R(d).length === 0) {
|
|
1622
|
+
c == null || c(null);
|
|
1623
|
+
return;
|
|
1624
|
+
}
|
|
1625
|
+
const k = ye(d, l);
|
|
1626
|
+
if (!k) {
|
|
1627
|
+
c == null || c(null);
|
|
1628
|
+
return;
|
|
1629
|
+
}
|
|
1630
|
+
c == null || c(he(k, l));
|
|
1631
|
+
}, ve = () => {
|
|
1632
|
+
Z(!0), _ === "time" && requestAnimationFrame(() => {
|
|
1633
|
+
a.current && (w.current = 0, h.current = "", $(a.current, 0, l));
|
|
1634
|
+
});
|
|
1635
|
+
}, Te = () => {
|
|
1636
|
+
if (Z(!1), _ !== "time") return;
|
|
1637
|
+
if (!O.current && R(p || "").length === 0) {
|
|
1638
|
+
D(""), c == null || c(null), h.current = "";
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (R(M || "").length === 0) {
|
|
1642
|
+
D(""), c == null || c(null), h.current = "";
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1645
|
+
const d = G(M || "", l), k = ye(d, l);
|
|
1646
|
+
if (!k) {
|
|
1647
|
+
D(""), c == null || c(null), h.current = "";
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
D(k), c == null || c(he(k, l)), h.current = "";
|
|
1651
|
+
}, Ye = (d) => {
|
|
1652
|
+
if (_ !== "time") {
|
|
1653
|
+
D(d.target.value);
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
const k = R(d.target.value);
|
|
1657
|
+
if (k.length === 0) {
|
|
1658
|
+
D(""), c == null || c(null);
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
O.current = !0;
|
|
1662
|
+
const E = G(k, l);
|
|
1663
|
+
D(E), B(E), requestAnimationFrame(() => {
|
|
1664
|
+
a.current && $(a.current, w.current, l);
|
|
1665
|
+
});
|
|
1666
|
+
}, Ee = (d) => {
|
|
1667
|
+
if (_ !== "time") return;
|
|
1668
|
+
const k = d.currentTarget, E = k.selectionStart ?? 0, g = pe(E === 2 || E === 5 ? E + 1 : E, l);
|
|
1669
|
+
w.current = g, h.current = "", $(k, g, l);
|
|
1670
|
+
}, Ie = (d) => {
|
|
1671
|
+
if (_ !== "time" || !a.current) return;
|
|
1672
|
+
const k = a.current, E = ae(l), g = w.current ?? 0, te = (I) => {
|
|
1673
|
+
const T = Math.max(0, Math.min(I, E.length - 1));
|
|
1674
|
+
w.current = T, h.current = "", requestAnimationFrame(() => $(k, T, l));
|
|
1675
|
+
};
|
|
1676
|
+
if (d.key !== "Tab") {
|
|
1677
|
+
if (d.key === "ArrowLeft") {
|
|
1678
|
+
d.preventDefault(), te(g - 1);
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
if (d.key === "ArrowRight" || d.key === ":") {
|
|
1682
|
+
d.preventDefault(), te(g + 1);
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
if (A && (d.key === "ArrowUp" || d.key === "ArrowDown")) {
|
|
1686
|
+
d.preventDefault(), O.current = !0;
|
|
1687
|
+
const I = G("", l), T = d.key === "ArrowUp" ? 1 : -1, z = E[g], L = I.slice(z.start, z.end), j = z.max, W = Number(L), re = ((Number.isFinite(W) ? W + T : 0) + (j + 1)) % (j + 1), se = String(re).padStart(2, "0"), V = S(I, g, l, se);
|
|
1688
|
+
D(V), B(V), requestAnimationFrame(() => $(k, g, l));
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
if (d.key === "ArrowUp" || d.key === "ArrowDown") {
|
|
1692
|
+
d.preventDefault(), O.current = !0;
|
|
1693
|
+
const I = d.key === "ArrowUp" ? 1 : -1, T = G(M || "", l), z = E[g], L = T.slice(z.start, z.end), j = z.max, W = Number(L), re = ((Number.isFinite(W) ? W + I : 0) + (j + 1)) % (j + 1), se = String(re).padStart(2, "0"), V = S(T, g, l, se);
|
|
1694
|
+
D(V), B(V), requestAnimationFrame(() => $(k, g, l));
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
if (d.key === "Backspace" || d.key === "Delete") {
|
|
1698
|
+
if (d.preventDefault(), O.current = !0, R(M || "").length === 0) {
|
|
1699
|
+
D(""), c == null || c(null), h.current = "";
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const I = G(M || "", l), T = S(I, g, l, "00");
|
|
1703
|
+
D(T), B(T), h.current = "", requestAnimationFrame(() => $(k, g, l));
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
if (/^\d$/.test(d.key)) {
|
|
1707
|
+
d.preventDefault(), O.current = !0;
|
|
1708
|
+
const I = R(M || "").length === 0 ? G("", l) : G(M || "", l), T = E[g], z = I.slice(T.start, T.end), L = (h.current + d.key).slice(0, 2);
|
|
1709
|
+
h.current = L;
|
|
1710
|
+
const j = L.length === 1 ? `${L}${z[1] ?? "0"}` : L, W = S(I, g, l, j);
|
|
1711
|
+
D(W), B(W), L.length === 2 ? te(g + 1) : requestAnimationFrame(() => $(k, g, l));
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
d.key.length === 1 && d.preventDefault();
|
|
1715
|
+
}
|
|
1716
|
+
}, Oe = () => {
|
|
1717
|
+
a.current && a.current.focus();
|
|
1718
|
+
}, qe = [
|
|
1719
|
+
P["input-style"],
|
|
1720
|
+
P[`input-style-size-${s}`],
|
|
1721
|
+
o && P["input-style-radius"],
|
|
1722
|
+
P.flexHorizontalBetween,
|
|
1723
|
+
v && P.fullWidth,
|
|
1724
|
+
_ === "time" && P["input-time"],
|
|
1725
|
+
C && P["input-time-placeholder"]
|
|
1726
|
+
].filter(Boolean).join(" "), Ne = [
|
|
1727
|
+
X && P["input-style-focused"],
|
|
1728
|
+
u && P["input-style-disabled"],
|
|
1729
|
+
e === "secondary" && P["input-style-secondary"],
|
|
1730
|
+
e === "ghost" && P["input-style-ghost"]
|
|
1731
|
+
].filter(Boolean).join(" "), ze = () => {
|
|
1732
|
+
switch (e) {
|
|
1733
|
+
case "error":
|
|
1734
|
+
return P["input-style-error"];
|
|
1735
|
+
default:
|
|
1736
|
+
return Ne;
|
|
1737
|
+
}
|
|
1738
|
+
}, Le = de(() => {
|
|
1739
|
+
if (Q !== void 0) return Q;
|
|
1740
|
+
}, [Q]), Re = de(() => _ !== "time" ? M : A ? St(l) : G(M || "", l), [M, _, l, A]);
|
|
1741
|
+
return /* @__PURE__ */ ue(
|
|
48
1742
|
"div",
|
|
49
1743
|
{
|
|
50
|
-
ref:
|
|
51
|
-
className: `${
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
default:
|
|
56
|
-
return F;
|
|
57
|
-
}
|
|
58
|
-
})()}`,
|
|
59
|
-
onFocus: C,
|
|
60
|
-
onBlur: H,
|
|
61
|
-
onClick: v,
|
|
1744
|
+
ref: J,
|
|
1745
|
+
className: `${qe} ${ze()}`,
|
|
1746
|
+
onFocus: ve,
|
|
1747
|
+
onBlur: Te,
|
|
1748
|
+
onClick: Oe,
|
|
62
1749
|
children: [
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */
|
|
1750
|
+
r && /* @__PURE__ */ F(ce, { children: r }),
|
|
1751
|
+
/* @__PURE__ */ F("div", { className: P["input-container"], children: /* @__PURE__ */ F(
|
|
65
1752
|
"input",
|
|
66
1753
|
{
|
|
67
1754
|
autoCorrect: "off",
|
|
68
1755
|
disabled: u,
|
|
69
|
-
value:
|
|
70
|
-
onChange:
|
|
71
|
-
|
|
72
|
-
|
|
1756
|
+
value: Re,
|
|
1757
|
+
onChange: Ye,
|
|
1758
|
+
onClick: Ee,
|
|
1759
|
+
onKeyDown: Ie,
|
|
1760
|
+
ref: a,
|
|
1761
|
+
inputMode: _ === "time" ? "numeric" : Y.inputMode,
|
|
1762
|
+
placeholder: Le,
|
|
1763
|
+
...Y
|
|
73
1764
|
}
|
|
74
1765
|
) }),
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
1766
|
+
/* @__PURE__ */ ue(ce, { children: [
|
|
1767
|
+
n && /* @__PURE__ */ F("div", { children: n }),
|
|
1768
|
+
t && /* @__PURE__ */ F("span", { className: P.flexHorizontal, children: t })
|
|
78
1769
|
] })
|
|
79
1770
|
]
|
|
80
1771
|
}
|
|
81
1772
|
);
|
|
82
1773
|
};
|
|
83
1774
|
export {
|
|
84
|
-
|
|
1775
|
+
nr as Input
|
|
85
1776
|
};
|