@purpurds/date-field 8.12.1 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +1 -1
- package/dist/date-field.cjs.js +1 -1
- package/dist/date-field.cjs.js.map +1 -1
- package/dist/date-field.es.js +1059 -1067
- package/dist/date-field.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +10 -10
package/dist/date-field.es.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as j, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import * as T from "react";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as ce, useId as vt, useRef as Ze, useState as _e, useEffect as Pt, useLayoutEffect as Ot } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const
|
|
5
|
+
const Mt = {
|
|
6
6
|
LG: "lg"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function Dt(n) {
|
|
9
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
10
10
|
}
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
var we = { exports: {} }, ye;
|
|
12
|
+
function Tt() {
|
|
13
|
+
return ye || (ye = 1, (function(n) {
|
|
14
14
|
(function() {
|
|
15
15
|
var e = {}.hasOwnProperty;
|
|
16
16
|
function t() {
|
|
17
17
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
18
18
|
var s = arguments[o];
|
|
19
|
-
s && (a = i(a,
|
|
19
|
+
s && (a = i(a, r.call(this, s)));
|
|
20
20
|
}
|
|
21
21
|
return a;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function r(a) {
|
|
24
24
|
if (typeof a == "string" || typeof a == "number")
|
|
25
25
|
return this && this[a] || a;
|
|
26
26
|
if (typeof a != "object")
|
|
@@ -37,60 +37,60 @@ function Nt() {
|
|
|
37
37
|
function i(a, o) {
|
|
38
38
|
return o ? a ? a + " " + o : a + o : a;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
41
41
|
})();
|
|
42
|
-
})(
|
|
42
|
+
})(we)), we.exports;
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
const
|
|
44
|
+
var kt = Tt();
|
|
45
|
+
const Nt = /* @__PURE__ */ Dt(kt), Yt = "_rotate_12t9p_1", Et = "_dash_12t9p_1", qt = {
|
|
46
46
|
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
47
|
-
rotate:
|
|
47
|
+
rotate: Yt,
|
|
48
48
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
49
49
|
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
50
50
|
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
51
51
|
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
52
52
|
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
53
53
|
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
54
|
-
dash:
|
|
54
|
+
dash: Et,
|
|
55
55
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
56
56
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
57
|
-
},
|
|
57
|
+
}, ge = Nt.bind(qt), G = "purpur-spinner", Wt = {
|
|
58
58
|
SM: "sm"
|
|
59
|
-
},
|
|
60
|
-
disabled:
|
|
59
|
+
}, Je = ({
|
|
60
|
+
disabled: n = !1,
|
|
61
61
|
negative: e = !1,
|
|
62
|
-
size: t =
|
|
63
|
-
className:
|
|
62
|
+
size: t = Wt.SM,
|
|
63
|
+
className: r,
|
|
64
64
|
...i
|
|
65
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
65
|
+
}) => /* @__PURE__ */ d("div", { className: ge(G, `${G}--${t}`, r), ...i, children: /* @__PURE__ */ d("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ d(
|
|
66
66
|
"circle",
|
|
67
67
|
{
|
|
68
|
-
className:
|
|
69
|
-
[`${
|
|
70
|
-
[`${
|
|
68
|
+
className: ge(`${G}__circle`, {
|
|
69
|
+
[`${G}__circle--disabled`]: n,
|
|
70
|
+
[`${G}__circle--negative`]: e
|
|
71
71
|
}),
|
|
72
72
|
cx: "25",
|
|
73
73
|
cy: "25",
|
|
74
74
|
r: "20"
|
|
75
75
|
}
|
|
76
76
|
) }) });
|
|
77
|
-
|
|
78
|
-
function
|
|
79
|
-
return
|
|
77
|
+
Je.displayName = "Spinner";
|
|
78
|
+
function $t(n) {
|
|
79
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
80
80
|
}
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
-
return
|
|
81
|
+
var be = { exports: {} }, xe;
|
|
82
|
+
function Ct() {
|
|
83
|
+
return xe || (xe = 1, (function(n) {
|
|
84
84
|
(function() {
|
|
85
85
|
var e = {}.hasOwnProperty;
|
|
86
86
|
function t() {
|
|
87
87
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
88
88
|
var s = arguments[o];
|
|
89
|
-
s && (a = i(a,
|
|
89
|
+
s && (a = i(a, r.call(this, s)));
|
|
90
90
|
}
|
|
91
91
|
return a;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function r(a) {
|
|
94
94
|
if (typeof a == "string" || typeof a == "number")
|
|
95
95
|
return this && this[a] || a;
|
|
96
96
|
if (typeof a != "object")
|
|
@@ -107,12 +107,12 @@ function Ht() {
|
|
|
107
107
|
function i(a, o) {
|
|
108
108
|
return o ? a ? a + " " + o : a + o : a;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
111
111
|
})();
|
|
112
|
-
})(
|
|
112
|
+
})(be)), be.exports;
|
|
113
113
|
}
|
|
114
|
-
var
|
|
115
|
-
const
|
|
114
|
+
var jt = Ct();
|
|
115
|
+
const Ht = /* @__PURE__ */ $t(jt), Lt = {
|
|
116
116
|
"purpur-button": "_purpur-button_10jh0_1",
|
|
117
117
|
"purpur-button--xs": "_purpur-button--xs_10jh0_22",
|
|
118
118
|
"purpur-button--icon-only": "_purpur-button--icon-only_10jh0_25",
|
|
@@ -135,12 +135,12 @@ const It = /* @__PURE__ */ Ct(Lt), Ft = {
|
|
|
135
135
|
"purpur-button--text-negative": "_purpur-button--text-negative_10jh0_185",
|
|
136
136
|
"purpur-button--text": "_purpur-button--text_10jh0_185",
|
|
137
137
|
"purpur-button__spinner": "_purpur-button__spinner_10jh0_235"
|
|
138
|
-
},
|
|
138
|
+
}, ve = Ht.bind(Lt), $ = "purpur-button", Ke = ce(
|
|
139
139
|
({
|
|
140
|
-
children:
|
|
140
|
+
children: n,
|
|
141
141
|
className: e,
|
|
142
142
|
disabled: t = !1,
|
|
143
|
-
fullWidth:
|
|
143
|
+
fullWidth: r = !1,
|
|
144
144
|
iconOnly: i,
|
|
145
145
|
loading: a = !1,
|
|
146
146
|
negative: o = !1,
|
|
@@ -148,69 +148,69 @@ const It = /* @__PURE__ */ Ct(Lt), Ft = {
|
|
|
148
148
|
size: h = "md",
|
|
149
149
|
variant: c,
|
|
150
150
|
type: m = "button",
|
|
151
|
-
...
|
|
151
|
+
...f
|
|
152
152
|
}, N) => {
|
|
153
153
|
if (i && c === "destructive")
|
|
154
154
|
return null;
|
|
155
|
-
const L =
|
|
155
|
+
const L = ve(
|
|
156
156
|
[
|
|
157
|
-
|
|
158
|
-
`${
|
|
159
|
-
`${
|
|
157
|
+
$,
|
|
158
|
+
`${$}--${o ? `${c}-negative` : c}`,
|
|
159
|
+
`${$}--${h}`
|
|
160
160
|
],
|
|
161
161
|
{
|
|
162
|
-
[`${
|
|
163
|
-
[`${
|
|
164
|
-
[`${
|
|
165
|
-
[`${
|
|
162
|
+
[`${$}--icon-only`]: i,
|
|
163
|
+
[`${$}--negative`]: o,
|
|
164
|
+
[`${$}--full-width`]: r,
|
|
165
|
+
[`${$}--disabled`]: t || a
|
|
166
166
|
},
|
|
167
167
|
e
|
|
168
168
|
), P = (u) => {
|
|
169
169
|
t || a ? u.preventDefault() : s && s(u);
|
|
170
|
-
},
|
|
171
|
-
return /* @__PURE__ */
|
|
170
|
+
}, w = !!f["aria-disabled"] || t || a;
|
|
171
|
+
return /* @__PURE__ */ j(
|
|
172
172
|
"button",
|
|
173
173
|
{
|
|
174
174
|
className: L,
|
|
175
175
|
type: m,
|
|
176
176
|
ref: N,
|
|
177
|
-
"aria-disabled":
|
|
177
|
+
"aria-disabled": w,
|
|
178
178
|
onClick: P,
|
|
179
|
-
...
|
|
179
|
+
...f,
|
|
180
180
|
children: [
|
|
181
181
|
a && /* @__PURE__ */ d(
|
|
182
|
-
|
|
182
|
+
Je,
|
|
183
183
|
{
|
|
184
|
-
size: h ===
|
|
184
|
+
size: h === Mt.LG ? "xs" : "xxs",
|
|
185
185
|
negative: o,
|
|
186
|
-
disabled:
|
|
187
|
-
className:
|
|
186
|
+
disabled: w,
|
|
187
|
+
className: ve(`${$}__spinner`)
|
|
188
188
|
}
|
|
189
189
|
),
|
|
190
190
|
" ",
|
|
191
|
-
|
|
191
|
+
n
|
|
192
192
|
]
|
|
193
193
|
}
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
);
|
|
197
|
-
|
|
198
|
-
function
|
|
199
|
-
return
|
|
197
|
+
Ke.displayName = "Button";
|
|
198
|
+
function It(n) {
|
|
199
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
return
|
|
201
|
+
var Pe = { exports: {} }, Oe;
|
|
202
|
+
function Ft() {
|
|
203
|
+
return Oe || (Oe = 1, (function(n) {
|
|
204
204
|
(function() {
|
|
205
205
|
var e = {}.hasOwnProperty;
|
|
206
206
|
function t() {
|
|
207
207
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
208
208
|
var s = arguments[o];
|
|
209
|
-
s && (a = i(a,
|
|
209
|
+
s && (a = i(a, r.call(this, s)));
|
|
210
210
|
}
|
|
211
211
|
return a;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function r(a) {
|
|
214
214
|
if (typeof a == "string" || typeof a == "number")
|
|
215
215
|
return this && this[a] || a;
|
|
216
216
|
if (typeof a != "object")
|
|
@@ -227,12 +227,12 @@ function At() {
|
|
|
227
227
|
function i(a, o) {
|
|
228
228
|
return o ? a ? a + " " + o : a + o : a;
|
|
229
229
|
}
|
|
230
|
-
|
|
230
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
231
231
|
})();
|
|
232
|
-
})(
|
|
232
|
+
})(Pe)), Pe.exports;
|
|
233
233
|
}
|
|
234
|
-
var
|
|
235
|
-
const
|
|
234
|
+
var Rt = Ft();
|
|
235
|
+
const At = /* @__PURE__ */ It(Rt), Qt = {
|
|
236
236
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
237
237
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
238
238
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -240,44 +240,44 @@ const Bt = /* @__PURE__ */ Rt(Qt), St = {
|
|
|
240
240
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
241
241
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
242
242
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
243
|
-
},
|
|
243
|
+
}, Bt = At.bind(Qt), Me = "purpur-icon", St = "md", Gt = (n) => n.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}="${e.value}"`).join(" "), Xt = ({ content: n = "", title: e } = {}) => {
|
|
244
244
|
const t = [
|
|
245
245
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
246
246
|
{ name: "fill", value: "currentColor" },
|
|
247
247
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
248
248
|
e ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
249
|
-
],
|
|
250
|
-
return `<svg ${
|
|
251
|
-
},
|
|
252
|
-
const a =
|
|
253
|
-
content:
|
|
249
|
+
], r = e ? `<title>${e}</title>` : "";
|
|
250
|
+
return `<svg ${Gt(t)}>${r}${n}</svg>`;
|
|
251
|
+
}, Vt = (n) => n.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Ue = ({ svg: n, allyTitle: e, className: t, size: r = St, ...i }) => {
|
|
252
|
+
const a = Xt({
|
|
253
|
+
content: Vt(n.svg),
|
|
254
254
|
title: e
|
|
255
|
-
}), o =
|
|
255
|
+
}), o = Bt(Me, `${Me}--${r}`, t);
|
|
256
256
|
return /* @__PURE__ */ d("span", { className: o, dangerouslySetInnerHTML: { __html: a }, ...i });
|
|
257
257
|
};
|
|
258
|
-
|
|
259
|
-
const
|
|
258
|
+
Ue.displayName = "Icon";
|
|
259
|
+
const zt = {
|
|
260
260
|
name: "error-filled",
|
|
261
261
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
|
|
262
262
|
keywords: ["error-filled"],
|
|
263
263
|
category: "status"
|
|
264
264
|
};
|
|
265
|
-
function
|
|
266
|
-
return
|
|
265
|
+
function Zt(n) {
|
|
266
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
267
267
|
}
|
|
268
|
-
var
|
|
269
|
-
function
|
|
270
|
-
return
|
|
268
|
+
var De = { exports: {} }, Te;
|
|
269
|
+
function Jt() {
|
|
270
|
+
return Te || (Te = 1, (function(n) {
|
|
271
271
|
(function() {
|
|
272
272
|
var e = {}.hasOwnProperty;
|
|
273
273
|
function t() {
|
|
274
274
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
275
275
|
var s = arguments[o];
|
|
276
|
-
s && (a = i(a,
|
|
276
|
+
s && (a = i(a, r.call(this, s)));
|
|
277
277
|
}
|
|
278
278
|
return a;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function r(a) {
|
|
281
281
|
if (typeof a == "string" || typeof a == "number")
|
|
282
282
|
return this && this[a] || a;
|
|
283
283
|
if (typeof a != "object")
|
|
@@ -294,52 +294,52 @@ function Ut() {
|
|
|
294
294
|
function i(a, o) {
|
|
295
295
|
return o ? a ? a + " " + o : a + o : a;
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
298
298
|
})();
|
|
299
|
-
})(
|
|
299
|
+
})(De)), De.exports;
|
|
300
300
|
}
|
|
301
|
-
var
|
|
302
|
-
const
|
|
301
|
+
var Kt = Jt();
|
|
302
|
+
const Ut = /* @__PURE__ */ Zt(Kt), er = {
|
|
303
303
|
"purpur-field-error-text": "_purpur-field-error-text_u1cy2_1",
|
|
304
304
|
"purpur-field-error-text--negative": "_purpur-field-error-text--negative_u1cy2_11",
|
|
305
305
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_u1cy2_14"
|
|
306
|
-
},
|
|
307
|
-
children:
|
|
306
|
+
}, ke = Ut.bind(er), U = "purpur-field-error-text", tr = ({
|
|
307
|
+
children: n,
|
|
308
308
|
className: e,
|
|
309
309
|
negative: t = !1,
|
|
310
|
-
["aria-relevant"]:
|
|
310
|
+
["aria-relevant"]: r = "additions text",
|
|
311
311
|
...i
|
|
312
|
-
}) => /* @__PURE__ */
|
|
312
|
+
}) => /* @__PURE__ */ j(
|
|
313
313
|
"div",
|
|
314
314
|
{
|
|
315
|
-
className:
|
|
316
|
-
[`${
|
|
315
|
+
className: ke(e, U, {
|
|
316
|
+
[`${U}--negative`]: t
|
|
317
317
|
}),
|
|
318
318
|
"aria-live": "assertive",
|
|
319
|
-
"aria-relevant":
|
|
319
|
+
"aria-relevant": r,
|
|
320
320
|
...i,
|
|
321
321
|
children: [
|
|
322
|
-
/* @__PURE__ */ d(
|
|
323
|
-
|
|
322
|
+
/* @__PURE__ */ d(Ue, { svg: zt, size: "xs", className: ke(`${U}__icon`) }),
|
|
323
|
+
n
|
|
324
324
|
]
|
|
325
325
|
}
|
|
326
326
|
);
|
|
327
|
-
function
|
|
328
|
-
return
|
|
327
|
+
function rr(n) {
|
|
328
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
329
329
|
}
|
|
330
|
-
var
|
|
331
|
-
function
|
|
332
|
-
return
|
|
330
|
+
var Ne = { exports: {} }, Ye;
|
|
331
|
+
function nr() {
|
|
332
|
+
return Ye || (Ye = 1, (function(n) {
|
|
333
333
|
(function() {
|
|
334
334
|
var e = {}.hasOwnProperty;
|
|
335
335
|
function t() {
|
|
336
336
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
337
337
|
var s = arguments[o];
|
|
338
|
-
s && (a = i(a,
|
|
338
|
+
s && (a = i(a, r.call(this, s)));
|
|
339
339
|
}
|
|
340
340
|
return a;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function r(a) {
|
|
343
343
|
if (typeof a == "string" || typeof a == "number")
|
|
344
344
|
return this && this[a] || a;
|
|
345
345
|
if (typeof a != "object")
|
|
@@ -356,45 +356,45 @@ function ir() {
|
|
|
356
356
|
function i(a, o) {
|
|
357
357
|
return o ? a ? a + " " + o : a + o : a;
|
|
358
358
|
}
|
|
359
|
-
|
|
359
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
360
360
|
})();
|
|
361
|
-
})(
|
|
361
|
+
})(Ne)), Ne.exports;
|
|
362
362
|
}
|
|
363
|
-
var
|
|
364
|
-
const
|
|
363
|
+
var ar = nr();
|
|
364
|
+
const ir = /* @__PURE__ */ rr(ar), or = {
|
|
365
365
|
"purpur-field-helper-text": "_purpur-field-helper-text_11nsh_1",
|
|
366
366
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_11nsh_9",
|
|
367
367
|
"purpur-field-helper-text--negative": "_purpur-field-helper-text--negative_11nsh_12"
|
|
368
|
-
},
|
|
369
|
-
children:
|
|
368
|
+
}, sr = ir.bind(or), ee = "purpur-field-helper-text", ur = ({
|
|
369
|
+
children: n,
|
|
370
370
|
className: e,
|
|
371
371
|
disabled: t,
|
|
372
|
-
id:
|
|
372
|
+
id: r,
|
|
373
373
|
negative: i,
|
|
374
374
|
...a
|
|
375
375
|
}) => {
|
|
376
|
-
const o =
|
|
377
|
-
[`${
|
|
378
|
-
[`${
|
|
376
|
+
const o = sr(e, ee, {
|
|
377
|
+
[`${ee}--disabled`]: t,
|
|
378
|
+
[`${ee}--negative`]: i
|
|
379
379
|
});
|
|
380
|
-
return /* @__PURE__ */ d("span", { id:
|
|
380
|
+
return /* @__PURE__ */ d("span", { id: r, className: o, ...a, children: n });
|
|
381
381
|
};
|
|
382
|
-
function
|
|
383
|
-
return
|
|
382
|
+
function cr(n) {
|
|
383
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
384
384
|
}
|
|
385
|
-
var
|
|
386
|
-
function
|
|
387
|
-
return
|
|
385
|
+
var Ee = { exports: {} }, qe;
|
|
386
|
+
function lr() {
|
|
387
|
+
return qe || (qe = 1, (function(n) {
|
|
388
388
|
(function() {
|
|
389
389
|
var e = {}.hasOwnProperty;
|
|
390
390
|
function t() {
|
|
391
391
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
392
392
|
var s = arguments[o];
|
|
393
|
-
s && (a = i(a,
|
|
393
|
+
s && (a = i(a, r.call(this, s)));
|
|
394
394
|
}
|
|
395
395
|
return a;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function r(a) {
|
|
398
398
|
if (typeof a == "string" || typeof a == "number")
|
|
399
399
|
return this && this[a] || a;
|
|
400
400
|
if (typeof a != "object")
|
|
@@ -411,12 +411,12 @@ function pr() {
|
|
|
411
411
|
function i(a, o) {
|
|
412
412
|
return o ? a ? a + " " + o : a + o : a;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
415
415
|
})();
|
|
416
|
-
})(
|
|
416
|
+
})(Ee)), Ee.exports;
|
|
417
417
|
}
|
|
418
|
-
var
|
|
419
|
-
const
|
|
418
|
+
var dr = lr();
|
|
419
|
+
const fr = /* @__PURE__ */ cr(dr), pr = {
|
|
420
420
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
421
421
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
422
422
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -424,110 +424,101 @@ const hr = /* @__PURE__ */ dr(fr), mr = {
|
|
|
424
424
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
425
425
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
426
426
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
427
|
-
},
|
|
427
|
+
}, hr = fr.bind(pr), We = "purpur-icon", mr = "md", _r = (n) => n.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}="${e.value}"`).join(" "), wr = ({ content: n = "", title: e } = {}) => {
|
|
428
428
|
const t = [
|
|
429
429
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
430
430
|
{ name: "fill", value: "currentColor" },
|
|
431
431
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
432
432
|
e ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
433
|
-
],
|
|
434
|
-
return `<svg ${
|
|
435
|
-
},
|
|
436
|
-
const a =
|
|
437
|
-
content:
|
|
433
|
+
], r = e ? `<title>${e}</title>` : "";
|
|
434
|
+
return `<svg ${_r(t)}>${r}${n}</svg>`;
|
|
435
|
+
}, yr = (n) => n.replace(/<(\/?)svg([^>]*)>/g, "").trim(), le = ({ svg: n, allyTitle: e, className: t, size: r = mr, ...i }) => {
|
|
436
|
+
const a = wr({
|
|
437
|
+
content: yr(n.svg),
|
|
438
438
|
title: e
|
|
439
|
-
}), o =
|
|
439
|
+
}), o = hr(We, `${We}--${r}`, t);
|
|
440
440
|
return /* @__PURE__ */ d("span", { className: o, dangerouslySetInnerHTML: { __html: a }, ...i });
|
|
441
441
|
};
|
|
442
|
-
|
|
443
|
-
const
|
|
442
|
+
le.displayName = "Icon";
|
|
443
|
+
const gr = {
|
|
444
444
|
name: "check-circle-filled",
|
|
445
445
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',
|
|
446
446
|
keywords: ["check-circle-filled"],
|
|
447
447
|
category: "status"
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
const
|
|
448
|
+
}, et = (n) => /* @__PURE__ */ d(le, { ...n, svg: gr });
|
|
449
|
+
et.displayName = "IconCheckCircleFilled";
|
|
450
|
+
const br = {
|
|
451
451
|
name: "close",
|
|
452
452
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
453
453
|
keywords: ["close"],
|
|
454
454
|
category: "utility"
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
function
|
|
458
|
-
if (typeof
|
|
459
|
-
return
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
function
|
|
455
|
+
}, tt = (n) => /* @__PURE__ */ d(le, { ...n, svg: br });
|
|
456
|
+
tt.displayName = "IconClose";
|
|
457
|
+
function $e(n, e) {
|
|
458
|
+
if (typeof n == "function")
|
|
459
|
+
return n(e);
|
|
460
|
+
n != null && (n.current = e);
|
|
461
|
+
}
|
|
462
|
+
function xr(...n) {
|
|
463
463
|
return (e) => {
|
|
464
464
|
let t = !1;
|
|
465
|
-
const
|
|
466
|
-
const a =
|
|
465
|
+
const r = n.map((i) => {
|
|
466
|
+
const a = $e(i, e);
|
|
467
467
|
return !t && typeof a == "function" && (t = !0), a;
|
|
468
468
|
});
|
|
469
469
|
if (t)
|
|
470
470
|
return () => {
|
|
471
|
-
for (let i = 0; i <
|
|
472
|
-
const a =
|
|
473
|
-
typeof a == "function" ? a() :
|
|
471
|
+
for (let i = 0; i < r.length; i++) {
|
|
472
|
+
const a = r[i];
|
|
473
|
+
typeof a == "function" ? a() : $e(n[i], null);
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
var Or = Symbol.for("react.lazy"), Z = T[" use ".trim().toString()];
|
|
479
|
-
function Mr(r) {
|
|
480
|
-
return typeof r == "object" && r !== null && "then" in r;
|
|
481
|
-
}
|
|
482
|
-
function nt(r) {
|
|
483
|
-
return r != null && typeof r == "object" && "$$typeof" in r && r.$$typeof === Or && "_payload" in r && Mr(r._payload);
|
|
484
|
-
}
|
|
485
478
|
// @__NO_SIDE_EFFECTS__
|
|
486
|
-
function
|
|
487
|
-
const e = /* @__PURE__ */
|
|
488
|
-
|
|
489
|
-
nt(a) && typeof Z == "function" && (a = Z(a._payload));
|
|
490
|
-
const s = T.Children.toArray(a), h = s.find(Nr);
|
|
479
|
+
function vr(n) {
|
|
480
|
+
const e = /* @__PURE__ */ Pr(n), t = T.forwardRef((r, i) => {
|
|
481
|
+
const { children: a, ...o } = r, s = T.Children.toArray(a), h = s.find(Mr);
|
|
491
482
|
if (h) {
|
|
492
|
-
const c = h.props.children, m = s.map((
|
|
483
|
+
const c = h.props.children, m = s.map((f) => f === h ? T.Children.count(c) > 1 ? T.Children.only(null) : T.isValidElement(c) ? c.props.children : null : f);
|
|
493
484
|
return /* @__PURE__ */ d(e, { ...o, ref: i, children: T.isValidElement(c) ? T.cloneElement(c, void 0, m) : null });
|
|
494
485
|
}
|
|
495
486
|
return /* @__PURE__ */ d(e, { ...o, ref: i, children: a });
|
|
496
487
|
});
|
|
497
|
-
return t.displayName = `${
|
|
488
|
+
return t.displayName = `${n}.Slot`, t;
|
|
498
489
|
}
|
|
499
490
|
// @__NO_SIDE_EFFECTS__
|
|
500
|
-
function
|
|
501
|
-
const e = T.forwardRef((t,
|
|
502
|
-
|
|
503
|
-
if (
|
|
504
|
-
const o =
|
|
505
|
-
return i.type !== T.Fragment && (s.ref =
|
|
491
|
+
function Pr(n) {
|
|
492
|
+
const e = T.forwardRef((t, r) => {
|
|
493
|
+
const { children: i, ...a } = t;
|
|
494
|
+
if (T.isValidElement(i)) {
|
|
495
|
+
const o = Tr(i), s = Dr(a, i.props);
|
|
496
|
+
return i.type !== T.Fragment && (s.ref = r ? xr(r, o) : o), T.cloneElement(i, s);
|
|
506
497
|
}
|
|
507
498
|
return T.Children.count(i) > 1 ? T.Children.only(null) : null;
|
|
508
499
|
});
|
|
509
|
-
return e.displayName = `${
|
|
500
|
+
return e.displayName = `${n}.SlotClone`, e;
|
|
510
501
|
}
|
|
511
|
-
var
|
|
512
|
-
function
|
|
513
|
-
return T.isValidElement(
|
|
502
|
+
var Or = Symbol("radix.slottable");
|
|
503
|
+
function Mr(n) {
|
|
504
|
+
return T.isValidElement(n) && typeof n.type == "function" && "__radixId" in n.type && n.type.__radixId === Or;
|
|
514
505
|
}
|
|
515
|
-
function
|
|
506
|
+
function Dr(n, e) {
|
|
516
507
|
const t = { ...e };
|
|
517
|
-
for (const
|
|
518
|
-
const i = r
|
|
519
|
-
/^on[A-Z]/.test(
|
|
508
|
+
for (const r in e) {
|
|
509
|
+
const i = n[r], a = e[r];
|
|
510
|
+
/^on[A-Z]/.test(r) ? i && a ? t[r] = (...o) => {
|
|
520
511
|
const s = a(...o);
|
|
521
512
|
return i(...o), s;
|
|
522
|
-
} : i && (t[
|
|
513
|
+
} : i && (t[r] = i) : r === "style" ? t[r] = { ...i, ...a } : r === "className" && (t[r] = [i, a].filter(Boolean).join(" "));
|
|
523
514
|
}
|
|
524
|
-
return { ...
|
|
515
|
+
return { ...n, ...t };
|
|
525
516
|
}
|
|
526
|
-
function
|
|
527
|
-
let e = Object.getOwnPropertyDescriptor(
|
|
528
|
-
return t ?
|
|
517
|
+
function Tr(n) {
|
|
518
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
|
|
519
|
+
return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
|
|
529
520
|
}
|
|
530
|
-
var
|
|
521
|
+
var kr = [
|
|
531
522
|
"a",
|
|
532
523
|
"button",
|
|
533
524
|
"div",
|
|
@@ -545,40 +536,40 @@ var qr = [
|
|
|
545
536
|
"span",
|
|
546
537
|
"svg",
|
|
547
538
|
"ul"
|
|
548
|
-
],
|
|
549
|
-
const t = /* @__PURE__ */
|
|
539
|
+
], Nr = kr.reduce((n, e) => {
|
|
540
|
+
const t = /* @__PURE__ */ vr(`Primitive.${e}`), r = T.forwardRef((i, a) => {
|
|
550
541
|
const { asChild: o, ...s } = i, h = o ? t : e;
|
|
551
542
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(h, { ...s, ref: a });
|
|
552
543
|
});
|
|
553
|
-
return
|
|
554
|
-
}, {}),
|
|
555
|
-
|
|
544
|
+
return r.displayName = `Primitive.${e}`, { ...n, [e]: r };
|
|
545
|
+
}, {}), Yr = "Label", rt = T.forwardRef((n, e) => /* @__PURE__ */ d(
|
|
546
|
+
Nr.label,
|
|
556
547
|
{
|
|
557
|
-
...
|
|
548
|
+
...n,
|
|
558
549
|
ref: e,
|
|
559
550
|
onMouseDown: (t) => {
|
|
560
|
-
t.target.closest("button, input, select, textarea") || (
|
|
551
|
+
t.target.closest("button, input, select, textarea") || (n.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
561
552
|
}
|
|
562
553
|
}
|
|
563
554
|
));
|
|
564
|
-
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
return
|
|
568
|
-
}
|
|
569
|
-
var Ce = { exports: {} },
|
|
570
|
-
function
|
|
571
|
-
return
|
|
555
|
+
rt.displayName = Yr;
|
|
556
|
+
var Er = rt;
|
|
557
|
+
function qr(n) {
|
|
558
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
559
|
+
}
|
|
560
|
+
var Ce = { exports: {} }, je;
|
|
561
|
+
function Wr() {
|
|
562
|
+
return je || (je = 1, (function(n) {
|
|
572
563
|
(function() {
|
|
573
564
|
var e = {}.hasOwnProperty;
|
|
574
565
|
function t() {
|
|
575
566
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
576
567
|
var s = arguments[o];
|
|
577
|
-
s && (a = i(a,
|
|
568
|
+
s && (a = i(a, r.call(this, s)));
|
|
578
569
|
}
|
|
579
570
|
return a;
|
|
580
571
|
}
|
|
581
|
-
function
|
|
572
|
+
function r(a) {
|
|
582
573
|
if (typeof a == "string" || typeof a == "number")
|
|
583
574
|
return this && this[a] || a;
|
|
584
575
|
if (typeof a != "object")
|
|
@@ -595,44 +586,44 @@ function Hr() {
|
|
|
595
586
|
function i(a, o) {
|
|
596
587
|
return o ? a ? a + " " + o : a + o : a;
|
|
597
588
|
}
|
|
598
|
-
|
|
589
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
599
590
|
})();
|
|
600
591
|
})(Ce)), Ce.exports;
|
|
601
592
|
}
|
|
602
|
-
var
|
|
603
|
-
const
|
|
593
|
+
var $r = Wr();
|
|
594
|
+
const Cr = /* @__PURE__ */ qr($r), jr = {
|
|
604
595
|
"purpur-label": "_purpur-label_1x80u_1",
|
|
605
596
|
"purpur-label--negative": "_purpur-label--negative_1x80u_8",
|
|
606
597
|
"purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
|
|
607
|
-
},
|
|
608
|
-
children:
|
|
598
|
+
}, Hr = Cr.bind(jr), te = "purpur-label", Lr = ({
|
|
599
|
+
children: n,
|
|
609
600
|
className: e,
|
|
610
601
|
disabled: t,
|
|
611
|
-
negative:
|
|
602
|
+
negative: r = !1,
|
|
612
603
|
...i
|
|
613
604
|
}) => {
|
|
614
|
-
const a =
|
|
615
|
-
[`${
|
|
616
|
-
[`${
|
|
605
|
+
const a = Hr(e, te, {
|
|
606
|
+
[`${te}--disabled`]: t,
|
|
607
|
+
[`${te}--negative`]: r
|
|
617
608
|
});
|
|
618
|
-
return /* @__PURE__ */ d(
|
|
609
|
+
return /* @__PURE__ */ d(Er, { className: a, ...i, children: n });
|
|
619
610
|
};
|
|
620
|
-
function
|
|
621
|
-
return
|
|
611
|
+
function Ir(n) {
|
|
612
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
622
613
|
}
|
|
623
|
-
var
|
|
624
|
-
function
|
|
625
|
-
return
|
|
614
|
+
var He = { exports: {} }, Le;
|
|
615
|
+
function Fr() {
|
|
616
|
+
return Le || (Le = 1, (function(n) {
|
|
626
617
|
(function() {
|
|
627
618
|
var e = {}.hasOwnProperty;
|
|
628
619
|
function t() {
|
|
629
620
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
630
621
|
var s = arguments[o];
|
|
631
|
-
s && (a = i(a,
|
|
622
|
+
s && (a = i(a, r.call(this, s)));
|
|
632
623
|
}
|
|
633
624
|
return a;
|
|
634
625
|
}
|
|
635
|
-
function
|
|
626
|
+
function r(a) {
|
|
636
627
|
if (typeof a == "string" || typeof a == "number")
|
|
637
628
|
return this && this[a] || a;
|
|
638
629
|
if (typeof a != "object")
|
|
@@ -649,60 +640,60 @@ function Br() {
|
|
|
649
640
|
function i(a, o) {
|
|
650
641
|
return o ? a ? a + " " + o : a + o : a;
|
|
651
642
|
}
|
|
652
|
-
|
|
643
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
653
644
|
})();
|
|
654
|
-
})(
|
|
645
|
+
})(He)), He.exports;
|
|
655
646
|
}
|
|
656
|
-
var
|
|
657
|
-
const
|
|
647
|
+
var Rr = Fr();
|
|
648
|
+
const Ar = /* @__PURE__ */ Ir(Rr), Qr = "_rotate_12t9p_1", Br = "_dash_12t9p_1", Sr = {
|
|
658
649
|
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
659
|
-
rotate:
|
|
650
|
+
rotate: Qr,
|
|
660
651
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
661
652
|
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
662
653
|
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
663
654
|
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
664
655
|
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
665
656
|
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
666
|
-
dash:
|
|
657
|
+
dash: Br,
|
|
667
658
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
668
659
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
669
|
-
},
|
|
660
|
+
}, Ie = Ar.bind(Sr), X = "purpur-spinner", Gr = {
|
|
670
661
|
SM: "sm"
|
|
671
|
-
},
|
|
672
|
-
disabled:
|
|
662
|
+
}, nt = ({
|
|
663
|
+
disabled: n = !1,
|
|
673
664
|
negative: e = !1,
|
|
674
|
-
size: t =
|
|
675
|
-
className:
|
|
665
|
+
size: t = Gr.SM,
|
|
666
|
+
className: r,
|
|
676
667
|
...i
|
|
677
|
-
}) => /* @__PURE__ */ d("div", { className:
|
|
668
|
+
}) => /* @__PURE__ */ d("div", { className: Ie(X, `${X}--${t}`, r), ...i, children: /* @__PURE__ */ d("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ d(
|
|
678
669
|
"circle",
|
|
679
670
|
{
|
|
680
|
-
className:
|
|
681
|
-
[`${
|
|
682
|
-
[`${
|
|
671
|
+
className: Ie(`${X}__circle`, {
|
|
672
|
+
[`${X}__circle--disabled`]: n,
|
|
673
|
+
[`${X}__circle--negative`]: e
|
|
683
674
|
}),
|
|
684
675
|
cx: "25",
|
|
685
676
|
cy: "25",
|
|
686
677
|
r: "20"
|
|
687
678
|
}
|
|
688
679
|
) }) });
|
|
689
|
-
|
|
690
|
-
function
|
|
691
|
-
return
|
|
680
|
+
nt.displayName = "Spinner";
|
|
681
|
+
function Xr(n) {
|
|
682
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
692
683
|
}
|
|
693
|
-
var
|
|
694
|
-
function
|
|
695
|
-
return
|
|
684
|
+
var Fe = { exports: {} }, Re;
|
|
685
|
+
function Vr() {
|
|
686
|
+
return Re || (Re = 1, (function(n) {
|
|
696
687
|
(function() {
|
|
697
688
|
var e = {}.hasOwnProperty;
|
|
698
689
|
function t() {
|
|
699
690
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
700
691
|
var s = arguments[o];
|
|
701
|
-
s && (a = i(a,
|
|
692
|
+
s && (a = i(a, r.call(this, s)));
|
|
702
693
|
}
|
|
703
694
|
return a;
|
|
704
695
|
}
|
|
705
|
-
function
|
|
696
|
+
function r(a) {
|
|
706
697
|
if (typeof a == "string" || typeof a == "number")
|
|
707
698
|
return this && this[a] || a;
|
|
708
699
|
if (typeof a != "object")
|
|
@@ -719,38 +710,38 @@ function Kr() {
|
|
|
719
710
|
function i(a, o) {
|
|
720
711
|
return o ? a ? a + " " + o : a + o : a;
|
|
721
712
|
}
|
|
722
|
-
|
|
713
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
723
714
|
})();
|
|
724
|
-
})(
|
|
725
|
-
}
|
|
726
|
-
var
|
|
727
|
-
const
|
|
728
|
-
"purpur-text-field": "_purpur-text-
|
|
729
|
-
"purpur-text-field__label": "_purpur-text-
|
|
730
|
-
"purpur-text-field__label-text": "_purpur-text-field__label-
|
|
731
|
-
"purpur-text-field__field-row": "_purpur-text-field__field-
|
|
732
|
-
"purpur-text-field__frame": "_purpur-text-
|
|
733
|
-
"purpur-text-field__frame--negative": "_purpur-text-field__frame--
|
|
734
|
-
"purpur-text-field__input-container": "_purpur-text-field__input-
|
|
735
|
-
"purpur-text-field__input-container--disabled": "_purpur-text-field__input-container--
|
|
736
|
-
"purpur-text-field__input-container--readonly": "_purpur-text-field__input-container--
|
|
737
|
-
"purpur-text-field__input-container--has-clear-button": "_purpur-text-field__input-container--has-clear-
|
|
738
|
-
"purpur-text-field__input-container--end-adornment": "_purpur-text-field__input-container--end-
|
|
739
|
-
"purpur-text-field__input": "_purpur-text-
|
|
740
|
-
"purpur-text-field__input-container--start-adornment": "_purpur-text-field__input-container--start-
|
|
741
|
-
"purpur-text-field__input-container--negative": "_purpur-text-field__input-container--
|
|
742
|
-
"purpur-text-field__input--valid": "_purpur-text-field__input--
|
|
743
|
-
"purpur-text-field__input--error": "_purpur-text-field__input--
|
|
744
|
-
"purpur-text-field__input--negative": "_purpur-text-field__input--
|
|
745
|
-
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-
|
|
746
|
-
"purpur-text-field__valid-icon": "_purpur-text-field__valid-
|
|
747
|
-
"purpur-text-field__valid-icon--negative": "_purpur-text-field__valid-icon--
|
|
748
|
-
},
|
|
715
|
+
})(Fe)), Fe.exports;
|
|
716
|
+
}
|
|
717
|
+
var zr = Vr();
|
|
718
|
+
const Zr = /* @__PURE__ */ Xr(zr), Jr = {
|
|
719
|
+
"purpur-text-field": "_purpur-text-field_h2fch_1",
|
|
720
|
+
"purpur-text-field__label": "_purpur-text-field__label_h2fch_7",
|
|
721
|
+
"purpur-text-field__label-text": "_purpur-text-field__label-text_h2fch_12",
|
|
722
|
+
"purpur-text-field__field-row": "_purpur-text-field__field-row_h2fch_15",
|
|
723
|
+
"purpur-text-field__frame": "_purpur-text-field__frame_h2fch_19",
|
|
724
|
+
"purpur-text-field__frame--negative": "_purpur-text-field__frame--negative_h2fch_26",
|
|
725
|
+
"purpur-text-field__input-container": "_purpur-text-field__input-container_h2fch_29",
|
|
726
|
+
"purpur-text-field__input-container--disabled": "_purpur-text-field__input-container--disabled_h2fch_40",
|
|
727
|
+
"purpur-text-field__input-container--readonly": "_purpur-text-field__input-container--readonly_h2fch_43",
|
|
728
|
+
"purpur-text-field__input-container--has-clear-button": "_purpur-text-field__input-container--has-clear-button_h2fch_46",
|
|
729
|
+
"purpur-text-field__input-container--end-adornment": "_purpur-text-field__input-container--end-adornment_h2fch_49",
|
|
730
|
+
"purpur-text-field__input": "_purpur-text-field__input_h2fch_29",
|
|
731
|
+
"purpur-text-field__input-container--start-adornment": "_purpur-text-field__input-container--start-adornment_h2fch_55",
|
|
732
|
+
"purpur-text-field__input-container--negative": "_purpur-text-field__input-container--negative_h2fch_61",
|
|
733
|
+
"purpur-text-field__input--valid": "_purpur-text-field__input--valid_h2fch_109",
|
|
734
|
+
"purpur-text-field__input--error": "_purpur-text-field__input--error_h2fch_109",
|
|
735
|
+
"purpur-text-field__input--negative": "_purpur-text-field__input--negative_h2fch_127",
|
|
736
|
+
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_h2fch_140",
|
|
737
|
+
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_h2fch_145",
|
|
738
|
+
"purpur-text-field__valid-icon--negative": "_purpur-text-field__valid-icon--negative_h2fch_148"
|
|
739
|
+
}, Kr = (n) => Ze(n), W = Zr.bind(Jr), O = "purpur-text-field", at = ce(
|
|
749
740
|
({
|
|
750
|
-
["data-testid"]:
|
|
741
|
+
["data-testid"]: n,
|
|
751
742
|
className: e,
|
|
752
743
|
clearButtonAriaLabel: t,
|
|
753
|
-
beforeField:
|
|
744
|
+
beforeField: r,
|
|
754
745
|
afterField: i,
|
|
755
746
|
endAdornment: a,
|
|
756
747
|
errorText: o,
|
|
@@ -758,95 +749,95 @@ const en = /* @__PURE__ */ Jr(Ur), tn = {
|
|
|
758
749
|
hideRequiredAsterisk: h = !1,
|
|
759
750
|
label: c,
|
|
760
751
|
loading: m = !1,
|
|
761
|
-
onClear:
|
|
752
|
+
onClear: f,
|
|
762
753
|
startAdornment: N,
|
|
763
754
|
valid: L = !1,
|
|
764
755
|
negative: P = !1,
|
|
765
|
-
...
|
|
756
|
+
...w
|
|
766
757
|
}, u) => {
|
|
767
|
-
const l =
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
|
|
771
|
-
},
|
|
758
|
+
const l = vt(), y = w.id ?? l, k = (q) => n ? `${n}-${q}` : void 0, F = L && !o, R = s ? `${y}-helper-text` : void 0, A = [N].filter((q) => !!q), he = (typeof w.value == "number" ? w.value !== void 0 : w.value?.length) && !w.disabled && !w.readOnly && !m && f && t, me = Kr(null), gt = (q) => {
|
|
759
|
+
me.current = q, typeof u == "function" ? u(q) : u && (u.current = q);
|
|
760
|
+
}, bt = () => {
|
|
761
|
+
f?.(), me.current?.focus();
|
|
762
|
+
}, K = [
|
|
772
763
|
m && /* @__PURE__ */ d(
|
|
773
|
-
|
|
764
|
+
nt,
|
|
774
765
|
{
|
|
775
|
-
disabled:
|
|
766
|
+
disabled: w.disabled,
|
|
776
767
|
size: "xs",
|
|
777
768
|
"data-testid": k("spinner"),
|
|
778
769
|
negative: P
|
|
779
770
|
},
|
|
780
771
|
"spinner"
|
|
781
772
|
),
|
|
782
|
-
|
|
783
|
-
|
|
773
|
+
he && /* @__PURE__ */ d(
|
|
774
|
+
Ke,
|
|
784
775
|
{
|
|
785
776
|
negative: P,
|
|
786
777
|
variant: "tertiary-purple",
|
|
787
|
-
onClick:
|
|
778
|
+
onClick: bt,
|
|
788
779
|
iconOnly: !0,
|
|
789
780
|
"aria-label": t ?? "",
|
|
790
781
|
"data-testid": k("clear-button"),
|
|
791
782
|
tabIndex: -1,
|
|
792
|
-
children: /* @__PURE__ */ d(
|
|
783
|
+
children: /* @__PURE__ */ d(tt, { size: "xs" })
|
|
793
784
|
},
|
|
794
785
|
"clear-button"
|
|
795
786
|
),
|
|
796
787
|
F && /* @__PURE__ */ d(
|
|
797
|
-
|
|
788
|
+
et,
|
|
798
789
|
{
|
|
799
790
|
"data-testid": k("valid-icon"),
|
|
800
|
-
className:
|
|
791
|
+
className: W(`${O}__valid-icon`, {
|
|
801
792
|
[`${O}__valid-icon--negative`]: P
|
|
802
793
|
})
|
|
803
794
|
},
|
|
804
795
|
"valid-icon"
|
|
805
796
|
)
|
|
806
|
-
].filter((q) => !!q),
|
|
797
|
+
].filter((q) => !!q), xt = W(`${O}__input-container`, {
|
|
807
798
|
[`${O}__input-container--start-adornment`]: A.length,
|
|
808
|
-
[`${O}__input-container--end-adornment`]:
|
|
809
|
-
[`${O}__input-container--disabled`]:
|
|
810
|
-
[`${O}__input-container--has-clear-button`]:
|
|
811
|
-
[`${O}__input-container--readonly`]:
|
|
799
|
+
[`${O}__input-container--end-adornment`]: K.length || a,
|
|
800
|
+
[`${O}__input-container--disabled`]: w.disabled,
|
|
801
|
+
[`${O}__input-container--has-clear-button`]: he,
|
|
802
|
+
[`${O}__input-container--readonly`]: w.readOnly && !w.disabled,
|
|
812
803
|
[`${O}__input-container--negative`]: P
|
|
813
804
|
});
|
|
814
|
-
return /* @__PURE__ */
|
|
815
|
-
c && /* @__PURE__ */
|
|
816
|
-
|
|
805
|
+
return /* @__PURE__ */ j("div", { className: W(e, O), children: [
|
|
806
|
+
c && /* @__PURE__ */ j(
|
|
807
|
+
Lr,
|
|
817
808
|
{
|
|
818
|
-
htmlFor:
|
|
819
|
-
className:
|
|
809
|
+
htmlFor: y,
|
|
810
|
+
className: W(`${O}__label`),
|
|
820
811
|
"data-testid": k("label"),
|
|
821
|
-
disabled:
|
|
812
|
+
disabled: w.disabled,
|
|
822
813
|
negative: P,
|
|
823
814
|
children: [
|
|
824
|
-
|
|
815
|
+
w.required && !h && /* @__PURE__ */ d("span", { "aria-hidden": !0, children: "*" }),
|
|
825
816
|
c
|
|
826
817
|
]
|
|
827
818
|
}
|
|
828
819
|
),
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
!!
|
|
831
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ j("div", { className: W(`${O}__field-row`), children: [
|
|
821
|
+
!!r && r,
|
|
822
|
+
/* @__PURE__ */ j("div", { className: xt, children: [
|
|
832
823
|
!!A.length && /* @__PURE__ */ d(
|
|
833
824
|
"div",
|
|
834
825
|
{
|
|
835
826
|
"data-testid": k("start-adornments"),
|
|
836
|
-
className:
|
|
827
|
+
className: W(`${O}__adornment-container`),
|
|
837
828
|
children: A
|
|
838
829
|
}
|
|
839
830
|
),
|
|
840
831
|
/* @__PURE__ */ d(
|
|
841
832
|
"input",
|
|
842
833
|
{
|
|
843
|
-
...
|
|
844
|
-
id:
|
|
845
|
-
ref:
|
|
834
|
+
...w,
|
|
835
|
+
id: y,
|
|
836
|
+
ref: gt,
|
|
846
837
|
"data-testid": k("input"),
|
|
847
|
-
"aria-describedby":
|
|
848
|
-
"aria-invalid":
|
|
849
|
-
className:
|
|
838
|
+
"aria-describedby": w["aria-describedby"] || R,
|
|
839
|
+
"aria-invalid": w["aria-invalid"] || !!o,
|
|
840
|
+
className: W([
|
|
850
841
|
`${O}__input`,
|
|
851
842
|
{
|
|
852
843
|
[`${O}__input--valid`]: F,
|
|
@@ -859,18 +850,18 @@ const en = /* @__PURE__ */ Jr(Ur), tn = {
|
|
|
859
850
|
/* @__PURE__ */ d(
|
|
860
851
|
"div",
|
|
861
852
|
{
|
|
862
|
-
className:
|
|
853
|
+
className: W(`${O}__frame`, {
|
|
863
854
|
[`${O}__frame--negative`]: P
|
|
864
855
|
})
|
|
865
856
|
}
|
|
866
857
|
),
|
|
867
|
-
(!!
|
|
858
|
+
(!!K.length || a) && /* @__PURE__ */ j(
|
|
868
859
|
"div",
|
|
869
860
|
{
|
|
870
861
|
"data-testid": k("end-adornments"),
|
|
871
|
-
className:
|
|
862
|
+
className: W(`${O}__adornment-container`),
|
|
872
863
|
children: [
|
|
873
|
-
|
|
864
|
+
K,
|
|
874
865
|
a
|
|
875
866
|
]
|
|
876
867
|
}
|
|
@@ -879,36 +870,37 @@ const en = /* @__PURE__ */ Jr(Ur), tn = {
|
|
|
879
870
|
!!i && i
|
|
880
871
|
] }),
|
|
881
872
|
R && /* @__PURE__ */ d(
|
|
882
|
-
|
|
873
|
+
ur,
|
|
883
874
|
{
|
|
884
875
|
"data-testid": k("helper-text"),
|
|
885
876
|
id: R,
|
|
886
877
|
negative: P,
|
|
878
|
+
disabled: w.disabled,
|
|
887
879
|
children: s
|
|
888
880
|
}
|
|
889
881
|
),
|
|
890
|
-
o && /* @__PURE__ */ d(
|
|
882
|
+
o && /* @__PURE__ */ d(tr, { "data-testid": k("error-text"), negative: P, children: o })
|
|
891
883
|
] });
|
|
892
884
|
}
|
|
893
885
|
);
|
|
894
|
-
|
|
895
|
-
function
|
|
896
|
-
return
|
|
897
|
-
}
|
|
898
|
-
var
|
|
899
|
-
var
|
|
900
|
-
function
|
|
901
|
-
return
|
|
886
|
+
at.displayName = "TextField";
|
|
887
|
+
function Ur(n) {
|
|
888
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
889
|
+
}
|
|
890
|
+
var re = { exports: {} };
|
|
891
|
+
var Ae;
|
|
892
|
+
function en() {
|
|
893
|
+
return Ae || (Ae = 1, (function(n) {
|
|
902
894
|
(function() {
|
|
903
895
|
var e = {}.hasOwnProperty;
|
|
904
896
|
function t() {
|
|
905
897
|
for (var a = "", o = 0; o < arguments.length; o++) {
|
|
906
898
|
var s = arguments[o];
|
|
907
|
-
s && (a = i(a,
|
|
899
|
+
s && (a = i(a, r.call(this, s)));
|
|
908
900
|
}
|
|
909
901
|
return a;
|
|
910
902
|
}
|
|
911
|
-
function
|
|
903
|
+
function r(a) {
|
|
912
904
|
if (typeof a == "string" || typeof a == "number")
|
|
913
905
|
return this && this[a] || a;
|
|
914
906
|
if (typeof a != "object")
|
|
@@ -925,43 +917,43 @@ function an() {
|
|
|
925
917
|
function i(a, o) {
|
|
926
918
|
return o ? a ? a + " " + o : a + o : a;
|
|
927
919
|
}
|
|
928
|
-
|
|
920
|
+
n.exports ? (t.default = t, n.exports = t) : window.classNames = t;
|
|
929
921
|
})();
|
|
930
|
-
})(
|
|
922
|
+
})(re)), re.exports;
|
|
931
923
|
}
|
|
932
|
-
var
|
|
933
|
-
const
|
|
934
|
-
function D(
|
|
935
|
-
return typeof
|
|
924
|
+
var tn = en();
|
|
925
|
+
const rn = /* @__PURE__ */ Ur(tn), it = 6048e5, nn = 864e5, an = 6e4, on = 36e5, sn = 1e3, Qe = Symbol.for("constructDateFrom");
|
|
926
|
+
function D(n, e) {
|
|
927
|
+
return typeof n == "function" ? n(e) : n && typeof n == "object" && Qe in n ? n[Qe](e) : n instanceof Date ? new n.constructor(e) : new Date(e);
|
|
936
928
|
}
|
|
937
|
-
function M(
|
|
938
|
-
return D(e ||
|
|
929
|
+
function M(n, e) {
|
|
930
|
+
return D(e || n, n);
|
|
939
931
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
return isNaN(e) ? D(t?.in ||
|
|
932
|
+
function ot(n, e, t) {
|
|
933
|
+
const r = M(n, t?.in);
|
|
934
|
+
return isNaN(e) ? D(t?.in || n, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
943
935
|
}
|
|
944
|
-
let
|
|
936
|
+
let un = {};
|
|
945
937
|
function S() {
|
|
946
|
-
return
|
|
938
|
+
return un;
|
|
947
939
|
}
|
|
948
|
-
function H(
|
|
949
|
-
const t = S(),
|
|
940
|
+
function H(n, e) {
|
|
941
|
+
const t = S(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? t.weekStartsOn ?? t.locale?.options?.weekStartsOn ?? 0, i = M(n, e?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
950
942
|
return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
|
|
951
943
|
}
|
|
952
|
-
function B(
|
|
953
|
-
return H(
|
|
944
|
+
function B(n, e) {
|
|
945
|
+
return H(n, { ...e, weekStartsOn: 1 });
|
|
954
946
|
}
|
|
955
|
-
function
|
|
956
|
-
const t = M(
|
|
957
|
-
i.setFullYear(
|
|
947
|
+
function st(n, e) {
|
|
948
|
+
const t = M(n, e?.in), r = t.getFullYear(), i = D(t, 0);
|
|
949
|
+
i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
|
|
958
950
|
const a = B(i), o = D(t, 0);
|
|
959
|
-
o.setFullYear(
|
|
951
|
+
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
960
952
|
const s = B(o);
|
|
961
|
-
return t.getTime() >= a.getTime() ?
|
|
953
|
+
return t.getTime() >= a.getTime() ? r + 1 : t.getTime() >= s.getTime() ? r : r - 1;
|
|
962
954
|
}
|
|
963
|
-
function
|
|
964
|
-
const e = M(
|
|
955
|
+
function Z(n) {
|
|
956
|
+
const e = M(n), t = new Date(
|
|
965
957
|
Date.UTC(
|
|
966
958
|
e.getFullYear(),
|
|
967
959
|
e.getMonth(),
|
|
@@ -972,42 +964,42 @@ function J(r) {
|
|
|
972
964
|
e.getMilliseconds()
|
|
973
965
|
)
|
|
974
966
|
);
|
|
975
|
-
return t.setUTCFullYear(e.getFullYear()), +
|
|
967
|
+
return t.setUTCFullYear(e.getFullYear()), +n - +t;
|
|
976
968
|
}
|
|
977
|
-
function
|
|
969
|
+
function cn(n, ...e) {
|
|
978
970
|
const t = D.bind(
|
|
979
971
|
null,
|
|
980
|
-
e.find((
|
|
972
|
+
e.find((r) => typeof r == "object")
|
|
981
973
|
);
|
|
982
974
|
return e.map(t);
|
|
983
975
|
}
|
|
984
|
-
function
|
|
985
|
-
const t = M(
|
|
976
|
+
function Be(n, e) {
|
|
977
|
+
const t = M(n, e?.in);
|
|
986
978
|
return t.setHours(0, 0, 0, 0), t;
|
|
987
979
|
}
|
|
988
|
-
function
|
|
989
|
-
const [
|
|
980
|
+
function ln(n, e, t) {
|
|
981
|
+
const [r, i] = cn(
|
|
990
982
|
t?.in,
|
|
991
|
-
|
|
983
|
+
n,
|
|
992
984
|
e
|
|
993
|
-
), a =
|
|
994
|
-
return Math.round((s - h) /
|
|
985
|
+
), a = Be(r), o = Be(i), s = +a - Z(a), h = +o - Z(o);
|
|
986
|
+
return Math.round((s - h) / nn);
|
|
995
987
|
}
|
|
996
|
-
function
|
|
997
|
-
const t =
|
|
998
|
-
return
|
|
988
|
+
function dn(n, e) {
|
|
989
|
+
const t = st(n, e), r = D(n, 0);
|
|
990
|
+
return r.setFullYear(t, 0, 4), r.setHours(0, 0, 0, 0), B(r);
|
|
999
991
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return
|
|
992
|
+
function fn(n) {
|
|
993
|
+
return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
|
|
1002
994
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return !(!
|
|
995
|
+
function ut(n) {
|
|
996
|
+
return !(!fn(n) && typeof n != "number" || isNaN(+M(n)));
|
|
1005
997
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const t = M(
|
|
998
|
+
function pn(n, e) {
|
|
999
|
+
const t = M(n, e?.in);
|
|
1008
1000
|
return t.setFullYear(t.getFullYear(), 0, 1), t.setHours(0, 0, 0, 0), t;
|
|
1009
1001
|
}
|
|
1010
|
-
const
|
|
1002
|
+
const hn = {
|
|
1011
1003
|
lessThanXSeconds: {
|
|
1012
1004
|
one: "less than a second",
|
|
1013
1005
|
other: "less than {{count}} seconds"
|
|
@@ -1069,77 +1061,77 @@ const yn = {
|
|
|
1069
1061
|
one: "almost 1 year",
|
|
1070
1062
|
other: "almost {{count}} years"
|
|
1071
1063
|
}
|
|
1072
|
-
},
|
|
1073
|
-
let
|
|
1074
|
-
const i =
|
|
1075
|
-
return typeof i == "string" ?
|
|
1064
|
+
}, mn = (n, e, t) => {
|
|
1065
|
+
let r;
|
|
1066
|
+
const i = hn[n];
|
|
1067
|
+
return typeof i == "string" ? r = i : e === 1 ? r = i.one : r = i.other.replace("{{count}}", e.toString()), t?.addSuffix ? t.comparison && t.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
1076
1068
|
};
|
|
1077
|
-
function
|
|
1069
|
+
function ne(n) {
|
|
1078
1070
|
return (e = {}) => {
|
|
1079
|
-
const t = e.width ? String(e.width) :
|
|
1080
|
-
return
|
|
1071
|
+
const t = e.width ? String(e.width) : n.defaultWidth;
|
|
1072
|
+
return n.formats[t] || n.formats[n.defaultWidth];
|
|
1081
1073
|
};
|
|
1082
1074
|
}
|
|
1083
|
-
const
|
|
1075
|
+
const _n = {
|
|
1084
1076
|
full: "EEEE, MMMM do, y",
|
|
1085
1077
|
long: "MMMM do, y",
|
|
1086
1078
|
medium: "MMM d, y",
|
|
1087
1079
|
short: "MM/dd/yyyy"
|
|
1088
|
-
},
|
|
1080
|
+
}, wn = {
|
|
1089
1081
|
full: "h:mm:ss a zzzz",
|
|
1090
1082
|
long: "h:mm:ss a z",
|
|
1091
1083
|
medium: "h:mm:ss a",
|
|
1092
1084
|
short: "h:mm a"
|
|
1093
|
-
},
|
|
1085
|
+
}, yn = {
|
|
1094
1086
|
full: "{{date}} 'at' {{time}}",
|
|
1095
1087
|
long: "{{date}} 'at' {{time}}",
|
|
1096
1088
|
medium: "{{date}}, {{time}}",
|
|
1097
1089
|
short: "{{date}}, {{time}}"
|
|
1098
|
-
},
|
|
1099
|
-
date:
|
|
1100
|
-
formats:
|
|
1090
|
+
}, gn = {
|
|
1091
|
+
date: ne({
|
|
1092
|
+
formats: _n,
|
|
1101
1093
|
defaultWidth: "full"
|
|
1102
1094
|
}),
|
|
1103
|
-
time:
|
|
1104
|
-
formats:
|
|
1095
|
+
time: ne({
|
|
1096
|
+
formats: wn,
|
|
1105
1097
|
defaultWidth: "full"
|
|
1106
1098
|
}),
|
|
1107
|
-
dateTime:
|
|
1108
|
-
formats:
|
|
1099
|
+
dateTime: ne({
|
|
1100
|
+
formats: yn,
|
|
1109
1101
|
defaultWidth: "full"
|
|
1110
1102
|
})
|
|
1111
|
-
},
|
|
1103
|
+
}, bn = {
|
|
1112
1104
|
lastWeek: "'last' eeee 'at' p",
|
|
1113
1105
|
yesterday: "'yesterday at' p",
|
|
1114
1106
|
today: "'today at' p",
|
|
1115
1107
|
tomorrow: "'tomorrow at' p",
|
|
1116
1108
|
nextWeek: "eeee 'at' p",
|
|
1117
1109
|
other: "P"
|
|
1118
|
-
},
|
|
1119
|
-
function V(
|
|
1110
|
+
}, xn = (n, e, t, r) => bn[n];
|
|
1111
|
+
function V(n) {
|
|
1120
1112
|
return (e, t) => {
|
|
1121
|
-
const
|
|
1113
|
+
const r = t?.context ? String(t.context) : "standalone";
|
|
1122
1114
|
let i;
|
|
1123
|
-
if (
|
|
1124
|
-
const o =
|
|
1125
|
-
i =
|
|
1115
|
+
if (r === "formatting" && n.formattingValues) {
|
|
1116
|
+
const o = n.defaultFormattingWidth || n.defaultWidth, s = t?.width ? String(t.width) : o;
|
|
1117
|
+
i = n.formattingValues[s] || n.formattingValues[o];
|
|
1126
1118
|
} else {
|
|
1127
|
-
const o =
|
|
1128
|
-
i =
|
|
1119
|
+
const o = n.defaultWidth, s = t?.width ? String(t.width) : n.defaultWidth;
|
|
1120
|
+
i = n.values[s] || n.values[o];
|
|
1129
1121
|
}
|
|
1130
|
-
const a =
|
|
1122
|
+
const a = n.argumentCallback ? n.argumentCallback(e) : e;
|
|
1131
1123
|
return i[a];
|
|
1132
1124
|
};
|
|
1133
1125
|
}
|
|
1134
|
-
const
|
|
1126
|
+
const vn = {
|
|
1135
1127
|
narrow: ["B", "A"],
|
|
1136
1128
|
abbreviated: ["BC", "AD"],
|
|
1137
1129
|
wide: ["Before Christ", "Anno Domini"]
|
|
1138
|
-
},
|
|
1130
|
+
}, Pn = {
|
|
1139
1131
|
narrow: ["1", "2", "3", "4"],
|
|
1140
1132
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1141
1133
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1142
|
-
},
|
|
1134
|
+
}, On = {
|
|
1143
1135
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1144
1136
|
abbreviated: [
|
|
1145
1137
|
"Jan",
|
|
@@ -1169,7 +1161,7 @@ const Dn = {
|
|
|
1169
1161
|
"November",
|
|
1170
1162
|
"December"
|
|
1171
1163
|
]
|
|
1172
|
-
},
|
|
1164
|
+
}, Mn = {
|
|
1173
1165
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1174
1166
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1175
1167
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -1182,7 +1174,7 @@ const Dn = {
|
|
|
1182
1174
|
"Friday",
|
|
1183
1175
|
"Saturday"
|
|
1184
1176
|
]
|
|
1185
|
-
},
|
|
1177
|
+
}, Dn = {
|
|
1186
1178
|
narrow: {
|
|
1187
1179
|
am: "a",
|
|
1188
1180
|
pm: "p",
|
|
@@ -1213,7 +1205,7 @@ const Dn = {
|
|
|
1213
1205
|
evening: "evening",
|
|
1214
1206
|
night: "night"
|
|
1215
1207
|
}
|
|
1216
|
-
},
|
|
1208
|
+
}, Tn = {
|
|
1217
1209
|
narrow: {
|
|
1218
1210
|
am: "a",
|
|
1219
1211
|
pm: "p",
|
|
@@ -1244,10 +1236,10 @@ const Dn = {
|
|
|
1244
1236
|
evening: "in the evening",
|
|
1245
1237
|
night: "at night"
|
|
1246
1238
|
}
|
|
1247
|
-
},
|
|
1248
|
-
const t = Number(
|
|
1249
|
-
if (
|
|
1250
|
-
switch (
|
|
1239
|
+
}, kn = (n, e) => {
|
|
1240
|
+
const t = Number(n), r = t % 100;
|
|
1241
|
+
if (r > 20 || r < 10)
|
|
1242
|
+
switch (r % 10) {
|
|
1251
1243
|
case 1:
|
|
1252
1244
|
return t + "st";
|
|
1253
1245
|
case 2:
|
|
@@ -1256,43 +1248,43 @@ const Dn = {
|
|
|
1256
1248
|
return t + "rd";
|
|
1257
1249
|
}
|
|
1258
1250
|
return t + "th";
|
|
1259
|
-
},
|
|
1260
|
-
ordinalNumber:
|
|
1251
|
+
}, Nn = {
|
|
1252
|
+
ordinalNumber: kn,
|
|
1261
1253
|
era: V({
|
|
1262
|
-
values:
|
|
1254
|
+
values: vn,
|
|
1263
1255
|
defaultWidth: "wide"
|
|
1264
1256
|
}),
|
|
1265
1257
|
quarter: V({
|
|
1266
|
-
values:
|
|
1258
|
+
values: Pn,
|
|
1267
1259
|
defaultWidth: "wide",
|
|
1268
|
-
argumentCallback: (
|
|
1260
|
+
argumentCallback: (n) => n - 1
|
|
1269
1261
|
}),
|
|
1270
1262
|
month: V({
|
|
1271
|
-
values:
|
|
1263
|
+
values: On,
|
|
1272
1264
|
defaultWidth: "wide"
|
|
1273
1265
|
}),
|
|
1274
1266
|
day: V({
|
|
1275
|
-
values:
|
|
1267
|
+
values: Mn,
|
|
1276
1268
|
defaultWidth: "wide"
|
|
1277
1269
|
}),
|
|
1278
1270
|
dayPeriod: V({
|
|
1279
|
-
values:
|
|
1271
|
+
values: Dn,
|
|
1280
1272
|
defaultWidth: "wide",
|
|
1281
|
-
formattingValues:
|
|
1273
|
+
formattingValues: Tn,
|
|
1282
1274
|
defaultFormattingWidth: "wide"
|
|
1283
1275
|
})
|
|
1284
1276
|
};
|
|
1285
|
-
function z(
|
|
1277
|
+
function z(n) {
|
|
1286
1278
|
return (e, t = {}) => {
|
|
1287
|
-
const
|
|
1279
|
+
const r = t.width, i = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], a = e.match(i);
|
|
1288
1280
|
if (!a)
|
|
1289
1281
|
return null;
|
|
1290
|
-
const o = a[0], s =
|
|
1282
|
+
const o = a[0], s = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], h = Array.isArray(s) ? En(s, (f) => f.test(o)) : (
|
|
1291
1283
|
// [TODO] -- I challenge you to fix the type
|
|
1292
|
-
|
|
1284
|
+
Yn(s, (f) => f.test(o))
|
|
1293
1285
|
);
|
|
1294
1286
|
let c;
|
|
1295
|
-
c =
|
|
1287
|
+
c = n.valueCallback ? n.valueCallback(h) : h, c = t.valueCallback ? (
|
|
1296
1288
|
// [TODO] -- I challenge you to fix the type
|
|
1297
1289
|
t.valueCallback(c)
|
|
1298
1290
|
) : c;
|
|
@@ -1300,45 +1292,45 @@ function z(r) {
|
|
|
1300
1292
|
return { value: c, rest: m };
|
|
1301
1293
|
};
|
|
1302
1294
|
}
|
|
1303
|
-
function
|
|
1304
|
-
for (const t in
|
|
1305
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1295
|
+
function Yn(n, e) {
|
|
1296
|
+
for (const t in n)
|
|
1297
|
+
if (Object.prototype.hasOwnProperty.call(n, t) && e(n[t]))
|
|
1306
1298
|
return t;
|
|
1307
1299
|
}
|
|
1308
|
-
function
|
|
1309
|
-
for (let t = 0; t <
|
|
1310
|
-
if (e(
|
|
1300
|
+
function En(n, e) {
|
|
1301
|
+
for (let t = 0; t < n.length; t++)
|
|
1302
|
+
if (e(n[t]))
|
|
1311
1303
|
return t;
|
|
1312
1304
|
}
|
|
1313
|
-
function
|
|
1305
|
+
function qn(n) {
|
|
1314
1306
|
return (e, t = {}) => {
|
|
1315
|
-
const
|
|
1316
|
-
if (!
|
|
1317
|
-
const i =
|
|
1307
|
+
const r = e.match(n.matchPattern);
|
|
1308
|
+
if (!r) return null;
|
|
1309
|
+
const i = r[0], a = e.match(n.parsePattern);
|
|
1318
1310
|
if (!a) return null;
|
|
1319
|
-
let o =
|
|
1311
|
+
let o = n.valueCallback ? n.valueCallback(a[0]) : a[0];
|
|
1320
1312
|
o = t.valueCallback ? t.valueCallback(o) : o;
|
|
1321
1313
|
const s = e.slice(i.length);
|
|
1322
1314
|
return { value: o, rest: s };
|
|
1323
1315
|
};
|
|
1324
1316
|
}
|
|
1325
|
-
const
|
|
1317
|
+
const Wn = /^(\d+)(th|st|nd|rd)?/i, $n = /\d+/i, Cn = {
|
|
1326
1318
|
narrow: /^(b|a)/i,
|
|
1327
1319
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1328
1320
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1329
|
-
},
|
|
1321
|
+
}, jn = {
|
|
1330
1322
|
any: [/^b/i, /^(a|c)/i]
|
|
1331
|
-
},
|
|
1323
|
+
}, Hn = {
|
|
1332
1324
|
narrow: /^[1234]/i,
|
|
1333
1325
|
abbreviated: /^q[1234]/i,
|
|
1334
1326
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1335
|
-
},
|
|
1327
|
+
}, Ln = {
|
|
1336
1328
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1337
|
-
},
|
|
1329
|
+
}, In = {
|
|
1338
1330
|
narrow: /^[jfmasond]/i,
|
|
1339
1331
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1340
1332
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1341
|
-
},
|
|
1333
|
+
}, Fn = {
|
|
1342
1334
|
narrow: [
|
|
1343
1335
|
/^j/i,
|
|
1344
1336
|
/^f/i,
|
|
@@ -1367,18 +1359,18 @@ const Hn = /^(\d+)(th|st|nd|rd)?/i, Ln = /\d+/i, In = {
|
|
|
1367
1359
|
/^n/i,
|
|
1368
1360
|
/^d/i
|
|
1369
1361
|
]
|
|
1370
|
-
},
|
|
1362
|
+
}, Rn = {
|
|
1371
1363
|
narrow: /^[smtwf]/i,
|
|
1372
1364
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1373
1365
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1374
1366
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1375
|
-
},
|
|
1367
|
+
}, An = {
|
|
1376
1368
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1377
1369
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1378
|
-
},
|
|
1370
|
+
}, Qn = {
|
|
1379
1371
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1380
1372
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1381
|
-
},
|
|
1373
|
+
}, Bn = {
|
|
1382
1374
|
any: {
|
|
1383
1375
|
am: /^a/i,
|
|
1384
1376
|
pm: /^p/i,
|
|
@@ -1389,101 +1381,101 @@ const Hn = /^(\d+)(th|st|nd|rd)?/i, Ln = /\d+/i, In = {
|
|
|
1389
1381
|
evening: /evening/i,
|
|
1390
1382
|
night: /night/i
|
|
1391
1383
|
}
|
|
1392
|
-
},
|
|
1393
|
-
ordinalNumber:
|
|
1394
|
-
matchPattern:
|
|
1395
|
-
parsePattern:
|
|
1396
|
-
valueCallback: (
|
|
1384
|
+
}, Sn = {
|
|
1385
|
+
ordinalNumber: qn({
|
|
1386
|
+
matchPattern: Wn,
|
|
1387
|
+
parsePattern: $n,
|
|
1388
|
+
valueCallback: (n) => parseInt(n, 10)
|
|
1397
1389
|
}),
|
|
1398
1390
|
era: z({
|
|
1399
|
-
matchPatterns:
|
|
1391
|
+
matchPatterns: Cn,
|
|
1400
1392
|
defaultMatchWidth: "wide",
|
|
1401
|
-
parsePatterns:
|
|
1393
|
+
parsePatterns: jn,
|
|
1402
1394
|
defaultParseWidth: "any"
|
|
1403
1395
|
}),
|
|
1404
1396
|
quarter: z({
|
|
1405
|
-
matchPatterns:
|
|
1397
|
+
matchPatterns: Hn,
|
|
1406
1398
|
defaultMatchWidth: "wide",
|
|
1407
|
-
parsePatterns:
|
|
1399
|
+
parsePatterns: Ln,
|
|
1408
1400
|
defaultParseWidth: "any",
|
|
1409
|
-
valueCallback: (
|
|
1401
|
+
valueCallback: (n) => n + 1
|
|
1410
1402
|
}),
|
|
1411
1403
|
month: z({
|
|
1412
|
-
matchPatterns:
|
|
1404
|
+
matchPatterns: In,
|
|
1413
1405
|
defaultMatchWidth: "wide",
|
|
1414
|
-
parsePatterns:
|
|
1406
|
+
parsePatterns: Fn,
|
|
1415
1407
|
defaultParseWidth: "any"
|
|
1416
1408
|
}),
|
|
1417
1409
|
day: z({
|
|
1418
|
-
matchPatterns:
|
|
1410
|
+
matchPatterns: Rn,
|
|
1419
1411
|
defaultMatchWidth: "wide",
|
|
1420
|
-
parsePatterns:
|
|
1412
|
+
parsePatterns: An,
|
|
1421
1413
|
defaultParseWidth: "any"
|
|
1422
1414
|
}),
|
|
1423
1415
|
dayPeriod: z({
|
|
1424
|
-
matchPatterns:
|
|
1416
|
+
matchPatterns: Qn,
|
|
1425
1417
|
defaultMatchWidth: "any",
|
|
1426
|
-
parsePatterns:
|
|
1418
|
+
parsePatterns: Bn,
|
|
1427
1419
|
defaultParseWidth: "any"
|
|
1428
1420
|
})
|
|
1429
|
-
},
|
|
1421
|
+
}, ct = {
|
|
1430
1422
|
code: "en-US",
|
|
1431
|
-
formatDistance:
|
|
1432
|
-
formatLong:
|
|
1433
|
-
formatRelative:
|
|
1434
|
-
localize:
|
|
1435
|
-
match:
|
|
1423
|
+
formatDistance: mn,
|
|
1424
|
+
formatLong: gn,
|
|
1425
|
+
formatRelative: xn,
|
|
1426
|
+
localize: Nn,
|
|
1427
|
+
match: Sn,
|
|
1436
1428
|
options: {
|
|
1437
1429
|
weekStartsOn: 0,
|
|
1438
1430
|
firstWeekContainsDate: 1
|
|
1439
1431
|
}
|
|
1440
1432
|
};
|
|
1441
|
-
function
|
|
1442
|
-
const t = M(
|
|
1443
|
-
return
|
|
1444
|
-
}
|
|
1445
|
-
function
|
|
1446
|
-
const t = M(
|
|
1447
|
-
return Math.round(
|
|
1448
|
-
}
|
|
1449
|
-
function
|
|
1450
|
-
const t = M(
|
|
1451
|
-
o.setFullYear(
|
|
1452
|
-
const s = H(o, e), h = D(e?.in ||
|
|
1453
|
-
h.setFullYear(
|
|
1433
|
+
function Gn(n, e) {
|
|
1434
|
+
const t = M(n, e?.in);
|
|
1435
|
+
return ln(t, pn(t)) + 1;
|
|
1436
|
+
}
|
|
1437
|
+
function lt(n, e) {
|
|
1438
|
+
const t = M(n, e?.in), r = +B(t) - +dn(t);
|
|
1439
|
+
return Math.round(r / it) + 1;
|
|
1440
|
+
}
|
|
1441
|
+
function de(n, e) {
|
|
1442
|
+
const t = M(n, e?.in), r = t.getFullYear(), i = S(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = D(e?.in || n, 0);
|
|
1443
|
+
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
1444
|
+
const s = H(o, e), h = D(e?.in || n, 0);
|
|
1445
|
+
h.setFullYear(r, 0, a), h.setHours(0, 0, 0, 0);
|
|
1454
1446
|
const c = H(h, e);
|
|
1455
|
-
return +t >= +s ?
|
|
1447
|
+
return +t >= +s ? r + 1 : +t >= +c ? r : r - 1;
|
|
1456
1448
|
}
|
|
1457
|
-
function
|
|
1458
|
-
const t = S(),
|
|
1459
|
-
return a.setFullYear(i, 0,
|
|
1449
|
+
function Xn(n, e) {
|
|
1450
|
+
const t = S(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? t.firstWeekContainsDate ?? t.locale?.options?.firstWeekContainsDate ?? 1, i = de(n, e), a = D(e?.in || n, 0);
|
|
1451
|
+
return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), H(a, e);
|
|
1460
1452
|
}
|
|
1461
|
-
function
|
|
1462
|
-
const t = M(
|
|
1463
|
-
return Math.round(
|
|
1453
|
+
function dt(n, e) {
|
|
1454
|
+
const t = M(n, e?.in), r = +H(t, e) - +Xn(t, e);
|
|
1455
|
+
return Math.round(r / it) + 1;
|
|
1464
1456
|
}
|
|
1465
|
-
function _(
|
|
1466
|
-
const t =
|
|
1467
|
-
return t +
|
|
1457
|
+
function _(n, e) {
|
|
1458
|
+
const t = n < 0 ? "-" : "", r = Math.abs(n).toString().padStart(e, "0");
|
|
1459
|
+
return t + r;
|
|
1468
1460
|
}
|
|
1469
|
-
const
|
|
1461
|
+
const C = {
|
|
1470
1462
|
// Year
|
|
1471
|
-
y(
|
|
1472
|
-
const t =
|
|
1473
|
-
return _(e === "yy" ?
|
|
1463
|
+
y(n, e) {
|
|
1464
|
+
const t = n.getFullYear(), r = t > 0 ? t : 1 - t;
|
|
1465
|
+
return _(e === "yy" ? r % 100 : r, e.length);
|
|
1474
1466
|
},
|
|
1475
1467
|
// Month
|
|
1476
|
-
M(
|
|
1477
|
-
const t =
|
|
1468
|
+
M(n, e) {
|
|
1469
|
+
const t = n.getMonth();
|
|
1478
1470
|
return e === "M" ? String(t + 1) : _(t + 1, 2);
|
|
1479
1471
|
},
|
|
1480
1472
|
// Day of the month
|
|
1481
|
-
d(
|
|
1482
|
-
return _(
|
|
1473
|
+
d(n, e) {
|
|
1474
|
+
return _(n.getDate(), e.length);
|
|
1483
1475
|
},
|
|
1484
1476
|
// AM or PM
|
|
1485
|
-
a(
|
|
1486
|
-
const t =
|
|
1477
|
+
a(n, e) {
|
|
1478
|
+
const t = n.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1487
1479
|
switch (e) {
|
|
1488
1480
|
case "a":
|
|
1489
1481
|
case "aa":
|
|
@@ -1498,25 +1490,25 @@ const j = {
|
|
|
1498
1490
|
}
|
|
1499
1491
|
},
|
|
1500
1492
|
// Hour [1-12]
|
|
1501
|
-
h(
|
|
1502
|
-
return _(
|
|
1493
|
+
h(n, e) {
|
|
1494
|
+
return _(n.getHours() % 12 || 12, e.length);
|
|
1503
1495
|
},
|
|
1504
1496
|
// Hour [0-23]
|
|
1505
|
-
H(
|
|
1506
|
-
return _(
|
|
1497
|
+
H(n, e) {
|
|
1498
|
+
return _(n.getHours(), e.length);
|
|
1507
1499
|
},
|
|
1508
1500
|
// Minute
|
|
1509
|
-
m(
|
|
1510
|
-
return _(
|
|
1501
|
+
m(n, e) {
|
|
1502
|
+
return _(n.getMinutes(), e.length);
|
|
1511
1503
|
},
|
|
1512
1504
|
// Second
|
|
1513
|
-
s(
|
|
1514
|
-
return _(
|
|
1505
|
+
s(n, e) {
|
|
1506
|
+
return _(n.getSeconds(), e.length);
|
|
1515
1507
|
},
|
|
1516
1508
|
// Fraction of second
|
|
1517
|
-
S(
|
|
1518
|
-
const t = e.length,
|
|
1519
|
-
|
|
1509
|
+
S(n, e) {
|
|
1510
|
+
const t = e.length, r = n.getMilliseconds(), i = Math.trunc(
|
|
1511
|
+
r * Math.pow(10, t - 3)
|
|
1520
1512
|
);
|
|
1521
1513
|
return _(i, e.length);
|
|
1522
1514
|
}
|
|
@@ -1527,36 +1519,36 @@ const j = {
|
|
|
1527
1519
|
afternoon: "afternoon",
|
|
1528
1520
|
evening: "evening",
|
|
1529
1521
|
night: "night"
|
|
1530
|
-
},
|
|
1522
|
+
}, Se = {
|
|
1531
1523
|
// Era
|
|
1532
|
-
G: function(
|
|
1533
|
-
const
|
|
1524
|
+
G: function(n, e, t) {
|
|
1525
|
+
const r = n.getFullYear() > 0 ? 1 : 0;
|
|
1534
1526
|
switch (e) {
|
|
1535
1527
|
// AD, BC
|
|
1536
1528
|
case "G":
|
|
1537
1529
|
case "GG":
|
|
1538
1530
|
case "GGG":
|
|
1539
|
-
return t.era(
|
|
1531
|
+
return t.era(r, { width: "abbreviated" });
|
|
1540
1532
|
// A, B
|
|
1541
1533
|
case "GGGGG":
|
|
1542
|
-
return t.era(
|
|
1534
|
+
return t.era(r, { width: "narrow" });
|
|
1543
1535
|
// Anno Domini, Before Christ
|
|
1544
1536
|
case "GGGG":
|
|
1545
1537
|
default:
|
|
1546
|
-
return t.era(
|
|
1538
|
+
return t.era(r, { width: "wide" });
|
|
1547
1539
|
}
|
|
1548
1540
|
},
|
|
1549
1541
|
// Year
|
|
1550
|
-
y: function(
|
|
1542
|
+
y: function(n, e, t) {
|
|
1551
1543
|
if (e === "yo") {
|
|
1552
|
-
const
|
|
1544
|
+
const r = n.getFullYear(), i = r > 0 ? r : 1 - r;
|
|
1553
1545
|
return t.ordinalNumber(i, { unit: "year" });
|
|
1554
1546
|
}
|
|
1555
|
-
return
|
|
1547
|
+
return C.y(n, e);
|
|
1556
1548
|
},
|
|
1557
1549
|
// Local week-numbering year
|
|
1558
|
-
Y: function(
|
|
1559
|
-
const i =
|
|
1550
|
+
Y: function(n, e, t, r) {
|
|
1551
|
+
const i = de(n, r), a = i > 0 ? i : 1 - i;
|
|
1560
1552
|
if (e === "YY") {
|
|
1561
1553
|
const o = a % 100;
|
|
1562
1554
|
return _(o, 2);
|
|
@@ -1564,8 +1556,8 @@ const j = {
|
|
|
1564
1556
|
return e === "Yo" ? t.ordinalNumber(a, { unit: "year" }) : _(a, e.length);
|
|
1565
1557
|
},
|
|
1566
1558
|
// ISO week-numbering year
|
|
1567
|
-
R: function(
|
|
1568
|
-
const t =
|
|
1559
|
+
R: function(n, e) {
|
|
1560
|
+
const t = st(n);
|
|
1569
1561
|
return _(t, e.length);
|
|
1570
1562
|
},
|
|
1571
1563
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -1577,192 +1569,192 @@ const j = {
|
|
|
1577
1569
|
// | BC 2 | 2 | -1 |
|
|
1578
1570
|
// Also `yy` always returns the last two digits of a year,
|
|
1579
1571
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
1580
|
-
u: function(
|
|
1581
|
-
const t =
|
|
1572
|
+
u: function(n, e) {
|
|
1573
|
+
const t = n.getFullYear();
|
|
1582
1574
|
return _(t, e.length);
|
|
1583
1575
|
},
|
|
1584
1576
|
// Quarter
|
|
1585
|
-
Q: function(
|
|
1586
|
-
const
|
|
1577
|
+
Q: function(n, e, t) {
|
|
1578
|
+
const r = Math.ceil((n.getMonth() + 1) / 3);
|
|
1587
1579
|
switch (e) {
|
|
1588
1580
|
// 1, 2, 3, 4
|
|
1589
1581
|
case "Q":
|
|
1590
|
-
return String(
|
|
1582
|
+
return String(r);
|
|
1591
1583
|
// 01, 02, 03, 04
|
|
1592
1584
|
case "QQ":
|
|
1593
|
-
return _(
|
|
1585
|
+
return _(r, 2);
|
|
1594
1586
|
// 1st, 2nd, 3rd, 4th
|
|
1595
1587
|
case "Qo":
|
|
1596
|
-
return t.ordinalNumber(
|
|
1588
|
+
return t.ordinalNumber(r, { unit: "quarter" });
|
|
1597
1589
|
// Q1, Q2, Q3, Q4
|
|
1598
1590
|
case "QQQ":
|
|
1599
|
-
return t.quarter(
|
|
1591
|
+
return t.quarter(r, {
|
|
1600
1592
|
width: "abbreviated",
|
|
1601
1593
|
context: "formatting"
|
|
1602
1594
|
});
|
|
1603
1595
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1604
1596
|
case "QQQQQ":
|
|
1605
|
-
return t.quarter(
|
|
1597
|
+
return t.quarter(r, {
|
|
1606
1598
|
width: "narrow",
|
|
1607
1599
|
context: "formatting"
|
|
1608
1600
|
});
|
|
1609
1601
|
// 1st quarter, 2nd quarter, ...
|
|
1610
1602
|
case "QQQQ":
|
|
1611
1603
|
default:
|
|
1612
|
-
return t.quarter(
|
|
1604
|
+
return t.quarter(r, {
|
|
1613
1605
|
width: "wide",
|
|
1614
1606
|
context: "formatting"
|
|
1615
1607
|
});
|
|
1616
1608
|
}
|
|
1617
1609
|
},
|
|
1618
1610
|
// Stand-alone quarter
|
|
1619
|
-
q: function(
|
|
1620
|
-
const
|
|
1611
|
+
q: function(n, e, t) {
|
|
1612
|
+
const r = Math.ceil((n.getMonth() + 1) / 3);
|
|
1621
1613
|
switch (e) {
|
|
1622
1614
|
// 1, 2, 3, 4
|
|
1623
1615
|
case "q":
|
|
1624
|
-
return String(
|
|
1616
|
+
return String(r);
|
|
1625
1617
|
// 01, 02, 03, 04
|
|
1626
1618
|
case "qq":
|
|
1627
|
-
return _(
|
|
1619
|
+
return _(r, 2);
|
|
1628
1620
|
// 1st, 2nd, 3rd, 4th
|
|
1629
1621
|
case "qo":
|
|
1630
|
-
return t.ordinalNumber(
|
|
1622
|
+
return t.ordinalNumber(r, { unit: "quarter" });
|
|
1631
1623
|
// Q1, Q2, Q3, Q4
|
|
1632
1624
|
case "qqq":
|
|
1633
|
-
return t.quarter(
|
|
1625
|
+
return t.quarter(r, {
|
|
1634
1626
|
width: "abbreviated",
|
|
1635
1627
|
context: "standalone"
|
|
1636
1628
|
});
|
|
1637
1629
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1638
1630
|
case "qqqqq":
|
|
1639
|
-
return t.quarter(
|
|
1631
|
+
return t.quarter(r, {
|
|
1640
1632
|
width: "narrow",
|
|
1641
1633
|
context: "standalone"
|
|
1642
1634
|
});
|
|
1643
1635
|
// 1st quarter, 2nd quarter, ...
|
|
1644
1636
|
case "qqqq":
|
|
1645
1637
|
default:
|
|
1646
|
-
return t.quarter(
|
|
1638
|
+
return t.quarter(r, {
|
|
1647
1639
|
width: "wide",
|
|
1648
1640
|
context: "standalone"
|
|
1649
1641
|
});
|
|
1650
1642
|
}
|
|
1651
1643
|
},
|
|
1652
1644
|
// Month
|
|
1653
|
-
M: function(
|
|
1654
|
-
const
|
|
1645
|
+
M: function(n, e, t) {
|
|
1646
|
+
const r = n.getMonth();
|
|
1655
1647
|
switch (e) {
|
|
1656
1648
|
case "M":
|
|
1657
1649
|
case "MM":
|
|
1658
|
-
return
|
|
1650
|
+
return C.M(n, e);
|
|
1659
1651
|
// 1st, 2nd, ..., 12th
|
|
1660
1652
|
case "Mo":
|
|
1661
|
-
return t.ordinalNumber(
|
|
1653
|
+
return t.ordinalNumber(r + 1, { unit: "month" });
|
|
1662
1654
|
// Jan, Feb, ..., Dec
|
|
1663
1655
|
case "MMM":
|
|
1664
|
-
return t.month(
|
|
1656
|
+
return t.month(r, {
|
|
1665
1657
|
width: "abbreviated",
|
|
1666
1658
|
context: "formatting"
|
|
1667
1659
|
});
|
|
1668
1660
|
// J, F, ..., D
|
|
1669
1661
|
case "MMMMM":
|
|
1670
|
-
return t.month(
|
|
1662
|
+
return t.month(r, {
|
|
1671
1663
|
width: "narrow",
|
|
1672
1664
|
context: "formatting"
|
|
1673
1665
|
});
|
|
1674
1666
|
// January, February, ..., December
|
|
1675
1667
|
case "MMMM":
|
|
1676
1668
|
default:
|
|
1677
|
-
return t.month(
|
|
1669
|
+
return t.month(r, { width: "wide", context: "formatting" });
|
|
1678
1670
|
}
|
|
1679
1671
|
},
|
|
1680
1672
|
// Stand-alone month
|
|
1681
|
-
L: function(
|
|
1682
|
-
const
|
|
1673
|
+
L: function(n, e, t) {
|
|
1674
|
+
const r = n.getMonth();
|
|
1683
1675
|
switch (e) {
|
|
1684
1676
|
// 1, 2, ..., 12
|
|
1685
1677
|
case "L":
|
|
1686
|
-
return String(
|
|
1678
|
+
return String(r + 1);
|
|
1687
1679
|
// 01, 02, ..., 12
|
|
1688
1680
|
case "LL":
|
|
1689
|
-
return _(
|
|
1681
|
+
return _(r + 1, 2);
|
|
1690
1682
|
// 1st, 2nd, ..., 12th
|
|
1691
1683
|
case "Lo":
|
|
1692
|
-
return t.ordinalNumber(
|
|
1684
|
+
return t.ordinalNumber(r + 1, { unit: "month" });
|
|
1693
1685
|
// Jan, Feb, ..., Dec
|
|
1694
1686
|
case "LLL":
|
|
1695
|
-
return t.month(
|
|
1687
|
+
return t.month(r, {
|
|
1696
1688
|
width: "abbreviated",
|
|
1697
1689
|
context: "standalone"
|
|
1698
1690
|
});
|
|
1699
1691
|
// J, F, ..., D
|
|
1700
1692
|
case "LLLLL":
|
|
1701
|
-
return t.month(
|
|
1693
|
+
return t.month(r, {
|
|
1702
1694
|
width: "narrow",
|
|
1703
1695
|
context: "standalone"
|
|
1704
1696
|
});
|
|
1705
1697
|
// January, February, ..., December
|
|
1706
1698
|
case "LLLL":
|
|
1707
1699
|
default:
|
|
1708
|
-
return t.month(
|
|
1700
|
+
return t.month(r, { width: "wide", context: "standalone" });
|
|
1709
1701
|
}
|
|
1710
1702
|
},
|
|
1711
1703
|
// Local week of year
|
|
1712
|
-
w: function(
|
|
1713
|
-
const i =
|
|
1704
|
+
w: function(n, e, t, r) {
|
|
1705
|
+
const i = dt(n, r);
|
|
1714
1706
|
return e === "wo" ? t.ordinalNumber(i, { unit: "week" }) : _(i, e.length);
|
|
1715
1707
|
},
|
|
1716
1708
|
// ISO week of year
|
|
1717
|
-
I: function(
|
|
1718
|
-
const
|
|
1719
|
-
return e === "Io" ? t.ordinalNumber(
|
|
1709
|
+
I: function(n, e, t) {
|
|
1710
|
+
const r = lt(n);
|
|
1711
|
+
return e === "Io" ? t.ordinalNumber(r, { unit: "week" }) : _(r, e.length);
|
|
1720
1712
|
},
|
|
1721
1713
|
// Day of the month
|
|
1722
|
-
d: function(
|
|
1723
|
-
return e === "do" ? t.ordinalNumber(
|
|
1714
|
+
d: function(n, e, t) {
|
|
1715
|
+
return e === "do" ? t.ordinalNumber(n.getDate(), { unit: "date" }) : C.d(n, e);
|
|
1724
1716
|
},
|
|
1725
1717
|
// Day of year
|
|
1726
|
-
D: function(
|
|
1727
|
-
const
|
|
1728
|
-
return e === "Do" ? t.ordinalNumber(
|
|
1718
|
+
D: function(n, e, t) {
|
|
1719
|
+
const r = Gn(n);
|
|
1720
|
+
return e === "Do" ? t.ordinalNumber(r, { unit: "dayOfYear" }) : _(r, e.length);
|
|
1729
1721
|
},
|
|
1730
1722
|
// Day of week
|
|
1731
|
-
E: function(
|
|
1732
|
-
const
|
|
1723
|
+
E: function(n, e, t) {
|
|
1724
|
+
const r = n.getDay();
|
|
1733
1725
|
switch (e) {
|
|
1734
1726
|
// Tue
|
|
1735
1727
|
case "E":
|
|
1736
1728
|
case "EE":
|
|
1737
1729
|
case "EEE":
|
|
1738
|
-
return t.day(
|
|
1730
|
+
return t.day(r, {
|
|
1739
1731
|
width: "abbreviated",
|
|
1740
1732
|
context: "formatting"
|
|
1741
1733
|
});
|
|
1742
1734
|
// T
|
|
1743
1735
|
case "EEEEE":
|
|
1744
|
-
return t.day(
|
|
1736
|
+
return t.day(r, {
|
|
1745
1737
|
width: "narrow",
|
|
1746
1738
|
context: "formatting"
|
|
1747
1739
|
});
|
|
1748
1740
|
// Tu
|
|
1749
1741
|
case "EEEEEE":
|
|
1750
|
-
return t.day(
|
|
1742
|
+
return t.day(r, {
|
|
1751
1743
|
width: "short",
|
|
1752
1744
|
context: "formatting"
|
|
1753
1745
|
});
|
|
1754
1746
|
// Tuesday
|
|
1755
1747
|
case "EEEE":
|
|
1756
1748
|
default:
|
|
1757
|
-
return t.day(
|
|
1749
|
+
return t.day(r, {
|
|
1758
1750
|
width: "wide",
|
|
1759
1751
|
context: "formatting"
|
|
1760
1752
|
});
|
|
1761
1753
|
}
|
|
1762
1754
|
},
|
|
1763
1755
|
// Local day of week
|
|
1764
|
-
e: function(
|
|
1765
|
-
const i =
|
|
1756
|
+
e: function(n, e, t, r) {
|
|
1757
|
+
const i = n.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
1766
1758
|
switch (e) {
|
|
1767
1759
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1768
1760
|
case "e":
|
|
@@ -1800,8 +1792,8 @@ const j = {
|
|
|
1800
1792
|
}
|
|
1801
1793
|
},
|
|
1802
1794
|
// Stand-alone local day of week
|
|
1803
|
-
c: function(
|
|
1804
|
-
const i =
|
|
1795
|
+
c: function(n, e, t, r) {
|
|
1796
|
+
const i = n.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
1805
1797
|
switch (e) {
|
|
1806
1798
|
// Numerical value (same as in `e`)
|
|
1807
1799
|
case "c":
|
|
@@ -1839,8 +1831,8 @@ const j = {
|
|
|
1839
1831
|
}
|
|
1840
1832
|
},
|
|
1841
1833
|
// ISO day of week
|
|
1842
|
-
i: function(
|
|
1843
|
-
const
|
|
1834
|
+
i: function(n, e, t) {
|
|
1835
|
+
const r = n.getDay(), i = r === 0 ? 7 : r;
|
|
1844
1836
|
switch (e) {
|
|
1845
1837
|
// 2
|
|
1846
1838
|
case "i":
|
|
@@ -1853,34 +1845,34 @@ const j = {
|
|
|
1853
1845
|
return t.ordinalNumber(i, { unit: "day" });
|
|
1854
1846
|
// Tue
|
|
1855
1847
|
case "iii":
|
|
1856
|
-
return t.day(
|
|
1848
|
+
return t.day(r, {
|
|
1857
1849
|
width: "abbreviated",
|
|
1858
1850
|
context: "formatting"
|
|
1859
1851
|
});
|
|
1860
1852
|
// T
|
|
1861
1853
|
case "iiiii":
|
|
1862
|
-
return t.day(
|
|
1854
|
+
return t.day(r, {
|
|
1863
1855
|
width: "narrow",
|
|
1864
1856
|
context: "formatting"
|
|
1865
1857
|
});
|
|
1866
1858
|
// Tu
|
|
1867
1859
|
case "iiiiii":
|
|
1868
|
-
return t.day(
|
|
1860
|
+
return t.day(r, {
|
|
1869
1861
|
width: "short",
|
|
1870
1862
|
context: "formatting"
|
|
1871
1863
|
});
|
|
1872
1864
|
// Tuesday
|
|
1873
1865
|
case "iiii":
|
|
1874
1866
|
default:
|
|
1875
|
-
return t.day(
|
|
1867
|
+
return t.day(r, {
|
|
1876
1868
|
width: "wide",
|
|
1877
1869
|
context: "formatting"
|
|
1878
1870
|
});
|
|
1879
1871
|
}
|
|
1880
1872
|
},
|
|
1881
1873
|
// AM or PM
|
|
1882
|
-
a: function(
|
|
1883
|
-
const i =
|
|
1874
|
+
a: function(n, e, t) {
|
|
1875
|
+
const i = n.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1884
1876
|
switch (e) {
|
|
1885
1877
|
case "a":
|
|
1886
1878
|
case "aa":
|
|
@@ -1907,10 +1899,10 @@ const j = {
|
|
|
1907
1899
|
}
|
|
1908
1900
|
},
|
|
1909
1901
|
// AM, PM, midnight, noon
|
|
1910
|
-
b: function(
|
|
1911
|
-
const
|
|
1902
|
+
b: function(n, e, t) {
|
|
1903
|
+
const r = n.getHours();
|
|
1912
1904
|
let i;
|
|
1913
|
-
switch (
|
|
1905
|
+
switch (r === 12 ? i = Q.noon : r === 0 ? i = Q.midnight : i = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1914
1906
|
case "b":
|
|
1915
1907
|
case "bb":
|
|
1916
1908
|
return t.dayPeriod(i, {
|
|
@@ -1936,10 +1928,10 @@ const j = {
|
|
|
1936
1928
|
}
|
|
1937
1929
|
},
|
|
1938
1930
|
// in the morning, in the afternoon, in the evening, at night
|
|
1939
|
-
B: function(
|
|
1940
|
-
const
|
|
1931
|
+
B: function(n, e, t) {
|
|
1932
|
+
const r = n.getHours();
|
|
1941
1933
|
let i;
|
|
1942
|
-
switch (
|
|
1934
|
+
switch (r >= 17 ? i = Q.evening : r >= 12 ? i = Q.afternoon : r >= 4 ? i = Q.morning : i = Q.night, e) {
|
|
1943
1935
|
case "B":
|
|
1944
1936
|
case "BB":
|
|
1945
1937
|
case "BBB":
|
|
@@ -1961,54 +1953,54 @@ const j = {
|
|
|
1961
1953
|
}
|
|
1962
1954
|
},
|
|
1963
1955
|
// Hour [1-12]
|
|
1964
|
-
h: function(
|
|
1956
|
+
h: function(n, e, t) {
|
|
1965
1957
|
if (e === "ho") {
|
|
1966
|
-
let
|
|
1967
|
-
return
|
|
1958
|
+
let r = n.getHours() % 12;
|
|
1959
|
+
return r === 0 && (r = 12), t.ordinalNumber(r, { unit: "hour" });
|
|
1968
1960
|
}
|
|
1969
|
-
return
|
|
1961
|
+
return C.h(n, e);
|
|
1970
1962
|
},
|
|
1971
1963
|
// Hour [0-23]
|
|
1972
|
-
H: function(
|
|
1973
|
-
return e === "Ho" ? t.ordinalNumber(
|
|
1964
|
+
H: function(n, e, t) {
|
|
1965
|
+
return e === "Ho" ? t.ordinalNumber(n.getHours(), { unit: "hour" }) : C.H(n, e);
|
|
1974
1966
|
},
|
|
1975
1967
|
// Hour [0-11]
|
|
1976
|
-
K: function(
|
|
1977
|
-
const
|
|
1978
|
-
return e === "Ko" ? t.ordinalNumber(
|
|
1968
|
+
K: function(n, e, t) {
|
|
1969
|
+
const r = n.getHours() % 12;
|
|
1970
|
+
return e === "Ko" ? t.ordinalNumber(r, { unit: "hour" }) : _(r, e.length);
|
|
1979
1971
|
},
|
|
1980
1972
|
// Hour [1-24]
|
|
1981
|
-
k: function(
|
|
1982
|
-
let
|
|
1983
|
-
return
|
|
1973
|
+
k: function(n, e, t) {
|
|
1974
|
+
let r = n.getHours();
|
|
1975
|
+
return r === 0 && (r = 24), e === "ko" ? t.ordinalNumber(r, { unit: "hour" }) : _(r, e.length);
|
|
1984
1976
|
},
|
|
1985
1977
|
// Minute
|
|
1986
|
-
m: function(
|
|
1987
|
-
return e === "mo" ? t.ordinalNumber(
|
|
1978
|
+
m: function(n, e, t) {
|
|
1979
|
+
return e === "mo" ? t.ordinalNumber(n.getMinutes(), { unit: "minute" }) : C.m(n, e);
|
|
1988
1980
|
},
|
|
1989
1981
|
// Second
|
|
1990
|
-
s: function(
|
|
1991
|
-
return e === "so" ? t.ordinalNumber(
|
|
1982
|
+
s: function(n, e, t) {
|
|
1983
|
+
return e === "so" ? t.ordinalNumber(n.getSeconds(), { unit: "second" }) : C.s(n, e);
|
|
1992
1984
|
},
|
|
1993
1985
|
// Fraction of second
|
|
1994
|
-
S: function(
|
|
1995
|
-
return
|
|
1986
|
+
S: function(n, e) {
|
|
1987
|
+
return C.S(n, e);
|
|
1996
1988
|
},
|
|
1997
1989
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1998
|
-
X: function(
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
1990
|
+
X: function(n, e, t) {
|
|
1991
|
+
const r = n.getTimezoneOffset();
|
|
1992
|
+
if (r === 0)
|
|
2001
1993
|
return "Z";
|
|
2002
1994
|
switch (e) {
|
|
2003
1995
|
// Hours and optional minutes
|
|
2004
1996
|
case "X":
|
|
2005
|
-
return
|
|
1997
|
+
return Xe(r);
|
|
2006
1998
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
2007
1999
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2008
2000
|
// so this token always has the same output as `XX`
|
|
2009
2001
|
case "XXXX":
|
|
2010
2002
|
case "XX":
|
|
2011
|
-
return I(
|
|
2003
|
+
return I(r);
|
|
2012
2004
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
2013
2005
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2014
2006
|
// so this token always has the same output as `XXX`
|
|
@@ -2016,22 +2008,22 @@ const j = {
|
|
|
2016
2008
|
case "XXX":
|
|
2017
2009
|
// Hours and minutes with `:` delimiter
|
|
2018
2010
|
default:
|
|
2019
|
-
return I(
|
|
2011
|
+
return I(r, ":");
|
|
2020
2012
|
}
|
|
2021
2013
|
},
|
|
2022
2014
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2023
|
-
x: function(
|
|
2024
|
-
const
|
|
2015
|
+
x: function(n, e, t) {
|
|
2016
|
+
const r = n.getTimezoneOffset();
|
|
2025
2017
|
switch (e) {
|
|
2026
2018
|
// Hours and optional minutes
|
|
2027
2019
|
case "x":
|
|
2028
|
-
return
|
|
2020
|
+
return Xe(r);
|
|
2029
2021
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
2030
2022
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2031
2023
|
// so this token always has the same output as `xx`
|
|
2032
2024
|
case "xxxx":
|
|
2033
2025
|
case "xx":
|
|
2034
|
-
return I(
|
|
2026
|
+
return I(r);
|
|
2035
2027
|
// Hours, minutes and optional seconds with `:` delimiter
|
|
2036
2028
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2037
2029
|
// so this token always has the same output as `xxx`
|
|
@@ -2039,62 +2031,62 @@ const j = {
|
|
|
2039
2031
|
case "xxx":
|
|
2040
2032
|
// Hours and minutes with `:` delimiter
|
|
2041
2033
|
default:
|
|
2042
|
-
return I(
|
|
2034
|
+
return I(r, ":");
|
|
2043
2035
|
}
|
|
2044
2036
|
},
|
|
2045
2037
|
// Timezone (GMT)
|
|
2046
|
-
O: function(
|
|
2047
|
-
const
|
|
2038
|
+
O: function(n, e, t) {
|
|
2039
|
+
const r = n.getTimezoneOffset();
|
|
2048
2040
|
switch (e) {
|
|
2049
2041
|
// Short
|
|
2050
2042
|
case "O":
|
|
2051
2043
|
case "OO":
|
|
2052
2044
|
case "OOO":
|
|
2053
|
-
return "GMT" + Ge(
|
|
2045
|
+
return "GMT" + Ge(r, ":");
|
|
2054
2046
|
// Long
|
|
2055
2047
|
case "OOOO":
|
|
2056
2048
|
default:
|
|
2057
|
-
return "GMT" + I(
|
|
2049
|
+
return "GMT" + I(r, ":");
|
|
2058
2050
|
}
|
|
2059
2051
|
},
|
|
2060
2052
|
// Timezone (specific non-location)
|
|
2061
|
-
z: function(
|
|
2062
|
-
const
|
|
2053
|
+
z: function(n, e, t) {
|
|
2054
|
+
const r = n.getTimezoneOffset();
|
|
2063
2055
|
switch (e) {
|
|
2064
2056
|
// Short
|
|
2065
2057
|
case "z":
|
|
2066
2058
|
case "zz":
|
|
2067
2059
|
case "zzz":
|
|
2068
|
-
return "GMT" + Ge(
|
|
2060
|
+
return "GMT" + Ge(r, ":");
|
|
2069
2061
|
// Long
|
|
2070
2062
|
case "zzzz":
|
|
2071
2063
|
default:
|
|
2072
|
-
return "GMT" + I(
|
|
2064
|
+
return "GMT" + I(r, ":");
|
|
2073
2065
|
}
|
|
2074
2066
|
},
|
|
2075
2067
|
// Seconds timestamp
|
|
2076
|
-
t: function(
|
|
2077
|
-
const
|
|
2078
|
-
return _(
|
|
2068
|
+
t: function(n, e, t) {
|
|
2069
|
+
const r = Math.trunc(+n / 1e3);
|
|
2070
|
+
return _(r, e.length);
|
|
2079
2071
|
},
|
|
2080
2072
|
// Milliseconds timestamp
|
|
2081
|
-
T: function(
|
|
2082
|
-
return _(+
|
|
2073
|
+
T: function(n, e, t) {
|
|
2074
|
+
return _(+n, e.length);
|
|
2083
2075
|
}
|
|
2084
2076
|
};
|
|
2085
|
-
function Ge(
|
|
2086
|
-
const t =
|
|
2077
|
+
function Ge(n, e = "") {
|
|
2078
|
+
const t = n > 0 ? "-" : "+", r = Math.abs(n), i = Math.trunc(r / 60), a = r % 60;
|
|
2087
2079
|
return a === 0 ? t + String(i) : t + String(i) + e + _(a, 2);
|
|
2088
2080
|
}
|
|
2089
|
-
function
|
|
2090
|
-
return
|
|
2081
|
+
function Xe(n, e) {
|
|
2082
|
+
return n % 60 === 0 ? (n > 0 ? "-" : "+") + _(Math.abs(n) / 60, 2) : I(n, e);
|
|
2091
2083
|
}
|
|
2092
|
-
function I(
|
|
2093
|
-
const t =
|
|
2084
|
+
function I(n, e = "") {
|
|
2085
|
+
const t = n > 0 ? "-" : "+", r = Math.abs(n), i = _(Math.trunc(r / 60), 2), a = _(r % 60, 2);
|
|
2094
2086
|
return t + i + e + a;
|
|
2095
2087
|
}
|
|
2096
|
-
const
|
|
2097
|
-
switch (
|
|
2088
|
+
const Ve = (n, e) => {
|
|
2089
|
+
switch (n) {
|
|
2098
2090
|
case "P":
|
|
2099
2091
|
return e.date({ width: "short" });
|
|
2100
2092
|
case "PP":
|
|
@@ -2105,8 +2097,8 @@ const ze = (r, e) => {
|
|
|
2105
2097
|
default:
|
|
2106
2098
|
return e.date({ width: "full" });
|
|
2107
2099
|
}
|
|
2108
|
-
},
|
|
2109
|
-
switch (
|
|
2100
|
+
}, ft = (n, e) => {
|
|
2101
|
+
switch (n) {
|
|
2110
2102
|
case "p":
|
|
2111
2103
|
return e.time({ width: "short" });
|
|
2112
2104
|
case "pp":
|
|
@@ -2117,12 +2109,12 @@ const ze = (r, e) => {
|
|
|
2117
2109
|
default:
|
|
2118
2110
|
return e.time({ width: "full" });
|
|
2119
2111
|
}
|
|
2120
|
-
},
|
|
2121
|
-
const t =
|
|
2112
|
+
}, Vn = (n, e) => {
|
|
2113
|
+
const t = n.match(/(P+)(p+)?/) || [], r = t[1], i = t[2];
|
|
2122
2114
|
if (!i)
|
|
2123
|
-
return
|
|
2115
|
+
return Ve(n, e);
|
|
2124
2116
|
let a;
|
|
2125
|
-
switch (
|
|
2117
|
+
switch (r) {
|
|
2126
2118
|
case "P":
|
|
2127
2119
|
a = e.dateTime({ width: "short" });
|
|
2128
2120
|
break;
|
|
@@ -2137,48 +2129,48 @@ const ze = (r, e) => {
|
|
|
2137
2129
|
a = e.dateTime({ width: "full" });
|
|
2138
2130
|
break;
|
|
2139
2131
|
}
|
|
2140
|
-
return a.replace("{{date}}",
|
|
2141
|
-
},
|
|
2142
|
-
p:
|
|
2143
|
-
P:
|
|
2144
|
-
},
|
|
2145
|
-
function
|
|
2146
|
-
return
|
|
2147
|
-
}
|
|
2148
|
-
function
|
|
2149
|
-
return
|
|
2150
|
-
}
|
|
2151
|
-
function
|
|
2152
|
-
const
|
|
2153
|
-
if (console.warn(
|
|
2154
|
-
}
|
|
2155
|
-
function
|
|
2156
|
-
const
|
|
2157
|
-
return `Use \`${
|
|
2158
|
-
}
|
|
2159
|
-
const
|
|
2160
|
-
function
|
|
2161
|
-
const
|
|
2162
|
-
if (!
|
|
2132
|
+
return a.replace("{{date}}", Ve(r, e)).replace("{{time}}", ft(i, e));
|
|
2133
|
+
}, se = {
|
|
2134
|
+
p: ft,
|
|
2135
|
+
P: Vn
|
|
2136
|
+
}, zn = /^D+$/, Zn = /^Y+$/, Jn = ["D", "DD", "YY", "YYYY"];
|
|
2137
|
+
function pt(n) {
|
|
2138
|
+
return zn.test(n);
|
|
2139
|
+
}
|
|
2140
|
+
function ht(n) {
|
|
2141
|
+
return Zn.test(n);
|
|
2142
|
+
}
|
|
2143
|
+
function ue(n, e, t) {
|
|
2144
|
+
const r = Kn(n, e, t);
|
|
2145
|
+
if (console.warn(r), Jn.includes(n)) throw new RangeError(r);
|
|
2146
|
+
}
|
|
2147
|
+
function Kn(n, e, t) {
|
|
2148
|
+
const r = n[0] === "Y" ? "years" : "days of the month";
|
|
2149
|
+
return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2150
|
+
}
|
|
2151
|
+
const Un = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ea = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ta = /^'([^]*?)'?$/, ra = /''/g, na = /[a-zA-Z]/;
|
|
2152
|
+
function aa(n, e, t) {
|
|
2153
|
+
const r = S(), i = r.locale ?? ct, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = M(n, t?.in);
|
|
2154
|
+
if (!ut(s))
|
|
2163
2155
|
throw new RangeError("Invalid time value");
|
|
2164
|
-
let h = e.match(
|
|
2165
|
-
const
|
|
2166
|
-
if (
|
|
2167
|
-
const N =
|
|
2156
|
+
let h = e.match(ea).map((m) => {
|
|
2157
|
+
const f = m[0];
|
|
2158
|
+
if (f === "p" || f === "P") {
|
|
2159
|
+
const N = se[f];
|
|
2168
2160
|
return N(m, i.formatLong);
|
|
2169
2161
|
}
|
|
2170
2162
|
return m;
|
|
2171
|
-
}).join("").match(
|
|
2163
|
+
}).join("").match(Un).map((m) => {
|
|
2172
2164
|
if (m === "''")
|
|
2173
2165
|
return { isToken: !1, value: "'" };
|
|
2174
|
-
const
|
|
2175
|
-
if (
|
|
2176
|
-
return { isToken: !1, value:
|
|
2177
|
-
if (
|
|
2166
|
+
const f = m[0];
|
|
2167
|
+
if (f === "'")
|
|
2168
|
+
return { isToken: !1, value: ia(m) };
|
|
2169
|
+
if (Se[f])
|
|
2178
2170
|
return { isToken: !0, value: m };
|
|
2179
|
-
if (
|
|
2171
|
+
if (f.match(na))
|
|
2180
2172
|
throw new RangeError(
|
|
2181
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
2173
|
+
"Format string contains an unescaped latin alphabet character `" + f + "`"
|
|
2182
2174
|
);
|
|
2183
2175
|
return { isToken: !1, value: m };
|
|
2184
2176
|
});
|
|
@@ -2190,68 +2182,68 @@ function ua(r, e, t) {
|
|
|
2190
2182
|
};
|
|
2191
2183
|
return h.map((m) => {
|
|
2192
2184
|
if (!m.isToken) return m.value;
|
|
2193
|
-
const
|
|
2194
|
-
(
|
|
2195
|
-
const N =
|
|
2196
|
-
return N(s,
|
|
2185
|
+
const f = m.value;
|
|
2186
|
+
(ht(f) || pt(f)) && ue(f, e, String(n));
|
|
2187
|
+
const N = Se[f[0]];
|
|
2188
|
+
return N(s, f, i.localize, c);
|
|
2197
2189
|
}).join("");
|
|
2198
2190
|
}
|
|
2199
|
-
function
|
|
2200
|
-
const e =
|
|
2201
|
-
return e ? e[1].replace(
|
|
2191
|
+
function ia(n) {
|
|
2192
|
+
const e = n.match(ta);
|
|
2193
|
+
return e ? e[1].replace(ra, "'") : n;
|
|
2202
2194
|
}
|
|
2203
|
-
function
|
|
2195
|
+
function oa() {
|
|
2204
2196
|
return Object.assign({}, S());
|
|
2205
2197
|
}
|
|
2206
|
-
function
|
|
2207
|
-
const t = M(
|
|
2198
|
+
function sa(n, e) {
|
|
2199
|
+
const t = M(n, e?.in).getDay();
|
|
2208
2200
|
return t === 0 ? 7 : t;
|
|
2209
2201
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const t =
|
|
2212
|
-
return t.setFullYear(
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2202
|
+
function ua(n, e) {
|
|
2203
|
+
const t = ca(e) ? new e(0) : D(e, 0);
|
|
2204
|
+
return t.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), t.setHours(
|
|
2205
|
+
n.getHours(),
|
|
2206
|
+
n.getMinutes(),
|
|
2207
|
+
n.getSeconds(),
|
|
2208
|
+
n.getMilliseconds()
|
|
2217
2209
|
), t;
|
|
2218
2210
|
}
|
|
2219
|
-
function
|
|
2220
|
-
return typeof
|
|
2211
|
+
function ca(n) {
|
|
2212
|
+
return typeof n == "function" && n.prototype?.constructor === n;
|
|
2221
2213
|
}
|
|
2222
|
-
const
|
|
2223
|
-
class
|
|
2214
|
+
const la = 10;
|
|
2215
|
+
class mt {
|
|
2224
2216
|
subPriority = 0;
|
|
2225
2217
|
validate(e, t) {
|
|
2226
2218
|
return !0;
|
|
2227
2219
|
}
|
|
2228
2220
|
}
|
|
2229
|
-
class
|
|
2230
|
-
constructor(e, t,
|
|
2231
|
-
super(), this.value = e, this.validateValue = t, this.setValue =
|
|
2221
|
+
class da extends mt {
|
|
2222
|
+
constructor(e, t, r, i, a) {
|
|
2223
|
+
super(), this.value = e, this.validateValue = t, this.setValue = r, this.priority = i, a && (this.subPriority = a);
|
|
2232
2224
|
}
|
|
2233
2225
|
validate(e, t) {
|
|
2234
2226
|
return this.validateValue(e, this.value, t);
|
|
2235
2227
|
}
|
|
2236
|
-
set(e, t,
|
|
2237
|
-
return this.setValue(e, t, this.value,
|
|
2228
|
+
set(e, t, r) {
|
|
2229
|
+
return this.setValue(e, t, this.value, r);
|
|
2238
2230
|
}
|
|
2239
2231
|
}
|
|
2240
|
-
class
|
|
2241
|
-
priority =
|
|
2232
|
+
class fa extends mt {
|
|
2233
|
+
priority = la;
|
|
2242
2234
|
subPriority = -1;
|
|
2243
2235
|
constructor(e, t) {
|
|
2244
|
-
super(), this.context = e || ((
|
|
2236
|
+
super(), this.context = e || ((r) => D(t, r));
|
|
2245
2237
|
}
|
|
2246
2238
|
set(e, t) {
|
|
2247
|
-
return t.timestampIsSet ? e : D(e,
|
|
2239
|
+
return t.timestampIsSet ? e : D(e, ua(e, this.context));
|
|
2248
2240
|
}
|
|
2249
2241
|
}
|
|
2250
|
-
class
|
|
2251
|
-
run(e, t,
|
|
2252
|
-
const a = this.parse(e, t,
|
|
2242
|
+
class p {
|
|
2243
|
+
run(e, t, r, i) {
|
|
2244
|
+
const a = this.parse(e, t, r, i);
|
|
2253
2245
|
return a ? {
|
|
2254
|
-
setter: new
|
|
2246
|
+
setter: new da(
|
|
2255
2247
|
a.value,
|
|
2256
2248
|
this.validate,
|
|
2257
2249
|
this.set,
|
|
@@ -2261,30 +2253,30 @@ class f {
|
|
|
2261
2253
|
rest: a.rest
|
|
2262
2254
|
} : null;
|
|
2263
2255
|
}
|
|
2264
|
-
validate(e, t,
|
|
2256
|
+
validate(e, t, r) {
|
|
2265
2257
|
return !0;
|
|
2266
2258
|
}
|
|
2267
2259
|
}
|
|
2268
|
-
class
|
|
2260
|
+
class pa extends p {
|
|
2269
2261
|
priority = 140;
|
|
2270
|
-
parse(e, t,
|
|
2262
|
+
parse(e, t, r) {
|
|
2271
2263
|
switch (t) {
|
|
2272
2264
|
// AD, BC
|
|
2273
2265
|
case "G":
|
|
2274
2266
|
case "GG":
|
|
2275
2267
|
case "GGG":
|
|
2276
|
-
return
|
|
2268
|
+
return r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
2277
2269
|
// A, B
|
|
2278
2270
|
case "GGGGG":
|
|
2279
|
-
return
|
|
2271
|
+
return r.era(e, { width: "narrow" });
|
|
2280
2272
|
// Anno Domini, Before Christ
|
|
2281
2273
|
case "GGGG":
|
|
2282
2274
|
default:
|
|
2283
|
-
return
|
|
2275
|
+
return r.era(e, { width: "wide" }) || r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
2284
2276
|
}
|
|
2285
2277
|
}
|
|
2286
|
-
set(e, t,
|
|
2287
|
-
return t.era =
|
|
2278
|
+
set(e, t, r) {
|
|
2279
|
+
return t.era = r, e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2288
2280
|
}
|
|
2289
2281
|
incompatibleTokens = ["R", "u", "t", "T"];
|
|
2290
2282
|
}
|
|
@@ -2333,21 +2325,21 @@ const x = {
|
|
|
2333
2325
|
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
2334
2326
|
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
2335
2327
|
};
|
|
2336
|
-
function v(
|
|
2337
|
-
return
|
|
2338
|
-
value: e(
|
|
2339
|
-
rest:
|
|
2328
|
+
function v(n, e) {
|
|
2329
|
+
return n && {
|
|
2330
|
+
value: e(n.value),
|
|
2331
|
+
rest: n.rest
|
|
2340
2332
|
};
|
|
2341
2333
|
}
|
|
2342
|
-
function g(
|
|
2343
|
-
const t = e.match(
|
|
2334
|
+
function g(n, e) {
|
|
2335
|
+
const t = e.match(n);
|
|
2344
2336
|
return t ? {
|
|
2345
2337
|
value: parseInt(t[0], 10),
|
|
2346
2338
|
rest: e.slice(t[0].length)
|
|
2347
2339
|
} : null;
|
|
2348
2340
|
}
|
|
2349
|
-
function E(
|
|
2350
|
-
const t = e.match(
|
|
2341
|
+
function E(n, e) {
|
|
2342
|
+
const t = e.match(n);
|
|
2351
2343
|
if (!t)
|
|
2352
2344
|
return null;
|
|
2353
2345
|
if (t[0] === "Z")
|
|
@@ -2355,17 +2347,17 @@ function E(r, e) {
|
|
|
2355
2347
|
value: 0,
|
|
2356
2348
|
rest: e.slice(1)
|
|
2357
2349
|
};
|
|
2358
|
-
const
|
|
2350
|
+
const r = t[1] === "+" ? 1 : -1, i = t[2] ? parseInt(t[2], 10) : 0, a = t[3] ? parseInt(t[3], 10) : 0, o = t[5] ? parseInt(t[5], 10) : 0;
|
|
2359
2351
|
return {
|
|
2360
|
-
value:
|
|
2352
|
+
value: r * (i * on + a * an + o * sn),
|
|
2361
2353
|
rest: e.slice(t[0].length)
|
|
2362
2354
|
};
|
|
2363
2355
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return g(x.anyDigitsSigned,
|
|
2356
|
+
function _t(n) {
|
|
2357
|
+
return g(x.anyDigitsSigned, n);
|
|
2366
2358
|
}
|
|
2367
|
-
function b(
|
|
2368
|
-
switch (
|
|
2359
|
+
function b(n, e) {
|
|
2360
|
+
switch (n) {
|
|
2369
2361
|
case 1:
|
|
2370
2362
|
return g(x.singleDigit, e);
|
|
2371
2363
|
case 2:
|
|
@@ -2375,11 +2367,11 @@ function b(r, e) {
|
|
|
2375
2367
|
case 4:
|
|
2376
2368
|
return g(x.fourDigits, e);
|
|
2377
2369
|
default:
|
|
2378
|
-
return g(new RegExp("^\\d{1," +
|
|
2370
|
+
return g(new RegExp("^\\d{1," + n + "}"), e);
|
|
2379
2371
|
}
|
|
2380
2372
|
}
|
|
2381
|
-
function
|
|
2382
|
-
switch (
|
|
2373
|
+
function J(n, e) {
|
|
2374
|
+
switch (n) {
|
|
2383
2375
|
case 1:
|
|
2384
2376
|
return g(x.singleDigitSigned, e);
|
|
2385
2377
|
case 2:
|
|
@@ -2389,11 +2381,11 @@ function K(r, e) {
|
|
|
2389
2381
|
case 4:
|
|
2390
2382
|
return g(x.fourDigitsSigned, e);
|
|
2391
2383
|
default:
|
|
2392
|
-
return g(new RegExp("^-?\\d{1," +
|
|
2384
|
+
return g(new RegExp("^-?\\d{1," + n + "}"), e);
|
|
2393
2385
|
}
|
|
2394
2386
|
}
|
|
2395
|
-
function fe(
|
|
2396
|
-
switch (
|
|
2387
|
+
function fe(n) {
|
|
2388
|
+
switch (n) {
|
|
2397
2389
|
case "morning":
|
|
2398
2390
|
return 4;
|
|
2399
2391
|
case "evening":
|
|
@@ -2409,24 +2401,24 @@ function fe(r) {
|
|
|
2409
2401
|
return 0;
|
|
2410
2402
|
}
|
|
2411
2403
|
}
|
|
2412
|
-
function
|
|
2413
|
-
const t = e > 0,
|
|
2404
|
+
function wt(n, e) {
|
|
2405
|
+
const t = e > 0, r = t ? e : 1 - e;
|
|
2414
2406
|
let i;
|
|
2415
|
-
if (
|
|
2416
|
-
i =
|
|
2407
|
+
if (r <= 50)
|
|
2408
|
+
i = n || 100;
|
|
2417
2409
|
else {
|
|
2418
|
-
const a =
|
|
2419
|
-
i =
|
|
2410
|
+
const a = r + 50, o = Math.trunc(a / 100) * 100, s = n >= a % 100;
|
|
2411
|
+
i = n + o - (s ? 100 : 0);
|
|
2420
2412
|
}
|
|
2421
2413
|
return t ? i : 1 - i;
|
|
2422
2414
|
}
|
|
2423
|
-
function
|
|
2424
|
-
return
|
|
2415
|
+
function yt(n) {
|
|
2416
|
+
return n % 400 === 0 || n % 4 === 0 && n % 100 !== 0;
|
|
2425
2417
|
}
|
|
2426
|
-
class
|
|
2418
|
+
class ha extends p {
|
|
2427
2419
|
priority = 130;
|
|
2428
2420
|
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
2429
|
-
parse(e, t,
|
|
2421
|
+
parse(e, t, r) {
|
|
2430
2422
|
const i = (a) => ({
|
|
2431
2423
|
year: a,
|
|
2432
2424
|
isTwoDigitYear: t === "yy"
|
|
@@ -2436,7 +2428,7 @@ class ya extends f {
|
|
|
2436
2428
|
return v(b(4, e), i);
|
|
2437
2429
|
case "yo":
|
|
2438
2430
|
return v(
|
|
2439
|
-
|
|
2431
|
+
r.ordinalNumber(e, {
|
|
2440
2432
|
unit: "year"
|
|
2441
2433
|
}),
|
|
2442
2434
|
i
|
|
@@ -2448,22 +2440,22 @@ class ya extends f {
|
|
|
2448
2440
|
validate(e, t) {
|
|
2449
2441
|
return t.isTwoDigitYear || t.year > 0;
|
|
2450
2442
|
}
|
|
2451
|
-
set(e, t,
|
|
2443
|
+
set(e, t, r) {
|
|
2452
2444
|
const i = e.getFullYear();
|
|
2453
|
-
if (
|
|
2454
|
-
const o =
|
|
2455
|
-
|
|
2445
|
+
if (r.isTwoDigitYear) {
|
|
2446
|
+
const o = wt(
|
|
2447
|
+
r.year,
|
|
2456
2448
|
i
|
|
2457
2449
|
);
|
|
2458
2450
|
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2459
2451
|
}
|
|
2460
|
-
const a = !("era" in t) || t.era === 1 ?
|
|
2452
|
+
const a = !("era" in t) || t.era === 1 ? r.year : 1 - r.year;
|
|
2461
2453
|
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2462
2454
|
}
|
|
2463
2455
|
}
|
|
2464
|
-
class
|
|
2456
|
+
class ma extends p {
|
|
2465
2457
|
priority = 130;
|
|
2466
|
-
parse(e, t,
|
|
2458
|
+
parse(e, t, r) {
|
|
2467
2459
|
const i = (a) => ({
|
|
2468
2460
|
year: a,
|
|
2469
2461
|
isTwoDigitYear: t === "YY"
|
|
@@ -2473,7 +2465,7 @@ class ga extends f {
|
|
|
2473
2465
|
return v(b(4, e), i);
|
|
2474
2466
|
case "Yo":
|
|
2475
2467
|
return v(
|
|
2476
|
-
|
|
2468
|
+
r.ordinalNumber(e, {
|
|
2477
2469
|
unit: "year"
|
|
2478
2470
|
}),
|
|
2479
2471
|
i
|
|
@@ -2485,11 +2477,11 @@ class ga extends f {
|
|
|
2485
2477
|
validate(e, t) {
|
|
2486
2478
|
return t.isTwoDigitYear || t.year > 0;
|
|
2487
2479
|
}
|
|
2488
|
-
set(e, t,
|
|
2489
|
-
const a =
|
|
2490
|
-
if (
|
|
2491
|
-
const s =
|
|
2492
|
-
|
|
2480
|
+
set(e, t, r, i) {
|
|
2481
|
+
const a = de(e, i);
|
|
2482
|
+
if (r.isTwoDigitYear) {
|
|
2483
|
+
const s = wt(
|
|
2484
|
+
r.year,
|
|
2493
2485
|
a
|
|
2494
2486
|
);
|
|
2495
2487
|
return e.setFullYear(
|
|
@@ -2498,7 +2490,7 @@ class ga extends f {
|
|
|
2498
2490
|
i.firstWeekContainsDate
|
|
2499
2491
|
), e.setHours(0, 0, 0, 0), H(e, i);
|
|
2500
2492
|
}
|
|
2501
|
-
const o = !("era" in t) || t.era === 1 ?
|
|
2493
|
+
const o = !("era" in t) || t.era === 1 ? r.year : 1 - r.year;
|
|
2502
2494
|
return e.setFullYear(o, 0, i.firstWeekContainsDate), e.setHours(0, 0, 0, 0), H(e, i);
|
|
2503
2495
|
}
|
|
2504
2496
|
incompatibleTokens = [
|
|
@@ -2517,14 +2509,14 @@ class ga extends f {
|
|
|
2517
2509
|
"T"
|
|
2518
2510
|
];
|
|
2519
2511
|
}
|
|
2520
|
-
class
|
|
2512
|
+
class _a extends p {
|
|
2521
2513
|
priority = 130;
|
|
2522
2514
|
parse(e, t) {
|
|
2523
|
-
return
|
|
2515
|
+
return J(t === "R" ? 4 : t.length, e);
|
|
2524
2516
|
}
|
|
2525
|
-
set(e, t,
|
|
2517
|
+
set(e, t, r) {
|
|
2526
2518
|
const i = D(e, 0);
|
|
2527
|
-
return i.setFullYear(
|
|
2519
|
+
return i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0), B(i);
|
|
2528
2520
|
}
|
|
2529
2521
|
incompatibleTokens = [
|
|
2530
2522
|
"G",
|
|
@@ -2544,19 +2536,19 @@ class ba extends f {
|
|
|
2544
2536
|
"T"
|
|
2545
2537
|
];
|
|
2546
2538
|
}
|
|
2547
|
-
class
|
|
2539
|
+
class wa extends p {
|
|
2548
2540
|
priority = 130;
|
|
2549
2541
|
parse(e, t) {
|
|
2550
|
-
return
|
|
2542
|
+
return J(t === "u" ? 4 : t.length, e);
|
|
2551
2543
|
}
|
|
2552
|
-
set(e, t,
|
|
2553
|
-
return e.setFullYear(
|
|
2544
|
+
set(e, t, r) {
|
|
2545
|
+
return e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2554
2546
|
}
|
|
2555
2547
|
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
2556
2548
|
}
|
|
2557
|
-
class
|
|
2549
|
+
class ya extends p {
|
|
2558
2550
|
priority = 120;
|
|
2559
|
-
parse(e, t,
|
|
2551
|
+
parse(e, t, r) {
|
|
2560
2552
|
switch (t) {
|
|
2561
2553
|
// 1, 2, 3, 4
|
|
2562
2554
|
case "Q":
|
|
@@ -2564,32 +2556,32 @@ class va extends f {
|
|
|
2564
2556
|
return b(t.length, e);
|
|
2565
2557
|
// 1st, 2nd, 3rd, 4th
|
|
2566
2558
|
case "Qo":
|
|
2567
|
-
return
|
|
2559
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
2568
2560
|
// Q1, Q2, Q3, Q4
|
|
2569
2561
|
case "QQQ":
|
|
2570
|
-
return
|
|
2562
|
+
return r.quarter(e, {
|
|
2571
2563
|
width: "abbreviated",
|
|
2572
2564
|
context: "formatting"
|
|
2573
|
-
}) ||
|
|
2565
|
+
}) || r.quarter(e, {
|
|
2574
2566
|
width: "narrow",
|
|
2575
2567
|
context: "formatting"
|
|
2576
2568
|
});
|
|
2577
2569
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2578
2570
|
case "QQQQQ":
|
|
2579
|
-
return
|
|
2571
|
+
return r.quarter(e, {
|
|
2580
2572
|
width: "narrow",
|
|
2581
2573
|
context: "formatting"
|
|
2582
2574
|
});
|
|
2583
2575
|
// 1st quarter, 2nd quarter, ...
|
|
2584
2576
|
case "QQQQ":
|
|
2585
2577
|
default:
|
|
2586
|
-
return
|
|
2578
|
+
return r.quarter(e, {
|
|
2587
2579
|
width: "wide",
|
|
2588
2580
|
context: "formatting"
|
|
2589
|
-
}) ||
|
|
2581
|
+
}) || r.quarter(e, {
|
|
2590
2582
|
width: "abbreviated",
|
|
2591
2583
|
context: "formatting"
|
|
2592
|
-
}) ||
|
|
2584
|
+
}) || r.quarter(e, {
|
|
2593
2585
|
width: "narrow",
|
|
2594
2586
|
context: "formatting"
|
|
2595
2587
|
});
|
|
@@ -2598,8 +2590,8 @@ class va extends f {
|
|
|
2598
2590
|
validate(e, t) {
|
|
2599
2591
|
return t >= 1 && t <= 4;
|
|
2600
2592
|
}
|
|
2601
|
-
set(e, t,
|
|
2602
|
-
return e.setMonth((
|
|
2593
|
+
set(e, t, r) {
|
|
2594
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
2603
2595
|
}
|
|
2604
2596
|
incompatibleTokens = [
|
|
2605
2597
|
"Y",
|
|
@@ -2618,9 +2610,9 @@ class va extends f {
|
|
|
2618
2610
|
"T"
|
|
2619
2611
|
];
|
|
2620
2612
|
}
|
|
2621
|
-
class
|
|
2613
|
+
class ga extends p {
|
|
2622
2614
|
priority = 120;
|
|
2623
|
-
parse(e, t,
|
|
2615
|
+
parse(e, t, r) {
|
|
2624
2616
|
switch (t) {
|
|
2625
2617
|
// 1, 2, 3, 4
|
|
2626
2618
|
case "q":
|
|
@@ -2628,32 +2620,32 @@ class Pa extends f {
|
|
|
2628
2620
|
return b(t.length, e);
|
|
2629
2621
|
// 1st, 2nd, 3rd, 4th
|
|
2630
2622
|
case "qo":
|
|
2631
|
-
return
|
|
2623
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
2632
2624
|
// Q1, Q2, Q3, Q4
|
|
2633
2625
|
case "qqq":
|
|
2634
|
-
return
|
|
2626
|
+
return r.quarter(e, {
|
|
2635
2627
|
width: "abbreviated",
|
|
2636
2628
|
context: "standalone"
|
|
2637
|
-
}) ||
|
|
2629
|
+
}) || r.quarter(e, {
|
|
2638
2630
|
width: "narrow",
|
|
2639
2631
|
context: "standalone"
|
|
2640
2632
|
});
|
|
2641
2633
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2642
2634
|
case "qqqqq":
|
|
2643
|
-
return
|
|
2635
|
+
return r.quarter(e, {
|
|
2644
2636
|
width: "narrow",
|
|
2645
2637
|
context: "standalone"
|
|
2646
2638
|
});
|
|
2647
2639
|
// 1st quarter, 2nd quarter, ...
|
|
2648
2640
|
case "qqqq":
|
|
2649
2641
|
default:
|
|
2650
|
-
return
|
|
2642
|
+
return r.quarter(e, {
|
|
2651
2643
|
width: "wide",
|
|
2652
2644
|
context: "standalone"
|
|
2653
|
-
}) ||
|
|
2645
|
+
}) || r.quarter(e, {
|
|
2654
2646
|
width: "abbreviated",
|
|
2655
2647
|
context: "standalone"
|
|
2656
|
-
}) ||
|
|
2648
|
+
}) || r.quarter(e, {
|
|
2657
2649
|
width: "narrow",
|
|
2658
2650
|
context: "standalone"
|
|
2659
2651
|
});
|
|
@@ -2662,8 +2654,8 @@ class Pa extends f {
|
|
|
2662
2654
|
validate(e, t) {
|
|
2663
2655
|
return t >= 1 && t <= 4;
|
|
2664
2656
|
}
|
|
2665
|
-
set(e, t,
|
|
2666
|
-
return e.setMonth((
|
|
2657
|
+
set(e, t, r) {
|
|
2658
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
2667
2659
|
}
|
|
2668
2660
|
incompatibleTokens = [
|
|
2669
2661
|
"Y",
|
|
@@ -2682,7 +2674,7 @@ class Pa extends f {
|
|
|
2682
2674
|
"T"
|
|
2683
2675
|
];
|
|
2684
2676
|
}
|
|
2685
|
-
class
|
|
2677
|
+
class ba extends p {
|
|
2686
2678
|
incompatibleTokens = [
|
|
2687
2679
|
"Y",
|
|
2688
2680
|
"R",
|
|
@@ -2699,7 +2691,7 @@ class Oa extends f {
|
|
|
2699
2691
|
"T"
|
|
2700
2692
|
];
|
|
2701
2693
|
priority = 110;
|
|
2702
|
-
parse(e, t,
|
|
2694
|
+
parse(e, t, r) {
|
|
2703
2695
|
const i = (a) => a - 1;
|
|
2704
2696
|
switch (t) {
|
|
2705
2697
|
// 1, 2, ..., 12
|
|
@@ -2714,42 +2706,42 @@ class Oa extends f {
|
|
|
2714
2706
|
// 1st, 2nd, ..., 12th
|
|
2715
2707
|
case "Mo":
|
|
2716
2708
|
return v(
|
|
2717
|
-
|
|
2709
|
+
r.ordinalNumber(e, {
|
|
2718
2710
|
unit: "month"
|
|
2719
2711
|
}),
|
|
2720
2712
|
i
|
|
2721
2713
|
);
|
|
2722
2714
|
// Jan, Feb, ..., Dec
|
|
2723
2715
|
case "MMM":
|
|
2724
|
-
return
|
|
2716
|
+
return r.month(e, {
|
|
2725
2717
|
width: "abbreviated",
|
|
2726
2718
|
context: "formatting"
|
|
2727
|
-
}) ||
|
|
2719
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
2728
2720
|
// J, F, ..., D
|
|
2729
2721
|
case "MMMMM":
|
|
2730
|
-
return
|
|
2722
|
+
return r.month(e, {
|
|
2731
2723
|
width: "narrow",
|
|
2732
2724
|
context: "formatting"
|
|
2733
2725
|
});
|
|
2734
2726
|
// January, February, ..., December
|
|
2735
2727
|
case "MMMM":
|
|
2736
2728
|
default:
|
|
2737
|
-
return
|
|
2729
|
+
return r.month(e, { width: "wide", context: "formatting" }) || r.month(e, {
|
|
2738
2730
|
width: "abbreviated",
|
|
2739
2731
|
context: "formatting"
|
|
2740
|
-
}) ||
|
|
2732
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
2741
2733
|
}
|
|
2742
2734
|
}
|
|
2743
2735
|
validate(e, t) {
|
|
2744
2736
|
return t >= 0 && t <= 11;
|
|
2745
2737
|
}
|
|
2746
|
-
set(e, t,
|
|
2747
|
-
return e.setMonth(
|
|
2738
|
+
set(e, t, r) {
|
|
2739
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
2748
2740
|
}
|
|
2749
2741
|
}
|
|
2750
|
-
class
|
|
2742
|
+
class xa extends p {
|
|
2751
2743
|
priority = 110;
|
|
2752
|
-
parse(e, t,
|
|
2744
|
+
parse(e, t, r) {
|
|
2753
2745
|
const i = (a) => a - 1;
|
|
2754
2746
|
switch (t) {
|
|
2755
2747
|
// 1, 2, ..., 12
|
|
@@ -2764,37 +2756,37 @@ class Ma extends f {
|
|
|
2764
2756
|
// 1st, 2nd, ..., 12th
|
|
2765
2757
|
case "Lo":
|
|
2766
2758
|
return v(
|
|
2767
|
-
|
|
2759
|
+
r.ordinalNumber(e, {
|
|
2768
2760
|
unit: "month"
|
|
2769
2761
|
}),
|
|
2770
2762
|
i
|
|
2771
2763
|
);
|
|
2772
2764
|
// Jan, Feb, ..., Dec
|
|
2773
2765
|
case "LLL":
|
|
2774
|
-
return
|
|
2766
|
+
return r.month(e, {
|
|
2775
2767
|
width: "abbreviated",
|
|
2776
2768
|
context: "standalone"
|
|
2777
|
-
}) ||
|
|
2769
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
2778
2770
|
// J, F, ..., D
|
|
2779
2771
|
case "LLLLL":
|
|
2780
|
-
return
|
|
2772
|
+
return r.month(e, {
|
|
2781
2773
|
width: "narrow",
|
|
2782
2774
|
context: "standalone"
|
|
2783
2775
|
});
|
|
2784
2776
|
// January, February, ..., December
|
|
2785
2777
|
case "LLLL":
|
|
2786
2778
|
default:
|
|
2787
|
-
return
|
|
2779
|
+
return r.month(e, { width: "wide", context: "standalone" }) || r.month(e, {
|
|
2788
2780
|
width: "abbreviated",
|
|
2789
2781
|
context: "standalone"
|
|
2790
|
-
}) ||
|
|
2782
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
2791
2783
|
}
|
|
2792
2784
|
}
|
|
2793
2785
|
validate(e, t) {
|
|
2794
2786
|
return t >= 0 && t <= 11;
|
|
2795
2787
|
}
|
|
2796
|
-
set(e, t,
|
|
2797
|
-
return e.setMonth(
|
|
2788
|
+
set(e, t, r) {
|
|
2789
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
2798
2790
|
}
|
|
2799
2791
|
incompatibleTokens = [
|
|
2800
2792
|
"Y",
|
|
@@ -2812,18 +2804,18 @@ class Ma extends f {
|
|
|
2812
2804
|
"T"
|
|
2813
2805
|
];
|
|
2814
2806
|
}
|
|
2815
|
-
function
|
|
2816
|
-
const
|
|
2817
|
-
return
|
|
2807
|
+
function va(n, e, t) {
|
|
2808
|
+
const r = M(n, t?.in), i = dt(r, t) - e;
|
|
2809
|
+
return r.setDate(r.getDate() - i * 7), M(r, t?.in);
|
|
2818
2810
|
}
|
|
2819
|
-
class
|
|
2811
|
+
class Pa extends p {
|
|
2820
2812
|
priority = 100;
|
|
2821
|
-
parse(e, t,
|
|
2813
|
+
parse(e, t, r) {
|
|
2822
2814
|
switch (t) {
|
|
2823
2815
|
case "w":
|
|
2824
2816
|
return g(x.week, e);
|
|
2825
2817
|
case "wo":
|
|
2826
|
-
return
|
|
2818
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
2827
2819
|
default:
|
|
2828
2820
|
return b(t.length, e);
|
|
2829
2821
|
}
|
|
@@ -2831,8 +2823,8 @@ class Ta extends f {
|
|
|
2831
2823
|
validate(e, t) {
|
|
2832
2824
|
return t >= 1 && t <= 53;
|
|
2833
2825
|
}
|
|
2834
|
-
set(e, t,
|
|
2835
|
-
return H(
|
|
2826
|
+
set(e, t, r, i) {
|
|
2827
|
+
return H(va(e, r, i), i);
|
|
2836
2828
|
}
|
|
2837
2829
|
incompatibleTokens = [
|
|
2838
2830
|
"y",
|
|
@@ -2850,18 +2842,18 @@ class Ta extends f {
|
|
|
2850
2842
|
"T"
|
|
2851
2843
|
];
|
|
2852
2844
|
}
|
|
2853
|
-
function
|
|
2854
|
-
const
|
|
2855
|
-
return
|
|
2845
|
+
function Oa(n, e, t) {
|
|
2846
|
+
const r = M(n, t?.in), i = lt(r, t) - e;
|
|
2847
|
+
return r.setDate(r.getDate() - i * 7), r;
|
|
2856
2848
|
}
|
|
2857
|
-
class
|
|
2849
|
+
class Ma extends p {
|
|
2858
2850
|
priority = 100;
|
|
2859
|
-
parse(e, t,
|
|
2851
|
+
parse(e, t, r) {
|
|
2860
2852
|
switch (t) {
|
|
2861
2853
|
case "I":
|
|
2862
2854
|
return g(x.week, e);
|
|
2863
2855
|
case "Io":
|
|
2864
|
-
return
|
|
2856
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
2865
2857
|
default:
|
|
2866
2858
|
return b(t.length, e);
|
|
2867
2859
|
}
|
|
@@ -2869,8 +2861,8 @@ class Na extends f {
|
|
|
2869
2861
|
validate(e, t) {
|
|
2870
2862
|
return t >= 1 && t <= 53;
|
|
2871
2863
|
}
|
|
2872
|
-
set(e, t,
|
|
2873
|
-
return B(
|
|
2864
|
+
set(e, t, r) {
|
|
2865
|
+
return B(Oa(e, r));
|
|
2874
2866
|
}
|
|
2875
2867
|
incompatibleTokens = [
|
|
2876
2868
|
"y",
|
|
@@ -2889,7 +2881,7 @@ class Na extends f {
|
|
|
2889
2881
|
"T"
|
|
2890
2882
|
];
|
|
2891
2883
|
}
|
|
2892
|
-
const
|
|
2884
|
+
const Da = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ta = [
|
|
2893
2885
|
31,
|
|
2894
2886
|
29,
|
|
2895
2887
|
31,
|
|
@@ -2903,25 +2895,25 @@ const Ya = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ea = [
|
|
|
2903
2895
|
30,
|
|
2904
2896
|
31
|
|
2905
2897
|
];
|
|
2906
|
-
class
|
|
2898
|
+
class ka extends p {
|
|
2907
2899
|
priority = 90;
|
|
2908
2900
|
subPriority = 1;
|
|
2909
|
-
parse(e, t,
|
|
2901
|
+
parse(e, t, r) {
|
|
2910
2902
|
switch (t) {
|
|
2911
2903
|
case "d":
|
|
2912
2904
|
return g(x.date, e);
|
|
2913
2905
|
case "do":
|
|
2914
|
-
return
|
|
2906
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
2915
2907
|
default:
|
|
2916
2908
|
return b(t.length, e);
|
|
2917
2909
|
}
|
|
2918
2910
|
}
|
|
2919
2911
|
validate(e, t) {
|
|
2920
|
-
const
|
|
2921
|
-
return i ? t >= 1 && t <=
|
|
2912
|
+
const r = e.getFullYear(), i = yt(r), a = e.getMonth();
|
|
2913
|
+
return i ? t >= 1 && t <= Ta[a] : t >= 1 && t <= Da[a];
|
|
2922
2914
|
}
|
|
2923
|
-
set(e, t,
|
|
2924
|
-
return e.setDate(
|
|
2915
|
+
set(e, t, r) {
|
|
2916
|
+
return e.setDate(r), e.setHours(0, 0, 0, 0), e;
|
|
2925
2917
|
}
|
|
2926
2918
|
incompatibleTokens = [
|
|
2927
2919
|
"Y",
|
|
@@ -2938,26 +2930,26 @@ class qa extends f {
|
|
|
2938
2930
|
"T"
|
|
2939
2931
|
];
|
|
2940
2932
|
}
|
|
2941
|
-
class
|
|
2933
|
+
class Na extends p {
|
|
2942
2934
|
priority = 90;
|
|
2943
2935
|
subpriority = 1;
|
|
2944
|
-
parse(e, t,
|
|
2936
|
+
parse(e, t, r) {
|
|
2945
2937
|
switch (t) {
|
|
2946
2938
|
case "D":
|
|
2947
2939
|
case "DD":
|
|
2948
2940
|
return g(x.dayOfYear, e);
|
|
2949
2941
|
case "Do":
|
|
2950
|
-
return
|
|
2942
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
2951
2943
|
default:
|
|
2952
2944
|
return b(t.length, e);
|
|
2953
2945
|
}
|
|
2954
2946
|
}
|
|
2955
2947
|
validate(e, t) {
|
|
2956
|
-
const
|
|
2957
|
-
return
|
|
2948
|
+
const r = e.getFullYear();
|
|
2949
|
+
return yt(r) ? t >= 1 && t <= 366 : t >= 1 && t <= 365;
|
|
2958
2950
|
}
|
|
2959
|
-
set(e, t,
|
|
2960
|
-
return e.setMonth(0,
|
|
2951
|
+
set(e, t, r) {
|
|
2952
|
+
return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
|
|
2961
2953
|
}
|
|
2962
2954
|
incompatibleTokens = [
|
|
2963
2955
|
"Y",
|
|
@@ -2977,51 +2969,51 @@ class $a extends f {
|
|
|
2977
2969
|
"T"
|
|
2978
2970
|
];
|
|
2979
2971
|
}
|
|
2980
|
-
function
|
|
2981
|
-
const
|
|
2982
|
-
return
|
|
2972
|
+
function pe(n, e, t) {
|
|
2973
|
+
const r = S(), i = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = M(n, t?.in), o = a.getDay(), h = (e % 7 + 7) % 7, c = 7 - i, m = e < 0 || e > 6 ? e - (o + c) % 7 : (h + c) % 7 - (o + c) % 7;
|
|
2974
|
+
return ot(a, m, t);
|
|
2983
2975
|
}
|
|
2984
|
-
class
|
|
2976
|
+
class Ya extends p {
|
|
2985
2977
|
priority = 90;
|
|
2986
|
-
parse(e, t,
|
|
2978
|
+
parse(e, t, r) {
|
|
2987
2979
|
switch (t) {
|
|
2988
2980
|
// Tue
|
|
2989
2981
|
case "E":
|
|
2990
2982
|
case "EE":
|
|
2991
2983
|
case "EEE":
|
|
2992
|
-
return
|
|
2984
|
+
return r.day(e, {
|
|
2993
2985
|
width: "abbreviated",
|
|
2994
2986
|
context: "formatting"
|
|
2995
|
-
}) ||
|
|
2987
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
2996
2988
|
// T
|
|
2997
2989
|
case "EEEEE":
|
|
2998
|
-
return
|
|
2990
|
+
return r.day(e, {
|
|
2999
2991
|
width: "narrow",
|
|
3000
2992
|
context: "formatting"
|
|
3001
2993
|
});
|
|
3002
2994
|
// Tu
|
|
3003
2995
|
case "EEEEEE":
|
|
3004
|
-
return
|
|
2996
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
3005
2997
|
// Tuesday
|
|
3006
2998
|
case "EEEE":
|
|
3007
2999
|
default:
|
|
3008
|
-
return
|
|
3000
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
3009
3001
|
width: "abbreviated",
|
|
3010
3002
|
context: "formatting"
|
|
3011
|
-
}) ||
|
|
3003
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
3012
3004
|
}
|
|
3013
3005
|
}
|
|
3014
3006
|
validate(e, t) {
|
|
3015
3007
|
return t >= 0 && t <= 6;
|
|
3016
3008
|
}
|
|
3017
|
-
set(e, t,
|
|
3018
|
-
return e =
|
|
3009
|
+
set(e, t, r, i) {
|
|
3010
|
+
return e = pe(e, r, i), e.setHours(0, 0, 0, 0), e;
|
|
3019
3011
|
}
|
|
3020
3012
|
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
3021
3013
|
}
|
|
3022
|
-
class
|
|
3014
|
+
class Ea extends p {
|
|
3023
3015
|
priority = 90;
|
|
3024
|
-
parse(e, t,
|
|
3016
|
+
parse(e, t, r, i) {
|
|
3025
3017
|
const a = (o) => {
|
|
3026
3018
|
const s = Math.floor((o - 1) / 7) * 7;
|
|
3027
3019
|
return (o + i.weekStartsOn + 6) % 7 + s;
|
|
@@ -3034,40 +3026,40 @@ class ja extends f {
|
|
|
3034
3026
|
// 3rd
|
|
3035
3027
|
case "eo":
|
|
3036
3028
|
return v(
|
|
3037
|
-
|
|
3029
|
+
r.ordinalNumber(e, {
|
|
3038
3030
|
unit: "day"
|
|
3039
3031
|
}),
|
|
3040
3032
|
a
|
|
3041
3033
|
);
|
|
3042
3034
|
// Tue
|
|
3043
3035
|
case "eee":
|
|
3044
|
-
return
|
|
3036
|
+
return r.day(e, {
|
|
3045
3037
|
width: "abbreviated",
|
|
3046
3038
|
context: "formatting"
|
|
3047
|
-
}) ||
|
|
3039
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
3048
3040
|
// T
|
|
3049
3041
|
case "eeeee":
|
|
3050
|
-
return
|
|
3042
|
+
return r.day(e, {
|
|
3051
3043
|
width: "narrow",
|
|
3052
3044
|
context: "formatting"
|
|
3053
3045
|
});
|
|
3054
3046
|
// Tu
|
|
3055
3047
|
case "eeeeee":
|
|
3056
|
-
return
|
|
3048
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
3057
3049
|
// Tuesday
|
|
3058
3050
|
case "eeee":
|
|
3059
3051
|
default:
|
|
3060
|
-
return
|
|
3052
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
3061
3053
|
width: "abbreviated",
|
|
3062
3054
|
context: "formatting"
|
|
3063
|
-
}) ||
|
|
3055
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
3064
3056
|
}
|
|
3065
3057
|
}
|
|
3066
3058
|
validate(e, t) {
|
|
3067
3059
|
return t >= 0 && t <= 6;
|
|
3068
3060
|
}
|
|
3069
|
-
set(e, t,
|
|
3070
|
-
return e =
|
|
3061
|
+
set(e, t, r, i) {
|
|
3062
|
+
return e = pe(e, r, i), e.setHours(0, 0, 0, 0), e;
|
|
3071
3063
|
}
|
|
3072
3064
|
incompatibleTokens = [
|
|
3073
3065
|
"y",
|
|
@@ -3087,9 +3079,9 @@ class ja extends f {
|
|
|
3087
3079
|
"T"
|
|
3088
3080
|
];
|
|
3089
3081
|
}
|
|
3090
|
-
class
|
|
3082
|
+
class qa extends p {
|
|
3091
3083
|
priority = 90;
|
|
3092
|
-
parse(e, t,
|
|
3084
|
+
parse(e, t, r, i) {
|
|
3093
3085
|
const a = (o) => {
|
|
3094
3086
|
const s = Math.floor((o - 1) / 7) * 7;
|
|
3095
3087
|
return (o + i.weekStartsOn + 6) % 7 + s;
|
|
@@ -3102,40 +3094,40 @@ class Ca extends f {
|
|
|
3102
3094
|
// 3rd
|
|
3103
3095
|
case "co":
|
|
3104
3096
|
return v(
|
|
3105
|
-
|
|
3097
|
+
r.ordinalNumber(e, {
|
|
3106
3098
|
unit: "day"
|
|
3107
3099
|
}),
|
|
3108
3100
|
a
|
|
3109
3101
|
);
|
|
3110
3102
|
// Tue
|
|
3111
3103
|
case "ccc":
|
|
3112
|
-
return
|
|
3104
|
+
return r.day(e, {
|
|
3113
3105
|
width: "abbreviated",
|
|
3114
3106
|
context: "standalone"
|
|
3115
|
-
}) ||
|
|
3107
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
3116
3108
|
// T
|
|
3117
3109
|
case "ccccc":
|
|
3118
|
-
return
|
|
3110
|
+
return r.day(e, {
|
|
3119
3111
|
width: "narrow",
|
|
3120
3112
|
context: "standalone"
|
|
3121
3113
|
});
|
|
3122
3114
|
// Tu
|
|
3123
3115
|
case "cccccc":
|
|
3124
|
-
return
|
|
3116
|
+
return r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
3125
3117
|
// Tuesday
|
|
3126
3118
|
case "cccc":
|
|
3127
3119
|
default:
|
|
3128
|
-
return
|
|
3120
|
+
return r.day(e, { width: "wide", context: "standalone" }) || r.day(e, {
|
|
3129
3121
|
width: "abbreviated",
|
|
3130
3122
|
context: "standalone"
|
|
3131
|
-
}) ||
|
|
3123
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
3132
3124
|
}
|
|
3133
3125
|
}
|
|
3134
3126
|
validate(e, t) {
|
|
3135
3127
|
return t >= 0 && t <= 6;
|
|
3136
3128
|
}
|
|
3137
|
-
set(e, t,
|
|
3138
|
-
return e =
|
|
3129
|
+
set(e, t, r, i) {
|
|
3130
|
+
return e = pe(e, r, i), e.setHours(0, 0, 0, 0), e;
|
|
3139
3131
|
}
|
|
3140
3132
|
incompatibleTokens = [
|
|
3141
3133
|
"y",
|
|
@@ -3155,13 +3147,13 @@ class Ca extends f {
|
|
|
3155
3147
|
"T"
|
|
3156
3148
|
];
|
|
3157
3149
|
}
|
|
3158
|
-
function
|
|
3159
|
-
const
|
|
3160
|
-
return
|
|
3150
|
+
function Wa(n, e, t) {
|
|
3151
|
+
const r = M(n, t?.in), i = sa(r, t), a = e - i;
|
|
3152
|
+
return ot(r, a, t);
|
|
3161
3153
|
}
|
|
3162
|
-
class
|
|
3154
|
+
class $a extends p {
|
|
3163
3155
|
priority = 90;
|
|
3164
|
-
parse(e, t,
|
|
3156
|
+
parse(e, t, r) {
|
|
3165
3157
|
const i = (a) => a === 0 ? 7 : a;
|
|
3166
3158
|
switch (t) {
|
|
3167
3159
|
// 2
|
|
@@ -3170,17 +3162,17 @@ class La extends f {
|
|
|
3170
3162
|
return b(t.length, e);
|
|
3171
3163
|
// 2nd
|
|
3172
3164
|
case "io":
|
|
3173
|
-
return
|
|
3165
|
+
return r.ordinalNumber(e, { unit: "day" });
|
|
3174
3166
|
// Tue
|
|
3175
3167
|
case "iii":
|
|
3176
3168
|
return v(
|
|
3177
|
-
|
|
3169
|
+
r.day(e, {
|
|
3178
3170
|
width: "abbreviated",
|
|
3179
3171
|
context: "formatting"
|
|
3180
|
-
}) ||
|
|
3172
|
+
}) || r.day(e, {
|
|
3181
3173
|
width: "short",
|
|
3182
3174
|
context: "formatting"
|
|
3183
|
-
}) ||
|
|
3175
|
+
}) || r.day(e, {
|
|
3184
3176
|
width: "narrow",
|
|
3185
3177
|
context: "formatting"
|
|
3186
3178
|
}),
|
|
@@ -3189,7 +3181,7 @@ class La extends f {
|
|
|
3189
3181
|
// T
|
|
3190
3182
|
case "iiiii":
|
|
3191
3183
|
return v(
|
|
3192
|
-
|
|
3184
|
+
r.day(e, {
|
|
3193
3185
|
width: "narrow",
|
|
3194
3186
|
context: "formatting"
|
|
3195
3187
|
}),
|
|
@@ -3198,10 +3190,10 @@ class La extends f {
|
|
|
3198
3190
|
// Tu
|
|
3199
3191
|
case "iiiiii":
|
|
3200
3192
|
return v(
|
|
3201
|
-
|
|
3193
|
+
r.day(e, {
|
|
3202
3194
|
width: "short",
|
|
3203
3195
|
context: "formatting"
|
|
3204
|
-
}) ||
|
|
3196
|
+
}) || r.day(e, {
|
|
3205
3197
|
width: "narrow",
|
|
3206
3198
|
context: "formatting"
|
|
3207
3199
|
}),
|
|
@@ -3211,16 +3203,16 @@ class La extends f {
|
|
|
3211
3203
|
case "iiii":
|
|
3212
3204
|
default:
|
|
3213
3205
|
return v(
|
|
3214
|
-
|
|
3206
|
+
r.day(e, {
|
|
3215
3207
|
width: "wide",
|
|
3216
3208
|
context: "formatting"
|
|
3217
|
-
}) ||
|
|
3209
|
+
}) || r.day(e, {
|
|
3218
3210
|
width: "abbreviated",
|
|
3219
3211
|
context: "formatting"
|
|
3220
|
-
}) ||
|
|
3212
|
+
}) || r.day(e, {
|
|
3221
3213
|
width: "short",
|
|
3222
3214
|
context: "formatting"
|
|
3223
|
-
}) ||
|
|
3215
|
+
}) || r.day(e, {
|
|
3224
3216
|
width: "narrow",
|
|
3225
3217
|
context: "formatting"
|
|
3226
3218
|
}),
|
|
@@ -3231,8 +3223,8 @@ class La extends f {
|
|
|
3231
3223
|
validate(e, t) {
|
|
3232
3224
|
return t >= 1 && t <= 7;
|
|
3233
3225
|
}
|
|
3234
|
-
set(e, t,
|
|
3235
|
-
return e =
|
|
3226
|
+
set(e, t, r) {
|
|
3227
|
+
return e = Wa(e, r), e.setHours(0, 0, 0, 0), e;
|
|
3236
3228
|
}
|
|
3237
3229
|
incompatibleTokens = [
|
|
3238
3230
|
"y",
|
|
@@ -3252,128 +3244,128 @@ class La extends f {
|
|
|
3252
3244
|
"T"
|
|
3253
3245
|
];
|
|
3254
3246
|
}
|
|
3255
|
-
class
|
|
3247
|
+
class Ca extends p {
|
|
3256
3248
|
priority = 80;
|
|
3257
|
-
parse(e, t,
|
|
3249
|
+
parse(e, t, r) {
|
|
3258
3250
|
switch (t) {
|
|
3259
3251
|
case "a":
|
|
3260
3252
|
case "aa":
|
|
3261
3253
|
case "aaa":
|
|
3262
|
-
return
|
|
3254
|
+
return r.dayPeriod(e, {
|
|
3263
3255
|
width: "abbreviated",
|
|
3264
3256
|
context: "formatting"
|
|
3265
|
-
}) ||
|
|
3257
|
+
}) || r.dayPeriod(e, {
|
|
3266
3258
|
width: "narrow",
|
|
3267
3259
|
context: "formatting"
|
|
3268
3260
|
});
|
|
3269
3261
|
case "aaaaa":
|
|
3270
|
-
return
|
|
3262
|
+
return r.dayPeriod(e, {
|
|
3271
3263
|
width: "narrow",
|
|
3272
3264
|
context: "formatting"
|
|
3273
3265
|
});
|
|
3274
3266
|
case "aaaa":
|
|
3275
3267
|
default:
|
|
3276
|
-
return
|
|
3268
|
+
return r.dayPeriod(e, {
|
|
3277
3269
|
width: "wide",
|
|
3278
3270
|
context: "formatting"
|
|
3279
|
-
}) ||
|
|
3271
|
+
}) || r.dayPeriod(e, {
|
|
3280
3272
|
width: "abbreviated",
|
|
3281
3273
|
context: "formatting"
|
|
3282
|
-
}) ||
|
|
3274
|
+
}) || r.dayPeriod(e, {
|
|
3283
3275
|
width: "narrow",
|
|
3284
3276
|
context: "formatting"
|
|
3285
3277
|
});
|
|
3286
3278
|
}
|
|
3287
3279
|
}
|
|
3288
|
-
set(e, t,
|
|
3289
|
-
return e.setHours(fe(
|
|
3280
|
+
set(e, t, r) {
|
|
3281
|
+
return e.setHours(fe(r), 0, 0, 0), e;
|
|
3290
3282
|
}
|
|
3291
3283
|
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
3292
3284
|
}
|
|
3293
|
-
class
|
|
3285
|
+
class ja extends p {
|
|
3294
3286
|
priority = 80;
|
|
3295
|
-
parse(e, t,
|
|
3287
|
+
parse(e, t, r) {
|
|
3296
3288
|
switch (t) {
|
|
3297
3289
|
case "b":
|
|
3298
3290
|
case "bb":
|
|
3299
3291
|
case "bbb":
|
|
3300
|
-
return
|
|
3292
|
+
return r.dayPeriod(e, {
|
|
3301
3293
|
width: "abbreviated",
|
|
3302
3294
|
context: "formatting"
|
|
3303
|
-
}) ||
|
|
3295
|
+
}) || r.dayPeriod(e, {
|
|
3304
3296
|
width: "narrow",
|
|
3305
3297
|
context: "formatting"
|
|
3306
3298
|
});
|
|
3307
3299
|
case "bbbbb":
|
|
3308
|
-
return
|
|
3300
|
+
return r.dayPeriod(e, {
|
|
3309
3301
|
width: "narrow",
|
|
3310
3302
|
context: "formatting"
|
|
3311
3303
|
});
|
|
3312
3304
|
case "bbbb":
|
|
3313
3305
|
default:
|
|
3314
|
-
return
|
|
3306
|
+
return r.dayPeriod(e, {
|
|
3315
3307
|
width: "wide",
|
|
3316
3308
|
context: "formatting"
|
|
3317
|
-
}) ||
|
|
3309
|
+
}) || r.dayPeriod(e, {
|
|
3318
3310
|
width: "abbreviated",
|
|
3319
3311
|
context: "formatting"
|
|
3320
|
-
}) ||
|
|
3312
|
+
}) || r.dayPeriod(e, {
|
|
3321
3313
|
width: "narrow",
|
|
3322
3314
|
context: "formatting"
|
|
3323
3315
|
});
|
|
3324
3316
|
}
|
|
3325
3317
|
}
|
|
3326
|
-
set(e, t,
|
|
3327
|
-
return e.setHours(fe(
|
|
3318
|
+
set(e, t, r) {
|
|
3319
|
+
return e.setHours(fe(r), 0, 0, 0), e;
|
|
3328
3320
|
}
|
|
3329
3321
|
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
3330
3322
|
}
|
|
3331
|
-
class
|
|
3323
|
+
class Ha extends p {
|
|
3332
3324
|
priority = 80;
|
|
3333
|
-
parse(e, t,
|
|
3325
|
+
parse(e, t, r) {
|
|
3334
3326
|
switch (t) {
|
|
3335
3327
|
case "B":
|
|
3336
3328
|
case "BB":
|
|
3337
3329
|
case "BBB":
|
|
3338
|
-
return
|
|
3330
|
+
return r.dayPeriod(e, {
|
|
3339
3331
|
width: "abbreviated",
|
|
3340
3332
|
context: "formatting"
|
|
3341
|
-
}) ||
|
|
3333
|
+
}) || r.dayPeriod(e, {
|
|
3342
3334
|
width: "narrow",
|
|
3343
3335
|
context: "formatting"
|
|
3344
3336
|
});
|
|
3345
3337
|
case "BBBBB":
|
|
3346
|
-
return
|
|
3338
|
+
return r.dayPeriod(e, {
|
|
3347
3339
|
width: "narrow",
|
|
3348
3340
|
context: "formatting"
|
|
3349
3341
|
});
|
|
3350
3342
|
case "BBBB":
|
|
3351
3343
|
default:
|
|
3352
|
-
return
|
|
3344
|
+
return r.dayPeriod(e, {
|
|
3353
3345
|
width: "wide",
|
|
3354
3346
|
context: "formatting"
|
|
3355
|
-
}) ||
|
|
3347
|
+
}) || r.dayPeriod(e, {
|
|
3356
3348
|
width: "abbreviated",
|
|
3357
3349
|
context: "formatting"
|
|
3358
|
-
}) ||
|
|
3350
|
+
}) || r.dayPeriod(e, {
|
|
3359
3351
|
width: "narrow",
|
|
3360
3352
|
context: "formatting"
|
|
3361
3353
|
});
|
|
3362
3354
|
}
|
|
3363
3355
|
}
|
|
3364
|
-
set(e, t,
|
|
3365
|
-
return e.setHours(fe(
|
|
3356
|
+
set(e, t, r) {
|
|
3357
|
+
return e.setHours(fe(r), 0, 0, 0), e;
|
|
3366
3358
|
}
|
|
3367
3359
|
incompatibleTokens = ["a", "b", "t", "T"];
|
|
3368
3360
|
}
|
|
3369
|
-
class
|
|
3361
|
+
class La extends p {
|
|
3370
3362
|
priority = 70;
|
|
3371
|
-
parse(e, t,
|
|
3363
|
+
parse(e, t, r) {
|
|
3372
3364
|
switch (t) {
|
|
3373
3365
|
case "h":
|
|
3374
3366
|
return g(x.hour12h, e);
|
|
3375
3367
|
case "ho":
|
|
3376
|
-
return
|
|
3368
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
3377
3369
|
default:
|
|
3378
3370
|
return b(t.length, e);
|
|
3379
3371
|
}
|
|
@@ -3381,20 +3373,20 @@ class Aa extends f {
|
|
|
3381
3373
|
validate(e, t) {
|
|
3382
3374
|
return t >= 1 && t <= 12;
|
|
3383
3375
|
}
|
|
3384
|
-
set(e, t,
|
|
3376
|
+
set(e, t, r) {
|
|
3385
3377
|
const i = e.getHours() >= 12;
|
|
3386
|
-
return i &&
|
|
3378
|
+
return i && r < 12 ? e.setHours(r + 12, 0, 0, 0) : !i && r === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
3387
3379
|
}
|
|
3388
3380
|
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
3389
3381
|
}
|
|
3390
|
-
class
|
|
3382
|
+
class Ia extends p {
|
|
3391
3383
|
priority = 70;
|
|
3392
|
-
parse(e, t,
|
|
3384
|
+
parse(e, t, r) {
|
|
3393
3385
|
switch (t) {
|
|
3394
3386
|
case "H":
|
|
3395
3387
|
return g(x.hour23h, e);
|
|
3396
3388
|
case "Ho":
|
|
3397
|
-
return
|
|
3389
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
3398
3390
|
default:
|
|
3399
3391
|
return b(t.length, e);
|
|
3400
3392
|
}
|
|
@@ -3402,19 +3394,19 @@ class Qa extends f {
|
|
|
3402
3394
|
validate(e, t) {
|
|
3403
3395
|
return t >= 0 && t <= 23;
|
|
3404
3396
|
}
|
|
3405
|
-
set(e, t,
|
|
3406
|
-
return e.setHours(
|
|
3397
|
+
set(e, t, r) {
|
|
3398
|
+
return e.setHours(r, 0, 0, 0), e;
|
|
3407
3399
|
}
|
|
3408
3400
|
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
3409
3401
|
}
|
|
3410
|
-
class
|
|
3402
|
+
class Fa extends p {
|
|
3411
3403
|
priority = 70;
|
|
3412
|
-
parse(e, t,
|
|
3404
|
+
parse(e, t, r) {
|
|
3413
3405
|
switch (t) {
|
|
3414
3406
|
case "K":
|
|
3415
3407
|
return g(x.hour11h, e);
|
|
3416
3408
|
case "Ko":
|
|
3417
|
-
return
|
|
3409
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
3418
3410
|
default:
|
|
3419
3411
|
return b(t.length, e);
|
|
3420
3412
|
}
|
|
@@ -3422,19 +3414,19 @@ class Ba extends f {
|
|
|
3422
3414
|
validate(e, t) {
|
|
3423
3415
|
return t >= 0 && t <= 11;
|
|
3424
3416
|
}
|
|
3425
|
-
set(e, t,
|
|
3426
|
-
return e.getHours() >= 12 &&
|
|
3417
|
+
set(e, t, r) {
|
|
3418
|
+
return e.getHours() >= 12 && r < 12 ? e.setHours(r + 12, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
3427
3419
|
}
|
|
3428
3420
|
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
3429
3421
|
}
|
|
3430
|
-
class
|
|
3422
|
+
class Ra extends p {
|
|
3431
3423
|
priority = 70;
|
|
3432
|
-
parse(e, t,
|
|
3424
|
+
parse(e, t, r) {
|
|
3433
3425
|
switch (t) {
|
|
3434
3426
|
case "k":
|
|
3435
3427
|
return g(x.hour24h, e);
|
|
3436
3428
|
case "ko":
|
|
3437
|
-
return
|
|
3429
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
3438
3430
|
default:
|
|
3439
3431
|
return b(t.length, e);
|
|
3440
3432
|
}
|
|
@@ -3442,20 +3434,20 @@ class Sa extends f {
|
|
|
3442
3434
|
validate(e, t) {
|
|
3443
3435
|
return t >= 1 && t <= 24;
|
|
3444
3436
|
}
|
|
3445
|
-
set(e, t,
|
|
3446
|
-
const i =
|
|
3437
|
+
set(e, t, r) {
|
|
3438
|
+
const i = r <= 24 ? r % 24 : r;
|
|
3447
3439
|
return e.setHours(i, 0, 0, 0), e;
|
|
3448
3440
|
}
|
|
3449
3441
|
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
3450
3442
|
}
|
|
3451
|
-
class
|
|
3443
|
+
class Aa extends p {
|
|
3452
3444
|
priority = 60;
|
|
3453
|
-
parse(e, t,
|
|
3445
|
+
parse(e, t, r) {
|
|
3454
3446
|
switch (t) {
|
|
3455
3447
|
case "m":
|
|
3456
3448
|
return g(x.minute, e);
|
|
3457
3449
|
case "mo":
|
|
3458
|
-
return
|
|
3450
|
+
return r.ordinalNumber(e, { unit: "minute" });
|
|
3459
3451
|
default:
|
|
3460
3452
|
return b(t.length, e);
|
|
3461
3453
|
}
|
|
@@ -3463,19 +3455,19 @@ class Xa extends f {
|
|
|
3463
3455
|
validate(e, t) {
|
|
3464
3456
|
return t >= 0 && t <= 59;
|
|
3465
3457
|
}
|
|
3466
|
-
set(e, t,
|
|
3467
|
-
return e.setMinutes(
|
|
3458
|
+
set(e, t, r) {
|
|
3459
|
+
return e.setMinutes(r, 0, 0), e;
|
|
3468
3460
|
}
|
|
3469
3461
|
incompatibleTokens = ["t", "T"];
|
|
3470
3462
|
}
|
|
3471
|
-
class
|
|
3463
|
+
class Qa extends p {
|
|
3472
3464
|
priority = 50;
|
|
3473
|
-
parse(e, t,
|
|
3465
|
+
parse(e, t, r) {
|
|
3474
3466
|
switch (t) {
|
|
3475
3467
|
case "s":
|
|
3476
3468
|
return g(x.second, e);
|
|
3477
3469
|
case "so":
|
|
3478
|
-
return
|
|
3470
|
+
return r.ordinalNumber(e, { unit: "second" });
|
|
3479
3471
|
default:
|
|
3480
3472
|
return b(t.length, e);
|
|
3481
3473
|
}
|
|
@@ -3483,23 +3475,23 @@ class Ga extends f {
|
|
|
3483
3475
|
validate(e, t) {
|
|
3484
3476
|
return t >= 0 && t <= 59;
|
|
3485
3477
|
}
|
|
3486
|
-
set(e, t,
|
|
3487
|
-
return e.setSeconds(
|
|
3478
|
+
set(e, t, r) {
|
|
3479
|
+
return e.setSeconds(r, 0), e;
|
|
3488
3480
|
}
|
|
3489
3481
|
incompatibleTokens = ["t", "T"];
|
|
3490
3482
|
}
|
|
3491
|
-
class
|
|
3483
|
+
class Ba extends p {
|
|
3492
3484
|
priority = 30;
|
|
3493
3485
|
parse(e, t) {
|
|
3494
|
-
const
|
|
3495
|
-
return v(b(t.length, e),
|
|
3486
|
+
const r = (i) => Math.trunc(i * Math.pow(10, -t.length + 3));
|
|
3487
|
+
return v(b(t.length, e), r);
|
|
3496
3488
|
}
|
|
3497
|
-
set(e, t,
|
|
3498
|
-
return e.setMilliseconds(
|
|
3489
|
+
set(e, t, r) {
|
|
3490
|
+
return e.setMilliseconds(r), e;
|
|
3499
3491
|
}
|
|
3500
3492
|
incompatibleTokens = ["t", "T"];
|
|
3501
3493
|
}
|
|
3502
|
-
class
|
|
3494
|
+
class Sa extends p {
|
|
3503
3495
|
priority = 10;
|
|
3504
3496
|
parse(e, t) {
|
|
3505
3497
|
switch (t) {
|
|
@@ -3525,15 +3517,15 @@ class za extends f {
|
|
|
3525
3517
|
return E(Y.extended, e);
|
|
3526
3518
|
}
|
|
3527
3519
|
}
|
|
3528
|
-
set(e, t,
|
|
3520
|
+
set(e, t, r) {
|
|
3529
3521
|
return t.timestampIsSet ? e : D(
|
|
3530
3522
|
e,
|
|
3531
|
-
e.getTime() -
|
|
3523
|
+
e.getTime() - Z(e) - r
|
|
3532
3524
|
);
|
|
3533
3525
|
}
|
|
3534
3526
|
incompatibleTokens = ["t", "T", "x"];
|
|
3535
3527
|
}
|
|
3536
|
-
class
|
|
3528
|
+
class Ga extends p {
|
|
3537
3529
|
priority = 10;
|
|
3538
3530
|
parse(e, t) {
|
|
3539
3531
|
switch (t) {
|
|
@@ -3559,85 +3551,85 @@ class Za extends f {
|
|
|
3559
3551
|
return E(Y.extended, e);
|
|
3560
3552
|
}
|
|
3561
3553
|
}
|
|
3562
|
-
set(e, t,
|
|
3554
|
+
set(e, t, r) {
|
|
3563
3555
|
return t.timestampIsSet ? e : D(
|
|
3564
3556
|
e,
|
|
3565
|
-
e.getTime() -
|
|
3557
|
+
e.getTime() - Z(e) - r
|
|
3566
3558
|
);
|
|
3567
3559
|
}
|
|
3568
3560
|
incompatibleTokens = ["t", "T", "X"];
|
|
3569
3561
|
}
|
|
3570
|
-
class
|
|
3562
|
+
class Xa extends p {
|
|
3571
3563
|
priority = 40;
|
|
3572
3564
|
parse(e) {
|
|
3573
|
-
return
|
|
3565
|
+
return _t(e);
|
|
3574
3566
|
}
|
|
3575
|
-
set(e, t,
|
|
3576
|
-
return [D(e,
|
|
3567
|
+
set(e, t, r) {
|
|
3568
|
+
return [D(e, r * 1e3), { timestampIsSet: !0 }];
|
|
3577
3569
|
}
|
|
3578
3570
|
incompatibleTokens = "*";
|
|
3579
3571
|
}
|
|
3580
|
-
class
|
|
3572
|
+
class Va extends p {
|
|
3581
3573
|
priority = 20;
|
|
3582
3574
|
parse(e) {
|
|
3583
|
-
return
|
|
3575
|
+
return _t(e);
|
|
3584
3576
|
}
|
|
3585
|
-
set(e, t,
|
|
3586
|
-
return [D(e,
|
|
3577
|
+
set(e, t, r) {
|
|
3578
|
+
return [D(e, r), { timestampIsSet: !0 }];
|
|
3587
3579
|
}
|
|
3588
3580
|
incompatibleTokens = "*";
|
|
3589
3581
|
}
|
|
3590
|
-
const
|
|
3591
|
-
G: new
|
|
3592
|
-
y: new
|
|
3593
|
-
Y: new
|
|
3594
|
-
R: new
|
|
3595
|
-
u: new
|
|
3596
|
-
Q: new
|
|
3597
|
-
q: new
|
|
3598
|
-
M: new
|
|
3599
|
-
L: new
|
|
3600
|
-
w: new
|
|
3601
|
-
I: new
|
|
3602
|
-
d: new
|
|
3603
|
-
D: new
|
|
3604
|
-
E: new
|
|
3605
|
-
e: new
|
|
3606
|
-
c: new
|
|
3607
|
-
i: new
|
|
3608
|
-
a: new
|
|
3609
|
-
b: new
|
|
3610
|
-
B: new
|
|
3611
|
-
h: new
|
|
3612
|
-
H: new
|
|
3613
|
-
K: new
|
|
3614
|
-
k: new
|
|
3615
|
-
m: new
|
|
3616
|
-
s: new
|
|
3617
|
-
S: new
|
|
3618
|
-
X: new
|
|
3619
|
-
x: new
|
|
3620
|
-
t: new
|
|
3621
|
-
T: new
|
|
3622
|
-
},
|
|
3623
|
-
function
|
|
3624
|
-
const i = () => D(t, NaN), a =
|
|
3582
|
+
const za = {
|
|
3583
|
+
G: new pa(),
|
|
3584
|
+
y: new ha(),
|
|
3585
|
+
Y: new ma(),
|
|
3586
|
+
R: new _a(),
|
|
3587
|
+
u: new wa(),
|
|
3588
|
+
Q: new ya(),
|
|
3589
|
+
q: new ga(),
|
|
3590
|
+
M: new ba(),
|
|
3591
|
+
L: new xa(),
|
|
3592
|
+
w: new Pa(),
|
|
3593
|
+
I: new Ma(),
|
|
3594
|
+
d: new ka(),
|
|
3595
|
+
D: new Na(),
|
|
3596
|
+
E: new Ya(),
|
|
3597
|
+
e: new Ea(),
|
|
3598
|
+
c: new qa(),
|
|
3599
|
+
i: new $a(),
|
|
3600
|
+
a: new Ca(),
|
|
3601
|
+
b: new ja(),
|
|
3602
|
+
B: new Ha(),
|
|
3603
|
+
h: new La(),
|
|
3604
|
+
H: new Ia(),
|
|
3605
|
+
K: new Fa(),
|
|
3606
|
+
k: new Ra(),
|
|
3607
|
+
m: new Aa(),
|
|
3608
|
+
s: new Qa(),
|
|
3609
|
+
S: new Ba(),
|
|
3610
|
+
X: new Sa(),
|
|
3611
|
+
x: new Ga(),
|
|
3612
|
+
t: new Xa(),
|
|
3613
|
+
T: new Va()
|
|
3614
|
+
}, Za = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ja = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ka = /^'([^]*?)'?$/, Ua = /''/g, ei = /\S/, ti = /[a-zA-Z]/;
|
|
3615
|
+
function ri(n, e, t, r) {
|
|
3616
|
+
const i = () => D(t, NaN), a = oa(), o = a.locale ?? ct, s = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, h = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, c = {
|
|
3625
3617
|
firstWeekContainsDate: s,
|
|
3626
3618
|
weekStartsOn: h,
|
|
3627
3619
|
locale: o
|
|
3628
|
-
}, m = [new
|
|
3620
|
+
}, m = [new fa(r?.in, t)], f = e.match(Ja).map((u) => {
|
|
3629
3621
|
const l = u[0];
|
|
3630
|
-
if (l in
|
|
3631
|
-
const
|
|
3632
|
-
return
|
|
3622
|
+
if (l in se) {
|
|
3623
|
+
const y = se[l];
|
|
3624
|
+
return y(u, o.formatLong);
|
|
3633
3625
|
}
|
|
3634
3626
|
return u;
|
|
3635
|
-
}).join("").match(
|
|
3636
|
-
for (let u of
|
|
3637
|
-
|
|
3638
|
-
const l = u[0],
|
|
3639
|
-
if (
|
|
3640
|
-
const { incompatibleTokens: k } =
|
|
3627
|
+
}).join("").match(Za), N = [];
|
|
3628
|
+
for (let u of f) {
|
|
3629
|
+
ht(u) && ue(u, e, n), pt(u) && ue(u, e, n);
|
|
3630
|
+
const l = u[0], y = za[l];
|
|
3631
|
+
if (y) {
|
|
3632
|
+
const { incompatibleTokens: k } = y;
|
|
3641
3633
|
if (Array.isArray(k)) {
|
|
3642
3634
|
const R = N.find(
|
|
3643
3635
|
(A) => k.includes(A.token) || A.token === l
|
|
@@ -3646,93 +3638,93 @@ function oi(r, e, t, n) {
|
|
|
3646
3638
|
throw new RangeError(
|
|
3647
3639
|
`The format string mustn't contain \`${R.fullToken}\` and \`${u}\` at the same time`
|
|
3648
3640
|
);
|
|
3649
|
-
} else if (
|
|
3641
|
+
} else if (y.incompatibleTokens === "*" && N.length > 0)
|
|
3650
3642
|
throw new RangeError(
|
|
3651
3643
|
`The format string mustn't contain \`${u}\` and any other token at the same time`
|
|
3652
3644
|
);
|
|
3653
3645
|
N.push({ token: l, fullToken: u });
|
|
3654
|
-
const F =
|
|
3655
|
-
|
|
3646
|
+
const F = y.run(
|
|
3647
|
+
n,
|
|
3656
3648
|
u,
|
|
3657
3649
|
o.match,
|
|
3658
3650
|
c
|
|
3659
3651
|
);
|
|
3660
3652
|
if (!F)
|
|
3661
3653
|
return i();
|
|
3662
|
-
m.push(F.setter),
|
|
3654
|
+
m.push(F.setter), n = F.rest;
|
|
3663
3655
|
} else {
|
|
3664
|
-
if (l.match(
|
|
3656
|
+
if (l.match(ti))
|
|
3665
3657
|
throw new RangeError(
|
|
3666
3658
|
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
3667
3659
|
);
|
|
3668
|
-
if (u === "''" ? u = "'" : l === "'" && (u =
|
|
3669
|
-
|
|
3660
|
+
if (u === "''" ? u = "'" : l === "'" && (u = ni(u)), n.indexOf(u) === 0)
|
|
3661
|
+
n = n.slice(u.length);
|
|
3670
3662
|
else
|
|
3671
3663
|
return i();
|
|
3672
3664
|
}
|
|
3673
3665
|
}
|
|
3674
|
-
if (
|
|
3666
|
+
if (n.length > 0 && ei.test(n))
|
|
3675
3667
|
return i();
|
|
3676
|
-
const L = m.map((u) => u.priority).sort((u, l) => l - u).filter((u, l,
|
|
3677
|
-
(u) => m.filter((l) => l.priority === u).sort((l,
|
|
3668
|
+
const L = m.map((u) => u.priority).sort((u, l) => l - u).filter((u, l, y) => y.indexOf(u) === l).map(
|
|
3669
|
+
(u) => m.filter((l) => l.priority === u).sort((l, y) => y.subPriority - l.subPriority)
|
|
3678
3670
|
).map((u) => u[0]);
|
|
3679
|
-
let P = M(t,
|
|
3671
|
+
let P = M(t, r?.in);
|
|
3680
3672
|
if (isNaN(+P)) return i();
|
|
3681
|
-
const
|
|
3673
|
+
const w = {};
|
|
3682
3674
|
for (const u of L) {
|
|
3683
3675
|
if (!u.validate(P, c))
|
|
3684
3676
|
return i();
|
|
3685
|
-
const l = u.set(P,
|
|
3686
|
-
Array.isArray(l) ? (P = l[0], Object.assign(
|
|
3677
|
+
const l = u.set(P, w, c);
|
|
3678
|
+
Array.isArray(l) ? (P = l[0], Object.assign(w, l[1])) : P = l;
|
|
3687
3679
|
}
|
|
3688
3680
|
return P;
|
|
3689
3681
|
}
|
|
3690
|
-
function
|
|
3691
|
-
return
|
|
3682
|
+
function ni(n) {
|
|
3683
|
+
return n.match(Ka)[1].replace(Ua, "'");
|
|
3692
3684
|
}
|
|
3693
|
-
const
|
|
3685
|
+
const ai = {
|
|
3694
3686
|
"purpur-date-field__container": "_purpur-date-field__container_ci2f4_1",
|
|
3695
3687
|
"purpur-date-field__overlay": "_purpur-date-field__overlay_ci2f4_5",
|
|
3696
3688
|
"purpur-date-field__start-adornment": "_purpur-date-field__start-adornment_ci2f4_16"
|
|
3697
|
-
},
|
|
3698
|
-
const e =
|
|
3689
|
+
}, ii = (n) => ri(n, "yyyy-MM-dd", /* @__PURE__ */ new Date()), ze = (n) => n ? aa(n, "yyyy-MM-dd") : "", oi = (...n) => {
|
|
3690
|
+
const e = n.filter(Boolean);
|
|
3699
3691
|
return e.length <= 1 ? e[0] || null : (t) => {
|
|
3700
|
-
for (const
|
|
3701
|
-
typeof
|
|
3692
|
+
for (const r of e)
|
|
3693
|
+
typeof r == "function" ? r(t) : r && (r.current = t);
|
|
3702
3694
|
};
|
|
3703
|
-
},
|
|
3704
|
-
({ id:
|
|
3705
|
-
const [s, h] =
|
|
3706
|
-
|
|
3707
|
-
h(e ?
|
|
3695
|
+
}, ae = rn.bind(ai), ie = "purpur-date-field", oe = "YYYY-MM-DD", si = ce(
|
|
3696
|
+
({ id: n, value: e, label: t, onChange: r, startAdornment: i, ...a }, o) => {
|
|
3697
|
+
const [s, h] = _e(ze(e));
|
|
3698
|
+
Pt(() => {
|
|
3699
|
+
h(e ? ze(e) : "");
|
|
3708
3700
|
}, [e]);
|
|
3709
|
-
const c =
|
|
3710
|
-
|
|
3701
|
+
const c = Ze(null), m = oi(o, c), [f, N] = _e({});
|
|
3702
|
+
Ot(() => {
|
|
3711
3703
|
if (c.current) {
|
|
3712
3704
|
const u = window.document.querySelector(
|
|
3713
3705
|
`label[for="${c.current.id}"]`
|
|
3714
|
-
), l = u ? u.offsetHeight + 4 : 0,
|
|
3706
|
+
), l = u ? u.offsetHeight + 4 : 0, y = window.getComputedStyle(c.current);
|
|
3715
3707
|
N({
|
|
3716
3708
|
position: "absolute",
|
|
3717
3709
|
top: c.current.offsetTop + l,
|
|
3718
3710
|
left: c.current.offsetLeft,
|
|
3719
|
-
padding:
|
|
3711
|
+
padding: y.padding,
|
|
3720
3712
|
width: c.current.offsetWidth,
|
|
3721
3713
|
height: c.current.offsetHeight
|
|
3722
3714
|
});
|
|
3723
3715
|
}
|
|
3724
3716
|
}, [s, t, c]);
|
|
3725
3717
|
const L = (u) => {
|
|
3726
|
-
if (u.length === 0 &&
|
|
3718
|
+
if (u.length === 0 && r?.(void 0), u.length !== oe.length)
|
|
3727
3719
|
return;
|
|
3728
|
-
const l =
|
|
3729
|
-
|
|
3720
|
+
const l = ii(u);
|
|
3721
|
+
ut(l) && r?.(l);
|
|
3730
3722
|
}, P = (u) => {
|
|
3731
3723
|
const l = u.target.value.replace(/\D/g, "");
|
|
3732
|
-
let
|
|
3733
|
-
l.length > 0 && (
|
|
3734
|
-
},
|
|
3735
|
-
const k = s[
|
|
3724
|
+
let y = "";
|
|
3725
|
+
l.length > 0 && (y += l.slice(0, 4)), l.length > 4 && (y += "-" + l.slice(4, 6)), l.length > 6 && (y += "-" + l.slice(6, 8)), h(y), L(u.target.value);
|
|
3726
|
+
}, w = () => oe.split("").map((l, y) => {
|
|
3727
|
+
const k = s[y];
|
|
3736
3728
|
return /* @__PURE__ */ d(
|
|
3737
3729
|
"span",
|
|
3738
3730
|
{
|
|
@@ -3741,30 +3733,30 @@ const ui = {
|
|
|
3741
3733
|
},
|
|
3742
3734
|
children: k || l
|
|
3743
3735
|
},
|
|
3744
|
-
|
|
3736
|
+
y
|
|
3745
3737
|
);
|
|
3746
3738
|
});
|
|
3747
|
-
return /* @__PURE__ */
|
|
3739
|
+
return /* @__PURE__ */ j("div", { className: ae(`${ie}__container`), children: [
|
|
3748
3740
|
/* @__PURE__ */ d(
|
|
3749
|
-
|
|
3741
|
+
at,
|
|
3750
3742
|
{
|
|
3751
3743
|
...a,
|
|
3752
|
-
startAdornment: i && /* @__PURE__ */ d("span", { className:
|
|
3744
|
+
startAdornment: i && /* @__PURE__ */ d("span", { className: ae(`${ie}__start-adornment`), children: i }, n),
|
|
3753
3745
|
ref: m,
|
|
3754
3746
|
value: s,
|
|
3755
3747
|
onChange: P,
|
|
3756
3748
|
type: "text",
|
|
3757
|
-
maxLength:
|
|
3749
|
+
maxLength: oe.length,
|
|
3758
3750
|
inputMode: "numeric",
|
|
3759
3751
|
label: t
|
|
3760
3752
|
}
|
|
3761
3753
|
),
|
|
3762
|
-
/* @__PURE__ */ d("div", { role: "presentation", style:
|
|
3754
|
+
/* @__PURE__ */ d("div", { role: "presentation", style: f, className: ae(`${ie}__overlay`), children: w() })
|
|
3763
3755
|
] });
|
|
3764
3756
|
}
|
|
3765
3757
|
);
|
|
3766
|
-
|
|
3758
|
+
si.displayName = "DateField";
|
|
3767
3759
|
export {
|
|
3768
|
-
|
|
3760
|
+
si as DateField
|
|
3769
3761
|
};
|
|
3770
3762
|
//# sourceMappingURL=date-field.es.js.map
|