@scbt-ecom/ui 0.76.3 → 0.77.1
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/{index-BcOxdcOI.js → index-DwZjTCDF.js} +2 -2
- package/dist/{index-BcOxdcOI.js.map → index-DwZjTCDF.js.map} +1 -1
- package/dist/{index-F-RYAmDP.js → index-PZSikNMt.js} +2512 -2503
- package/dist/index-PZSikNMt.js.map +1 -0
- package/dist/lib/shared/ui/dialog/Dialog.d.ts +6 -0
- package/dist/lib/shared/ui/dialog/index.d.ts +1 -0
- package/dist/lib/shared/ui/icon/allowedIcons.d.ts +2 -1
- package/dist/lib/shared/ui/icon/iconsMap.d.ts +12 -0
- package/dist/lib/shared/ui/icon/sprite.gen.d.ts +1 -0
- package/dist/lib/shared/ui/index.d.ts +1 -0
- package/dist/lib/widgets/banner/Banner.d.ts +11 -3
- package/dist/lib/widgets/banner/model/types.d.ts +0 -5
- package/dist/lib/widgets/banner/ui/banners/BannerImageFull.d.ts +1 -1
- package/dist/lib/widgets/banner/ui/banners/BannerWithSeparateImg.d.ts +1 -1
- package/dist/sprites/media.svg +1 -0
- package/dist/static/static/media/desktop.svg +3 -0
- package/dist/static/static/media/mobile.svg +4 -0
- package/dist/ui.js +562 -522
- package/dist/ui.js.map +1 -1
- package/dist/{utils-CaWgHX_C.js → utils-CnDzHNQ6.js} +1186 -1204
- package/dist/utils-CnDzHNQ6.js.map +1 -0
- package/dist/validation.js +2 -2
- package/dist/widget.js +278 -266
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-F-RYAmDP.js.map +0 -1
- package/dist/utils-CaWgHX_C.js.map +0 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (
|
|
4
|
-
import { c as
|
|
1
|
+
var bt = Object.defineProperty;
|
|
2
|
+
var xt = (a, t, e) => t in a ? bt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var f = (a, t, e) => xt(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { c as Ee } from "./typeGuards-CSiImkUY.js";
|
|
5
5
|
var w;
|
|
6
|
-
(function(
|
|
7
|
-
|
|
6
|
+
(function(a) {
|
|
7
|
+
a.assertEqual = (n) => {
|
|
8
8
|
};
|
|
9
|
-
function t(
|
|
9
|
+
function t(n) {
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
function e(
|
|
11
|
+
a.assertIs = t;
|
|
12
|
+
function e(n) {
|
|
13
13
|
throw new Error();
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
a.assertNever = e, a.arrayToEnum = (n) => {
|
|
16
16
|
const s = {};
|
|
17
|
-
for (const i of
|
|
17
|
+
for (const i of n)
|
|
18
18
|
s[i] = i;
|
|
19
19
|
return s;
|
|
20
|
-
},
|
|
21
|
-
const s =
|
|
20
|
+
}, a.getValidEnumValues = (n) => {
|
|
21
|
+
const s = a.objectKeys(n).filter((o) => typeof n[n[o]] != "number"), i = {};
|
|
22
22
|
for (const o of s)
|
|
23
|
-
i[o] =
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
return
|
|
27
|
-
}),
|
|
23
|
+
i[o] = n[o];
|
|
24
|
+
return a.objectValues(i);
|
|
25
|
+
}, a.objectValues = (n) => a.objectKeys(n).map(function(s) {
|
|
26
|
+
return n[s];
|
|
27
|
+
}), a.objectKeys = typeof Object.keys == "function" ? (n) => Object.keys(n) : (n) => {
|
|
28
28
|
const s = [];
|
|
29
|
-
for (const i in
|
|
30
|
-
Object.prototype.hasOwnProperty.call(
|
|
29
|
+
for (const i in n)
|
|
30
|
+
Object.prototype.hasOwnProperty.call(n, i) && s.push(i);
|
|
31
31
|
return s;
|
|
32
|
-
},
|
|
33
|
-
for (const i of
|
|
32
|
+
}, a.find = (n, s) => {
|
|
33
|
+
for (const i of n)
|
|
34
34
|
if (s(i))
|
|
35
35
|
return i;
|
|
36
|
-
},
|
|
37
|
-
function r(
|
|
38
|
-
return
|
|
36
|
+
}, a.isInteger = typeof Number.isInteger == "function" ? (n) => Number.isInteger(n) : (n) => typeof n == "number" && Number.isFinite(n) && Math.floor(n) === n;
|
|
37
|
+
function r(n, s = " | ") {
|
|
38
|
+
return n.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
a.joinValues = r, a.jsonStringifyReplacer = (n, s) => typeof s == "bigint" ? s.toString() : s;
|
|
41
41
|
})(w || (w = {}));
|
|
42
|
-
var
|
|
43
|
-
(function(
|
|
44
|
-
|
|
42
|
+
var Je;
|
|
43
|
+
(function(a) {
|
|
44
|
+
a.mergeShapes = (t, e) => ({
|
|
45
45
|
...t,
|
|
46
46
|
...e
|
|
47
47
|
// second overwrites first
|
|
48
48
|
});
|
|
49
|
-
})(
|
|
49
|
+
})(Je || (Je = {}));
|
|
50
50
|
const h = w.arrayToEnum([
|
|
51
51
|
"string",
|
|
52
52
|
"nan",
|
|
@@ -68,14 +68,14 @@ const h = w.arrayToEnum([
|
|
|
68
68
|
"never",
|
|
69
69
|
"map",
|
|
70
70
|
"set"
|
|
71
|
-
]), Q = (
|
|
72
|
-
switch (typeof
|
|
71
|
+
]), Q = (a) => {
|
|
72
|
+
switch (typeof a) {
|
|
73
73
|
case "undefined":
|
|
74
74
|
return h.undefined;
|
|
75
75
|
case "string":
|
|
76
76
|
return h.string;
|
|
77
77
|
case "number":
|
|
78
|
-
return Number.isNaN(
|
|
78
|
+
return Number.isNaN(a) ? h.nan : h.number;
|
|
79
79
|
case "boolean":
|
|
80
80
|
return h.boolean;
|
|
81
81
|
case "function":
|
|
@@ -85,7 +85,7 @@ const h = w.arrayToEnum([
|
|
|
85
85
|
case "symbol":
|
|
86
86
|
return h.symbol;
|
|
87
87
|
case "object":
|
|
88
|
-
return Array.isArray(
|
|
88
|
+
return Array.isArray(a) ? h.array : a === null ? h.null : a.then && typeof a.then == "function" && a.catch && typeof a.catch == "function" ? h.promise : typeof Map < "u" && a instanceof Map ? h.map : typeof Set < "u" && a instanceof Set ? h.set : typeof Date < "u" && a instanceof Date ? h.date : h.object;
|
|
89
89
|
default:
|
|
90
90
|
return h.unknown;
|
|
91
91
|
}
|
|
@@ -106,7 +106,7 @@ const h = w.arrayToEnum([
|
|
|
106
106
|
"invalid_intersection_types",
|
|
107
107
|
"not_multiple_of",
|
|
108
108
|
"not_finite"
|
|
109
|
-
]),
|
|
109
|
+
]), za = (a) => JSON.stringify(a, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
110
110
|
class Z extends Error {
|
|
111
111
|
get errors() {
|
|
112
112
|
return this.issues;
|
|
@@ -123,14 +123,14 @@ class Z extends Error {
|
|
|
123
123
|
format(t) {
|
|
124
124
|
const e = t || function(s) {
|
|
125
125
|
return s.message;
|
|
126
|
-
}, r = { _errors: [] },
|
|
126
|
+
}, r = { _errors: [] }, n = (s) => {
|
|
127
127
|
for (const i of s.issues)
|
|
128
128
|
if (i.code === "invalid_union")
|
|
129
|
-
i.unionErrors.map(
|
|
129
|
+
i.unionErrors.map(n);
|
|
130
130
|
else if (i.code === "invalid_return_type")
|
|
131
|
-
|
|
131
|
+
n(i.returnTypeError);
|
|
132
132
|
else if (i.code === "invalid_arguments")
|
|
133
|
-
|
|
133
|
+
n(i.argumentsError);
|
|
134
134
|
else if (i.path.length === 0)
|
|
135
135
|
r._errors.push(e(i));
|
|
136
136
|
else {
|
|
@@ -141,7 +141,7 @@ class Z extends Error {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
|
-
return
|
|
144
|
+
return n(this), r;
|
|
145
145
|
}
|
|
146
146
|
static assert(t) {
|
|
147
147
|
if (!(t instanceof Z))
|
|
@@ -158,35 +158,35 @@ class Z extends Error {
|
|
|
158
158
|
}
|
|
159
159
|
flatten(t = (e) => e.message) {
|
|
160
160
|
const e = {}, r = [];
|
|
161
|
-
for (const
|
|
162
|
-
|
|
161
|
+
for (const n of this.issues)
|
|
162
|
+
n.path.length > 0 ? (e[n.path[0]] = e[n.path[0]] || [], e[n.path[0]].push(t(n))) : r.push(t(n));
|
|
163
163
|
return { formErrors: r, fieldErrors: e };
|
|
164
164
|
}
|
|
165
165
|
get formErrors() {
|
|
166
166
|
return this.flatten();
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
Z.create = (
|
|
170
|
-
const
|
|
169
|
+
Z.create = (a) => new Z(a);
|
|
170
|
+
const le = (a, t) => {
|
|
171
171
|
let e;
|
|
172
|
-
switch (
|
|
172
|
+
switch (a.code) {
|
|
173
173
|
case c.invalid_type:
|
|
174
|
-
|
|
174
|
+
a.received === h.undefined ? e = "Required" : e = `Expected ${a.expected}, received ${a.received}`;
|
|
175
175
|
break;
|
|
176
176
|
case c.invalid_literal:
|
|
177
|
-
e = `Invalid literal value, expected ${JSON.stringify(
|
|
177
|
+
e = `Invalid literal value, expected ${JSON.stringify(a.expected, w.jsonStringifyReplacer)}`;
|
|
178
178
|
break;
|
|
179
179
|
case c.unrecognized_keys:
|
|
180
|
-
e = `Unrecognized key(s) in object: ${w.joinValues(
|
|
180
|
+
e = `Unrecognized key(s) in object: ${w.joinValues(a.keys, ", ")}`;
|
|
181
181
|
break;
|
|
182
182
|
case c.invalid_union:
|
|
183
183
|
e = "Invalid input";
|
|
184
184
|
break;
|
|
185
185
|
case c.invalid_union_discriminator:
|
|
186
|
-
e = `Invalid discriminator value. Expected ${w.joinValues(
|
|
186
|
+
e = `Invalid discriminator value. Expected ${w.joinValues(a.options)}`;
|
|
187
187
|
break;
|
|
188
188
|
case c.invalid_enum_value:
|
|
189
|
-
e = `Invalid enum value. Expected ${w.joinValues(
|
|
189
|
+
e = `Invalid enum value. Expected ${w.joinValues(a.options)}, received '${a.received}'`;
|
|
190
190
|
break;
|
|
191
191
|
case c.invalid_arguments:
|
|
192
192
|
e = "Invalid function arguments";
|
|
@@ -198,13 +198,13 @@ const he = (n, t) => {
|
|
|
198
198
|
e = "Invalid date";
|
|
199
199
|
break;
|
|
200
200
|
case c.invalid_string:
|
|
201
|
-
typeof
|
|
201
|
+
typeof a.validation == "object" ? "includes" in a.validation ? (e = `Invalid input: must include "${a.validation.includes}"`, typeof a.validation.position == "number" && (e = `${e} at one or more positions greater than or equal to ${a.validation.position}`)) : "startsWith" in a.validation ? e = `Invalid input: must start with "${a.validation.startsWith}"` : "endsWith" in a.validation ? e = `Invalid input: must end with "${a.validation.endsWith}"` : w.assertNever(a.validation) : a.validation !== "regex" ? e = `Invalid ${a.validation}` : e = "Invalid";
|
|
202
202
|
break;
|
|
203
203
|
case c.too_small:
|
|
204
|
-
|
|
204
|
+
a.type === "array" ? e = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "more than"} ${a.minimum} element(s)` : a.type === "string" ? e = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "over"} ${a.minimum} character(s)` : a.type === "number" ? e = `Number must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${a.minimum}` : a.type === "date" ? e = `Date must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(a.minimum))}` : e = "Invalid input";
|
|
205
205
|
break;
|
|
206
206
|
case c.too_big:
|
|
207
|
-
|
|
207
|
+
a.type === "array" ? e = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "less than"} ${a.maximum} element(s)` : a.type === "string" ? e = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "under"} ${a.maximum} character(s)` : a.type === "number" ? e = `Number must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "bigint" ? e = `BigInt must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "date" ? e = `Date must be ${a.exact ? "exactly" : a.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(a.maximum))}` : e = "Invalid input";
|
|
208
208
|
break;
|
|
209
209
|
case c.custom:
|
|
210
210
|
e = "Invalid input";
|
|
@@ -213,61 +213,61 @@ const he = (n, t) => {
|
|
|
213
213
|
e = "Intersection results could not be merged";
|
|
214
214
|
break;
|
|
215
215
|
case c.not_multiple_of:
|
|
216
|
-
e = `Number must be a multiple of ${
|
|
216
|
+
e = `Number must be a multiple of ${a.multipleOf}`;
|
|
217
217
|
break;
|
|
218
218
|
case c.not_finite:
|
|
219
219
|
e = "Number must be finite";
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
|
-
e = t.defaultError, w.assertNever(
|
|
222
|
+
e = t.defaultError, w.assertNever(a);
|
|
223
223
|
}
|
|
224
224
|
return { message: e };
|
|
225
225
|
};
|
|
226
|
-
let
|
|
227
|
-
function
|
|
228
|
-
|
|
226
|
+
let ot = le;
|
|
227
|
+
function qa(a) {
|
|
228
|
+
ot = a;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return
|
|
230
|
+
function Ae() {
|
|
231
|
+
return ot;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
234
|
-
const { data: t, path: e, errorMaps: r, issueData:
|
|
235
|
-
...
|
|
233
|
+
const Ze = (a) => {
|
|
234
|
+
const { data: t, path: e, errorMaps: r, issueData: n } = a, s = [...e, ...n.path || []], i = {
|
|
235
|
+
...n,
|
|
236
236
|
path: s
|
|
237
237
|
};
|
|
238
|
-
if (
|
|
238
|
+
if (n.message !== void 0)
|
|
239
239
|
return {
|
|
240
|
-
...
|
|
240
|
+
...n,
|
|
241
241
|
path: s,
|
|
242
|
-
message:
|
|
242
|
+
message: n.message
|
|
243
243
|
};
|
|
244
244
|
let o = "";
|
|
245
245
|
const u = r.filter((d) => !!d).slice().reverse();
|
|
246
246
|
for (const d of u)
|
|
247
247
|
o = d(i, { data: t, defaultError: o }).message;
|
|
248
248
|
return {
|
|
249
|
-
...
|
|
249
|
+
...n,
|
|
250
250
|
path: s,
|
|
251
251
|
message: o
|
|
252
252
|
};
|
|
253
|
-
},
|
|
254
|
-
function l(
|
|
255
|
-
const e =
|
|
253
|
+
}, Ha = [];
|
|
254
|
+
function l(a, t) {
|
|
255
|
+
const e = Ae(), r = Ze({
|
|
256
256
|
issueData: t,
|
|
257
|
-
data:
|
|
258
|
-
path:
|
|
257
|
+
data: a.data,
|
|
258
|
+
path: a.path,
|
|
259
259
|
errorMaps: [
|
|
260
|
-
|
|
260
|
+
a.common.contextualErrorMap,
|
|
261
261
|
// contextual error map is first priority
|
|
262
|
-
|
|
262
|
+
a.schemaErrorMap,
|
|
263
263
|
// then schema-bound map if available
|
|
264
264
|
e,
|
|
265
265
|
// then global override map
|
|
266
|
-
e ===
|
|
266
|
+
e === le ? void 0 : le
|
|
267
267
|
// then global default map
|
|
268
|
-
].filter((
|
|
268
|
+
].filter((n) => !!n)
|
|
269
269
|
});
|
|
270
|
-
|
|
270
|
+
a.common.issues.push(r);
|
|
271
271
|
}
|
|
272
272
|
class I {
|
|
273
273
|
constructor() {
|
|
@@ -281,17 +281,17 @@ class I {
|
|
|
281
281
|
}
|
|
282
282
|
static mergeArray(t, e) {
|
|
283
283
|
const r = [];
|
|
284
|
-
for (const
|
|
285
|
-
if (
|
|
286
|
-
return
|
|
287
|
-
|
|
284
|
+
for (const n of e) {
|
|
285
|
+
if (n.status === "aborted")
|
|
286
|
+
return y;
|
|
287
|
+
n.status === "dirty" && t.dirty(), r.push(n.value);
|
|
288
288
|
}
|
|
289
289
|
return { status: t.value, value: r };
|
|
290
290
|
}
|
|
291
291
|
static async mergeObjectAsync(t, e) {
|
|
292
292
|
const r = [];
|
|
293
|
-
for (const
|
|
294
|
-
const s = await
|
|
293
|
+
for (const n of e) {
|
|
294
|
+
const s = await n.key, i = await n.value;
|
|
295
295
|
r.push({
|
|
296
296
|
key: s,
|
|
297
297
|
value: i
|
|
@@ -301,65 +301,55 @@ class I {
|
|
|
301
301
|
}
|
|
302
302
|
static mergeObjectSync(t, e) {
|
|
303
303
|
const r = {};
|
|
304
|
-
for (const
|
|
305
|
-
const { key: s, value: i } =
|
|
304
|
+
for (const n of e) {
|
|
305
|
+
const { key: s, value: i } = n;
|
|
306
306
|
if (s.status === "aborted" || i.status === "aborted")
|
|
307
|
-
return
|
|
308
|
-
s.status === "dirty" && t.dirty(), i.status === "dirty" && t.dirty(), s.value !== "__proto__" && (typeof i.value < "u" ||
|
|
307
|
+
return y;
|
|
308
|
+
s.status === "dirty" && t.dirty(), i.status === "dirty" && t.dirty(), s.value !== "__proto__" && (typeof i.value < "u" || n.alwaysSet) && (r[s.value] = i.value);
|
|
309
309
|
}
|
|
310
310
|
return { status: t.value, value: r };
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
const
|
|
313
|
+
const y = Object.freeze({
|
|
314
314
|
status: "aborted"
|
|
315
|
-
}), ue = (
|
|
315
|
+
}), ue = (a) => ({ status: "dirty", value: a }), R = (a) => ({ status: "valid", value: a }), Ke = (a) => a.status === "aborted", et = (a) => a.status === "dirty", ae = (a) => a.status === "valid", pe = (a) => typeof Promise < "u" && a instanceof Promise;
|
|
316
316
|
var m;
|
|
317
|
-
(function(
|
|
318
|
-
|
|
317
|
+
(function(a) {
|
|
318
|
+
a.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, a.toString = (t) => typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
319
319
|
})(m || (m = {}));
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return e === "m" ? r : e === "a" ? r.call(n) : r ? r.value : t.get(n);
|
|
324
|
-
}, lt = function(n, t, e, r, a) {
|
|
325
|
-
if (r === "m") throw new TypeError("Private method is not writable");
|
|
326
|
-
if (r === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
|
|
327
|
-
if (typeof t == "function" ? n !== t || !a : !t.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
328
|
-
return r === "a" ? a.call(n, e) : a ? a.value = e : t.set(n, e), e;
|
|
329
|
-
}, de, le;
|
|
330
|
-
class S {
|
|
331
|
-
constructor(t, e, r, a) {
|
|
332
|
-
this._cachedPath = [], this.parent = t, this.data = e, this._path = r, this._key = a;
|
|
320
|
+
class V {
|
|
321
|
+
constructor(t, e, r, n) {
|
|
322
|
+
this._cachedPath = [], this.parent = t, this.data = e, this._path = r, this._key = n;
|
|
333
323
|
}
|
|
334
324
|
get path() {
|
|
335
325
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
336
326
|
}
|
|
337
327
|
}
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
328
|
+
const tt = (a, t) => {
|
|
329
|
+
if (ae(t))
|
|
340
330
|
return { success: !0, data: t.value };
|
|
341
|
-
if (!
|
|
331
|
+
if (!a.common.issues.length)
|
|
342
332
|
throw new Error("Validation failed but no issues detected.");
|
|
343
333
|
return {
|
|
344
334
|
success: !1,
|
|
345
335
|
get error() {
|
|
346
336
|
if (this._error)
|
|
347
337
|
return this._error;
|
|
348
|
-
const e = new Z(
|
|
338
|
+
const e = new Z(a.common.issues);
|
|
349
339
|
return this._error = e, this._error;
|
|
350
340
|
}
|
|
351
341
|
};
|
|
352
342
|
};
|
|
353
|
-
function _(
|
|
354
|
-
if (!
|
|
343
|
+
function _(a) {
|
|
344
|
+
if (!a)
|
|
355
345
|
return {};
|
|
356
|
-
const { errorMap: t, invalid_type_error: e, required_error: r, description:
|
|
346
|
+
const { errorMap: t, invalid_type_error: e, required_error: r, description: n } = a;
|
|
357
347
|
if (t && (e || r))
|
|
358
348
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
359
|
-
return t ? { errorMap: t, description:
|
|
360
|
-
const { message: u } =
|
|
349
|
+
return t ? { errorMap: t, description: n } : { errorMap: (i, o) => {
|
|
350
|
+
const { message: u } = a;
|
|
361
351
|
return i.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: u ?? r ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: u ?? e ?? o.defaultError };
|
|
362
|
-
}, description:
|
|
352
|
+
}, description: n };
|
|
363
353
|
}
|
|
364
354
|
class v {
|
|
365
355
|
get description() {
|
|
@@ -393,7 +383,7 @@ class v {
|
|
|
393
383
|
}
|
|
394
384
|
_parseSync(t) {
|
|
395
385
|
const e = this._parse(t);
|
|
396
|
-
if (
|
|
386
|
+
if (pe(e))
|
|
397
387
|
throw new Error("Synchronous parse encountered promise.");
|
|
398
388
|
return e;
|
|
399
389
|
}
|
|
@@ -419,11 +409,11 @@ class v {
|
|
|
419
409
|
parent: null,
|
|
420
410
|
data: t,
|
|
421
411
|
parsedType: Q(t)
|
|
422
|
-
},
|
|
423
|
-
return
|
|
412
|
+
}, n = this._parseSync({ data: t, path: r.path, parent: r });
|
|
413
|
+
return tt(r, n);
|
|
424
414
|
}
|
|
425
415
|
"~validate"(t) {
|
|
426
|
-
var r,
|
|
416
|
+
var r, n;
|
|
427
417
|
const e = {
|
|
428
418
|
common: {
|
|
429
419
|
issues: [],
|
|
@@ -438,18 +428,18 @@ class v {
|
|
|
438
428
|
if (!this["~standard"].async)
|
|
439
429
|
try {
|
|
440
430
|
const s = this._parseSync({ data: t, path: [], parent: e });
|
|
441
|
-
return
|
|
431
|
+
return ae(s) ? {
|
|
442
432
|
value: s.value
|
|
443
433
|
} : {
|
|
444
434
|
issues: e.common.issues
|
|
445
435
|
};
|
|
446
436
|
} catch (s) {
|
|
447
|
-
(
|
|
437
|
+
(n = (r = s == null ? void 0 : s.message) == null ? void 0 : r.toLowerCase()) != null && n.includes("encountered") && (this["~standard"].async = !0), e.common = {
|
|
448
438
|
issues: [],
|
|
449
439
|
async: !0
|
|
450
440
|
};
|
|
451
441
|
}
|
|
452
|
-
return this._parseAsync({ data: t, path: [], parent: e }).then((s) =>
|
|
442
|
+
return this._parseAsync({ data: t, path: [], parent: e }).then((s) => ae(s) ? {
|
|
453
443
|
value: s.value
|
|
454
444
|
} : {
|
|
455
445
|
issues: e.common.issues
|
|
@@ -473,26 +463,26 @@ class v {
|
|
|
473
463
|
parent: null,
|
|
474
464
|
data: t,
|
|
475
465
|
parsedType: Q(t)
|
|
476
|
-
},
|
|
477
|
-
return
|
|
466
|
+
}, n = this._parse({ data: t, path: r.path, parent: r }), s = await (pe(n) ? n : Promise.resolve(n));
|
|
467
|
+
return tt(r, s);
|
|
478
468
|
}
|
|
479
469
|
refine(t, e) {
|
|
480
|
-
const r = (
|
|
481
|
-
return this._refinement((
|
|
482
|
-
const i = t(
|
|
470
|
+
const r = (n) => typeof e == "string" || typeof e > "u" ? { message: e } : typeof e == "function" ? e(n) : e;
|
|
471
|
+
return this._refinement((n, s) => {
|
|
472
|
+
const i = t(n), o = () => s.addIssue({
|
|
483
473
|
code: c.custom,
|
|
484
|
-
...r(
|
|
474
|
+
...r(n)
|
|
485
475
|
});
|
|
486
476
|
return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
487
477
|
});
|
|
488
478
|
}
|
|
489
479
|
refinement(t, e) {
|
|
490
|
-
return this._refinement((r,
|
|
480
|
+
return this._refinement((r, n) => t(r) ? !0 : (n.addIssue(typeof e == "function" ? e(r, n) : e), !1));
|
|
491
481
|
}
|
|
492
482
|
_refinement(t) {
|
|
493
483
|
return new B({
|
|
494
484
|
schema: this,
|
|
495
|
-
typeName:
|
|
485
|
+
typeName: g.ZodEffects,
|
|
496
486
|
effect: { type: "refinement", refinement: t }
|
|
497
487
|
});
|
|
498
488
|
}
|
|
@@ -516,48 +506,48 @@ class v {
|
|
|
516
506
|
return this.nullable().optional();
|
|
517
507
|
}
|
|
518
508
|
array() {
|
|
519
|
-
return
|
|
509
|
+
return S.create(this);
|
|
520
510
|
}
|
|
521
511
|
promise() {
|
|
522
|
-
return
|
|
512
|
+
return he.create(this, this._def);
|
|
523
513
|
}
|
|
524
514
|
or(t) {
|
|
525
|
-
return
|
|
515
|
+
return ve.create([this, t], this._def);
|
|
526
516
|
}
|
|
527
517
|
and(t) {
|
|
528
|
-
return
|
|
518
|
+
return we.create(this, t, this._def);
|
|
529
519
|
}
|
|
530
520
|
transform(t) {
|
|
531
521
|
return new B({
|
|
532
522
|
..._(this._def),
|
|
533
523
|
schema: this,
|
|
534
|
-
typeName:
|
|
524
|
+
typeName: g.ZodEffects,
|
|
535
525
|
effect: { type: "transform", transform: t }
|
|
536
526
|
});
|
|
537
527
|
}
|
|
538
528
|
default(t) {
|
|
539
529
|
const e = typeof t == "function" ? t : () => t;
|
|
540
|
-
return new
|
|
530
|
+
return new Oe({
|
|
541
531
|
..._(this._def),
|
|
542
532
|
innerType: this,
|
|
543
533
|
defaultValue: e,
|
|
544
|
-
typeName:
|
|
534
|
+
typeName: g.ZodDefault
|
|
545
535
|
});
|
|
546
536
|
}
|
|
547
537
|
brand() {
|
|
548
|
-
return new
|
|
549
|
-
typeName:
|
|
538
|
+
return new lt({
|
|
539
|
+
typeName: g.ZodBranded,
|
|
550
540
|
type: this,
|
|
551
541
|
..._(this._def)
|
|
552
542
|
});
|
|
553
543
|
}
|
|
554
544
|
catch(t) {
|
|
555
545
|
const e = typeof t == "function" ? t : () => t;
|
|
556
|
-
return new
|
|
546
|
+
return new Pe({
|
|
557
547
|
..._(this._def),
|
|
558
548
|
innerType: this,
|
|
559
549
|
catchValue: e,
|
|
560
|
-
typeName:
|
|
550
|
+
typeName: g.ZodCatch
|
|
561
551
|
});
|
|
562
552
|
}
|
|
563
553
|
describe(t) {
|
|
@@ -568,10 +558,10 @@ class v {
|
|
|
568
558
|
});
|
|
569
559
|
}
|
|
570
560
|
pipe(t) {
|
|
571
|
-
return
|
|
561
|
+
return De.create(this, t);
|
|
572
562
|
}
|
|
573
563
|
readonly() {
|
|
574
|
-
return
|
|
564
|
+
return Ce.create(this);
|
|
575
565
|
}
|
|
576
566
|
isOptional() {
|
|
577
567
|
return this.safeParse(void 0).success;
|
|
@@ -580,38 +570,38 @@ class v {
|
|
|
580
570
|
return this.safeParse(null).success;
|
|
581
571
|
}
|
|
582
572
|
}
|
|
583
|
-
const
|
|
584
|
-
let
|
|
585
|
-
const
|
|
586
|
-
function
|
|
573
|
+
const kt = /^c[^\s-]{8,}$/i, Tt = /^[0-9a-z]+$/, Ot = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Pt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ct = /^[a-z0-9_-]{21}$/i, Mt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Dt = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Nt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Et = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
574
|
+
let Ie;
|
|
575
|
+
const It = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Rt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, At = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Zt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, jt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Yt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ct = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Wt = new RegExp(`^${ct}$`);
|
|
576
|
+
function ut(a) {
|
|
587
577
|
let t = "[0-5]\\d";
|
|
588
|
-
|
|
589
|
-
const e =
|
|
578
|
+
a.precision ? t = `${t}\\.\\d{${a.precision}}` : a.precision == null && (t = `${t}(\\.\\d+)?`);
|
|
579
|
+
const e = a.precision ? "+" : "?";
|
|
590
580
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`;
|
|
591
581
|
}
|
|
592
|
-
function
|
|
593
|
-
return new RegExp(`^${
|
|
582
|
+
function $t(a) {
|
|
583
|
+
return new RegExp(`^${ut(a)}$`);
|
|
594
584
|
}
|
|
595
|
-
function
|
|
596
|
-
let t = `${
|
|
585
|
+
function Lt(a) {
|
|
586
|
+
let t = `${ct}T${ut(a)}`;
|
|
597
587
|
const e = [];
|
|
598
|
-
return e.push(
|
|
588
|
+
return e.push(a.local ? "Z?" : "Z"), a.offset && e.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${e.join("|")})`, new RegExp(`^${t}$`);
|
|
599
589
|
}
|
|
600
|
-
function
|
|
601
|
-
return !!((t === "v4" || !t) &&
|
|
590
|
+
function St(a, t) {
|
|
591
|
+
return !!((t === "v4" || !t) && It.test(a) || (t === "v6" || !t) && At.test(a));
|
|
602
592
|
}
|
|
603
|
-
function
|
|
604
|
-
if (!
|
|
593
|
+
function Vt(a, t) {
|
|
594
|
+
if (!Mt.test(a))
|
|
605
595
|
return !1;
|
|
606
596
|
try {
|
|
607
|
-
const [e] =
|
|
608
|
-
return !(typeof
|
|
597
|
+
const [e] = a.split("."), r = e.replace(/-/g, "+").replace(/_/g, "/").padEnd(e.length + (4 - e.length % 4) % 4, "="), n = JSON.parse(atob(r));
|
|
598
|
+
return !(typeof n != "object" || n === null || "typ" in n && (n == null ? void 0 : n.typ) !== "JWT" || !n.alg || t && n.alg !== t);
|
|
609
599
|
} catch {
|
|
610
600
|
return !1;
|
|
611
601
|
}
|
|
612
602
|
}
|
|
613
|
-
function
|
|
614
|
-
return !!((t === "v4" || !t) &&
|
|
603
|
+
function Ft(a, t) {
|
|
604
|
+
return !!((t === "v4" || !t) && Rt.test(a) || (t === "v6" || !t) && Zt.test(a));
|
|
615
605
|
}
|
|
616
606
|
class L extends v {
|
|
617
607
|
_parse(t) {
|
|
@@ -621,13 +611,13 @@ class L extends v {
|
|
|
621
611
|
code: c.invalid_type,
|
|
622
612
|
expected: h.string,
|
|
623
613
|
received: s.parsedType
|
|
624
|
-
}),
|
|
614
|
+
}), y;
|
|
625
615
|
}
|
|
626
616
|
const r = new I();
|
|
627
|
-
let
|
|
617
|
+
let n;
|
|
628
618
|
for (const s of this._def.checks)
|
|
629
619
|
if (s.kind === "min")
|
|
630
|
-
t.data.length < s.value && (
|
|
620
|
+
t.data.length < s.value && (n = this._getOrReturnCtx(t, n), l(n, {
|
|
631
621
|
code: c.too_small,
|
|
632
622
|
minimum: s.value,
|
|
633
623
|
type: "string",
|
|
@@ -636,7 +626,7 @@ class L extends v {
|
|
|
636
626
|
message: s.message
|
|
637
627
|
}), r.dirty());
|
|
638
628
|
else if (s.kind === "max")
|
|
639
|
-
t.data.length > s.value && (
|
|
629
|
+
t.data.length > s.value && (n = this._getOrReturnCtx(t, n), l(n, {
|
|
640
630
|
code: c.too_big,
|
|
641
631
|
maximum: s.value,
|
|
642
632
|
type: "string",
|
|
@@ -646,14 +636,14 @@ class L extends v {
|
|
|
646
636
|
}), r.dirty());
|
|
647
637
|
else if (s.kind === "length") {
|
|
648
638
|
const i = t.data.length > s.value, o = t.data.length < s.value;
|
|
649
|
-
(i || o) && (
|
|
639
|
+
(i || o) && (n = this._getOrReturnCtx(t, n), i ? l(n, {
|
|
650
640
|
code: c.too_big,
|
|
651
641
|
maximum: s.value,
|
|
652
642
|
type: "string",
|
|
653
643
|
inclusive: !0,
|
|
654
644
|
exact: !0,
|
|
655
645
|
message: s.message
|
|
656
|
-
}) : o && l(
|
|
646
|
+
}) : o && l(n, {
|
|
657
647
|
code: c.too_small,
|
|
658
648
|
minimum: s.value,
|
|
659
649
|
type: "string",
|
|
@@ -662,43 +652,43 @@ class L extends v {
|
|
|
662
652
|
message: s.message
|
|
663
653
|
}), r.dirty());
|
|
664
654
|
} else if (s.kind === "email")
|
|
665
|
-
|
|
655
|
+
Nt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
666
656
|
validation: "email",
|
|
667
657
|
code: c.invalid_string,
|
|
668
658
|
message: s.message
|
|
669
659
|
}), r.dirty());
|
|
670
660
|
else if (s.kind === "emoji")
|
|
671
|
-
|
|
661
|
+
Ie || (Ie = new RegExp(Et, "u")), Ie.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
672
662
|
validation: "emoji",
|
|
673
663
|
code: c.invalid_string,
|
|
674
664
|
message: s.message
|
|
675
665
|
}), r.dirty());
|
|
676
666
|
else if (s.kind === "uuid")
|
|
677
|
-
|
|
667
|
+
Pt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
678
668
|
validation: "uuid",
|
|
679
669
|
code: c.invalid_string,
|
|
680
670
|
message: s.message
|
|
681
671
|
}), r.dirty());
|
|
682
672
|
else if (s.kind === "nanoid")
|
|
683
|
-
|
|
673
|
+
Ct.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
684
674
|
validation: "nanoid",
|
|
685
675
|
code: c.invalid_string,
|
|
686
676
|
message: s.message
|
|
687
677
|
}), r.dirty());
|
|
688
678
|
else if (s.kind === "cuid")
|
|
689
|
-
|
|
679
|
+
kt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
690
680
|
validation: "cuid",
|
|
691
681
|
code: c.invalid_string,
|
|
692
682
|
message: s.message
|
|
693
683
|
}), r.dirty());
|
|
694
684
|
else if (s.kind === "cuid2")
|
|
695
|
-
|
|
685
|
+
Tt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
696
686
|
validation: "cuid2",
|
|
697
687
|
code: c.invalid_string,
|
|
698
688
|
message: s.message
|
|
699
689
|
}), r.dirty());
|
|
700
690
|
else if (s.kind === "ulid")
|
|
701
|
-
|
|
691
|
+
Ot.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
702
692
|
validation: "ulid",
|
|
703
693
|
code: c.invalid_string,
|
|
704
694
|
message: s.message
|
|
@@ -707,61 +697,61 @@ class L extends v {
|
|
|
707
697
|
try {
|
|
708
698
|
new URL(t.data);
|
|
709
699
|
} catch {
|
|
710
|
-
|
|
700
|
+
n = this._getOrReturnCtx(t, n), l(n, {
|
|
711
701
|
validation: "url",
|
|
712
702
|
code: c.invalid_string,
|
|
713
703
|
message: s.message
|
|
714
704
|
}), r.dirty();
|
|
715
705
|
}
|
|
716
|
-
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(t.data) || (
|
|
706
|
+
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
717
707
|
validation: "regex",
|
|
718
708
|
code: c.invalid_string,
|
|
719
709
|
message: s.message
|
|
720
|
-
}), r.dirty())) : s.kind === "trim" ? t.data = t.data.trim() : s.kind === "includes" ? t.data.includes(s.value, s.position) || (
|
|
710
|
+
}), r.dirty())) : s.kind === "trim" ? t.data = t.data.trim() : s.kind === "includes" ? t.data.includes(s.value, s.position) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
721
711
|
code: c.invalid_string,
|
|
722
712
|
validation: { includes: s.value, position: s.position },
|
|
723
713
|
message: s.message
|
|
724
|
-
}), r.dirty()) : s.kind === "toLowerCase" ? t.data = t.data.toLowerCase() : s.kind === "toUpperCase" ? t.data = t.data.toUpperCase() : s.kind === "startsWith" ? t.data.startsWith(s.value) || (
|
|
714
|
+
}), r.dirty()) : s.kind === "toLowerCase" ? t.data = t.data.toLowerCase() : s.kind === "toUpperCase" ? t.data = t.data.toUpperCase() : s.kind === "startsWith" ? t.data.startsWith(s.value) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
725
715
|
code: c.invalid_string,
|
|
726
716
|
validation: { startsWith: s.value },
|
|
727
717
|
message: s.message
|
|
728
|
-
}), r.dirty()) : s.kind === "endsWith" ? t.data.endsWith(s.value) || (
|
|
718
|
+
}), r.dirty()) : s.kind === "endsWith" ? t.data.endsWith(s.value) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
729
719
|
code: c.invalid_string,
|
|
730
720
|
validation: { endsWith: s.value },
|
|
731
721
|
message: s.message
|
|
732
|
-
}), r.dirty()) : s.kind === "datetime" ?
|
|
722
|
+
}), r.dirty()) : s.kind === "datetime" ? Lt(s).test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
733
723
|
code: c.invalid_string,
|
|
734
724
|
validation: "datetime",
|
|
735
725
|
message: s.message
|
|
736
|
-
}), r.dirty()) : s.kind === "date" ?
|
|
726
|
+
}), r.dirty()) : s.kind === "date" ? Wt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
737
727
|
code: c.invalid_string,
|
|
738
728
|
validation: "date",
|
|
739
729
|
message: s.message
|
|
740
|
-
}), r.dirty()) : s.kind === "time" ?
|
|
730
|
+
}), r.dirty()) : s.kind === "time" ? $t(s).test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
741
731
|
code: c.invalid_string,
|
|
742
732
|
validation: "time",
|
|
743
733
|
message: s.message
|
|
744
|
-
}), r.dirty()) : s.kind === "duration" ?
|
|
734
|
+
}), r.dirty()) : s.kind === "duration" ? Dt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
745
735
|
validation: "duration",
|
|
746
736
|
code: c.invalid_string,
|
|
747
737
|
message: s.message
|
|
748
|
-
}), r.dirty()) : s.kind === "ip" ?
|
|
738
|
+
}), r.dirty()) : s.kind === "ip" ? St(t.data, s.version) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
749
739
|
validation: "ip",
|
|
750
740
|
code: c.invalid_string,
|
|
751
741
|
message: s.message
|
|
752
|
-
}), r.dirty()) : s.kind === "jwt" ?
|
|
742
|
+
}), r.dirty()) : s.kind === "jwt" ? Vt(t.data, s.alg) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
753
743
|
validation: "jwt",
|
|
754
744
|
code: c.invalid_string,
|
|
755
745
|
message: s.message
|
|
756
|
-
}), r.dirty()) : s.kind === "cidr" ?
|
|
746
|
+
}), r.dirty()) : s.kind === "cidr" ? Ft(t.data, s.version) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
757
747
|
validation: "cidr",
|
|
758
748
|
code: c.invalid_string,
|
|
759
749
|
message: s.message
|
|
760
|
-
}), r.dirty()) : s.kind === "base64" ?
|
|
750
|
+
}), r.dirty()) : s.kind === "base64" ? jt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
761
751
|
validation: "base64",
|
|
762
752
|
code: c.invalid_string,
|
|
763
753
|
message: s.message
|
|
764
|
-
}), r.dirty()) : s.kind === "base64url" ?
|
|
754
|
+
}), r.dirty()) : s.kind === "base64url" ? Yt.test(t.data) || (n = this._getOrReturnCtx(t, n), l(n, {
|
|
765
755
|
validation: "base64url",
|
|
766
756
|
code: c.invalid_string,
|
|
767
757
|
message: s.message
|
|
@@ -769,7 +759,7 @@ class L extends v {
|
|
|
769
759
|
return { status: r.value, value: t.data };
|
|
770
760
|
}
|
|
771
761
|
_regex(t, e, r) {
|
|
772
|
-
return this.refinement((
|
|
762
|
+
return this.refinement((n) => t.test(n), {
|
|
773
763
|
validation: e,
|
|
774
764
|
code: c.invalid_string,
|
|
775
765
|
...m.errToObj(r)
|
|
@@ -990,15 +980,15 @@ class L extends v {
|
|
|
990
980
|
return t;
|
|
991
981
|
}
|
|
992
982
|
}
|
|
993
|
-
L.create = (
|
|
983
|
+
L.create = (a) => new L({
|
|
994
984
|
checks: [],
|
|
995
|
-
typeName:
|
|
996
|
-
coerce: (
|
|
997
|
-
..._(
|
|
985
|
+
typeName: g.ZodString,
|
|
986
|
+
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
987
|
+
..._(a)
|
|
998
988
|
});
|
|
999
|
-
function
|
|
1000
|
-
const e = (
|
|
1001
|
-
return s % i / 10 **
|
|
989
|
+
function zt(a, t) {
|
|
990
|
+
const e = (a.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, n = e > r ? e : r, s = Number.parseInt(a.toFixed(n).replace(".", "")), i = Number.parseInt(t.toFixed(n).replace(".", ""));
|
|
991
|
+
return s % i / 10 ** n;
|
|
1002
992
|
}
|
|
1003
993
|
class G extends v {
|
|
1004
994
|
constructor() {
|
|
@@ -1011,39 +1001,39 @@ class G extends v {
|
|
|
1011
1001
|
code: c.invalid_type,
|
|
1012
1002
|
expected: h.number,
|
|
1013
1003
|
received: s.parsedType
|
|
1014
|
-
}),
|
|
1004
|
+
}), y;
|
|
1015
1005
|
}
|
|
1016
1006
|
let r;
|
|
1017
|
-
const
|
|
1007
|
+
const n = new I();
|
|
1018
1008
|
for (const s of this._def.checks)
|
|
1019
1009
|
s.kind === "int" ? w.isInteger(t.data) || (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1020
1010
|
code: c.invalid_type,
|
|
1021
1011
|
expected: "integer",
|
|
1022
1012
|
received: "float",
|
|
1023
1013
|
message: s.message
|
|
1024
|
-
}),
|
|
1014
|
+
}), n.dirty()) : s.kind === "min" ? (s.inclusive ? t.data < s.value : t.data <= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1025
1015
|
code: c.too_small,
|
|
1026
1016
|
minimum: s.value,
|
|
1027
1017
|
type: "number",
|
|
1028
1018
|
inclusive: s.inclusive,
|
|
1029
1019
|
exact: !1,
|
|
1030
1020
|
message: s.message
|
|
1031
|
-
}),
|
|
1021
|
+
}), n.dirty()) : s.kind === "max" ? (s.inclusive ? t.data > s.value : t.data >= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1032
1022
|
code: c.too_big,
|
|
1033
1023
|
maximum: s.value,
|
|
1034
1024
|
type: "number",
|
|
1035
1025
|
inclusive: s.inclusive,
|
|
1036
1026
|
exact: !1,
|
|
1037
1027
|
message: s.message
|
|
1038
|
-
}),
|
|
1028
|
+
}), n.dirty()) : s.kind === "multipleOf" ? zt(t.data, s.value) !== 0 && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1039
1029
|
code: c.not_multiple_of,
|
|
1040
1030
|
multipleOf: s.value,
|
|
1041
1031
|
message: s.message
|
|
1042
|
-
}),
|
|
1032
|
+
}), n.dirty()) : s.kind === "finite" ? Number.isFinite(t.data) || (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1043
1033
|
code: c.not_finite,
|
|
1044
1034
|
message: s.message
|
|
1045
|
-
}),
|
|
1046
|
-
return { status:
|
|
1035
|
+
}), n.dirty()) : w.assertNever(s);
|
|
1036
|
+
return { status: n.value, value: t.data };
|
|
1047
1037
|
}
|
|
1048
1038
|
gte(t, e) {
|
|
1049
1039
|
return this.setLimit("min", t, !0, m.toString(e));
|
|
@@ -1057,7 +1047,7 @@ class G extends v {
|
|
|
1057
1047
|
lt(t, e) {
|
|
1058
1048
|
return this.setLimit("max", t, !1, m.toString(e));
|
|
1059
1049
|
}
|
|
1060
|
-
setLimit(t, e, r,
|
|
1050
|
+
setLimit(t, e, r, n) {
|
|
1061
1051
|
return new G({
|
|
1062
1052
|
...this._def,
|
|
1063
1053
|
checks: [
|
|
@@ -1066,7 +1056,7 @@ class G extends v {
|
|
|
1066
1056
|
kind: t,
|
|
1067
1057
|
value: e,
|
|
1068
1058
|
inclusive: r,
|
|
1069
|
-
message: m.toString(
|
|
1059
|
+
message: m.toString(n)
|
|
1070
1060
|
}
|
|
1071
1061
|
]
|
|
1072
1062
|
});
|
|
@@ -1166,11 +1156,11 @@ class G extends v {
|
|
|
1166
1156
|
return Number.isFinite(e) && Number.isFinite(t);
|
|
1167
1157
|
}
|
|
1168
1158
|
}
|
|
1169
|
-
G.create = (
|
|
1159
|
+
G.create = (a) => new G({
|
|
1170
1160
|
checks: [],
|
|
1171
|
-
typeName:
|
|
1172
|
-
coerce: (
|
|
1173
|
-
..._(
|
|
1161
|
+
typeName: g.ZodNumber,
|
|
1162
|
+
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1163
|
+
..._(a)
|
|
1174
1164
|
});
|
|
1175
1165
|
class J extends v {
|
|
1176
1166
|
constructor() {
|
|
@@ -1186,7 +1176,7 @@ class J extends v {
|
|
|
1186
1176
|
if (this._getType(t) !== h.bigint)
|
|
1187
1177
|
return this._getInvalidInput(t);
|
|
1188
1178
|
let r;
|
|
1189
|
-
const
|
|
1179
|
+
const n = new I();
|
|
1190
1180
|
for (const s of this._def.checks)
|
|
1191
1181
|
s.kind === "min" ? (s.inclusive ? t.data < s.value : t.data <= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1192
1182
|
code: c.too_small,
|
|
@@ -1194,18 +1184,18 @@ class J extends v {
|
|
|
1194
1184
|
minimum: s.value,
|
|
1195
1185
|
inclusive: s.inclusive,
|
|
1196
1186
|
message: s.message
|
|
1197
|
-
}),
|
|
1187
|
+
}), n.dirty()) : s.kind === "max" ? (s.inclusive ? t.data > s.value : t.data >= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1198
1188
|
code: c.too_big,
|
|
1199
1189
|
type: "bigint",
|
|
1200
1190
|
maximum: s.value,
|
|
1201
1191
|
inclusive: s.inclusive,
|
|
1202
1192
|
message: s.message
|
|
1203
|
-
}),
|
|
1193
|
+
}), n.dirty()) : s.kind === "multipleOf" ? t.data % s.value !== BigInt(0) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1204
1194
|
code: c.not_multiple_of,
|
|
1205
1195
|
multipleOf: s.value,
|
|
1206
1196
|
message: s.message
|
|
1207
|
-
}),
|
|
1208
|
-
return { status:
|
|
1197
|
+
}), n.dirty()) : w.assertNever(s);
|
|
1198
|
+
return { status: n.value, value: t.data };
|
|
1209
1199
|
}
|
|
1210
1200
|
_getInvalidInput(t) {
|
|
1211
1201
|
const e = this._getOrReturnCtx(t);
|
|
@@ -1213,7 +1203,7 @@ class J extends v {
|
|
|
1213
1203
|
code: c.invalid_type,
|
|
1214
1204
|
expected: h.bigint,
|
|
1215
1205
|
received: e.parsedType
|
|
1216
|
-
}),
|
|
1206
|
+
}), y;
|
|
1217
1207
|
}
|
|
1218
1208
|
gte(t, e) {
|
|
1219
1209
|
return this.setLimit("min", t, !0, m.toString(e));
|
|
@@ -1227,7 +1217,7 @@ class J extends v {
|
|
|
1227
1217
|
lt(t, e) {
|
|
1228
1218
|
return this.setLimit("max", t, !1, m.toString(e));
|
|
1229
1219
|
}
|
|
1230
|
-
setLimit(t, e, r,
|
|
1220
|
+
setLimit(t, e, r, n) {
|
|
1231
1221
|
return new J({
|
|
1232
1222
|
...this._def,
|
|
1233
1223
|
checks: [
|
|
@@ -1236,7 +1226,7 @@ class J extends v {
|
|
|
1236
1226
|
kind: t,
|
|
1237
1227
|
value: e,
|
|
1238
1228
|
inclusive: r,
|
|
1239
|
-
message: m.toString(
|
|
1229
|
+
message: m.toString(n)
|
|
1240
1230
|
}
|
|
1241
1231
|
]
|
|
1242
1232
|
});
|
|
@@ -1299,13 +1289,13 @@ class J extends v {
|
|
|
1299
1289
|
return t;
|
|
1300
1290
|
}
|
|
1301
1291
|
}
|
|
1302
|
-
J.create = (
|
|
1292
|
+
J.create = (a) => new J({
|
|
1303
1293
|
checks: [],
|
|
1304
|
-
typeName:
|
|
1305
|
-
coerce: (
|
|
1306
|
-
..._(
|
|
1294
|
+
typeName: g.ZodBigInt,
|
|
1295
|
+
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
1296
|
+
..._(a)
|
|
1307
1297
|
});
|
|
1308
|
-
class
|
|
1298
|
+
class ye extends v {
|
|
1309
1299
|
_parse(t) {
|
|
1310
1300
|
if (this._def.coerce && (t.data = !!t.data), this._getType(t) !== h.boolean) {
|
|
1311
1301
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1313,17 +1303,17 @@ class ve extends v {
|
|
|
1313
1303
|
code: c.invalid_type,
|
|
1314
1304
|
expected: h.boolean,
|
|
1315
1305
|
received: r.parsedType
|
|
1316
|
-
}),
|
|
1306
|
+
}), y;
|
|
1317
1307
|
}
|
|
1318
1308
|
return R(t.data);
|
|
1319
1309
|
}
|
|
1320
1310
|
}
|
|
1321
|
-
|
|
1322
|
-
typeName:
|
|
1323
|
-
coerce: (
|
|
1324
|
-
..._(
|
|
1311
|
+
ye.create = (a) => new ye({
|
|
1312
|
+
typeName: g.ZodBoolean,
|
|
1313
|
+
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1314
|
+
..._(a)
|
|
1325
1315
|
});
|
|
1326
|
-
class
|
|
1316
|
+
class ne extends v {
|
|
1327
1317
|
_parse(t) {
|
|
1328
1318
|
if (this._def.coerce && (t.data = new Date(t.data)), this._getType(t) !== h.date) {
|
|
1329
1319
|
const s = this._getOrReturnCtx(t);
|
|
@@ -1331,25 +1321,25 @@ class ae extends v {
|
|
|
1331
1321
|
code: c.invalid_type,
|
|
1332
1322
|
expected: h.date,
|
|
1333
1323
|
received: s.parsedType
|
|
1334
|
-
}),
|
|
1324
|
+
}), y;
|
|
1335
1325
|
}
|
|
1336
1326
|
if (Number.isNaN(t.data.getTime())) {
|
|
1337
1327
|
const s = this._getOrReturnCtx(t);
|
|
1338
1328
|
return l(s, {
|
|
1339
1329
|
code: c.invalid_date
|
|
1340
|
-
}),
|
|
1330
|
+
}), y;
|
|
1341
1331
|
}
|
|
1342
1332
|
const r = new I();
|
|
1343
|
-
let
|
|
1333
|
+
let n;
|
|
1344
1334
|
for (const s of this._def.checks)
|
|
1345
|
-
s.kind === "min" ? t.data.getTime() < s.value && (
|
|
1335
|
+
s.kind === "min" ? t.data.getTime() < s.value && (n = this._getOrReturnCtx(t, n), l(n, {
|
|
1346
1336
|
code: c.too_small,
|
|
1347
1337
|
message: s.message,
|
|
1348
1338
|
inclusive: !0,
|
|
1349
1339
|
exact: !1,
|
|
1350
1340
|
minimum: s.value,
|
|
1351
1341
|
type: "date"
|
|
1352
|
-
}), r.dirty()) : s.kind === "max" ? t.data.getTime() > s.value && (
|
|
1342
|
+
}), r.dirty()) : s.kind === "max" ? t.data.getTime() > s.value && (n = this._getOrReturnCtx(t, n), l(n, {
|
|
1353
1343
|
code: c.too_big,
|
|
1354
1344
|
message: s.message,
|
|
1355
1345
|
inclusive: !0,
|
|
@@ -1363,7 +1353,7 @@ class ae extends v {
|
|
|
1363
1353
|
};
|
|
1364
1354
|
}
|
|
1365
1355
|
_addCheck(t) {
|
|
1366
|
-
return new
|
|
1356
|
+
return new ne({
|
|
1367
1357
|
...this._def,
|
|
1368
1358
|
checks: [...this._def.checks, t]
|
|
1369
1359
|
});
|
|
@@ -1395,13 +1385,13 @@ class ae extends v {
|
|
|
1395
1385
|
return t != null ? new Date(t) : null;
|
|
1396
1386
|
}
|
|
1397
1387
|
}
|
|
1398
|
-
|
|
1388
|
+
ne.create = (a) => new ne({
|
|
1399
1389
|
checks: [],
|
|
1400
|
-
coerce: (
|
|
1401
|
-
typeName:
|
|
1402
|
-
..._(
|
|
1390
|
+
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1391
|
+
typeName: g.ZodDate,
|
|
1392
|
+
..._(a)
|
|
1403
1393
|
});
|
|
1404
|
-
class
|
|
1394
|
+
class je extends v {
|
|
1405
1395
|
_parse(t) {
|
|
1406
1396
|
if (this._getType(t) !== h.symbol) {
|
|
1407
1397
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1409,16 +1399,16 @@ class $e extends v {
|
|
|
1409
1399
|
code: c.invalid_type,
|
|
1410
1400
|
expected: h.symbol,
|
|
1411
1401
|
received: r.parsedType
|
|
1412
|
-
}),
|
|
1402
|
+
}), y;
|
|
1413
1403
|
}
|
|
1414
1404
|
return R(t.data);
|
|
1415
1405
|
}
|
|
1416
1406
|
}
|
|
1417
|
-
|
|
1418
|
-
typeName:
|
|
1419
|
-
..._(
|
|
1407
|
+
je.create = (a) => new je({
|
|
1408
|
+
typeName: g.ZodSymbol,
|
|
1409
|
+
..._(a)
|
|
1420
1410
|
});
|
|
1421
|
-
class
|
|
1411
|
+
class ge extends v {
|
|
1422
1412
|
_parse(t) {
|
|
1423
1413
|
if (this._getType(t) !== h.undefined) {
|
|
1424
1414
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1426,16 +1416,16 @@ class we extends v {
|
|
|
1426
1416
|
code: c.invalid_type,
|
|
1427
1417
|
expected: h.undefined,
|
|
1428
1418
|
received: r.parsedType
|
|
1429
|
-
}),
|
|
1419
|
+
}), y;
|
|
1430
1420
|
}
|
|
1431
1421
|
return R(t.data);
|
|
1432
1422
|
}
|
|
1433
1423
|
}
|
|
1434
|
-
|
|
1435
|
-
typeName:
|
|
1436
|
-
..._(
|
|
1424
|
+
ge.create = (a) => new ge({
|
|
1425
|
+
typeName: g.ZodUndefined,
|
|
1426
|
+
..._(a)
|
|
1437
1427
|
});
|
|
1438
|
-
class
|
|
1428
|
+
class _e extends v {
|
|
1439
1429
|
_parse(t) {
|
|
1440
1430
|
if (this._getType(t) !== h.null) {
|
|
1441
1431
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1443,16 +1433,16 @@ class be extends v {
|
|
|
1443
1433
|
code: c.invalid_type,
|
|
1444
1434
|
expected: h.null,
|
|
1445
1435
|
received: r.parsedType
|
|
1446
|
-
}),
|
|
1436
|
+
}), y;
|
|
1447
1437
|
}
|
|
1448
1438
|
return R(t.data);
|
|
1449
1439
|
}
|
|
1450
1440
|
}
|
|
1451
|
-
|
|
1452
|
-
typeName:
|
|
1453
|
-
..._(
|
|
1441
|
+
_e.create = (a) => new _e({
|
|
1442
|
+
typeName: g.ZodNull,
|
|
1443
|
+
..._(a)
|
|
1454
1444
|
});
|
|
1455
|
-
class
|
|
1445
|
+
class fe extends v {
|
|
1456
1446
|
constructor() {
|
|
1457
1447
|
super(...arguments), this._any = !0;
|
|
1458
1448
|
}
|
|
@@ -1460,9 +1450,9 @@ class me extends v {
|
|
|
1460
1450
|
return R(t.data);
|
|
1461
1451
|
}
|
|
1462
1452
|
}
|
|
1463
|
-
|
|
1464
|
-
typeName:
|
|
1465
|
-
..._(
|
|
1453
|
+
fe.create = (a) => new fe({
|
|
1454
|
+
typeName: g.ZodAny,
|
|
1455
|
+
..._(a)
|
|
1466
1456
|
});
|
|
1467
1457
|
class re extends v {
|
|
1468
1458
|
constructor() {
|
|
@@ -1472,9 +1462,9 @@ class re extends v {
|
|
|
1472
1462
|
return R(t.data);
|
|
1473
1463
|
}
|
|
1474
1464
|
}
|
|
1475
|
-
re.create = (
|
|
1476
|
-
typeName:
|
|
1477
|
-
..._(
|
|
1465
|
+
re.create = (a) => new re({
|
|
1466
|
+
typeName: g.ZodUnknown,
|
|
1467
|
+
..._(a)
|
|
1478
1468
|
});
|
|
1479
1469
|
class U extends v {
|
|
1480
1470
|
_parse(t) {
|
|
@@ -1483,14 +1473,14 @@ class U extends v {
|
|
|
1483
1473
|
code: c.invalid_type,
|
|
1484
1474
|
expected: h.never,
|
|
1485
1475
|
received: e.parsedType
|
|
1486
|
-
}),
|
|
1476
|
+
}), y;
|
|
1487
1477
|
}
|
|
1488
1478
|
}
|
|
1489
|
-
U.create = (
|
|
1490
|
-
typeName:
|
|
1491
|
-
..._(
|
|
1479
|
+
U.create = (a) => new U({
|
|
1480
|
+
typeName: g.ZodNever,
|
|
1481
|
+
..._(a)
|
|
1492
1482
|
});
|
|
1493
|
-
class
|
|
1483
|
+
class Ye extends v {
|
|
1494
1484
|
_parse(t) {
|
|
1495
1485
|
if (this._getType(t) !== h.undefined) {
|
|
1496
1486
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1498,72 +1488,72 @@ class Le extends v {
|
|
|
1498
1488
|
code: c.invalid_type,
|
|
1499
1489
|
expected: h.void,
|
|
1500
1490
|
received: r.parsedType
|
|
1501
|
-
}),
|
|
1491
|
+
}), y;
|
|
1502
1492
|
}
|
|
1503
1493
|
return R(t.data);
|
|
1504
1494
|
}
|
|
1505
1495
|
}
|
|
1506
|
-
|
|
1507
|
-
typeName:
|
|
1508
|
-
..._(
|
|
1496
|
+
Ye.create = (a) => new Ye({
|
|
1497
|
+
typeName: g.ZodVoid,
|
|
1498
|
+
..._(a)
|
|
1509
1499
|
});
|
|
1510
|
-
class
|
|
1500
|
+
class S extends v {
|
|
1511
1501
|
_parse(t) {
|
|
1512
|
-
const { ctx: e, status: r } = this._processInputParams(t),
|
|
1502
|
+
const { ctx: e, status: r } = this._processInputParams(t), n = this._def;
|
|
1513
1503
|
if (e.parsedType !== h.array)
|
|
1514
1504
|
return l(e, {
|
|
1515
1505
|
code: c.invalid_type,
|
|
1516
1506
|
expected: h.array,
|
|
1517
1507
|
received: e.parsedType
|
|
1518
|
-
}),
|
|
1519
|
-
if (
|
|
1520
|
-
const i = e.data.length >
|
|
1508
|
+
}), y;
|
|
1509
|
+
if (n.exactLength !== null) {
|
|
1510
|
+
const i = e.data.length > n.exactLength.value, o = e.data.length < n.exactLength.value;
|
|
1521
1511
|
(i || o) && (l(e, {
|
|
1522
1512
|
code: i ? c.too_big : c.too_small,
|
|
1523
|
-
minimum: o ?
|
|
1524
|
-
maximum: i ?
|
|
1513
|
+
minimum: o ? n.exactLength.value : void 0,
|
|
1514
|
+
maximum: i ? n.exactLength.value : void 0,
|
|
1525
1515
|
type: "array",
|
|
1526
1516
|
inclusive: !0,
|
|
1527
1517
|
exact: !0,
|
|
1528
|
-
message:
|
|
1518
|
+
message: n.exactLength.message
|
|
1529
1519
|
}), r.dirty());
|
|
1530
1520
|
}
|
|
1531
|
-
if (
|
|
1521
|
+
if (n.minLength !== null && e.data.length < n.minLength.value && (l(e, {
|
|
1532
1522
|
code: c.too_small,
|
|
1533
|
-
minimum:
|
|
1523
|
+
minimum: n.minLength.value,
|
|
1534
1524
|
type: "array",
|
|
1535
1525
|
inclusive: !0,
|
|
1536
1526
|
exact: !1,
|
|
1537
|
-
message:
|
|
1538
|
-
}), r.dirty()),
|
|
1527
|
+
message: n.minLength.message
|
|
1528
|
+
}), r.dirty()), n.maxLength !== null && e.data.length > n.maxLength.value && (l(e, {
|
|
1539
1529
|
code: c.too_big,
|
|
1540
|
-
maximum:
|
|
1530
|
+
maximum: n.maxLength.value,
|
|
1541
1531
|
type: "array",
|
|
1542
1532
|
inclusive: !0,
|
|
1543
1533
|
exact: !1,
|
|
1544
|
-
message:
|
|
1534
|
+
message: n.maxLength.message
|
|
1545
1535
|
}), r.dirty()), e.common.async)
|
|
1546
|
-
return Promise.all([...e.data].map((i, o) =>
|
|
1547
|
-
const s = [...e.data].map((i, o) =>
|
|
1536
|
+
return Promise.all([...e.data].map((i, o) => n.type._parseAsync(new V(e, i, e.path, o)))).then((i) => I.mergeArray(r, i));
|
|
1537
|
+
const s = [...e.data].map((i, o) => n.type._parseSync(new V(e, i, e.path, o)));
|
|
1548
1538
|
return I.mergeArray(r, s);
|
|
1549
1539
|
}
|
|
1550
1540
|
get element() {
|
|
1551
1541
|
return this._def.type;
|
|
1552
1542
|
}
|
|
1553
1543
|
min(t, e) {
|
|
1554
|
-
return new
|
|
1544
|
+
return new S({
|
|
1555
1545
|
...this._def,
|
|
1556
1546
|
minLength: { value: t, message: m.toString(e) }
|
|
1557
1547
|
});
|
|
1558
1548
|
}
|
|
1559
1549
|
max(t, e) {
|
|
1560
|
-
return new
|
|
1550
|
+
return new S({
|
|
1561
1551
|
...this._def,
|
|
1562
1552
|
maxLength: { value: t, message: m.toString(e) }
|
|
1563
1553
|
});
|
|
1564
1554
|
}
|
|
1565
1555
|
length(t, e) {
|
|
1566
|
-
return new
|
|
1556
|
+
return new S({
|
|
1567
1557
|
...this._def,
|
|
1568
1558
|
exactLength: { value: t, message: m.toString(e) }
|
|
1569
1559
|
});
|
|
@@ -1572,29 +1562,29 @@ class F extends v {
|
|
|
1572
1562
|
return this.min(1, t);
|
|
1573
1563
|
}
|
|
1574
1564
|
}
|
|
1575
|
-
|
|
1576
|
-
type:
|
|
1565
|
+
S.create = (a, t) => new S({
|
|
1566
|
+
type: a,
|
|
1577
1567
|
minLength: null,
|
|
1578
1568
|
maxLength: null,
|
|
1579
1569
|
exactLength: null,
|
|
1580
|
-
typeName:
|
|
1570
|
+
typeName: g.ZodArray,
|
|
1581
1571
|
..._(t)
|
|
1582
1572
|
});
|
|
1583
|
-
function te(
|
|
1584
|
-
if (
|
|
1573
|
+
function te(a) {
|
|
1574
|
+
if (a instanceof P) {
|
|
1585
1575
|
const t = {};
|
|
1586
|
-
for (const e in
|
|
1587
|
-
const r =
|
|
1576
|
+
for (const e in a.shape) {
|
|
1577
|
+
const r = a.shape[e];
|
|
1588
1578
|
t[e] = q.create(te(r));
|
|
1589
1579
|
}
|
|
1590
1580
|
return new P({
|
|
1591
|
-
...
|
|
1581
|
+
...a._def,
|
|
1592
1582
|
shape: () => t
|
|
1593
1583
|
});
|
|
1594
|
-
} else return
|
|
1595
|
-
...
|
|
1596
|
-
type: te(
|
|
1597
|
-
}) :
|
|
1584
|
+
} else return a instanceof S ? new S({
|
|
1585
|
+
...a._def,
|
|
1586
|
+
type: te(a.element)
|
|
1587
|
+
}) : a instanceof q ? q.create(te(a.unwrap())) : a instanceof ee ? ee.create(te(a.unwrap())) : a instanceof H ? H.create(a.items.map((t) => te(t))) : a;
|
|
1598
1588
|
}
|
|
1599
1589
|
class P extends v {
|
|
1600
1590
|
constructor() {
|
|
@@ -1613,19 +1603,19 @@ class P extends v {
|
|
|
1613
1603
|
code: c.invalid_type,
|
|
1614
1604
|
expected: h.object,
|
|
1615
1605
|
received: d.parsedType
|
|
1616
|
-
}),
|
|
1606
|
+
}), y;
|
|
1617
1607
|
}
|
|
1618
|
-
const { status: r, ctx:
|
|
1608
|
+
const { status: r, ctx: n } = this._processInputParams(t), { shape: s, keys: i } = this._getCached(), o = [];
|
|
1619
1609
|
if (!(this._def.catchall instanceof U && this._def.unknownKeys === "strip"))
|
|
1620
|
-
for (const d in
|
|
1610
|
+
for (const d in n.data)
|
|
1621
1611
|
i.includes(d) || o.push(d);
|
|
1622
1612
|
const u = [];
|
|
1623
1613
|
for (const d of i) {
|
|
1624
|
-
const p = s[d], k =
|
|
1614
|
+
const p = s[d], k = n.data[d];
|
|
1625
1615
|
u.push({
|
|
1626
1616
|
key: { status: "valid", value: d },
|
|
1627
|
-
value: p._parse(new
|
|
1628
|
-
alwaysSet: d in
|
|
1617
|
+
value: p._parse(new V(n, k, n.path, d)),
|
|
1618
|
+
alwaysSet: d in n.data
|
|
1629
1619
|
});
|
|
1630
1620
|
}
|
|
1631
1621
|
if (this._def.catchall instanceof U) {
|
|
@@ -1634,10 +1624,10 @@ class P extends v {
|
|
|
1634
1624
|
for (const p of o)
|
|
1635
1625
|
u.push({
|
|
1636
1626
|
key: { status: "valid", value: p },
|
|
1637
|
-
value: { status: "valid", value:
|
|
1627
|
+
value: { status: "valid", value: n.data[p] }
|
|
1638
1628
|
});
|
|
1639
1629
|
else if (d === "strict")
|
|
1640
|
-
o.length > 0 && (l(
|
|
1630
|
+
o.length > 0 && (l(n, {
|
|
1641
1631
|
code: c.unrecognized_keys,
|
|
1642
1632
|
keys: o
|
|
1643
1633
|
}), r.dirty());
|
|
@@ -1645,18 +1635,18 @@ class P extends v {
|
|
|
1645
1635
|
} else {
|
|
1646
1636
|
const d = this._def.catchall;
|
|
1647
1637
|
for (const p of o) {
|
|
1648
|
-
const k =
|
|
1638
|
+
const k = n.data[p];
|
|
1649
1639
|
u.push({
|
|
1650
1640
|
key: { status: "valid", value: p },
|
|
1651
1641
|
value: d._parse(
|
|
1652
|
-
new
|
|
1642
|
+
new V(n, k, n.path, p)
|
|
1653
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1654
1644
|
),
|
|
1655
|
-
alwaysSet: p in
|
|
1645
|
+
alwaysSet: p in n.data
|
|
1656
1646
|
});
|
|
1657
1647
|
}
|
|
1658
1648
|
}
|
|
1659
|
-
return
|
|
1649
|
+
return n.common.async ? Promise.resolve().then(async () => {
|
|
1660
1650
|
const d = [];
|
|
1661
1651
|
for (const p of u) {
|
|
1662
1652
|
const k = await p.key, A = await p.value;
|
|
@@ -1679,11 +1669,11 @@ class P extends v {
|
|
|
1679
1669
|
...t !== void 0 ? {
|
|
1680
1670
|
errorMap: (e, r) => {
|
|
1681
1671
|
var s, i;
|
|
1682
|
-
const
|
|
1672
|
+
const n = ((i = (s = this._def).errorMap) == null ? void 0 : i.call(s, e, r).message) ?? r.defaultError;
|
|
1683
1673
|
return e.code === "unrecognized_keys" ? {
|
|
1684
|
-
message: m.errToObj(t).message ??
|
|
1674
|
+
message: m.errToObj(t).message ?? n
|
|
1685
1675
|
} : {
|
|
1686
|
-
message:
|
|
1676
|
+
message: n
|
|
1687
1677
|
};
|
|
1688
1678
|
}
|
|
1689
1679
|
} : {}
|
|
@@ -1740,7 +1730,7 @@ class P extends v {
|
|
|
1740
1730
|
...this._def.shape(),
|
|
1741
1731
|
...t._def.shape()
|
|
1742
1732
|
}),
|
|
1743
|
-
typeName:
|
|
1733
|
+
typeName: g.ZodObject
|
|
1744
1734
|
});
|
|
1745
1735
|
}
|
|
1746
1736
|
// merge<
|
|
@@ -1835,8 +1825,8 @@ class P extends v {
|
|
|
1835
1825
|
partial(t) {
|
|
1836
1826
|
const e = {};
|
|
1837
1827
|
for (const r of w.objectKeys(this.shape)) {
|
|
1838
|
-
const
|
|
1839
|
-
t && !t[r] ? e[r] =
|
|
1828
|
+
const n = this.shape[r];
|
|
1829
|
+
t && !t[r] ? e[r] = n : e[r] = n.optional();
|
|
1840
1830
|
}
|
|
1841
1831
|
return new P({
|
|
1842
1832
|
...this._def,
|
|
@@ -1860,34 +1850,34 @@ class P extends v {
|
|
|
1860
1850
|
});
|
|
1861
1851
|
}
|
|
1862
1852
|
keyof() {
|
|
1863
|
-
return
|
|
1853
|
+
return dt(w.objectKeys(this.shape));
|
|
1864
1854
|
}
|
|
1865
1855
|
}
|
|
1866
|
-
P.create = (
|
|
1867
|
-
shape: () =>
|
|
1856
|
+
P.create = (a, t) => new P({
|
|
1857
|
+
shape: () => a,
|
|
1868
1858
|
unknownKeys: "strip",
|
|
1869
1859
|
catchall: U.create(),
|
|
1870
|
-
typeName:
|
|
1860
|
+
typeName: g.ZodObject,
|
|
1871
1861
|
..._(t)
|
|
1872
1862
|
});
|
|
1873
|
-
P.strictCreate = (
|
|
1874
|
-
shape: () =>
|
|
1863
|
+
P.strictCreate = (a, t) => new P({
|
|
1864
|
+
shape: () => a,
|
|
1875
1865
|
unknownKeys: "strict",
|
|
1876
1866
|
catchall: U.create(),
|
|
1877
|
-
typeName:
|
|
1867
|
+
typeName: g.ZodObject,
|
|
1878
1868
|
..._(t)
|
|
1879
1869
|
});
|
|
1880
|
-
P.lazycreate = (
|
|
1881
|
-
shape:
|
|
1870
|
+
P.lazycreate = (a, t) => new P({
|
|
1871
|
+
shape: a,
|
|
1882
1872
|
unknownKeys: "strip",
|
|
1883
1873
|
catchall: U.create(),
|
|
1884
|
-
typeName:
|
|
1874
|
+
typeName: g.ZodObject,
|
|
1885
1875
|
..._(t)
|
|
1886
1876
|
});
|
|
1887
|
-
class
|
|
1877
|
+
class ve extends v {
|
|
1888
1878
|
_parse(t) {
|
|
1889
1879
|
const { ctx: e } = this._processInputParams(t), r = this._def.options;
|
|
1890
|
-
function
|
|
1880
|
+
function n(s) {
|
|
1891
1881
|
for (const o of s)
|
|
1892
1882
|
if (o.result.status === "valid")
|
|
1893
1883
|
return o.result;
|
|
@@ -1898,7 +1888,7 @@ class xe extends v {
|
|
|
1898
1888
|
return l(e, {
|
|
1899
1889
|
code: c.invalid_union,
|
|
1900
1890
|
unionErrors: i
|
|
1901
|
-
}),
|
|
1891
|
+
}), y;
|
|
1902
1892
|
}
|
|
1903
1893
|
if (e.common.async)
|
|
1904
1894
|
return Promise.all(r.map(async (s) => {
|
|
@@ -1918,7 +1908,7 @@ class xe extends v {
|
|
|
1918
1908
|
}),
|
|
1919
1909
|
ctx: i
|
|
1920
1910
|
};
|
|
1921
|
-
})).then(
|
|
1911
|
+
})).then(n);
|
|
1922
1912
|
{
|
|
1923
1913
|
let s;
|
|
1924
1914
|
const i = [];
|
|
@@ -1945,20 +1935,20 @@ class xe extends v {
|
|
|
1945
1935
|
return l(e, {
|
|
1946
1936
|
code: c.invalid_union,
|
|
1947
1937
|
unionErrors: o
|
|
1948
|
-
}),
|
|
1938
|
+
}), y;
|
|
1949
1939
|
}
|
|
1950
1940
|
}
|
|
1951
1941
|
get options() {
|
|
1952
1942
|
return this._def.options;
|
|
1953
1943
|
}
|
|
1954
1944
|
}
|
|
1955
|
-
|
|
1956
|
-
options:
|
|
1957
|
-
typeName:
|
|
1945
|
+
ve.create = (a, t) => new ve({
|
|
1946
|
+
options: a,
|
|
1947
|
+
typeName: g.ZodUnion,
|
|
1958
1948
|
..._(t)
|
|
1959
1949
|
});
|
|
1960
|
-
const z = (
|
|
1961
|
-
class
|
|
1950
|
+
const z = (a) => a instanceof xe ? z(a.schema) : a instanceof B ? z(a.innerType()) : a instanceof ke ? [a.value] : a instanceof K ? a.options : a instanceof Te ? w.objectValues(a.enum) : a instanceof Oe ? z(a._def.innerType) : a instanceof ge ? [void 0] : a instanceof _e ? [null] : a instanceof q ? [void 0, ...z(a.unwrap())] : a instanceof ee ? [null, ...z(a.unwrap())] : a instanceof lt || a instanceof Ce ? z(a.unwrap()) : a instanceof Pe ? z(a._def.innerType) : [];
|
|
1951
|
+
class Se extends v {
|
|
1962
1952
|
_parse(t) {
|
|
1963
1953
|
const { ctx: e } = this._processInputParams(t);
|
|
1964
1954
|
if (e.parsedType !== h.object)
|
|
@@ -1966,8 +1956,8 @@ class ze extends v {
|
|
|
1966
1956
|
code: c.invalid_type,
|
|
1967
1957
|
expected: h.object,
|
|
1968
1958
|
received: e.parsedType
|
|
1969
|
-
}),
|
|
1970
|
-
const r = this.discriminator,
|
|
1959
|
+
}), y;
|
|
1960
|
+
const r = this.discriminator, n = e.data[r], s = this.optionsMap.get(n);
|
|
1971
1961
|
return s ? e.common.async ? s._parseAsync({
|
|
1972
1962
|
data: e.data,
|
|
1973
1963
|
path: e.path,
|
|
@@ -1980,7 +1970,7 @@ class ze extends v {
|
|
|
1980
1970
|
code: c.invalid_union_discriminator,
|
|
1981
1971
|
options: Array.from(this.optionsMap.keys()),
|
|
1982
1972
|
path: [r]
|
|
1983
|
-
}),
|
|
1973
|
+
}), y);
|
|
1984
1974
|
}
|
|
1985
1975
|
get discriminator() {
|
|
1986
1976
|
return this._def.discriminator;
|
|
@@ -2000,61 +1990,61 @@ class ze extends v {
|
|
|
2000
1990
|
* @param params
|
|
2001
1991
|
*/
|
|
2002
1992
|
static create(t, e, r) {
|
|
2003
|
-
const
|
|
1993
|
+
const n = /* @__PURE__ */ new Map();
|
|
2004
1994
|
for (const s of e) {
|
|
2005
1995
|
const i = z(s.shape[t]);
|
|
2006
1996
|
if (!i.length)
|
|
2007
1997
|
throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
2008
1998
|
for (const o of i) {
|
|
2009
|
-
if (
|
|
1999
|
+
if (n.has(o))
|
|
2010
2000
|
throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);
|
|
2011
|
-
|
|
2001
|
+
n.set(o, s);
|
|
2012
2002
|
}
|
|
2013
2003
|
}
|
|
2014
|
-
return new
|
|
2015
|
-
typeName:
|
|
2004
|
+
return new Se({
|
|
2005
|
+
typeName: g.ZodDiscriminatedUnion,
|
|
2016
2006
|
discriminator: t,
|
|
2017
2007
|
options: e,
|
|
2018
|
-
optionsMap:
|
|
2008
|
+
optionsMap: n,
|
|
2019
2009
|
..._(r)
|
|
2020
2010
|
});
|
|
2021
2011
|
}
|
|
2022
2012
|
}
|
|
2023
|
-
function
|
|
2024
|
-
const e = Q(
|
|
2025
|
-
if (
|
|
2026
|
-
return { valid: !0, data:
|
|
2013
|
+
function We(a, t) {
|
|
2014
|
+
const e = Q(a), r = Q(t);
|
|
2015
|
+
if (a === t)
|
|
2016
|
+
return { valid: !0, data: a };
|
|
2027
2017
|
if (e === h.object && r === h.object) {
|
|
2028
|
-
const
|
|
2018
|
+
const n = w.objectKeys(t), s = w.objectKeys(a).filter((o) => n.indexOf(o) !== -1), i = { ...a, ...t };
|
|
2029
2019
|
for (const o of s) {
|
|
2030
|
-
const u =
|
|
2020
|
+
const u = We(a[o], t[o]);
|
|
2031
2021
|
if (!u.valid)
|
|
2032
2022
|
return { valid: !1 };
|
|
2033
2023
|
i[o] = u.data;
|
|
2034
2024
|
}
|
|
2035
2025
|
return { valid: !0, data: i };
|
|
2036
2026
|
} else if (e === h.array && r === h.array) {
|
|
2037
|
-
if (
|
|
2027
|
+
if (a.length !== t.length)
|
|
2038
2028
|
return { valid: !1 };
|
|
2039
|
-
const
|
|
2040
|
-
for (let s = 0; s <
|
|
2041
|
-
const i =
|
|
2029
|
+
const n = [];
|
|
2030
|
+
for (let s = 0; s < a.length; s++) {
|
|
2031
|
+
const i = a[s], o = t[s], u = We(i, o);
|
|
2042
2032
|
if (!u.valid)
|
|
2043
2033
|
return { valid: !1 };
|
|
2044
|
-
|
|
2034
|
+
n.push(u.data);
|
|
2045
2035
|
}
|
|
2046
|
-
return { valid: !0, data:
|
|
2047
|
-
} else return e === h.date && r === h.date && +
|
|
2036
|
+
return { valid: !0, data: n };
|
|
2037
|
+
} else return e === h.date && r === h.date && +a == +t ? { valid: !0, data: a } : { valid: !1 };
|
|
2048
2038
|
}
|
|
2049
|
-
class
|
|
2039
|
+
class we extends v {
|
|
2050
2040
|
_parse(t) {
|
|
2051
|
-
const { status: e, ctx: r } = this._processInputParams(t),
|
|
2052
|
-
if (
|
|
2053
|
-
return
|
|
2054
|
-
const o =
|
|
2055
|
-
return o.valid ? ((
|
|
2041
|
+
const { status: e, ctx: r } = this._processInputParams(t), n = (s, i) => {
|
|
2042
|
+
if (Ke(s) || Ke(i))
|
|
2043
|
+
return y;
|
|
2044
|
+
const o = We(s.value, i.value);
|
|
2045
|
+
return o.valid ? ((et(s) || et(i)) && e.dirty(), { status: e.value, value: o.data }) : (l(r, {
|
|
2056
2046
|
code: c.invalid_intersection_types
|
|
2057
|
-
}),
|
|
2047
|
+
}), y);
|
|
2058
2048
|
};
|
|
2059
2049
|
return r.common.async ? Promise.all([
|
|
2060
2050
|
this._def.left._parseAsync({
|
|
@@ -2067,7 +2057,7 @@ class ke extends v {
|
|
|
2067
2057
|
path: r.path,
|
|
2068
2058
|
parent: r
|
|
2069
2059
|
})
|
|
2070
|
-
]).then(([s, i]) =>
|
|
2060
|
+
]).then(([s, i]) => n(s, i)) : n(this._def.left._parseSync({
|
|
2071
2061
|
data: r.data,
|
|
2072
2062
|
path: r.path,
|
|
2073
2063
|
parent: r
|
|
@@ -2078,10 +2068,10 @@ class ke extends v {
|
|
|
2078
2068
|
}));
|
|
2079
2069
|
}
|
|
2080
2070
|
}
|
|
2081
|
-
|
|
2082
|
-
left:
|
|
2071
|
+
we.create = (a, t, e) => new we({
|
|
2072
|
+
left: a,
|
|
2083
2073
|
right: t,
|
|
2084
|
-
typeName:
|
|
2074
|
+
typeName: g.ZodIntersection,
|
|
2085
2075
|
..._(e)
|
|
2086
2076
|
});
|
|
2087
2077
|
class H extends v {
|
|
@@ -2092,7 +2082,7 @@ class H extends v {
|
|
|
2092
2082
|
code: c.invalid_type,
|
|
2093
2083
|
expected: h.array,
|
|
2094
2084
|
received: r.parsedType
|
|
2095
|
-
}),
|
|
2085
|
+
}), y;
|
|
2096
2086
|
if (r.data.length < this._def.items.length)
|
|
2097
2087
|
return l(r, {
|
|
2098
2088
|
code: c.too_small,
|
|
@@ -2100,7 +2090,7 @@ class H extends v {
|
|
|
2100
2090
|
inclusive: !0,
|
|
2101
2091
|
exact: !1,
|
|
2102
2092
|
type: "array"
|
|
2103
|
-
}),
|
|
2093
|
+
}), y;
|
|
2104
2094
|
!this._def.rest && r.data.length > this._def.items.length && (l(r, {
|
|
2105
2095
|
code: c.too_big,
|
|
2106
2096
|
maximum: this._def.items.length,
|
|
@@ -2110,7 +2100,7 @@ class H extends v {
|
|
|
2110
2100
|
}), e.dirty());
|
|
2111
2101
|
const s = [...r.data].map((i, o) => {
|
|
2112
2102
|
const u = this._def.items[o] || this._def.rest;
|
|
2113
|
-
return u ? u._parse(new
|
|
2103
|
+
return u ? u._parse(new V(r, i, r.path, o)) : null;
|
|
2114
2104
|
}).filter((i) => !!i);
|
|
2115
2105
|
return r.common.async ? Promise.all(s).then((i) => I.mergeArray(e, i)) : I.mergeArray(e, s);
|
|
2116
2106
|
}
|
|
@@ -2124,17 +2114,17 @@ class H extends v {
|
|
|
2124
2114
|
});
|
|
2125
2115
|
}
|
|
2126
2116
|
}
|
|
2127
|
-
H.create = (
|
|
2128
|
-
if (!Array.isArray(
|
|
2117
|
+
H.create = (a, t) => {
|
|
2118
|
+
if (!Array.isArray(a))
|
|
2129
2119
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2130
2120
|
return new H({
|
|
2131
|
-
items:
|
|
2132
|
-
typeName:
|
|
2121
|
+
items: a,
|
|
2122
|
+
typeName: g.ZodTuple,
|
|
2133
2123
|
rest: null,
|
|
2134
2124
|
..._(t)
|
|
2135
2125
|
});
|
|
2136
2126
|
};
|
|
2137
|
-
class
|
|
2127
|
+
class be extends v {
|
|
2138
2128
|
get keySchema() {
|
|
2139
2129
|
return this._def.keyType;
|
|
2140
2130
|
}
|
|
@@ -2148,34 +2138,34 @@ class Te extends v {
|
|
|
2148
2138
|
code: c.invalid_type,
|
|
2149
2139
|
expected: h.object,
|
|
2150
2140
|
received: r.parsedType
|
|
2151
|
-
}),
|
|
2152
|
-
const
|
|
2141
|
+
}), y;
|
|
2142
|
+
const n = [], s = this._def.keyType, i = this._def.valueType;
|
|
2153
2143
|
for (const o in r.data)
|
|
2154
|
-
|
|
2155
|
-
key: s._parse(new
|
|
2156
|
-
value: i._parse(new
|
|
2144
|
+
n.push({
|
|
2145
|
+
key: s._parse(new V(r, o, r.path, o)),
|
|
2146
|
+
value: i._parse(new V(r, r.data[o], r.path, o)),
|
|
2157
2147
|
alwaysSet: o in r.data
|
|
2158
2148
|
});
|
|
2159
|
-
return r.common.async ? I.mergeObjectAsync(e,
|
|
2149
|
+
return r.common.async ? I.mergeObjectAsync(e, n) : I.mergeObjectSync(e, n);
|
|
2160
2150
|
}
|
|
2161
2151
|
get element() {
|
|
2162
2152
|
return this._def.valueType;
|
|
2163
2153
|
}
|
|
2164
2154
|
static create(t, e, r) {
|
|
2165
|
-
return e instanceof v ? new
|
|
2155
|
+
return e instanceof v ? new be({
|
|
2166
2156
|
keyType: t,
|
|
2167
2157
|
valueType: e,
|
|
2168
|
-
typeName:
|
|
2158
|
+
typeName: g.ZodRecord,
|
|
2169
2159
|
..._(r)
|
|
2170
|
-
}) : new
|
|
2160
|
+
}) : new be({
|
|
2171
2161
|
keyType: L.create(),
|
|
2172
2162
|
valueType: t,
|
|
2173
|
-
typeName:
|
|
2163
|
+
typeName: g.ZodRecord,
|
|
2174
2164
|
..._(e)
|
|
2175
2165
|
});
|
|
2176
2166
|
}
|
|
2177
2167
|
}
|
|
2178
|
-
class
|
|
2168
|
+
class $e extends v {
|
|
2179
2169
|
get keySchema() {
|
|
2180
2170
|
return this._def.keyType;
|
|
2181
2171
|
}
|
|
@@ -2189,10 +2179,10 @@ class Se extends v {
|
|
|
2189
2179
|
code: c.invalid_type,
|
|
2190
2180
|
expected: h.map,
|
|
2191
2181
|
received: r.parsedType
|
|
2192
|
-
}),
|
|
2193
|
-
const
|
|
2194
|
-
key:
|
|
2195
|
-
value: s._parse(new
|
|
2182
|
+
}), y;
|
|
2183
|
+
const n = this._def.keyType, s = this._def.valueType, i = [...r.data.entries()].map(([o, u], d) => ({
|
|
2184
|
+
key: n._parse(new V(r, o, r.path, [d, "key"])),
|
|
2185
|
+
value: s._parse(new V(r, u, r.path, [d, "value"]))
|
|
2196
2186
|
}));
|
|
2197
2187
|
if (r.common.async) {
|
|
2198
2188
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2200,7 +2190,7 @@ class Se extends v {
|
|
|
2200
2190
|
for (const u of i) {
|
|
2201
2191
|
const d = await u.key, p = await u.value;
|
|
2202
2192
|
if (d.status === "aborted" || p.status === "aborted")
|
|
2203
|
-
return
|
|
2193
|
+
return y;
|
|
2204
2194
|
(d.status === "dirty" || p.status === "dirty") && e.dirty(), o.set(d.value, p.value);
|
|
2205
2195
|
}
|
|
2206
2196
|
return { status: e.value, value: o };
|
|
@@ -2210,17 +2200,17 @@ class Se extends v {
|
|
|
2210
2200
|
for (const u of i) {
|
|
2211
2201
|
const d = u.key, p = u.value;
|
|
2212
2202
|
if (d.status === "aborted" || p.status === "aborted")
|
|
2213
|
-
return
|
|
2203
|
+
return y;
|
|
2214
2204
|
(d.status === "dirty" || p.status === "dirty") && e.dirty(), o.set(d.value, p.value);
|
|
2215
2205
|
}
|
|
2216
2206
|
return { status: e.value, value: o };
|
|
2217
2207
|
}
|
|
2218
2208
|
}
|
|
2219
2209
|
}
|
|
2220
|
-
|
|
2210
|
+
$e.create = (a, t, e) => new $e({
|
|
2221
2211
|
valueType: t,
|
|
2222
|
-
keyType:
|
|
2223
|
-
typeName:
|
|
2212
|
+
keyType: a,
|
|
2213
|
+
typeName: g.ZodMap,
|
|
2224
2214
|
..._(e)
|
|
2225
2215
|
});
|
|
2226
2216
|
class se extends v {
|
|
@@ -2231,34 +2221,34 @@ class se extends v {
|
|
|
2231
2221
|
code: c.invalid_type,
|
|
2232
2222
|
expected: h.set,
|
|
2233
2223
|
received: r.parsedType
|
|
2234
|
-
}),
|
|
2235
|
-
const
|
|
2236
|
-
|
|
2224
|
+
}), y;
|
|
2225
|
+
const n = this._def;
|
|
2226
|
+
n.minSize !== null && r.data.size < n.minSize.value && (l(r, {
|
|
2237
2227
|
code: c.too_small,
|
|
2238
|
-
minimum:
|
|
2228
|
+
minimum: n.minSize.value,
|
|
2239
2229
|
type: "set",
|
|
2240
2230
|
inclusive: !0,
|
|
2241
2231
|
exact: !1,
|
|
2242
|
-
message:
|
|
2243
|
-
}), e.dirty()),
|
|
2232
|
+
message: n.minSize.message
|
|
2233
|
+
}), e.dirty()), n.maxSize !== null && r.data.size > n.maxSize.value && (l(r, {
|
|
2244
2234
|
code: c.too_big,
|
|
2245
|
-
maximum:
|
|
2235
|
+
maximum: n.maxSize.value,
|
|
2246
2236
|
type: "set",
|
|
2247
2237
|
inclusive: !0,
|
|
2248
2238
|
exact: !1,
|
|
2249
|
-
message:
|
|
2239
|
+
message: n.maxSize.message
|
|
2250
2240
|
}), e.dirty());
|
|
2251
2241
|
const s = this._def.valueType;
|
|
2252
2242
|
function i(u) {
|
|
2253
2243
|
const d = /* @__PURE__ */ new Set();
|
|
2254
2244
|
for (const p of u) {
|
|
2255
2245
|
if (p.status === "aborted")
|
|
2256
|
-
return
|
|
2246
|
+
return y;
|
|
2257
2247
|
p.status === "dirty" && e.dirty(), d.add(p.value);
|
|
2258
2248
|
}
|
|
2259
2249
|
return { status: e.value, value: d };
|
|
2260
2250
|
}
|
|
2261
|
-
const o = [...r.data.values()].map((u, d) => s._parse(new
|
|
2251
|
+
const o = [...r.data.values()].map((u, d) => s._parse(new V(r, u, r.path, d)));
|
|
2262
2252
|
return r.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2263
2253
|
}
|
|
2264
2254
|
min(t, e) {
|
|
@@ -2280,14 +2270,14 @@ class se extends v {
|
|
|
2280
2270
|
return this.min(1, t);
|
|
2281
2271
|
}
|
|
2282
2272
|
}
|
|
2283
|
-
se.create = (
|
|
2284
|
-
valueType:
|
|
2273
|
+
se.create = (a, t) => new se({
|
|
2274
|
+
valueType: a,
|
|
2285
2275
|
minSize: null,
|
|
2286
2276
|
maxSize: null,
|
|
2287
|
-
typeName:
|
|
2277
|
+
typeName: g.ZodSet,
|
|
2288
2278
|
..._(t)
|
|
2289
2279
|
});
|
|
2290
|
-
class
|
|
2280
|
+
class de extends v {
|
|
2291
2281
|
constructor() {
|
|
2292
2282
|
super(...arguments), this.validate = this.implement;
|
|
2293
2283
|
}
|
|
@@ -2298,23 +2288,23 @@ class fe extends v {
|
|
|
2298
2288
|
code: c.invalid_type,
|
|
2299
2289
|
expected: h.function,
|
|
2300
2290
|
received: e.parsedType
|
|
2301
|
-
}),
|
|
2291
|
+
}), y;
|
|
2302
2292
|
function r(o, u) {
|
|
2303
|
-
return
|
|
2293
|
+
return Ze({
|
|
2304
2294
|
data: o,
|
|
2305
2295
|
path: e.path,
|
|
2306
|
-
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap,
|
|
2296
|
+
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, Ae(), le].filter((d) => !!d),
|
|
2307
2297
|
issueData: {
|
|
2308
2298
|
code: c.invalid_arguments,
|
|
2309
2299
|
argumentsError: u
|
|
2310
2300
|
}
|
|
2311
2301
|
});
|
|
2312
2302
|
}
|
|
2313
|
-
function
|
|
2314
|
-
return
|
|
2303
|
+
function n(o, u) {
|
|
2304
|
+
return Ze({
|
|
2315
2305
|
data: o,
|
|
2316
2306
|
path: e.path,
|
|
2317
|
-
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap,
|
|
2307
|
+
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, Ae(), le].filter((d) => !!d),
|
|
2318
2308
|
issueData: {
|
|
2319
2309
|
code: c.invalid_return_type,
|
|
2320
2310
|
returnTypeError: u
|
|
@@ -2322,14 +2312,14 @@ class fe extends v {
|
|
|
2322
2312
|
});
|
|
2323
2313
|
}
|
|
2324
2314
|
const s = { errorMap: e.common.contextualErrorMap }, i = e.data;
|
|
2325
|
-
if (this._def.returns instanceof
|
|
2315
|
+
if (this._def.returns instanceof he) {
|
|
2326
2316
|
const o = this;
|
|
2327
2317
|
return R(async function(...u) {
|
|
2328
2318
|
const d = new Z([]), p = await o._def.args.parseAsync(u, s).catch((j) => {
|
|
2329
2319
|
throw d.addIssue(r(u, j)), d;
|
|
2330
2320
|
}), k = await Reflect.apply(i, this, p);
|
|
2331
2321
|
return await o._def.returns._def.type.parseAsync(k, s).catch((j) => {
|
|
2332
|
-
throw d.addIssue(
|
|
2322
|
+
throw d.addIssue(n(k, j)), d;
|
|
2333
2323
|
});
|
|
2334
2324
|
});
|
|
2335
2325
|
} else {
|
|
@@ -2340,7 +2330,7 @@ class fe extends v {
|
|
|
2340
2330
|
throw new Z([r(u, d.error)]);
|
|
2341
2331
|
const p = Reflect.apply(i, this, d.data), k = o._def.returns.safeParse(p, s);
|
|
2342
2332
|
if (!k.success)
|
|
2343
|
-
throw new Z([
|
|
2333
|
+
throw new Z([n(p, k.error)]);
|
|
2344
2334
|
return k.data;
|
|
2345
2335
|
});
|
|
2346
2336
|
}
|
|
@@ -2352,13 +2342,13 @@ class fe extends v {
|
|
|
2352
2342
|
return this._def.returns;
|
|
2353
2343
|
}
|
|
2354
2344
|
args(...t) {
|
|
2355
|
-
return new
|
|
2345
|
+
return new de({
|
|
2356
2346
|
...this._def,
|
|
2357
2347
|
args: H.create(t).rest(re.create())
|
|
2358
2348
|
});
|
|
2359
2349
|
}
|
|
2360
2350
|
returns(t) {
|
|
2361
|
-
return new
|
|
2351
|
+
return new de({
|
|
2362
2352
|
...this._def,
|
|
2363
2353
|
returns: t
|
|
2364
2354
|
});
|
|
@@ -2370,15 +2360,15 @@ class fe extends v {
|
|
|
2370
2360
|
return this.parse(t);
|
|
2371
2361
|
}
|
|
2372
2362
|
static create(t, e, r) {
|
|
2373
|
-
return new
|
|
2363
|
+
return new de({
|
|
2374
2364
|
args: t || H.create([]).rest(re.create()),
|
|
2375
2365
|
returns: e || re.create(),
|
|
2376
|
-
typeName:
|
|
2366
|
+
typeName: g.ZodFunction,
|
|
2377
2367
|
..._(r)
|
|
2378
2368
|
});
|
|
2379
2369
|
}
|
|
2380
2370
|
}
|
|
2381
|
-
class
|
|
2371
|
+
class xe extends v {
|
|
2382
2372
|
get schema() {
|
|
2383
2373
|
return this._def.getter();
|
|
2384
2374
|
}
|
|
@@ -2387,12 +2377,12 @@ class Oe extends v {
|
|
|
2387
2377
|
return this._def.getter()._parse({ data: e.data, path: e.path, parent: e });
|
|
2388
2378
|
}
|
|
2389
2379
|
}
|
|
2390
|
-
|
|
2391
|
-
getter:
|
|
2392
|
-
typeName:
|
|
2380
|
+
xe.create = (a, t) => new xe({
|
|
2381
|
+
getter: a,
|
|
2382
|
+
typeName: g.ZodLazy,
|
|
2393
2383
|
..._(t)
|
|
2394
2384
|
});
|
|
2395
|
-
class
|
|
2385
|
+
class ke extends v {
|
|
2396
2386
|
_parse(t) {
|
|
2397
2387
|
if (t.data !== this._def.value) {
|
|
2398
2388
|
const e = this._getOrReturnCtx(t);
|
|
@@ -2400,7 +2390,7 @@ class Pe extends v {
|
|
|
2400
2390
|
received: e.data,
|
|
2401
2391
|
code: c.invalid_literal,
|
|
2402
2392
|
expected: this._def.value
|
|
2403
|
-
}),
|
|
2393
|
+
}), y;
|
|
2404
2394
|
}
|
|
2405
2395
|
return { status: "valid", value: t.data };
|
|
2406
2396
|
}
|
|
@@ -2408,22 +2398,19 @@ class Pe extends v {
|
|
|
2408
2398
|
return this._def.value;
|
|
2409
2399
|
}
|
|
2410
2400
|
}
|
|
2411
|
-
|
|
2412
|
-
value:
|
|
2413
|
-
typeName:
|
|
2401
|
+
ke.create = (a, t) => new ke({
|
|
2402
|
+
value: a,
|
|
2403
|
+
typeName: g.ZodLiteral,
|
|
2414
2404
|
..._(t)
|
|
2415
2405
|
});
|
|
2416
|
-
function
|
|
2406
|
+
function dt(a, t) {
|
|
2417
2407
|
return new K({
|
|
2418
|
-
values:
|
|
2419
|
-
typeName:
|
|
2408
|
+
values: a,
|
|
2409
|
+
typeName: g.ZodEnum,
|
|
2420
2410
|
..._(t)
|
|
2421
2411
|
});
|
|
2422
2412
|
}
|
|
2423
2413
|
class K extends v {
|
|
2424
|
-
constructor() {
|
|
2425
|
-
super(...arguments), de.set(this, void 0);
|
|
2426
|
-
}
|
|
2427
2414
|
_parse(t) {
|
|
2428
2415
|
if (typeof t.data != "string") {
|
|
2429
2416
|
const e = this._getOrReturnCtx(t), r = this._def.values;
|
|
@@ -2431,15 +2418,15 @@ class K extends v {
|
|
|
2431
2418
|
expected: w.joinValues(r),
|
|
2432
2419
|
received: e.parsedType,
|
|
2433
2420
|
code: c.invalid_type
|
|
2434
|
-
}),
|
|
2421
|
+
}), y;
|
|
2435
2422
|
}
|
|
2436
|
-
if (
|
|
2423
|
+
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(t.data)) {
|
|
2437
2424
|
const e = this._getOrReturnCtx(t), r = this._def.values;
|
|
2438
2425
|
return l(e, {
|
|
2439
2426
|
received: e.data,
|
|
2440
2427
|
code: c.invalid_enum_value,
|
|
2441
2428
|
options: r
|
|
2442
|
-
}),
|
|
2429
|
+
}), y;
|
|
2443
2430
|
}
|
|
2444
2431
|
return R(t.data);
|
|
2445
2432
|
}
|
|
@@ -2477,29 +2464,25 @@ class K extends v {
|
|
|
2477
2464
|
});
|
|
2478
2465
|
}
|
|
2479
2466
|
}
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
class Ce extends v {
|
|
2483
|
-
constructor() {
|
|
2484
|
-
super(...arguments), le.set(this, void 0);
|
|
2485
|
-
}
|
|
2467
|
+
K.create = dt;
|
|
2468
|
+
class Te extends v {
|
|
2486
2469
|
_parse(t) {
|
|
2487
2470
|
const e = w.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(t);
|
|
2488
2471
|
if (r.parsedType !== h.string && r.parsedType !== h.number) {
|
|
2489
|
-
const
|
|
2472
|
+
const n = w.objectValues(e);
|
|
2490
2473
|
return l(r, {
|
|
2491
|
-
expected: w.joinValues(
|
|
2474
|
+
expected: w.joinValues(n),
|
|
2492
2475
|
received: r.parsedType,
|
|
2493
2476
|
code: c.invalid_type
|
|
2494
|
-
}),
|
|
2477
|
+
}), y;
|
|
2495
2478
|
}
|
|
2496
|
-
if (
|
|
2497
|
-
const
|
|
2479
|
+
if (this._cache || (this._cache = new Set(w.getValidEnumValues(this._def.values))), !this._cache.has(t.data)) {
|
|
2480
|
+
const n = w.objectValues(e);
|
|
2498
2481
|
return l(r, {
|
|
2499
2482
|
received: r.data,
|
|
2500
2483
|
code: c.invalid_enum_value,
|
|
2501
|
-
options:
|
|
2502
|
-
}),
|
|
2484
|
+
options: n
|
|
2485
|
+
}), y;
|
|
2503
2486
|
}
|
|
2504
2487
|
return R(t.data);
|
|
2505
2488
|
}
|
|
@@ -2507,13 +2490,12 @@ class Ce extends v {
|
|
|
2507
2490
|
return this._def.values;
|
|
2508
2491
|
}
|
|
2509
2492
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
typeName: y.ZodNativeEnum,
|
|
2493
|
+
Te.create = (a, t) => new Te({
|
|
2494
|
+
values: a,
|
|
2495
|
+
typeName: g.ZodNativeEnum,
|
|
2514
2496
|
..._(t)
|
|
2515
2497
|
});
|
|
2516
|
-
class
|
|
2498
|
+
class he extends v {
|
|
2517
2499
|
unwrap() {
|
|
2518
2500
|
return this._def.type;
|
|
2519
2501
|
}
|
|
@@ -2524,17 +2506,17 @@ class pe extends v {
|
|
|
2524
2506
|
code: c.invalid_type,
|
|
2525
2507
|
expected: h.promise,
|
|
2526
2508
|
received: e.parsedType
|
|
2527
|
-
}),
|
|
2509
|
+
}), y;
|
|
2528
2510
|
const r = e.parsedType === h.promise ? e.data : Promise.resolve(e.data);
|
|
2529
|
-
return R(r.then((
|
|
2511
|
+
return R(r.then((n) => this._def.type.parseAsync(n, {
|
|
2530
2512
|
path: e.path,
|
|
2531
2513
|
errorMap: e.common.contextualErrorMap
|
|
2532
2514
|
})));
|
|
2533
2515
|
}
|
|
2534
2516
|
}
|
|
2535
|
-
|
|
2536
|
-
type:
|
|
2537
|
-
typeName:
|
|
2517
|
+
he.create = (a, t) => new he({
|
|
2518
|
+
type: a,
|
|
2519
|
+
typeName: g.ZodPromise,
|
|
2538
2520
|
..._(t)
|
|
2539
2521
|
});
|
|
2540
2522
|
class B extends v {
|
|
@@ -2542,10 +2524,10 @@ class B extends v {
|
|
|
2542
2524
|
return this._def.schema;
|
|
2543
2525
|
}
|
|
2544
2526
|
sourceType() {
|
|
2545
|
-
return this._def.schema._def.typeName ===
|
|
2527
|
+
return this._def.schema._def.typeName === g.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2546
2528
|
}
|
|
2547
2529
|
_parse(t) {
|
|
2548
|
-
const { status: e, ctx: r } = this._processInputParams(t),
|
|
2530
|
+
const { status: e, ctx: r } = this._processInputParams(t), n = this._def.effect || null, s = {
|
|
2549
2531
|
addIssue: (i) => {
|
|
2550
2532
|
l(r, i), i.fatal ? e.abort() : e.dirty();
|
|
2551
2533
|
},
|
|
@@ -2553,33 +2535,33 @@ class B extends v {
|
|
|
2553
2535
|
return r.path;
|
|
2554
2536
|
}
|
|
2555
2537
|
};
|
|
2556
|
-
if (s.addIssue = s.addIssue.bind(s),
|
|
2557
|
-
const i =
|
|
2538
|
+
if (s.addIssue = s.addIssue.bind(s), n.type === "preprocess") {
|
|
2539
|
+
const i = n.transform(r.data, s);
|
|
2558
2540
|
if (r.common.async)
|
|
2559
2541
|
return Promise.resolve(i).then(async (o) => {
|
|
2560
2542
|
if (e.value === "aborted")
|
|
2561
|
-
return
|
|
2543
|
+
return y;
|
|
2562
2544
|
const u = await this._def.schema._parseAsync({
|
|
2563
2545
|
data: o,
|
|
2564
2546
|
path: r.path,
|
|
2565
2547
|
parent: r
|
|
2566
2548
|
});
|
|
2567
|
-
return u.status === "aborted" ?
|
|
2549
|
+
return u.status === "aborted" ? y : u.status === "dirty" || e.value === "dirty" ? ue(u.value) : u;
|
|
2568
2550
|
});
|
|
2569
2551
|
{
|
|
2570
2552
|
if (e.value === "aborted")
|
|
2571
|
-
return
|
|
2553
|
+
return y;
|
|
2572
2554
|
const o = this._def.schema._parseSync({
|
|
2573
2555
|
data: i,
|
|
2574
2556
|
path: r.path,
|
|
2575
2557
|
parent: r
|
|
2576
2558
|
});
|
|
2577
|
-
return o.status === "aborted" ?
|
|
2559
|
+
return o.status === "aborted" ? y : o.status === "dirty" || e.value === "dirty" ? ue(o.value) : o;
|
|
2578
2560
|
}
|
|
2579
2561
|
}
|
|
2580
|
-
if (
|
|
2562
|
+
if (n.type === "refinement") {
|
|
2581
2563
|
const i = (o) => {
|
|
2582
|
-
const u =
|
|
2564
|
+
const u = n.refinement(o, s);
|
|
2583
2565
|
if (r.common.async)
|
|
2584
2566
|
return Promise.resolve(u);
|
|
2585
2567
|
if (u instanceof Promise)
|
|
@@ -2592,41 +2574,41 @@ class B extends v {
|
|
|
2592
2574
|
path: r.path,
|
|
2593
2575
|
parent: r
|
|
2594
2576
|
});
|
|
2595
|
-
return o.status === "aborted" ?
|
|
2577
|
+
return o.status === "aborted" ? y : (o.status === "dirty" && e.dirty(), i(o.value), { status: e.value, value: o.value });
|
|
2596
2578
|
} else
|
|
2597
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ?
|
|
2579
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => o.status === "aborted" ? y : (o.status === "dirty" && e.dirty(), i(o.value).then(() => ({ status: e.value, value: o.value }))));
|
|
2598
2580
|
}
|
|
2599
|
-
if (
|
|
2581
|
+
if (n.type === "transform")
|
|
2600
2582
|
if (r.common.async === !1) {
|
|
2601
2583
|
const i = this._def.schema._parseSync({
|
|
2602
2584
|
data: r.data,
|
|
2603
2585
|
path: r.path,
|
|
2604
2586
|
parent: r
|
|
2605
2587
|
});
|
|
2606
|
-
if (!
|
|
2607
|
-
return
|
|
2608
|
-
const o =
|
|
2588
|
+
if (!ae(i))
|
|
2589
|
+
return y;
|
|
2590
|
+
const o = n.transform(i.value, s);
|
|
2609
2591
|
if (o instanceof Promise)
|
|
2610
2592
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2611
2593
|
return { status: e.value, value: o };
|
|
2612
2594
|
} else
|
|
2613
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) =>
|
|
2595
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => ae(i) ? Promise.resolve(n.transform(i.value, s)).then((o) => ({
|
|
2614
2596
|
status: e.value,
|
|
2615
2597
|
value: o
|
|
2616
|
-
})) :
|
|
2617
|
-
w.assertNever(
|
|
2598
|
+
})) : y);
|
|
2599
|
+
w.assertNever(n);
|
|
2618
2600
|
}
|
|
2619
2601
|
}
|
|
2620
|
-
B.create = (
|
|
2621
|
-
schema:
|
|
2622
|
-
typeName:
|
|
2602
|
+
B.create = (a, t, e) => new B({
|
|
2603
|
+
schema: a,
|
|
2604
|
+
typeName: g.ZodEffects,
|
|
2623
2605
|
effect: t,
|
|
2624
2606
|
..._(e)
|
|
2625
2607
|
});
|
|
2626
|
-
B.createWithPreprocess = (
|
|
2608
|
+
B.createWithPreprocess = (a, t, e) => new B({
|
|
2627
2609
|
schema: t,
|
|
2628
|
-
effect: { type: "preprocess", transform:
|
|
2629
|
-
typeName:
|
|
2610
|
+
effect: { type: "preprocess", transform: a },
|
|
2611
|
+
typeName: g.ZodEffects,
|
|
2630
2612
|
..._(e)
|
|
2631
2613
|
});
|
|
2632
2614
|
class q extends v {
|
|
@@ -2637,9 +2619,9 @@ class q extends v {
|
|
|
2637
2619
|
return this._def.innerType;
|
|
2638
2620
|
}
|
|
2639
2621
|
}
|
|
2640
|
-
q.create = (
|
|
2641
|
-
innerType:
|
|
2642
|
-
typeName:
|
|
2622
|
+
q.create = (a, t) => new q({
|
|
2623
|
+
innerType: a,
|
|
2624
|
+
typeName: g.ZodOptional,
|
|
2643
2625
|
..._(t)
|
|
2644
2626
|
});
|
|
2645
2627
|
class ee extends v {
|
|
@@ -2650,12 +2632,12 @@ class ee extends v {
|
|
|
2650
2632
|
return this._def.innerType;
|
|
2651
2633
|
}
|
|
2652
2634
|
}
|
|
2653
|
-
ee.create = (
|
|
2654
|
-
innerType:
|
|
2655
|
-
typeName:
|
|
2635
|
+
ee.create = (a, t) => new ee({
|
|
2636
|
+
innerType: a,
|
|
2637
|
+
typeName: g.ZodNullable,
|
|
2656
2638
|
..._(t)
|
|
2657
2639
|
});
|
|
2658
|
-
class
|
|
2640
|
+
class Oe extends v {
|
|
2659
2641
|
_parse(t) {
|
|
2660
2642
|
const { ctx: e } = this._processInputParams(t);
|
|
2661
2643
|
let r = e.data;
|
|
@@ -2669,13 +2651,13 @@ class Me extends v {
|
|
|
2669
2651
|
return this._def.innerType;
|
|
2670
2652
|
}
|
|
2671
2653
|
}
|
|
2672
|
-
|
|
2673
|
-
innerType:
|
|
2674
|
-
typeName:
|
|
2654
|
+
Oe.create = (a, t) => new Oe({
|
|
2655
|
+
innerType: a,
|
|
2656
|
+
typeName: g.ZodDefault,
|
|
2675
2657
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2676
2658
|
..._(t)
|
|
2677
2659
|
});
|
|
2678
|
-
class
|
|
2660
|
+
class Pe extends v {
|
|
2679
2661
|
_parse(t) {
|
|
2680
2662
|
const { ctx: e } = this._processInputParams(t), r = {
|
|
2681
2663
|
...e,
|
|
@@ -2683,14 +2665,14 @@ class De extends v {
|
|
|
2683
2665
|
...e.common,
|
|
2684
2666
|
issues: []
|
|
2685
2667
|
}
|
|
2686
|
-
},
|
|
2668
|
+
}, n = this._def.innerType._parse({
|
|
2687
2669
|
data: r.data,
|
|
2688
2670
|
path: r.path,
|
|
2689
2671
|
parent: {
|
|
2690
2672
|
...r
|
|
2691
2673
|
}
|
|
2692
2674
|
});
|
|
2693
|
-
return
|
|
2675
|
+
return pe(n) ? n.then((s) => ({
|
|
2694
2676
|
status: "valid",
|
|
2695
2677
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2696
2678
|
get error() {
|
|
@@ -2700,7 +2682,7 @@ class De extends v {
|
|
|
2700
2682
|
})
|
|
2701
2683
|
})) : {
|
|
2702
2684
|
status: "valid",
|
|
2703
|
-
value:
|
|
2685
|
+
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
2704
2686
|
get error() {
|
|
2705
2687
|
return new Z(r.common.issues);
|
|
2706
2688
|
},
|
|
@@ -2712,13 +2694,13 @@ class De extends v {
|
|
|
2712
2694
|
return this._def.innerType;
|
|
2713
2695
|
}
|
|
2714
2696
|
}
|
|
2715
|
-
|
|
2716
|
-
innerType:
|
|
2717
|
-
typeName:
|
|
2697
|
+
Pe.create = (a, t) => new Pe({
|
|
2698
|
+
innerType: a,
|
|
2699
|
+
typeName: g.ZodCatch,
|
|
2718
2700
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2719
2701
|
..._(t)
|
|
2720
2702
|
});
|
|
2721
|
-
class
|
|
2703
|
+
class Le extends v {
|
|
2722
2704
|
_parse(t) {
|
|
2723
2705
|
if (this._getType(t) !== h.nan) {
|
|
2724
2706
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2726,17 +2708,17 @@ class Ve extends v {
|
|
|
2726
2708
|
code: c.invalid_type,
|
|
2727
2709
|
expected: h.nan,
|
|
2728
2710
|
received: r.parsedType
|
|
2729
|
-
}),
|
|
2711
|
+
}), y;
|
|
2730
2712
|
}
|
|
2731
2713
|
return { status: "valid", value: t.data };
|
|
2732
2714
|
}
|
|
2733
2715
|
}
|
|
2734
|
-
|
|
2735
|
-
typeName:
|
|
2736
|
-
..._(
|
|
2716
|
+
Le.create = (a) => new Le({
|
|
2717
|
+
typeName: g.ZodNaN,
|
|
2718
|
+
..._(a)
|
|
2737
2719
|
});
|
|
2738
|
-
const
|
|
2739
|
-
class
|
|
2720
|
+
const Ba = Symbol("zod_brand");
|
|
2721
|
+
class lt extends v {
|
|
2740
2722
|
_parse(t) {
|
|
2741
2723
|
const { ctx: e } = this._processInputParams(t), r = e.data;
|
|
2742
2724
|
return this._def.type._parse({
|
|
@@ -2749,7 +2731,7 @@ class pt extends v {
|
|
|
2749
2731
|
return this._def.type;
|
|
2750
2732
|
}
|
|
2751
2733
|
}
|
|
2752
|
-
class
|
|
2734
|
+
class De extends v {
|
|
2753
2735
|
_parse(t) {
|
|
2754
2736
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2755
2737
|
if (r.common.async)
|
|
@@ -2759,121 +2741,121 @@ class Ie extends v {
|
|
|
2759
2741
|
path: r.path,
|
|
2760
2742
|
parent: r
|
|
2761
2743
|
});
|
|
2762
|
-
return s.status === "aborted" ?
|
|
2744
|
+
return s.status === "aborted" ? y : s.status === "dirty" ? (e.dirty(), ue(s.value)) : this._def.out._parseAsync({
|
|
2763
2745
|
data: s.value,
|
|
2764
2746
|
path: r.path,
|
|
2765
2747
|
parent: r
|
|
2766
2748
|
});
|
|
2767
2749
|
})();
|
|
2768
2750
|
{
|
|
2769
|
-
const
|
|
2751
|
+
const n = this._def.in._parseSync({
|
|
2770
2752
|
data: r.data,
|
|
2771
2753
|
path: r.path,
|
|
2772
2754
|
parent: r
|
|
2773
2755
|
});
|
|
2774
|
-
return
|
|
2756
|
+
return n.status === "aborted" ? y : n.status === "dirty" ? (e.dirty(), {
|
|
2775
2757
|
status: "dirty",
|
|
2776
|
-
value:
|
|
2758
|
+
value: n.value
|
|
2777
2759
|
}) : this._def.out._parseSync({
|
|
2778
|
-
data:
|
|
2760
|
+
data: n.value,
|
|
2779
2761
|
path: r.path,
|
|
2780
2762
|
parent: r
|
|
2781
2763
|
});
|
|
2782
2764
|
}
|
|
2783
2765
|
}
|
|
2784
2766
|
static create(t, e) {
|
|
2785
|
-
return new
|
|
2767
|
+
return new De({
|
|
2786
2768
|
in: t,
|
|
2787
2769
|
out: e,
|
|
2788
|
-
typeName:
|
|
2770
|
+
typeName: g.ZodPipeline
|
|
2789
2771
|
});
|
|
2790
2772
|
}
|
|
2791
2773
|
}
|
|
2792
|
-
class
|
|
2774
|
+
class Ce extends v {
|
|
2793
2775
|
_parse(t) {
|
|
2794
|
-
const e = this._def.innerType._parse(t), r = (
|
|
2795
|
-
return
|
|
2776
|
+
const e = this._def.innerType._parse(t), r = (n) => (ae(n) && (n.value = Object.freeze(n.value)), n);
|
|
2777
|
+
return pe(e) ? e.then((n) => r(n)) : r(e);
|
|
2796
2778
|
}
|
|
2797
2779
|
unwrap() {
|
|
2798
2780
|
return this._def.innerType;
|
|
2799
2781
|
}
|
|
2800
2782
|
}
|
|
2801
|
-
|
|
2802
|
-
innerType:
|
|
2803
|
-
typeName:
|
|
2783
|
+
Ce.create = (a, t) => new Ce({
|
|
2784
|
+
innerType: a,
|
|
2785
|
+
typeName: g.ZodReadonly,
|
|
2804
2786
|
..._(t)
|
|
2805
2787
|
});
|
|
2806
|
-
function
|
|
2807
|
-
const e = typeof
|
|
2788
|
+
function rt(a, t) {
|
|
2789
|
+
const e = typeof a == "function" ? a(t) : typeof a == "string" ? { message: a } : a;
|
|
2808
2790
|
return typeof e == "string" ? { message: e } : e;
|
|
2809
2791
|
}
|
|
2810
|
-
function
|
|
2811
|
-
return
|
|
2812
|
-
const s =
|
|
2792
|
+
function qt(a, t = {}, e) {
|
|
2793
|
+
return a ? fe.create().superRefine((r, n) => {
|
|
2794
|
+
const s = a(r);
|
|
2813
2795
|
if (s instanceof Promise)
|
|
2814
2796
|
return s.then((i) => {
|
|
2815
2797
|
if (!i) {
|
|
2816
|
-
const o =
|
|
2817
|
-
|
|
2798
|
+
const o = rt(t, r), u = o.fatal ?? e ?? !0;
|
|
2799
|
+
n.addIssue({ code: "custom", ...o, fatal: u });
|
|
2818
2800
|
}
|
|
2819
2801
|
});
|
|
2820
2802
|
if (!s) {
|
|
2821
|
-
const i =
|
|
2822
|
-
|
|
2803
|
+
const i = rt(t, r), o = i.fatal ?? e ?? !0;
|
|
2804
|
+
n.addIssue({ code: "custom", ...i, fatal: o });
|
|
2823
2805
|
}
|
|
2824
|
-
}) :
|
|
2806
|
+
}) : fe.create();
|
|
2825
2807
|
}
|
|
2826
|
-
const
|
|
2808
|
+
const Qa = {
|
|
2827
2809
|
object: P.lazycreate
|
|
2828
2810
|
};
|
|
2829
|
-
var
|
|
2830
|
-
(function(
|
|
2831
|
-
|
|
2832
|
-
})(
|
|
2833
|
-
const
|
|
2834
|
-
message: `Input not instance of ${
|
|
2835
|
-
}) =>
|
|
2836
|
-
string: (
|
|
2837
|
-
number: (
|
|
2838
|
-
boolean: (
|
|
2839
|
-
...
|
|
2811
|
+
var g;
|
|
2812
|
+
(function(a) {
|
|
2813
|
+
a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
|
|
2814
|
+
})(g || (g = {}));
|
|
2815
|
+
const Ua = (a, t = {
|
|
2816
|
+
message: `Input not instance of ${a.name}`
|
|
2817
|
+
}) => qt((e) => e instanceof a, t), Ht = L.create, Bt = G.create, Xa = Le.create, Ga = J.create, Qt = ye.create, Ja = ne.create, Ka = je.create, en = ge.create, tn = _e.create, rn = fe.create, an = re.create, nn = U.create, sn = Ye.create, on = S.create, cn = P.create, un = P.strictCreate, dn = ve.create, ln = Se.create, fn = we.create, hn = H.create, mn = be.create, pn = $e.create, yn = se.create, gn = de.create, _n = xe.create, vn = ke.create, wn = K.create, bn = Te.create, xn = he.create, kn = B.create, Tn = q.create, On = ee.create, Pn = B.createWithPreprocess, Cn = De.create, Mn = () => Ht().optional(), Dn = () => Bt().optional(), Nn = () => Qt().optional(), En = {
|
|
2818
|
+
string: (a) => L.create({ ...a, coerce: !0 }),
|
|
2819
|
+
number: (a) => G.create({ ...a, coerce: !0 }),
|
|
2820
|
+
boolean: (a) => ye.create({
|
|
2821
|
+
...a,
|
|
2840
2822
|
coerce: !0
|
|
2841
2823
|
}),
|
|
2842
|
-
bigint: (
|
|
2843
|
-
date: (
|
|
2844
|
-
},
|
|
2845
|
-
function N(
|
|
2846
|
-
return typeof
|
|
2824
|
+
bigint: (a) => J.create({ ...a, coerce: !0 }),
|
|
2825
|
+
date: (a) => ne.create({ ...a, coerce: !0 })
|
|
2826
|
+
}, In = y, ft = 6048e5, Rn = 864e5, Ut = 6e4, Xt = 36e5, Gt = 1e3, at = Symbol.for("constructDateFrom");
|
|
2827
|
+
function N(a, t) {
|
|
2828
|
+
return typeof a == "function" ? a(t) : a && typeof a == "object" && at in a ? a[at](t) : a instanceof Date ? new a.constructor(t) : new Date(t);
|
|
2847
2829
|
}
|
|
2848
|
-
function E(
|
|
2849
|
-
return N(t ||
|
|
2830
|
+
function E(a, t) {
|
|
2831
|
+
return N(t || a, a);
|
|
2850
2832
|
}
|
|
2851
|
-
function
|
|
2852
|
-
const r = E(
|
|
2853
|
-
return isNaN(t) ? N((e == null ? void 0 : e.in) ||
|
|
2833
|
+
function ht(a, t, e) {
|
|
2834
|
+
const r = E(a, e == null ? void 0 : e.in);
|
|
2835
|
+
return isNaN(t) ? N((e == null ? void 0 : e.in) || a, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
2854
2836
|
}
|
|
2855
|
-
let
|
|
2856
|
-
function
|
|
2857
|
-
return
|
|
2837
|
+
let Jt = {};
|
|
2838
|
+
function me() {
|
|
2839
|
+
return Jt;
|
|
2858
2840
|
}
|
|
2859
|
-
function X(
|
|
2841
|
+
function X(a, t) {
|
|
2860
2842
|
var o, u, d, p;
|
|
2861
|
-
const e =
|
|
2862
|
-
return
|
|
2843
|
+
const e = me(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? e.weekStartsOn ?? ((p = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : p.weekStartsOn) ?? 0, n = E(a, t == null ? void 0 : t.in), s = n.getDay(), i = (s < r ? 7 : 0) + s - r;
|
|
2844
|
+
return n.setDate(n.getDate() - i), n.setHours(0, 0, 0, 0), n;
|
|
2863
2845
|
}
|
|
2864
|
-
function ie(
|
|
2865
|
-
return X(
|
|
2846
|
+
function ie(a, t) {
|
|
2847
|
+
return X(a, { ...t, weekStartsOn: 1 });
|
|
2866
2848
|
}
|
|
2867
|
-
function
|
|
2868
|
-
const e = E(
|
|
2869
|
-
|
|
2870
|
-
const s = ie(
|
|
2849
|
+
function Kt(a, t) {
|
|
2850
|
+
const e = E(a, t == null ? void 0 : t.in), r = e.getFullYear(), n = N(e, 0);
|
|
2851
|
+
n.setFullYear(r + 1, 0, 4), n.setHours(0, 0, 0, 0);
|
|
2852
|
+
const s = ie(n), i = N(e, 0);
|
|
2871
2853
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
2872
2854
|
const o = ie(i);
|
|
2873
2855
|
return e.getTime() >= s.getTime() ? r + 1 : e.getTime() >= o.getTime() ? r : r - 1;
|
|
2874
2856
|
}
|
|
2875
|
-
function
|
|
2876
|
-
const t = E(
|
|
2857
|
+
function mt(a) {
|
|
2858
|
+
const t = E(a), e = new Date(
|
|
2877
2859
|
Date.UTC(
|
|
2878
2860
|
t.getFullYear(),
|
|
2879
2861
|
t.getMonth(),
|
|
@@ -2884,19 +2866,19 @@ function _t(n) {
|
|
|
2884
2866
|
t.getMilliseconds()
|
|
2885
2867
|
)
|
|
2886
2868
|
);
|
|
2887
|
-
return e.setUTCFullYear(t.getFullYear()), +
|
|
2869
|
+
return e.setUTCFullYear(t.getFullYear()), +a - +e;
|
|
2888
2870
|
}
|
|
2889
|
-
function
|
|
2890
|
-
const e =
|
|
2871
|
+
function er(a, t) {
|
|
2872
|
+
const e = Kt(a, t), r = N(a, 0);
|
|
2891
2873
|
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), ie(r);
|
|
2892
2874
|
}
|
|
2893
|
-
function
|
|
2894
|
-
return
|
|
2875
|
+
function tr(a) {
|
|
2876
|
+
return a instanceof Date || typeof a == "object" && Object.prototype.toString.call(a) === "[object Date]";
|
|
2895
2877
|
}
|
|
2896
|
-
function
|
|
2897
|
-
return !(!
|
|
2878
|
+
function An(a) {
|
|
2879
|
+
return !(!tr(a) && typeof a != "number" || isNaN(+E(a)));
|
|
2898
2880
|
}
|
|
2899
|
-
const
|
|
2881
|
+
const rr = {
|
|
2900
2882
|
lessThanXSeconds: {
|
|
2901
2883
|
one: "less than a second",
|
|
2902
2884
|
other: "less than {{count}} seconds"
|
|
@@ -2958,77 +2940,77 @@ const ir = {
|
|
|
2958
2940
|
one: "almost 1 year",
|
|
2959
2941
|
other: "almost {{count}} years"
|
|
2960
2942
|
}
|
|
2961
|
-
},
|
|
2943
|
+
}, ar = (a, t, e) => {
|
|
2962
2944
|
let r;
|
|
2963
|
-
const
|
|
2964
|
-
return typeof
|
|
2945
|
+
const n = rr[a];
|
|
2946
|
+
return typeof n == "string" ? r = n : t === 1 ? r = n.one : r = n.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
2965
2947
|
};
|
|
2966
|
-
function
|
|
2948
|
+
function Re(a) {
|
|
2967
2949
|
return (t = {}) => {
|
|
2968
|
-
const e = t.width ? String(t.width) :
|
|
2969
|
-
return
|
|
2950
|
+
const e = t.width ? String(t.width) : a.defaultWidth;
|
|
2951
|
+
return a.formats[e] || a.formats[a.defaultWidth];
|
|
2970
2952
|
};
|
|
2971
2953
|
}
|
|
2972
|
-
const
|
|
2954
|
+
const nr = {
|
|
2973
2955
|
full: "EEEE, MMMM do, y",
|
|
2974
2956
|
long: "MMMM do, y",
|
|
2975
2957
|
medium: "MMM d, y",
|
|
2976
2958
|
short: "MM/dd/yyyy"
|
|
2977
|
-
},
|
|
2959
|
+
}, sr = {
|
|
2978
2960
|
full: "h:mm:ss a zzzz",
|
|
2979
2961
|
long: "h:mm:ss a z",
|
|
2980
2962
|
medium: "h:mm:ss a",
|
|
2981
2963
|
short: "h:mm a"
|
|
2982
|
-
},
|
|
2964
|
+
}, ir = {
|
|
2983
2965
|
full: "{{date}} 'at' {{time}}",
|
|
2984
2966
|
long: "{{date}} 'at' {{time}}",
|
|
2985
2967
|
medium: "{{date}}, {{time}}",
|
|
2986
2968
|
short: "{{date}}, {{time}}"
|
|
2987
|
-
},
|
|
2988
|
-
date:
|
|
2989
|
-
formats:
|
|
2969
|
+
}, or = {
|
|
2970
|
+
date: Re({
|
|
2971
|
+
formats: nr,
|
|
2990
2972
|
defaultWidth: "full"
|
|
2991
2973
|
}),
|
|
2992
|
-
time:
|
|
2993
|
-
formats:
|
|
2974
|
+
time: Re({
|
|
2975
|
+
formats: sr,
|
|
2994
2976
|
defaultWidth: "full"
|
|
2995
2977
|
}),
|
|
2996
|
-
dateTime:
|
|
2997
|
-
formats:
|
|
2978
|
+
dateTime: Re({
|
|
2979
|
+
formats: ir,
|
|
2998
2980
|
defaultWidth: "full"
|
|
2999
2981
|
})
|
|
3000
|
-
},
|
|
2982
|
+
}, cr = {
|
|
3001
2983
|
lastWeek: "'last' eeee 'at' p",
|
|
3002
2984
|
yesterday: "'yesterday at' p",
|
|
3003
2985
|
today: "'today at' p",
|
|
3004
2986
|
tomorrow: "'tomorrow at' p",
|
|
3005
2987
|
nextWeek: "eeee 'at' p",
|
|
3006
2988
|
other: "P"
|
|
3007
|
-
},
|
|
3008
|
-
function oe(
|
|
2989
|
+
}, ur = (a, t, e, r) => cr[a];
|
|
2990
|
+
function oe(a) {
|
|
3009
2991
|
return (t, e) => {
|
|
3010
2992
|
const r = e != null && e.context ? String(e.context) : "standalone";
|
|
3011
|
-
let
|
|
3012
|
-
if (r === "formatting" &&
|
|
3013
|
-
const i =
|
|
3014
|
-
|
|
2993
|
+
let n;
|
|
2994
|
+
if (r === "formatting" && a.formattingValues) {
|
|
2995
|
+
const i = a.defaultFormattingWidth || a.defaultWidth, o = e != null && e.width ? String(e.width) : i;
|
|
2996
|
+
n = a.formattingValues[o] || a.formattingValues[i];
|
|
3015
2997
|
} else {
|
|
3016
|
-
const i =
|
|
3017
|
-
|
|
2998
|
+
const i = a.defaultWidth, o = e != null && e.width ? String(e.width) : a.defaultWidth;
|
|
2999
|
+
n = a.values[o] || a.values[i];
|
|
3018
3000
|
}
|
|
3019
|
-
const s =
|
|
3020
|
-
return
|
|
3001
|
+
const s = a.argumentCallback ? a.argumentCallback(t) : t;
|
|
3002
|
+
return n[s];
|
|
3021
3003
|
};
|
|
3022
3004
|
}
|
|
3023
|
-
const
|
|
3005
|
+
const dr = {
|
|
3024
3006
|
narrow: ["B", "A"],
|
|
3025
3007
|
abbreviated: ["BC", "AD"],
|
|
3026
3008
|
wide: ["Before Christ", "Anno Domini"]
|
|
3027
|
-
},
|
|
3009
|
+
}, lr = {
|
|
3028
3010
|
narrow: ["1", "2", "3", "4"],
|
|
3029
3011
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
3030
3012
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
3031
|
-
},
|
|
3013
|
+
}, fr = {
|
|
3032
3014
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
3033
3015
|
abbreviated: [
|
|
3034
3016
|
"Jan",
|
|
@@ -3058,7 +3040,7 @@ const mr = {
|
|
|
3058
3040
|
"November",
|
|
3059
3041
|
"December"
|
|
3060
3042
|
]
|
|
3061
|
-
},
|
|
3043
|
+
}, hr = {
|
|
3062
3044
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
3063
3045
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
3064
3046
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -3071,7 +3053,7 @@ const mr = {
|
|
|
3071
3053
|
"Friday",
|
|
3072
3054
|
"Saturday"
|
|
3073
3055
|
]
|
|
3074
|
-
},
|
|
3056
|
+
}, mr = {
|
|
3075
3057
|
narrow: {
|
|
3076
3058
|
am: "a",
|
|
3077
3059
|
pm: "p",
|
|
@@ -3102,7 +3084,7 @@ const mr = {
|
|
|
3102
3084
|
evening: "evening",
|
|
3103
3085
|
night: "night"
|
|
3104
3086
|
}
|
|
3105
|
-
},
|
|
3087
|
+
}, pr = {
|
|
3106
3088
|
narrow: {
|
|
3107
3089
|
am: "a",
|
|
3108
3090
|
pm: "p",
|
|
@@ -3133,8 +3115,8 @@ const mr = {
|
|
|
3133
3115
|
evening: "in the evening",
|
|
3134
3116
|
night: "at night"
|
|
3135
3117
|
}
|
|
3136
|
-
},
|
|
3137
|
-
const e = Number(
|
|
3118
|
+
}, yr = (a, t) => {
|
|
3119
|
+
const e = Number(a), r = e % 100;
|
|
3138
3120
|
if (r > 20 || r < 10)
|
|
3139
3121
|
switch (r % 10) {
|
|
3140
3122
|
case 1:
|
|
@@ -3145,43 +3127,43 @@ const mr = {
|
|
|
3145
3127
|
return e + "rd";
|
|
3146
3128
|
}
|
|
3147
3129
|
return e + "th";
|
|
3148
|
-
},
|
|
3149
|
-
ordinalNumber:
|
|
3130
|
+
}, gr = {
|
|
3131
|
+
ordinalNumber: yr,
|
|
3150
3132
|
era: oe({
|
|
3151
|
-
values:
|
|
3133
|
+
values: dr,
|
|
3152
3134
|
defaultWidth: "wide"
|
|
3153
3135
|
}),
|
|
3154
3136
|
quarter: oe({
|
|
3155
|
-
values:
|
|
3137
|
+
values: lr,
|
|
3156
3138
|
defaultWidth: "wide",
|
|
3157
|
-
argumentCallback: (
|
|
3139
|
+
argumentCallback: (a) => a - 1
|
|
3158
3140
|
}),
|
|
3159
3141
|
month: oe({
|
|
3160
|
-
values:
|
|
3142
|
+
values: fr,
|
|
3161
3143
|
defaultWidth: "wide"
|
|
3162
3144
|
}),
|
|
3163
3145
|
day: oe({
|
|
3164
|
-
values:
|
|
3146
|
+
values: hr,
|
|
3165
3147
|
defaultWidth: "wide"
|
|
3166
3148
|
}),
|
|
3167
3149
|
dayPeriod: oe({
|
|
3168
|
-
values:
|
|
3150
|
+
values: mr,
|
|
3169
3151
|
defaultWidth: "wide",
|
|
3170
|
-
formattingValues:
|
|
3152
|
+
formattingValues: pr,
|
|
3171
3153
|
defaultFormattingWidth: "wide"
|
|
3172
3154
|
})
|
|
3173
3155
|
};
|
|
3174
|
-
function ce(
|
|
3156
|
+
function ce(a) {
|
|
3175
3157
|
return (t, e = {}) => {
|
|
3176
|
-
const r = e.width,
|
|
3158
|
+
const r = e.width, n = r && a.matchPatterns[r] || a.matchPatterns[a.defaultMatchWidth], s = t.match(n);
|
|
3177
3159
|
if (!s)
|
|
3178
3160
|
return null;
|
|
3179
|
-
const i = s[0], o = r &&
|
|
3161
|
+
const i = s[0], o = r && a.parsePatterns[r] || a.parsePatterns[a.defaultParseWidth], u = Array.isArray(o) ? vr(o, (k) => k.test(i)) : (
|
|
3180
3162
|
// [TODO] -- I challenge you to fix the type
|
|
3181
|
-
|
|
3163
|
+
_r(o, (k) => k.test(i))
|
|
3182
3164
|
);
|
|
3183
3165
|
let d;
|
|
3184
|
-
d =
|
|
3166
|
+
d = a.valueCallback ? a.valueCallback(u) : u, d = e.valueCallback ? (
|
|
3185
3167
|
// [TODO] -- I challenge you to fix the type
|
|
3186
3168
|
e.valueCallback(d)
|
|
3187
3169
|
) : d;
|
|
@@ -3189,45 +3171,45 @@ function ce(n) {
|
|
|
3189
3171
|
return { value: d, rest: p };
|
|
3190
3172
|
};
|
|
3191
3173
|
}
|
|
3192
|
-
function
|
|
3193
|
-
for (const e in
|
|
3194
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
3174
|
+
function _r(a, t) {
|
|
3175
|
+
for (const e in a)
|
|
3176
|
+
if (Object.prototype.hasOwnProperty.call(a, e) && t(a[e]))
|
|
3195
3177
|
return e;
|
|
3196
3178
|
}
|
|
3197
|
-
function
|
|
3198
|
-
for (let e = 0; e <
|
|
3199
|
-
if (t(
|
|
3179
|
+
function vr(a, t) {
|
|
3180
|
+
for (let e = 0; e < a.length; e++)
|
|
3181
|
+
if (t(a[e]))
|
|
3200
3182
|
return e;
|
|
3201
3183
|
}
|
|
3202
|
-
function
|
|
3184
|
+
function wr(a) {
|
|
3203
3185
|
return (t, e = {}) => {
|
|
3204
|
-
const r = t.match(
|
|
3186
|
+
const r = t.match(a.matchPattern);
|
|
3205
3187
|
if (!r) return null;
|
|
3206
|
-
const
|
|
3188
|
+
const n = r[0], s = t.match(a.parsePattern);
|
|
3207
3189
|
if (!s) return null;
|
|
3208
|
-
let i =
|
|
3190
|
+
let i = a.valueCallback ? a.valueCallback(s[0]) : s[0];
|
|
3209
3191
|
i = e.valueCallback ? e.valueCallback(i) : i;
|
|
3210
|
-
const o = t.slice(
|
|
3192
|
+
const o = t.slice(n.length);
|
|
3211
3193
|
return { value: i, rest: o };
|
|
3212
3194
|
};
|
|
3213
3195
|
}
|
|
3214
|
-
const
|
|
3196
|
+
const br = /^(\d+)(th|st|nd|rd)?/i, xr = /\d+/i, kr = {
|
|
3215
3197
|
narrow: /^(b|a)/i,
|
|
3216
3198
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
3217
3199
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
3218
|
-
},
|
|
3200
|
+
}, Tr = {
|
|
3219
3201
|
any: [/^b/i, /^(a|c)/i]
|
|
3220
|
-
},
|
|
3202
|
+
}, Or = {
|
|
3221
3203
|
narrow: /^[1234]/i,
|
|
3222
3204
|
abbreviated: /^q[1234]/i,
|
|
3223
3205
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
3224
|
-
},
|
|
3206
|
+
}, Pr = {
|
|
3225
3207
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
3226
|
-
},
|
|
3208
|
+
}, Cr = {
|
|
3227
3209
|
narrow: /^[jfmasond]/i,
|
|
3228
3210
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
3229
3211
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
3230
|
-
},
|
|
3212
|
+
}, Mr = {
|
|
3231
3213
|
narrow: [
|
|
3232
3214
|
/^j/i,
|
|
3233
3215
|
/^f/i,
|
|
@@ -3256,18 +3238,18 @@ const Or = /^(\d+)(th|st|nd|rd)?/i, Pr = /\d+/i, Cr = {
|
|
|
3256
3238
|
/^n/i,
|
|
3257
3239
|
/^d/i
|
|
3258
3240
|
]
|
|
3259
|
-
},
|
|
3241
|
+
}, Dr = {
|
|
3260
3242
|
narrow: /^[smtwf]/i,
|
|
3261
3243
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
3262
3244
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
3263
3245
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
3264
|
-
},
|
|
3246
|
+
}, Nr = {
|
|
3265
3247
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
3266
3248
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
3267
|
-
},
|
|
3249
|
+
}, Er = {
|
|
3268
3250
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
3269
3251
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
3270
|
-
},
|
|
3252
|
+
}, Ir = {
|
|
3271
3253
|
any: {
|
|
3272
3254
|
am: /^a/i,
|
|
3273
3255
|
pm: /^p/i,
|
|
@@ -3278,79 +3260,79 @@ const Or = /^(\d+)(th|st|nd|rd)?/i, Pr = /\d+/i, Cr = {
|
|
|
3278
3260
|
evening: /evening/i,
|
|
3279
3261
|
night: /night/i
|
|
3280
3262
|
}
|
|
3281
|
-
},
|
|
3282
|
-
ordinalNumber:
|
|
3283
|
-
matchPattern:
|
|
3284
|
-
parsePattern:
|
|
3285
|
-
valueCallback: (
|
|
3263
|
+
}, Rr = {
|
|
3264
|
+
ordinalNumber: wr({
|
|
3265
|
+
matchPattern: br,
|
|
3266
|
+
parsePattern: xr,
|
|
3267
|
+
valueCallback: (a) => parseInt(a, 10)
|
|
3286
3268
|
}),
|
|
3287
3269
|
era: ce({
|
|
3288
|
-
matchPatterns:
|
|
3270
|
+
matchPatterns: kr,
|
|
3289
3271
|
defaultMatchWidth: "wide",
|
|
3290
|
-
parsePatterns:
|
|
3272
|
+
parsePatterns: Tr,
|
|
3291
3273
|
defaultParseWidth: "any"
|
|
3292
3274
|
}),
|
|
3293
3275
|
quarter: ce({
|
|
3294
|
-
matchPatterns:
|
|
3276
|
+
matchPatterns: Or,
|
|
3295
3277
|
defaultMatchWidth: "wide",
|
|
3296
|
-
parsePatterns:
|
|
3278
|
+
parsePatterns: Pr,
|
|
3297
3279
|
defaultParseWidth: "any",
|
|
3298
|
-
valueCallback: (
|
|
3280
|
+
valueCallback: (a) => a + 1
|
|
3299
3281
|
}),
|
|
3300
3282
|
month: ce({
|
|
3301
|
-
matchPatterns:
|
|
3283
|
+
matchPatterns: Cr,
|
|
3302
3284
|
defaultMatchWidth: "wide",
|
|
3303
|
-
parsePatterns:
|
|
3285
|
+
parsePatterns: Mr,
|
|
3304
3286
|
defaultParseWidth: "any"
|
|
3305
3287
|
}),
|
|
3306
3288
|
day: ce({
|
|
3307
|
-
matchPatterns:
|
|
3289
|
+
matchPatterns: Dr,
|
|
3308
3290
|
defaultMatchWidth: "wide",
|
|
3309
|
-
parsePatterns:
|
|
3291
|
+
parsePatterns: Nr,
|
|
3310
3292
|
defaultParseWidth: "any"
|
|
3311
3293
|
}),
|
|
3312
3294
|
dayPeriod: ce({
|
|
3313
|
-
matchPatterns:
|
|
3295
|
+
matchPatterns: Er,
|
|
3314
3296
|
defaultMatchWidth: "any",
|
|
3315
|
-
parsePatterns:
|
|
3297
|
+
parsePatterns: Ir,
|
|
3316
3298
|
defaultParseWidth: "any"
|
|
3317
3299
|
})
|
|
3318
|
-
},
|
|
3300
|
+
}, Ar = {
|
|
3319
3301
|
code: "en-US",
|
|
3320
|
-
formatDistance:
|
|
3321
|
-
formatLong:
|
|
3322
|
-
formatRelative:
|
|
3323
|
-
localize:
|
|
3324
|
-
match:
|
|
3302
|
+
formatDistance: ar,
|
|
3303
|
+
formatLong: or,
|
|
3304
|
+
formatRelative: ur,
|
|
3305
|
+
localize: gr,
|
|
3306
|
+
match: Rr,
|
|
3325
3307
|
options: {
|
|
3326
3308
|
weekStartsOn: 0,
|
|
3327
3309
|
firstWeekContainsDate: 1
|
|
3328
3310
|
}
|
|
3329
3311
|
};
|
|
3330
|
-
function
|
|
3331
|
-
const e = E(
|
|
3332
|
-
return Math.round(r /
|
|
3312
|
+
function Zr(a, t) {
|
|
3313
|
+
const e = E(a, t == null ? void 0 : t.in), r = +ie(e) - +er(e);
|
|
3314
|
+
return Math.round(r / ft) + 1;
|
|
3333
3315
|
}
|
|
3334
|
-
function
|
|
3316
|
+
function pt(a, t) {
|
|
3335
3317
|
var p, k, A, j;
|
|
3336
|
-
const e = E(
|
|
3318
|
+
const e = E(a, t == null ? void 0 : t.in), r = e.getFullYear(), n = me(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((k = (p = t == null ? void 0 : t.locale) == null ? void 0 : p.options) == null ? void 0 : k.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((j = (A = n.locale) == null ? void 0 : A.options) == null ? void 0 : j.firstWeekContainsDate) ?? 1, i = N((t == null ? void 0 : t.in) || a, 0);
|
|
3337
3319
|
i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
|
|
3338
|
-
const o = X(i, t), u = N((t == null ? void 0 : t.in) ||
|
|
3320
|
+
const o = X(i, t), u = N((t == null ? void 0 : t.in) || a, 0);
|
|
3339
3321
|
u.setFullYear(r, 0, s), u.setHours(0, 0, 0, 0);
|
|
3340
3322
|
const d = X(u, t);
|
|
3341
3323
|
return +e >= +o ? r + 1 : +e >= +d ? r : r - 1;
|
|
3342
3324
|
}
|
|
3343
|
-
function
|
|
3325
|
+
function jr(a, t) {
|
|
3344
3326
|
var o, u, d, p;
|
|
3345
|
-
const e =
|
|
3346
|
-
return s.setFullYear(
|
|
3327
|
+
const e = me(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((p = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : p.firstWeekContainsDate) ?? 1, n = pt(a, t), s = N((t == null ? void 0 : t.in) || a, 0);
|
|
3328
|
+
return s.setFullYear(n, 0, r), s.setHours(0, 0, 0, 0), X(s, t);
|
|
3347
3329
|
}
|
|
3348
|
-
function
|
|
3349
|
-
const e = E(
|
|
3350
|
-
return Math.round(r /
|
|
3330
|
+
function Yr(a, t) {
|
|
3331
|
+
const e = E(a, t == null ? void 0 : t.in), r = +X(e, t) - +jr(e, t);
|
|
3332
|
+
return Math.round(r / ft) + 1;
|
|
3351
3333
|
}
|
|
3352
|
-
const
|
|
3353
|
-
switch (
|
|
3334
|
+
const nt = (a, t) => {
|
|
3335
|
+
switch (a) {
|
|
3354
3336
|
case "P":
|
|
3355
3337
|
return t.date({ width: "short" });
|
|
3356
3338
|
case "PP":
|
|
@@ -3361,8 +3343,8 @@ const ot = (n, t) => {
|
|
|
3361
3343
|
default:
|
|
3362
3344
|
return t.date({ width: "full" });
|
|
3363
3345
|
}
|
|
3364
|
-
},
|
|
3365
|
-
switch (
|
|
3346
|
+
}, yt = (a, t) => {
|
|
3347
|
+
switch (a) {
|
|
3366
3348
|
case "p":
|
|
3367
3349
|
return t.time({ width: "short" });
|
|
3368
3350
|
case "pp":
|
|
@@ -3373,10 +3355,10 @@ const ot = (n, t) => {
|
|
|
3373
3355
|
default:
|
|
3374
3356
|
return t.time({ width: "full" });
|
|
3375
3357
|
}
|
|
3376
|
-
},
|
|
3377
|
-
const e =
|
|
3378
|
-
if (!
|
|
3379
|
-
return
|
|
3358
|
+
}, Wr = (a, t) => {
|
|
3359
|
+
const e = a.match(/(P+)(p+)?/) || [], r = e[1], n = e[2];
|
|
3360
|
+
if (!n)
|
|
3361
|
+
return nt(a, t);
|
|
3380
3362
|
let s;
|
|
3381
3363
|
switch (r) {
|
|
3382
3364
|
case "P":
|
|
@@ -3393,47 +3375,47 @@ const ot = (n, t) => {
|
|
|
3393
3375
|
s = t.dateTime({ width: "full" });
|
|
3394
3376
|
break;
|
|
3395
3377
|
}
|
|
3396
|
-
return s.replace("{{date}}",
|
|
3397
|
-
},
|
|
3398
|
-
p:
|
|
3399
|
-
P:
|
|
3400
|
-
},
|
|
3401
|
-
function
|
|
3402
|
-
return
|
|
3378
|
+
return s.replace("{{date}}", nt(r, t)).replace("{{time}}", yt(n, t));
|
|
3379
|
+
}, st = {
|
|
3380
|
+
p: yt,
|
|
3381
|
+
P: Wr
|
|
3382
|
+
}, $r = /^D+$/, Lr = /^Y+$/, Sr = ["D", "DD", "YY", "YYYY"];
|
|
3383
|
+
function Vr(a) {
|
|
3384
|
+
return $r.test(a);
|
|
3403
3385
|
}
|
|
3404
|
-
function
|
|
3405
|
-
return
|
|
3386
|
+
function Fr(a) {
|
|
3387
|
+
return Lr.test(a);
|
|
3406
3388
|
}
|
|
3407
|
-
function
|
|
3408
|
-
const r =
|
|
3409
|
-
if (console.warn(r),
|
|
3389
|
+
function it(a, t, e) {
|
|
3390
|
+
const r = zr(a, t, e);
|
|
3391
|
+
if (console.warn(r), Sr.includes(a)) throw new RangeError(r);
|
|
3410
3392
|
}
|
|
3411
|
-
function
|
|
3412
|
-
const r =
|
|
3413
|
-
return `Use \`${
|
|
3393
|
+
function zr(a, t, e) {
|
|
3394
|
+
const r = a[0] === "Y" ? "years" : "days of the month";
|
|
3395
|
+
return `Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
3414
3396
|
}
|
|
3415
|
-
function
|
|
3416
|
-
return Object.assign({},
|
|
3397
|
+
function qr() {
|
|
3398
|
+
return Object.assign({}, me());
|
|
3417
3399
|
}
|
|
3418
|
-
function
|
|
3419
|
-
const e = E(
|
|
3400
|
+
function Hr(a, t) {
|
|
3401
|
+
const e = E(a, t == null ? void 0 : t.in).getDay();
|
|
3420
3402
|
return e === 0 ? 7 : e;
|
|
3421
3403
|
}
|
|
3422
|
-
function
|
|
3423
|
-
const e =
|
|
3424
|
-
return e.setFullYear(
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3404
|
+
function Br(a, t) {
|
|
3405
|
+
const e = Qr(t) ? new t(0) : N(t, 0);
|
|
3406
|
+
return e.setFullYear(a.getFullYear(), a.getMonth(), a.getDate()), e.setHours(
|
|
3407
|
+
a.getHours(),
|
|
3408
|
+
a.getMinutes(),
|
|
3409
|
+
a.getSeconds(),
|
|
3410
|
+
a.getMilliseconds()
|
|
3429
3411
|
), e;
|
|
3430
3412
|
}
|
|
3431
|
-
function
|
|
3413
|
+
function Qr(a) {
|
|
3432
3414
|
var t;
|
|
3433
|
-
return typeof
|
|
3415
|
+
return typeof a == "function" && ((t = a.prototype) == null ? void 0 : t.constructor) === a;
|
|
3434
3416
|
}
|
|
3435
|
-
const
|
|
3436
|
-
class
|
|
3417
|
+
const Ur = 10;
|
|
3418
|
+
class gt {
|
|
3437
3419
|
constructor() {
|
|
3438
3420
|
f(this, "subPriority", 0);
|
|
3439
3421
|
}
|
|
@@ -3441,9 +3423,9 @@ class bt {
|
|
|
3441
3423
|
return !0;
|
|
3442
3424
|
}
|
|
3443
3425
|
}
|
|
3444
|
-
class
|
|
3445
|
-
constructor(t, e, r,
|
|
3446
|
-
super(), this.value = t, this.validateValue = e, this.setValue = r, this.priority =
|
|
3426
|
+
class Xr extends gt {
|
|
3427
|
+
constructor(t, e, r, n, s) {
|
|
3428
|
+
super(), this.value = t, this.validateValue = e, this.setValue = r, this.priority = n, s && (this.subPriority = s);
|
|
3447
3429
|
}
|
|
3448
3430
|
validate(t, e) {
|
|
3449
3431
|
return this.validateValue(t, this.value, e);
|
|
@@ -3452,22 +3434,22 @@ class en extends bt {
|
|
|
3452
3434
|
return this.setValue(t, e, this.value, r);
|
|
3453
3435
|
}
|
|
3454
3436
|
}
|
|
3455
|
-
class
|
|
3437
|
+
class Gr extends gt {
|
|
3456
3438
|
constructor(e, r) {
|
|
3457
3439
|
super();
|
|
3458
|
-
f(this, "priority",
|
|
3440
|
+
f(this, "priority", Ur);
|
|
3459
3441
|
f(this, "subPriority", -1);
|
|
3460
|
-
this.context = e || ((
|
|
3442
|
+
this.context = e || ((n) => N(r, n));
|
|
3461
3443
|
}
|
|
3462
3444
|
set(e, r) {
|
|
3463
|
-
return r.timestampIsSet ? e : N(e,
|
|
3445
|
+
return r.timestampIsSet ? e : N(e, Br(e, this.context));
|
|
3464
3446
|
}
|
|
3465
3447
|
}
|
|
3466
3448
|
class x {
|
|
3467
|
-
run(t, e, r,
|
|
3468
|
-
const s = this.parse(t, e, r,
|
|
3449
|
+
run(t, e, r, n) {
|
|
3450
|
+
const s = this.parse(t, e, r, n);
|
|
3469
3451
|
return s ? {
|
|
3470
|
-
setter: new
|
|
3452
|
+
setter: new Xr(
|
|
3471
3453
|
s.value,
|
|
3472
3454
|
this.validate,
|
|
3473
3455
|
this.set,
|
|
@@ -3481,30 +3463,30 @@ class x {
|
|
|
3481
3463
|
return !0;
|
|
3482
3464
|
}
|
|
3483
3465
|
}
|
|
3484
|
-
class
|
|
3466
|
+
class Jr extends x {
|
|
3485
3467
|
constructor() {
|
|
3486
3468
|
super(...arguments);
|
|
3487
3469
|
f(this, "priority", 140);
|
|
3488
3470
|
f(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
3489
3471
|
}
|
|
3490
|
-
parse(e, r,
|
|
3472
|
+
parse(e, r, n) {
|
|
3491
3473
|
switch (r) {
|
|
3492
3474
|
// AD, BC
|
|
3493
3475
|
case "G":
|
|
3494
3476
|
case "GG":
|
|
3495
3477
|
case "GGG":
|
|
3496
|
-
return
|
|
3478
|
+
return n.era(e, { width: "abbreviated" }) || n.era(e, { width: "narrow" });
|
|
3497
3479
|
// A, B
|
|
3498
3480
|
case "GGGGG":
|
|
3499
|
-
return
|
|
3481
|
+
return n.era(e, { width: "narrow" });
|
|
3500
3482
|
// Anno Domini, Before Christ
|
|
3501
3483
|
case "GGGG":
|
|
3502
3484
|
default:
|
|
3503
|
-
return
|
|
3485
|
+
return n.era(e, { width: "wide" }) || n.era(e, { width: "abbreviated" }) || n.era(e, { width: "narrow" });
|
|
3504
3486
|
}
|
|
3505
3487
|
}
|
|
3506
|
-
set(e, r,
|
|
3507
|
-
return r.era =
|
|
3488
|
+
set(e, r, n) {
|
|
3489
|
+
return r.era = n, e.setFullYear(n, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3508
3490
|
}
|
|
3509
3491
|
}
|
|
3510
3492
|
const M = {
|
|
@@ -3545,28 +3527,28 @@ const M = {
|
|
|
3545
3527
|
// 0 to 999, -0 to -999
|
|
3546
3528
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
3547
3529
|
// 0 to 9999, -0 to -9999
|
|
3548
|
-
},
|
|
3530
|
+
}, W = {
|
|
3549
3531
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
3550
3532
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
3551
3533
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
3552
3534
|
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
3553
3535
|
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
3554
3536
|
};
|
|
3555
|
-
function D(
|
|
3556
|
-
return
|
|
3557
|
-
value: t(
|
|
3558
|
-
rest:
|
|
3537
|
+
function D(a, t) {
|
|
3538
|
+
return a && {
|
|
3539
|
+
value: t(a.value),
|
|
3540
|
+
rest: a.rest
|
|
3559
3541
|
};
|
|
3560
3542
|
}
|
|
3561
|
-
function T(
|
|
3562
|
-
const e = t.match(
|
|
3543
|
+
function T(a, t) {
|
|
3544
|
+
const e = t.match(a);
|
|
3563
3545
|
return e ? {
|
|
3564
3546
|
value: parseInt(e[0], 10),
|
|
3565
3547
|
rest: t.slice(e[0].length)
|
|
3566
3548
|
} : null;
|
|
3567
3549
|
}
|
|
3568
|
-
function $(
|
|
3569
|
-
const e = t.match(
|
|
3550
|
+
function $(a, t) {
|
|
3551
|
+
const e = t.match(a);
|
|
3570
3552
|
if (!e)
|
|
3571
3553
|
return null;
|
|
3572
3554
|
if (e[0] === "Z")
|
|
@@ -3574,17 +3556,17 @@ function $(n, t) {
|
|
|
3574
3556
|
value: 0,
|
|
3575
3557
|
rest: t.slice(1)
|
|
3576
3558
|
};
|
|
3577
|
-
const r = e[1] === "+" ? 1 : -1,
|
|
3559
|
+
const r = e[1] === "+" ? 1 : -1, n = e[2] ? parseInt(e[2], 10) : 0, s = e[3] ? parseInt(e[3], 10) : 0, i = e[5] ? parseInt(e[5], 10) : 0;
|
|
3578
3560
|
return {
|
|
3579
|
-
value: r * (
|
|
3561
|
+
value: r * (n * Xt + s * Ut + i * Gt),
|
|
3580
3562
|
rest: t.slice(e[0].length)
|
|
3581
3563
|
};
|
|
3582
3564
|
}
|
|
3583
|
-
function
|
|
3584
|
-
return T(M.anyDigitsSigned,
|
|
3565
|
+
function _t(a) {
|
|
3566
|
+
return T(M.anyDigitsSigned, a);
|
|
3585
3567
|
}
|
|
3586
|
-
function C(
|
|
3587
|
-
switch (
|
|
3568
|
+
function C(a, t) {
|
|
3569
|
+
switch (a) {
|
|
3588
3570
|
case 1:
|
|
3589
3571
|
return T(M.singleDigit, t);
|
|
3590
3572
|
case 2:
|
|
@@ -3594,11 +3576,11 @@ function C(n, t) {
|
|
|
3594
3576
|
case 4:
|
|
3595
3577
|
return T(M.fourDigits, t);
|
|
3596
3578
|
default:
|
|
3597
|
-
return T(new RegExp("^\\d{1," +
|
|
3579
|
+
return T(new RegExp("^\\d{1," + a + "}"), t);
|
|
3598
3580
|
}
|
|
3599
3581
|
}
|
|
3600
|
-
function
|
|
3601
|
-
switch (
|
|
3582
|
+
function Me(a, t) {
|
|
3583
|
+
switch (a) {
|
|
3602
3584
|
case 1:
|
|
3603
3585
|
return T(M.singleDigitSigned, t);
|
|
3604
3586
|
case 2:
|
|
@@ -3608,11 +3590,11 @@ function Ee(n, t) {
|
|
|
3608
3590
|
case 4:
|
|
3609
3591
|
return T(M.fourDigitsSigned, t);
|
|
3610
3592
|
default:
|
|
3611
|
-
return T(new RegExp("^-?\\d{1," +
|
|
3593
|
+
return T(new RegExp("^-?\\d{1," + a + "}"), t);
|
|
3612
3594
|
}
|
|
3613
3595
|
}
|
|
3614
|
-
function
|
|
3615
|
-
switch (
|
|
3596
|
+
function Ve(a) {
|
|
3597
|
+
switch (a) {
|
|
3616
3598
|
case "morning":
|
|
3617
3599
|
return 4;
|
|
3618
3600
|
case "evening":
|
|
@@ -3628,27 +3610,27 @@ function qe(n) {
|
|
|
3628
3610
|
return 0;
|
|
3629
3611
|
}
|
|
3630
3612
|
}
|
|
3631
|
-
function
|
|
3613
|
+
function vt(a, t) {
|
|
3632
3614
|
const e = t > 0, r = e ? t : 1 - t;
|
|
3633
|
-
let
|
|
3615
|
+
let n;
|
|
3634
3616
|
if (r <= 50)
|
|
3635
|
-
|
|
3617
|
+
n = a || 100;
|
|
3636
3618
|
else {
|
|
3637
|
-
const s = r + 50, i = Math.trunc(s / 100) * 100, o =
|
|
3638
|
-
|
|
3619
|
+
const s = r + 50, i = Math.trunc(s / 100) * 100, o = a >= s % 100;
|
|
3620
|
+
n = a + i - (o ? 100 : 0);
|
|
3639
3621
|
}
|
|
3640
|
-
return e ?
|
|
3622
|
+
return e ? n : 1 - n;
|
|
3641
3623
|
}
|
|
3642
|
-
function
|
|
3643
|
-
return
|
|
3624
|
+
function wt(a) {
|
|
3625
|
+
return a % 400 === 0 || a % 4 === 0 && a % 100 !== 0;
|
|
3644
3626
|
}
|
|
3645
|
-
class
|
|
3627
|
+
class Kr extends x {
|
|
3646
3628
|
constructor() {
|
|
3647
3629
|
super(...arguments);
|
|
3648
3630
|
f(this, "priority", 130);
|
|
3649
3631
|
f(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
3650
3632
|
}
|
|
3651
|
-
parse(e, r,
|
|
3633
|
+
parse(e, r, n) {
|
|
3652
3634
|
const s = (i) => ({
|
|
3653
3635
|
year: i,
|
|
3654
3636
|
isTwoDigitYear: r === "yy"
|
|
@@ -3658,7 +3640,7 @@ class nn extends x {
|
|
|
3658
3640
|
return D(C(4, e), s);
|
|
3659
3641
|
case "yo":
|
|
3660
3642
|
return D(
|
|
3661
|
-
|
|
3643
|
+
n.ordinalNumber(e, {
|
|
3662
3644
|
unit: "year"
|
|
3663
3645
|
}),
|
|
3664
3646
|
s
|
|
@@ -3670,20 +3652,20 @@ class nn extends x {
|
|
|
3670
3652
|
validate(e, r) {
|
|
3671
3653
|
return r.isTwoDigitYear || r.year > 0;
|
|
3672
3654
|
}
|
|
3673
|
-
set(e, r,
|
|
3655
|
+
set(e, r, n) {
|
|
3674
3656
|
const s = e.getFullYear();
|
|
3675
|
-
if (
|
|
3676
|
-
const o =
|
|
3677
|
-
|
|
3657
|
+
if (n.isTwoDigitYear) {
|
|
3658
|
+
const o = vt(
|
|
3659
|
+
n.year,
|
|
3678
3660
|
s
|
|
3679
3661
|
);
|
|
3680
3662
|
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3681
3663
|
}
|
|
3682
|
-
const i = !("era" in r) || r.era === 1 ?
|
|
3664
|
+
const i = !("era" in r) || r.era === 1 ? n.year : 1 - n.year;
|
|
3683
3665
|
return e.setFullYear(i, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3684
3666
|
}
|
|
3685
3667
|
}
|
|
3686
|
-
class
|
|
3668
|
+
class ea extends x {
|
|
3687
3669
|
constructor() {
|
|
3688
3670
|
super(...arguments);
|
|
3689
3671
|
f(this, "priority", 130);
|
|
@@ -3703,7 +3685,7 @@ class an extends x {
|
|
|
3703
3685
|
"T"
|
|
3704
3686
|
]);
|
|
3705
3687
|
}
|
|
3706
|
-
parse(e, r,
|
|
3688
|
+
parse(e, r, n) {
|
|
3707
3689
|
const s = (i) => ({
|
|
3708
3690
|
year: i,
|
|
3709
3691
|
isTwoDigitYear: r === "YY"
|
|
@@ -3713,7 +3695,7 @@ class an extends x {
|
|
|
3713
3695
|
return D(C(4, e), s);
|
|
3714
3696
|
case "Yo":
|
|
3715
3697
|
return D(
|
|
3716
|
-
|
|
3698
|
+
n.ordinalNumber(e, {
|
|
3717
3699
|
unit: "year"
|
|
3718
3700
|
}),
|
|
3719
3701
|
s
|
|
@@ -3725,11 +3707,11 @@ class an extends x {
|
|
|
3725
3707
|
validate(e, r) {
|
|
3726
3708
|
return r.isTwoDigitYear || r.year > 0;
|
|
3727
3709
|
}
|
|
3728
|
-
set(e, r,
|
|
3729
|
-
const i =
|
|
3730
|
-
if (
|
|
3731
|
-
const u =
|
|
3732
|
-
|
|
3710
|
+
set(e, r, n, s) {
|
|
3711
|
+
const i = pt(e, s);
|
|
3712
|
+
if (n.isTwoDigitYear) {
|
|
3713
|
+
const u = vt(
|
|
3714
|
+
n.year,
|
|
3733
3715
|
i
|
|
3734
3716
|
);
|
|
3735
3717
|
return e.setFullYear(
|
|
@@ -3738,11 +3720,11 @@ class an extends x {
|
|
|
3738
3720
|
s.firstWeekContainsDate
|
|
3739
3721
|
), e.setHours(0, 0, 0, 0), X(e, s);
|
|
3740
3722
|
}
|
|
3741
|
-
const o = !("era" in r) || r.era === 1 ?
|
|
3723
|
+
const o = !("era" in r) || r.era === 1 ? n.year : 1 - n.year;
|
|
3742
3724
|
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), X(e, s);
|
|
3743
3725
|
}
|
|
3744
3726
|
}
|
|
3745
|
-
class
|
|
3727
|
+
class ta extends x {
|
|
3746
3728
|
constructor() {
|
|
3747
3729
|
super(...arguments);
|
|
3748
3730
|
f(this, "priority", 130);
|
|
@@ -3765,27 +3747,27 @@ class sn extends x {
|
|
|
3765
3747
|
]);
|
|
3766
3748
|
}
|
|
3767
3749
|
parse(e, r) {
|
|
3768
|
-
return
|
|
3750
|
+
return Me(r === "R" ? 4 : r.length, e);
|
|
3769
3751
|
}
|
|
3770
|
-
set(e, r,
|
|
3752
|
+
set(e, r, n) {
|
|
3771
3753
|
const s = N(e, 0);
|
|
3772
|
-
return s.setFullYear(
|
|
3754
|
+
return s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0), ie(s);
|
|
3773
3755
|
}
|
|
3774
3756
|
}
|
|
3775
|
-
class
|
|
3757
|
+
class ra extends x {
|
|
3776
3758
|
constructor() {
|
|
3777
3759
|
super(...arguments);
|
|
3778
3760
|
f(this, "priority", 130);
|
|
3779
3761
|
f(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
3780
3762
|
}
|
|
3781
3763
|
parse(e, r) {
|
|
3782
|
-
return
|
|
3764
|
+
return Me(r === "u" ? 4 : r.length, e);
|
|
3783
3765
|
}
|
|
3784
|
-
set(e, r,
|
|
3785
|
-
return e.setFullYear(
|
|
3766
|
+
set(e, r, n) {
|
|
3767
|
+
return e.setFullYear(n, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3786
3768
|
}
|
|
3787
3769
|
}
|
|
3788
|
-
class
|
|
3770
|
+
class aa extends x {
|
|
3789
3771
|
constructor() {
|
|
3790
3772
|
super(...arguments);
|
|
3791
3773
|
f(this, "priority", 120);
|
|
@@ -3806,7 +3788,7 @@ class cn extends x {
|
|
|
3806
3788
|
"T"
|
|
3807
3789
|
]);
|
|
3808
3790
|
}
|
|
3809
|
-
parse(e, r,
|
|
3791
|
+
parse(e, r, n) {
|
|
3810
3792
|
switch (r) {
|
|
3811
3793
|
// 1, 2, 3, 4
|
|
3812
3794
|
case "Q":
|
|
@@ -3814,32 +3796,32 @@ class cn extends x {
|
|
|
3814
3796
|
return C(r.length, e);
|
|
3815
3797
|
// 1st, 2nd, 3rd, 4th
|
|
3816
3798
|
case "Qo":
|
|
3817
|
-
return
|
|
3799
|
+
return n.ordinalNumber(e, { unit: "quarter" });
|
|
3818
3800
|
// Q1, Q2, Q3, Q4
|
|
3819
3801
|
case "QQQ":
|
|
3820
|
-
return
|
|
3802
|
+
return n.quarter(e, {
|
|
3821
3803
|
width: "abbreviated",
|
|
3822
3804
|
context: "formatting"
|
|
3823
|
-
}) ||
|
|
3805
|
+
}) || n.quarter(e, {
|
|
3824
3806
|
width: "narrow",
|
|
3825
3807
|
context: "formatting"
|
|
3826
3808
|
});
|
|
3827
3809
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
3828
3810
|
case "QQQQQ":
|
|
3829
|
-
return
|
|
3811
|
+
return n.quarter(e, {
|
|
3830
3812
|
width: "narrow",
|
|
3831
3813
|
context: "formatting"
|
|
3832
3814
|
});
|
|
3833
3815
|
// 1st quarter, 2nd quarter, ...
|
|
3834
3816
|
case "QQQQ":
|
|
3835
3817
|
default:
|
|
3836
|
-
return
|
|
3818
|
+
return n.quarter(e, {
|
|
3837
3819
|
width: "wide",
|
|
3838
3820
|
context: "formatting"
|
|
3839
|
-
}) ||
|
|
3821
|
+
}) || n.quarter(e, {
|
|
3840
3822
|
width: "abbreviated",
|
|
3841
3823
|
context: "formatting"
|
|
3842
|
-
}) ||
|
|
3824
|
+
}) || n.quarter(e, {
|
|
3843
3825
|
width: "narrow",
|
|
3844
3826
|
context: "formatting"
|
|
3845
3827
|
});
|
|
@@ -3848,11 +3830,11 @@ class cn extends x {
|
|
|
3848
3830
|
validate(e, r) {
|
|
3849
3831
|
return r >= 1 && r <= 4;
|
|
3850
3832
|
}
|
|
3851
|
-
set(e, r,
|
|
3852
|
-
return e.setMonth((
|
|
3833
|
+
set(e, r, n) {
|
|
3834
|
+
return e.setMonth((n - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
3853
3835
|
}
|
|
3854
3836
|
}
|
|
3855
|
-
class
|
|
3837
|
+
class na extends x {
|
|
3856
3838
|
constructor() {
|
|
3857
3839
|
super(...arguments);
|
|
3858
3840
|
f(this, "priority", 120);
|
|
@@ -3873,7 +3855,7 @@ class un extends x {
|
|
|
3873
3855
|
"T"
|
|
3874
3856
|
]);
|
|
3875
3857
|
}
|
|
3876
|
-
parse(e, r,
|
|
3858
|
+
parse(e, r, n) {
|
|
3877
3859
|
switch (r) {
|
|
3878
3860
|
// 1, 2, 3, 4
|
|
3879
3861
|
case "q":
|
|
@@ -3881,32 +3863,32 @@ class un extends x {
|
|
|
3881
3863
|
return C(r.length, e);
|
|
3882
3864
|
// 1st, 2nd, 3rd, 4th
|
|
3883
3865
|
case "qo":
|
|
3884
|
-
return
|
|
3866
|
+
return n.ordinalNumber(e, { unit: "quarter" });
|
|
3885
3867
|
// Q1, Q2, Q3, Q4
|
|
3886
3868
|
case "qqq":
|
|
3887
|
-
return
|
|
3869
|
+
return n.quarter(e, {
|
|
3888
3870
|
width: "abbreviated",
|
|
3889
3871
|
context: "standalone"
|
|
3890
|
-
}) ||
|
|
3872
|
+
}) || n.quarter(e, {
|
|
3891
3873
|
width: "narrow",
|
|
3892
3874
|
context: "standalone"
|
|
3893
3875
|
});
|
|
3894
3876
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
3895
3877
|
case "qqqqq":
|
|
3896
|
-
return
|
|
3878
|
+
return n.quarter(e, {
|
|
3897
3879
|
width: "narrow",
|
|
3898
3880
|
context: "standalone"
|
|
3899
3881
|
});
|
|
3900
3882
|
// 1st quarter, 2nd quarter, ...
|
|
3901
3883
|
case "qqqq":
|
|
3902
3884
|
default:
|
|
3903
|
-
return
|
|
3885
|
+
return n.quarter(e, {
|
|
3904
3886
|
width: "wide",
|
|
3905
3887
|
context: "standalone"
|
|
3906
|
-
}) ||
|
|
3888
|
+
}) || n.quarter(e, {
|
|
3907
3889
|
width: "abbreviated",
|
|
3908
3890
|
context: "standalone"
|
|
3909
|
-
}) ||
|
|
3891
|
+
}) || n.quarter(e, {
|
|
3910
3892
|
width: "narrow",
|
|
3911
3893
|
context: "standalone"
|
|
3912
3894
|
});
|
|
@@ -3915,11 +3897,11 @@ class un extends x {
|
|
|
3915
3897
|
validate(e, r) {
|
|
3916
3898
|
return r >= 1 && r <= 4;
|
|
3917
3899
|
}
|
|
3918
|
-
set(e, r,
|
|
3919
|
-
return e.setMonth((
|
|
3900
|
+
set(e, r, n) {
|
|
3901
|
+
return e.setMonth((n - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
3920
3902
|
}
|
|
3921
3903
|
}
|
|
3922
|
-
class
|
|
3904
|
+
class sa extends x {
|
|
3923
3905
|
constructor() {
|
|
3924
3906
|
super(...arguments);
|
|
3925
3907
|
f(this, "incompatibleTokens", [
|
|
@@ -3939,7 +3921,7 @@ class dn extends x {
|
|
|
3939
3921
|
]);
|
|
3940
3922
|
f(this, "priority", 110);
|
|
3941
3923
|
}
|
|
3942
|
-
parse(e, r,
|
|
3924
|
+
parse(e, r, n) {
|
|
3943
3925
|
const s = (i) => i - 1;
|
|
3944
3926
|
switch (r) {
|
|
3945
3927
|
// 1, 2, ..., 12
|
|
@@ -3954,40 +3936,40 @@ class dn extends x {
|
|
|
3954
3936
|
// 1st, 2nd, ..., 12th
|
|
3955
3937
|
case "Mo":
|
|
3956
3938
|
return D(
|
|
3957
|
-
|
|
3939
|
+
n.ordinalNumber(e, {
|
|
3958
3940
|
unit: "month"
|
|
3959
3941
|
}),
|
|
3960
3942
|
s
|
|
3961
3943
|
);
|
|
3962
3944
|
// Jan, Feb, ..., Dec
|
|
3963
3945
|
case "MMM":
|
|
3964
|
-
return
|
|
3946
|
+
return n.month(e, {
|
|
3965
3947
|
width: "abbreviated",
|
|
3966
3948
|
context: "formatting"
|
|
3967
|
-
}) ||
|
|
3949
|
+
}) || n.month(e, { width: "narrow", context: "formatting" });
|
|
3968
3950
|
// J, F, ..., D
|
|
3969
3951
|
case "MMMMM":
|
|
3970
|
-
return
|
|
3952
|
+
return n.month(e, {
|
|
3971
3953
|
width: "narrow",
|
|
3972
3954
|
context: "formatting"
|
|
3973
3955
|
});
|
|
3974
3956
|
// January, February, ..., December
|
|
3975
3957
|
case "MMMM":
|
|
3976
3958
|
default:
|
|
3977
|
-
return
|
|
3959
|
+
return n.month(e, { width: "wide", context: "formatting" }) || n.month(e, {
|
|
3978
3960
|
width: "abbreviated",
|
|
3979
3961
|
context: "formatting"
|
|
3980
|
-
}) ||
|
|
3962
|
+
}) || n.month(e, { width: "narrow", context: "formatting" });
|
|
3981
3963
|
}
|
|
3982
3964
|
}
|
|
3983
3965
|
validate(e, r) {
|
|
3984
3966
|
return r >= 0 && r <= 11;
|
|
3985
3967
|
}
|
|
3986
|
-
set(e, r,
|
|
3987
|
-
return e.setMonth(
|
|
3968
|
+
set(e, r, n) {
|
|
3969
|
+
return e.setMonth(n, 1), e.setHours(0, 0, 0, 0), e;
|
|
3988
3970
|
}
|
|
3989
3971
|
}
|
|
3990
|
-
class
|
|
3972
|
+
class ia extends x {
|
|
3991
3973
|
constructor() {
|
|
3992
3974
|
super(...arguments);
|
|
3993
3975
|
f(this, "priority", 110);
|
|
@@ -4007,7 +3989,7 @@ class ln extends x {
|
|
|
4007
3989
|
"T"
|
|
4008
3990
|
]);
|
|
4009
3991
|
}
|
|
4010
|
-
parse(e, r,
|
|
3992
|
+
parse(e, r, n) {
|
|
4011
3993
|
const s = (i) => i - 1;
|
|
4012
3994
|
switch (r) {
|
|
4013
3995
|
// 1, 2, ..., 12
|
|
@@ -4022,44 +4004,44 @@ class ln extends x {
|
|
|
4022
4004
|
// 1st, 2nd, ..., 12th
|
|
4023
4005
|
case "Lo":
|
|
4024
4006
|
return D(
|
|
4025
|
-
|
|
4007
|
+
n.ordinalNumber(e, {
|
|
4026
4008
|
unit: "month"
|
|
4027
4009
|
}),
|
|
4028
4010
|
s
|
|
4029
4011
|
);
|
|
4030
4012
|
// Jan, Feb, ..., Dec
|
|
4031
4013
|
case "LLL":
|
|
4032
|
-
return
|
|
4014
|
+
return n.month(e, {
|
|
4033
4015
|
width: "abbreviated",
|
|
4034
4016
|
context: "standalone"
|
|
4035
|
-
}) ||
|
|
4017
|
+
}) || n.month(e, { width: "narrow", context: "standalone" });
|
|
4036
4018
|
// J, F, ..., D
|
|
4037
4019
|
case "LLLLL":
|
|
4038
|
-
return
|
|
4020
|
+
return n.month(e, {
|
|
4039
4021
|
width: "narrow",
|
|
4040
4022
|
context: "standalone"
|
|
4041
4023
|
});
|
|
4042
4024
|
// January, February, ..., December
|
|
4043
4025
|
case "LLLL":
|
|
4044
4026
|
default:
|
|
4045
|
-
return
|
|
4027
|
+
return n.month(e, { width: "wide", context: "standalone" }) || n.month(e, {
|
|
4046
4028
|
width: "abbreviated",
|
|
4047
4029
|
context: "standalone"
|
|
4048
|
-
}) ||
|
|
4030
|
+
}) || n.month(e, { width: "narrow", context: "standalone" });
|
|
4049
4031
|
}
|
|
4050
4032
|
}
|
|
4051
4033
|
validate(e, r) {
|
|
4052
4034
|
return r >= 0 && r <= 11;
|
|
4053
4035
|
}
|
|
4054
|
-
set(e, r,
|
|
4055
|
-
return e.setMonth(
|
|
4036
|
+
set(e, r, n) {
|
|
4037
|
+
return e.setMonth(n, 1), e.setHours(0, 0, 0, 0), e;
|
|
4056
4038
|
}
|
|
4057
4039
|
}
|
|
4058
|
-
function
|
|
4059
|
-
const r = E(
|
|
4060
|
-
return r.setDate(r.getDate() -
|
|
4040
|
+
function oa(a, t, e) {
|
|
4041
|
+
const r = E(a, e == null ? void 0 : e.in), n = Yr(r, e) - t;
|
|
4042
|
+
return r.setDate(r.getDate() - n * 7), E(r, e == null ? void 0 : e.in);
|
|
4061
4043
|
}
|
|
4062
|
-
class
|
|
4044
|
+
class ca extends x {
|
|
4063
4045
|
constructor() {
|
|
4064
4046
|
super(...arguments);
|
|
4065
4047
|
f(this, "priority", 100);
|
|
@@ -4079,12 +4061,12 @@ class hn extends x {
|
|
|
4079
4061
|
"T"
|
|
4080
4062
|
]);
|
|
4081
4063
|
}
|
|
4082
|
-
parse(e, r,
|
|
4064
|
+
parse(e, r, n) {
|
|
4083
4065
|
switch (r) {
|
|
4084
4066
|
case "w":
|
|
4085
4067
|
return T(M.week, e);
|
|
4086
4068
|
case "wo":
|
|
4087
|
-
return
|
|
4069
|
+
return n.ordinalNumber(e, { unit: "week" });
|
|
4088
4070
|
default:
|
|
4089
4071
|
return C(r.length, e);
|
|
4090
4072
|
}
|
|
@@ -4092,15 +4074,15 @@ class hn extends x {
|
|
|
4092
4074
|
validate(e, r) {
|
|
4093
4075
|
return r >= 1 && r <= 53;
|
|
4094
4076
|
}
|
|
4095
|
-
set(e, r,
|
|
4096
|
-
return X(
|
|
4077
|
+
set(e, r, n, s) {
|
|
4078
|
+
return X(oa(e, n, s), s);
|
|
4097
4079
|
}
|
|
4098
4080
|
}
|
|
4099
|
-
function
|
|
4100
|
-
const r = E(
|
|
4101
|
-
return r.setDate(r.getDate() -
|
|
4081
|
+
function ua(a, t, e) {
|
|
4082
|
+
const r = E(a, e == null ? void 0 : e.in), n = Zr(r, e) - t;
|
|
4083
|
+
return r.setDate(r.getDate() - n * 7), r;
|
|
4102
4084
|
}
|
|
4103
|
-
class
|
|
4085
|
+
class da extends x {
|
|
4104
4086
|
constructor() {
|
|
4105
4087
|
super(...arguments);
|
|
4106
4088
|
f(this, "priority", 100);
|
|
@@ -4121,12 +4103,12 @@ class pn extends x {
|
|
|
4121
4103
|
"T"
|
|
4122
4104
|
]);
|
|
4123
4105
|
}
|
|
4124
|
-
parse(e, r,
|
|
4106
|
+
parse(e, r, n) {
|
|
4125
4107
|
switch (r) {
|
|
4126
4108
|
case "I":
|
|
4127
4109
|
return T(M.week, e);
|
|
4128
4110
|
case "Io":
|
|
4129
|
-
return
|
|
4111
|
+
return n.ordinalNumber(e, { unit: "week" });
|
|
4130
4112
|
default:
|
|
4131
4113
|
return C(r.length, e);
|
|
4132
4114
|
}
|
|
@@ -4134,11 +4116,11 @@ class pn extends x {
|
|
|
4134
4116
|
validate(e, r) {
|
|
4135
4117
|
return r >= 1 && r <= 53;
|
|
4136
4118
|
}
|
|
4137
|
-
set(e, r,
|
|
4138
|
-
return ie(
|
|
4119
|
+
set(e, r, n) {
|
|
4120
|
+
return ie(ua(e, n));
|
|
4139
4121
|
}
|
|
4140
4122
|
}
|
|
4141
|
-
const
|
|
4123
|
+
const la = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], fa = [
|
|
4142
4124
|
31,
|
|
4143
4125
|
29,
|
|
4144
4126
|
31,
|
|
@@ -4152,7 +4134,7 @@ const yn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gn = [
|
|
|
4152
4134
|
30,
|
|
4153
4135
|
31
|
|
4154
4136
|
];
|
|
4155
|
-
class
|
|
4137
|
+
class ha extends x {
|
|
4156
4138
|
constructor() {
|
|
4157
4139
|
super(...arguments);
|
|
4158
4140
|
f(this, "priority", 90);
|
|
@@ -4172,25 +4154,25 @@ class _n extends x {
|
|
|
4172
4154
|
"T"
|
|
4173
4155
|
]);
|
|
4174
4156
|
}
|
|
4175
|
-
parse(e, r,
|
|
4157
|
+
parse(e, r, n) {
|
|
4176
4158
|
switch (r) {
|
|
4177
4159
|
case "d":
|
|
4178
4160
|
return T(M.date, e);
|
|
4179
4161
|
case "do":
|
|
4180
|
-
return
|
|
4162
|
+
return n.ordinalNumber(e, { unit: "date" });
|
|
4181
4163
|
default:
|
|
4182
4164
|
return C(r.length, e);
|
|
4183
4165
|
}
|
|
4184
4166
|
}
|
|
4185
4167
|
validate(e, r) {
|
|
4186
|
-
const
|
|
4187
|
-
return s ? r >= 1 && r <=
|
|
4168
|
+
const n = e.getFullYear(), s = wt(n), i = e.getMonth();
|
|
4169
|
+
return s ? r >= 1 && r <= fa[i] : r >= 1 && r <= la[i];
|
|
4188
4170
|
}
|
|
4189
|
-
set(e, r,
|
|
4190
|
-
return e.setDate(
|
|
4171
|
+
set(e, r, n) {
|
|
4172
|
+
return e.setDate(n), e.setHours(0, 0, 0, 0), e;
|
|
4191
4173
|
}
|
|
4192
4174
|
}
|
|
4193
|
-
class
|
|
4175
|
+
class ma extends x {
|
|
4194
4176
|
constructor() {
|
|
4195
4177
|
super(...arguments);
|
|
4196
4178
|
f(this, "priority", 90);
|
|
@@ -4213,72 +4195,72 @@ class vn extends x {
|
|
|
4213
4195
|
"T"
|
|
4214
4196
|
]);
|
|
4215
4197
|
}
|
|
4216
|
-
parse(e, r,
|
|
4198
|
+
parse(e, r, n) {
|
|
4217
4199
|
switch (r) {
|
|
4218
4200
|
case "D":
|
|
4219
4201
|
case "DD":
|
|
4220
4202
|
return T(M.dayOfYear, e);
|
|
4221
4203
|
case "Do":
|
|
4222
|
-
return
|
|
4204
|
+
return n.ordinalNumber(e, { unit: "date" });
|
|
4223
4205
|
default:
|
|
4224
4206
|
return C(r.length, e);
|
|
4225
4207
|
}
|
|
4226
4208
|
}
|
|
4227
4209
|
validate(e, r) {
|
|
4228
|
-
const
|
|
4229
|
-
return
|
|
4210
|
+
const n = e.getFullYear();
|
|
4211
|
+
return wt(n) ? r >= 1 && r <= 366 : r >= 1 && r <= 365;
|
|
4230
4212
|
}
|
|
4231
|
-
set(e, r,
|
|
4232
|
-
return e.setMonth(0,
|
|
4213
|
+
set(e, r, n) {
|
|
4214
|
+
return e.setMonth(0, n), e.setHours(0, 0, 0, 0), e;
|
|
4233
4215
|
}
|
|
4234
4216
|
}
|
|
4235
|
-
function
|
|
4236
|
-
var k, A, j,
|
|
4237
|
-
const r =
|
|
4238
|
-
return
|
|
4217
|
+
function Fe(a, t, e) {
|
|
4218
|
+
var k, A, j, F;
|
|
4219
|
+
const r = me(), n = (e == null ? void 0 : e.weekStartsOn) ?? ((A = (k = e == null ? void 0 : e.locale) == null ? void 0 : k.options) == null ? void 0 : A.weekStartsOn) ?? r.weekStartsOn ?? ((F = (j = r.locale) == null ? void 0 : j.options) == null ? void 0 : F.weekStartsOn) ?? 0, s = E(a, e == null ? void 0 : e.in), i = s.getDay(), u = (t % 7 + 7) % 7, d = 7 - n, p = t < 0 || t > 6 ? t - (i + d) % 7 : (u + d) % 7 - (i + d) % 7;
|
|
4220
|
+
return ht(s, p, e);
|
|
4239
4221
|
}
|
|
4240
|
-
class
|
|
4222
|
+
class pa extends x {
|
|
4241
4223
|
constructor() {
|
|
4242
4224
|
super(...arguments);
|
|
4243
4225
|
f(this, "priority", 90);
|
|
4244
4226
|
f(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
4245
4227
|
}
|
|
4246
|
-
parse(e, r,
|
|
4228
|
+
parse(e, r, n) {
|
|
4247
4229
|
switch (r) {
|
|
4248
4230
|
// Tue
|
|
4249
4231
|
case "E":
|
|
4250
4232
|
case "EE":
|
|
4251
4233
|
case "EEE":
|
|
4252
|
-
return
|
|
4234
|
+
return n.day(e, {
|
|
4253
4235
|
width: "abbreviated",
|
|
4254
4236
|
context: "formatting"
|
|
4255
|
-
}) ||
|
|
4237
|
+
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4256
4238
|
// T
|
|
4257
4239
|
case "EEEEE":
|
|
4258
|
-
return
|
|
4240
|
+
return n.day(e, {
|
|
4259
4241
|
width: "narrow",
|
|
4260
4242
|
context: "formatting"
|
|
4261
4243
|
});
|
|
4262
4244
|
// Tu
|
|
4263
4245
|
case "EEEEEE":
|
|
4264
|
-
return
|
|
4246
|
+
return n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4265
4247
|
// Tuesday
|
|
4266
4248
|
case "EEEE":
|
|
4267
4249
|
default:
|
|
4268
|
-
return
|
|
4250
|
+
return n.day(e, { width: "wide", context: "formatting" }) || n.day(e, {
|
|
4269
4251
|
width: "abbreviated",
|
|
4270
4252
|
context: "formatting"
|
|
4271
|
-
}) ||
|
|
4253
|
+
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4272
4254
|
}
|
|
4273
4255
|
}
|
|
4274
4256
|
validate(e, r) {
|
|
4275
4257
|
return r >= 0 && r <= 6;
|
|
4276
4258
|
}
|
|
4277
|
-
set(e, r,
|
|
4278
|
-
return e =
|
|
4259
|
+
set(e, r, n, s) {
|
|
4260
|
+
return e = Fe(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
4279
4261
|
}
|
|
4280
4262
|
}
|
|
4281
|
-
class
|
|
4263
|
+
class ya extends x {
|
|
4282
4264
|
constructor() {
|
|
4283
4265
|
super(...arguments);
|
|
4284
4266
|
f(this, "priority", 90);
|
|
@@ -4300,7 +4282,7 @@ class bn extends x {
|
|
|
4300
4282
|
"T"
|
|
4301
4283
|
]);
|
|
4302
4284
|
}
|
|
4303
|
-
parse(e, r,
|
|
4285
|
+
parse(e, r, n, s) {
|
|
4304
4286
|
const i = (o) => {
|
|
4305
4287
|
const u = Math.floor((o - 1) / 7) * 7;
|
|
4306
4288
|
return (o + s.weekStartsOn + 6) % 7 + u;
|
|
@@ -4313,43 +4295,43 @@ class bn extends x {
|
|
|
4313
4295
|
// 3rd
|
|
4314
4296
|
case "eo":
|
|
4315
4297
|
return D(
|
|
4316
|
-
|
|
4298
|
+
n.ordinalNumber(e, {
|
|
4317
4299
|
unit: "day"
|
|
4318
4300
|
}),
|
|
4319
4301
|
i
|
|
4320
4302
|
);
|
|
4321
4303
|
// Tue
|
|
4322
4304
|
case "eee":
|
|
4323
|
-
return
|
|
4305
|
+
return n.day(e, {
|
|
4324
4306
|
width: "abbreviated",
|
|
4325
4307
|
context: "formatting"
|
|
4326
|
-
}) ||
|
|
4308
|
+
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4327
4309
|
// T
|
|
4328
4310
|
case "eeeee":
|
|
4329
|
-
return
|
|
4311
|
+
return n.day(e, {
|
|
4330
4312
|
width: "narrow",
|
|
4331
4313
|
context: "formatting"
|
|
4332
4314
|
});
|
|
4333
4315
|
// Tu
|
|
4334
4316
|
case "eeeeee":
|
|
4335
|
-
return
|
|
4317
|
+
return n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4336
4318
|
// Tuesday
|
|
4337
4319
|
case "eeee":
|
|
4338
4320
|
default:
|
|
4339
|
-
return
|
|
4321
|
+
return n.day(e, { width: "wide", context: "formatting" }) || n.day(e, {
|
|
4340
4322
|
width: "abbreviated",
|
|
4341
4323
|
context: "formatting"
|
|
4342
|
-
}) ||
|
|
4324
|
+
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
4343
4325
|
}
|
|
4344
4326
|
}
|
|
4345
4327
|
validate(e, r) {
|
|
4346
4328
|
return r >= 0 && r <= 6;
|
|
4347
4329
|
}
|
|
4348
|
-
set(e, r,
|
|
4349
|
-
return e =
|
|
4330
|
+
set(e, r, n, s) {
|
|
4331
|
+
return e = Fe(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
4350
4332
|
}
|
|
4351
4333
|
}
|
|
4352
|
-
class
|
|
4334
|
+
class ga extends x {
|
|
4353
4335
|
constructor() {
|
|
4354
4336
|
super(...arguments);
|
|
4355
4337
|
f(this, "priority", 90);
|
|
@@ -4371,7 +4353,7 @@ class xn extends x {
|
|
|
4371
4353
|
"T"
|
|
4372
4354
|
]);
|
|
4373
4355
|
}
|
|
4374
|
-
parse(e, r,
|
|
4356
|
+
parse(e, r, n, s) {
|
|
4375
4357
|
const i = (o) => {
|
|
4376
4358
|
const u = Math.floor((o - 1) / 7) * 7;
|
|
4377
4359
|
return (o + s.weekStartsOn + 6) % 7 + u;
|
|
@@ -4384,47 +4366,47 @@ class xn extends x {
|
|
|
4384
4366
|
// 3rd
|
|
4385
4367
|
case "co":
|
|
4386
4368
|
return D(
|
|
4387
|
-
|
|
4369
|
+
n.ordinalNumber(e, {
|
|
4388
4370
|
unit: "day"
|
|
4389
4371
|
}),
|
|
4390
4372
|
i
|
|
4391
4373
|
);
|
|
4392
4374
|
// Tue
|
|
4393
4375
|
case "ccc":
|
|
4394
|
-
return
|
|
4376
|
+
return n.day(e, {
|
|
4395
4377
|
width: "abbreviated",
|
|
4396
4378
|
context: "standalone"
|
|
4397
|
-
}) ||
|
|
4379
|
+
}) || n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
4398
4380
|
// T
|
|
4399
4381
|
case "ccccc":
|
|
4400
|
-
return
|
|
4382
|
+
return n.day(e, {
|
|
4401
4383
|
width: "narrow",
|
|
4402
4384
|
context: "standalone"
|
|
4403
4385
|
});
|
|
4404
4386
|
// Tu
|
|
4405
4387
|
case "cccccc":
|
|
4406
|
-
return
|
|
4388
|
+
return n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
4407
4389
|
// Tuesday
|
|
4408
4390
|
case "cccc":
|
|
4409
4391
|
default:
|
|
4410
|
-
return
|
|
4392
|
+
return n.day(e, { width: "wide", context: "standalone" }) || n.day(e, {
|
|
4411
4393
|
width: "abbreviated",
|
|
4412
4394
|
context: "standalone"
|
|
4413
|
-
}) ||
|
|
4395
|
+
}) || n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
4414
4396
|
}
|
|
4415
4397
|
}
|
|
4416
4398
|
validate(e, r) {
|
|
4417
4399
|
return r >= 0 && r <= 6;
|
|
4418
4400
|
}
|
|
4419
|
-
set(e, r,
|
|
4420
|
-
return e =
|
|
4401
|
+
set(e, r, n, s) {
|
|
4402
|
+
return e = Fe(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
4421
4403
|
}
|
|
4422
4404
|
}
|
|
4423
|
-
function
|
|
4424
|
-
const r = E(
|
|
4425
|
-
return
|
|
4405
|
+
function _a(a, t, e) {
|
|
4406
|
+
const r = E(a, e == null ? void 0 : e.in), n = Hr(r, e), s = t - n;
|
|
4407
|
+
return ht(r, s, e);
|
|
4426
4408
|
}
|
|
4427
|
-
class
|
|
4409
|
+
class va extends x {
|
|
4428
4410
|
constructor() {
|
|
4429
4411
|
super(...arguments);
|
|
4430
4412
|
f(this, "priority", 90);
|
|
@@ -4446,7 +4428,7 @@ class Tn extends x {
|
|
|
4446
4428
|
"T"
|
|
4447
4429
|
]);
|
|
4448
4430
|
}
|
|
4449
|
-
parse(e, r,
|
|
4431
|
+
parse(e, r, n) {
|
|
4450
4432
|
const s = (i) => i === 0 ? 7 : i;
|
|
4451
4433
|
switch (r) {
|
|
4452
4434
|
// 2
|
|
@@ -4455,17 +4437,17 @@ class Tn extends x {
|
|
|
4455
4437
|
return C(r.length, e);
|
|
4456
4438
|
// 2nd
|
|
4457
4439
|
case "io":
|
|
4458
|
-
return
|
|
4440
|
+
return n.ordinalNumber(e, { unit: "day" });
|
|
4459
4441
|
// Tue
|
|
4460
4442
|
case "iii":
|
|
4461
4443
|
return D(
|
|
4462
|
-
|
|
4444
|
+
n.day(e, {
|
|
4463
4445
|
width: "abbreviated",
|
|
4464
4446
|
context: "formatting"
|
|
4465
|
-
}) ||
|
|
4447
|
+
}) || n.day(e, {
|
|
4466
4448
|
width: "short",
|
|
4467
4449
|
context: "formatting"
|
|
4468
|
-
}) ||
|
|
4450
|
+
}) || n.day(e, {
|
|
4469
4451
|
width: "narrow",
|
|
4470
4452
|
context: "formatting"
|
|
4471
4453
|
}),
|
|
@@ -4474,7 +4456,7 @@ class Tn extends x {
|
|
|
4474
4456
|
// T
|
|
4475
4457
|
case "iiiii":
|
|
4476
4458
|
return D(
|
|
4477
|
-
|
|
4459
|
+
n.day(e, {
|
|
4478
4460
|
width: "narrow",
|
|
4479
4461
|
context: "formatting"
|
|
4480
4462
|
}),
|
|
@@ -4483,10 +4465,10 @@ class Tn extends x {
|
|
|
4483
4465
|
// Tu
|
|
4484
4466
|
case "iiiiii":
|
|
4485
4467
|
return D(
|
|
4486
|
-
|
|
4468
|
+
n.day(e, {
|
|
4487
4469
|
width: "short",
|
|
4488
4470
|
context: "formatting"
|
|
4489
|
-
}) ||
|
|
4471
|
+
}) || n.day(e, {
|
|
4490
4472
|
width: "narrow",
|
|
4491
4473
|
context: "formatting"
|
|
4492
4474
|
}),
|
|
@@ -4496,16 +4478,16 @@ class Tn extends x {
|
|
|
4496
4478
|
case "iiii":
|
|
4497
4479
|
default:
|
|
4498
4480
|
return D(
|
|
4499
|
-
|
|
4481
|
+
n.day(e, {
|
|
4500
4482
|
width: "wide",
|
|
4501
4483
|
context: "formatting"
|
|
4502
|
-
}) ||
|
|
4484
|
+
}) || n.day(e, {
|
|
4503
4485
|
width: "abbreviated",
|
|
4504
4486
|
context: "formatting"
|
|
4505
|
-
}) ||
|
|
4487
|
+
}) || n.day(e, {
|
|
4506
4488
|
width: "short",
|
|
4507
4489
|
context: "formatting"
|
|
4508
|
-
}) ||
|
|
4490
|
+
}) || n.day(e, {
|
|
4509
4491
|
width: "narrow",
|
|
4510
4492
|
context: "formatting"
|
|
4511
4493
|
}),
|
|
@@ -4516,145 +4498,145 @@ class Tn extends x {
|
|
|
4516
4498
|
validate(e, r) {
|
|
4517
4499
|
return r >= 1 && r <= 7;
|
|
4518
4500
|
}
|
|
4519
|
-
set(e, r,
|
|
4520
|
-
return e =
|
|
4501
|
+
set(e, r, n) {
|
|
4502
|
+
return e = _a(e, n), e.setHours(0, 0, 0, 0), e;
|
|
4521
4503
|
}
|
|
4522
4504
|
}
|
|
4523
|
-
class
|
|
4505
|
+
class wa extends x {
|
|
4524
4506
|
constructor() {
|
|
4525
4507
|
super(...arguments);
|
|
4526
4508
|
f(this, "priority", 80);
|
|
4527
4509
|
f(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
4528
4510
|
}
|
|
4529
|
-
parse(e, r,
|
|
4511
|
+
parse(e, r, n) {
|
|
4530
4512
|
switch (r) {
|
|
4531
4513
|
case "a":
|
|
4532
4514
|
case "aa":
|
|
4533
4515
|
case "aaa":
|
|
4534
|
-
return
|
|
4516
|
+
return n.dayPeriod(e, {
|
|
4535
4517
|
width: "abbreviated",
|
|
4536
4518
|
context: "formatting"
|
|
4537
|
-
}) ||
|
|
4519
|
+
}) || n.dayPeriod(e, {
|
|
4538
4520
|
width: "narrow",
|
|
4539
4521
|
context: "formatting"
|
|
4540
4522
|
});
|
|
4541
4523
|
case "aaaaa":
|
|
4542
|
-
return
|
|
4524
|
+
return n.dayPeriod(e, {
|
|
4543
4525
|
width: "narrow",
|
|
4544
4526
|
context: "formatting"
|
|
4545
4527
|
});
|
|
4546
4528
|
case "aaaa":
|
|
4547
4529
|
default:
|
|
4548
|
-
return
|
|
4530
|
+
return n.dayPeriod(e, {
|
|
4549
4531
|
width: "wide",
|
|
4550
4532
|
context: "formatting"
|
|
4551
|
-
}) ||
|
|
4533
|
+
}) || n.dayPeriod(e, {
|
|
4552
4534
|
width: "abbreviated",
|
|
4553
4535
|
context: "formatting"
|
|
4554
|
-
}) ||
|
|
4536
|
+
}) || n.dayPeriod(e, {
|
|
4555
4537
|
width: "narrow",
|
|
4556
4538
|
context: "formatting"
|
|
4557
4539
|
});
|
|
4558
4540
|
}
|
|
4559
4541
|
}
|
|
4560
|
-
set(e, r,
|
|
4561
|
-
return e.setHours(
|
|
4542
|
+
set(e, r, n) {
|
|
4543
|
+
return e.setHours(Ve(n), 0, 0, 0), e;
|
|
4562
4544
|
}
|
|
4563
4545
|
}
|
|
4564
|
-
class
|
|
4546
|
+
class ba extends x {
|
|
4565
4547
|
constructor() {
|
|
4566
4548
|
super(...arguments);
|
|
4567
4549
|
f(this, "priority", 80);
|
|
4568
4550
|
f(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
4569
4551
|
}
|
|
4570
|
-
parse(e, r,
|
|
4552
|
+
parse(e, r, n) {
|
|
4571
4553
|
switch (r) {
|
|
4572
4554
|
case "b":
|
|
4573
4555
|
case "bb":
|
|
4574
4556
|
case "bbb":
|
|
4575
|
-
return
|
|
4557
|
+
return n.dayPeriod(e, {
|
|
4576
4558
|
width: "abbreviated",
|
|
4577
4559
|
context: "formatting"
|
|
4578
|
-
}) ||
|
|
4560
|
+
}) || n.dayPeriod(e, {
|
|
4579
4561
|
width: "narrow",
|
|
4580
4562
|
context: "formatting"
|
|
4581
4563
|
});
|
|
4582
4564
|
case "bbbbb":
|
|
4583
|
-
return
|
|
4565
|
+
return n.dayPeriod(e, {
|
|
4584
4566
|
width: "narrow",
|
|
4585
4567
|
context: "formatting"
|
|
4586
4568
|
});
|
|
4587
4569
|
case "bbbb":
|
|
4588
4570
|
default:
|
|
4589
|
-
return
|
|
4571
|
+
return n.dayPeriod(e, {
|
|
4590
4572
|
width: "wide",
|
|
4591
4573
|
context: "formatting"
|
|
4592
|
-
}) ||
|
|
4574
|
+
}) || n.dayPeriod(e, {
|
|
4593
4575
|
width: "abbreviated",
|
|
4594
4576
|
context: "formatting"
|
|
4595
|
-
}) ||
|
|
4577
|
+
}) || n.dayPeriod(e, {
|
|
4596
4578
|
width: "narrow",
|
|
4597
4579
|
context: "formatting"
|
|
4598
4580
|
});
|
|
4599
4581
|
}
|
|
4600
4582
|
}
|
|
4601
|
-
set(e, r,
|
|
4602
|
-
return e.setHours(
|
|
4583
|
+
set(e, r, n) {
|
|
4584
|
+
return e.setHours(Ve(n), 0, 0, 0), e;
|
|
4603
4585
|
}
|
|
4604
4586
|
}
|
|
4605
|
-
class
|
|
4587
|
+
class xa extends x {
|
|
4606
4588
|
constructor() {
|
|
4607
4589
|
super(...arguments);
|
|
4608
4590
|
f(this, "priority", 80);
|
|
4609
4591
|
f(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
4610
4592
|
}
|
|
4611
|
-
parse(e, r,
|
|
4593
|
+
parse(e, r, n) {
|
|
4612
4594
|
switch (r) {
|
|
4613
4595
|
case "B":
|
|
4614
4596
|
case "BB":
|
|
4615
4597
|
case "BBB":
|
|
4616
|
-
return
|
|
4598
|
+
return n.dayPeriod(e, {
|
|
4617
4599
|
width: "abbreviated",
|
|
4618
4600
|
context: "formatting"
|
|
4619
|
-
}) ||
|
|
4601
|
+
}) || n.dayPeriod(e, {
|
|
4620
4602
|
width: "narrow",
|
|
4621
4603
|
context: "formatting"
|
|
4622
4604
|
});
|
|
4623
4605
|
case "BBBBB":
|
|
4624
|
-
return
|
|
4606
|
+
return n.dayPeriod(e, {
|
|
4625
4607
|
width: "narrow",
|
|
4626
4608
|
context: "formatting"
|
|
4627
4609
|
});
|
|
4628
4610
|
case "BBBB":
|
|
4629
4611
|
default:
|
|
4630
|
-
return
|
|
4612
|
+
return n.dayPeriod(e, {
|
|
4631
4613
|
width: "wide",
|
|
4632
4614
|
context: "formatting"
|
|
4633
|
-
}) ||
|
|
4615
|
+
}) || n.dayPeriod(e, {
|
|
4634
4616
|
width: "abbreviated",
|
|
4635
4617
|
context: "formatting"
|
|
4636
|
-
}) ||
|
|
4618
|
+
}) || n.dayPeriod(e, {
|
|
4637
4619
|
width: "narrow",
|
|
4638
4620
|
context: "formatting"
|
|
4639
4621
|
});
|
|
4640
4622
|
}
|
|
4641
4623
|
}
|
|
4642
|
-
set(e, r,
|
|
4643
|
-
return e.setHours(
|
|
4624
|
+
set(e, r, n) {
|
|
4625
|
+
return e.setHours(Ve(n), 0, 0, 0), e;
|
|
4644
4626
|
}
|
|
4645
4627
|
}
|
|
4646
|
-
class
|
|
4628
|
+
class ka extends x {
|
|
4647
4629
|
constructor() {
|
|
4648
4630
|
super(...arguments);
|
|
4649
4631
|
f(this, "priority", 70);
|
|
4650
4632
|
f(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
4651
4633
|
}
|
|
4652
|
-
parse(e, r,
|
|
4634
|
+
parse(e, r, n) {
|
|
4653
4635
|
switch (r) {
|
|
4654
4636
|
case "h":
|
|
4655
4637
|
return T(M.hour12h, e);
|
|
4656
4638
|
case "ho":
|
|
4657
|
-
return
|
|
4639
|
+
return n.ordinalNumber(e, { unit: "hour" });
|
|
4658
4640
|
default:
|
|
4659
4641
|
return C(r.length, e);
|
|
4660
4642
|
}
|
|
@@ -4662,23 +4644,23 @@ class Mn extends x {
|
|
|
4662
4644
|
validate(e, r) {
|
|
4663
4645
|
return r >= 1 && r <= 12;
|
|
4664
4646
|
}
|
|
4665
|
-
set(e, r,
|
|
4647
|
+
set(e, r, n) {
|
|
4666
4648
|
const s = e.getHours() >= 12;
|
|
4667
|
-
return s &&
|
|
4649
|
+
return s && n < 12 ? e.setHours(n + 12, 0, 0, 0) : !s && n === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(n, 0, 0, 0), e;
|
|
4668
4650
|
}
|
|
4669
4651
|
}
|
|
4670
|
-
class
|
|
4652
|
+
class Ta extends x {
|
|
4671
4653
|
constructor() {
|
|
4672
4654
|
super(...arguments);
|
|
4673
4655
|
f(this, "priority", 70);
|
|
4674
4656
|
f(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
4675
4657
|
}
|
|
4676
|
-
parse(e, r,
|
|
4658
|
+
parse(e, r, n) {
|
|
4677
4659
|
switch (r) {
|
|
4678
4660
|
case "H":
|
|
4679
4661
|
return T(M.hour23h, e);
|
|
4680
4662
|
case "Ho":
|
|
4681
|
-
return
|
|
4663
|
+
return n.ordinalNumber(e, { unit: "hour" });
|
|
4682
4664
|
default:
|
|
4683
4665
|
return C(r.length, e);
|
|
4684
4666
|
}
|
|
@@ -4686,22 +4668,22 @@ class Dn extends x {
|
|
|
4686
4668
|
validate(e, r) {
|
|
4687
4669
|
return r >= 0 && r <= 23;
|
|
4688
4670
|
}
|
|
4689
|
-
set(e, r,
|
|
4690
|
-
return e.setHours(
|
|
4671
|
+
set(e, r, n) {
|
|
4672
|
+
return e.setHours(n, 0, 0, 0), e;
|
|
4691
4673
|
}
|
|
4692
4674
|
}
|
|
4693
|
-
class
|
|
4675
|
+
class Oa extends x {
|
|
4694
4676
|
constructor() {
|
|
4695
4677
|
super(...arguments);
|
|
4696
4678
|
f(this, "priority", 70);
|
|
4697
4679
|
f(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
4698
4680
|
}
|
|
4699
|
-
parse(e, r,
|
|
4681
|
+
parse(e, r, n) {
|
|
4700
4682
|
switch (r) {
|
|
4701
4683
|
case "K":
|
|
4702
4684
|
return T(M.hour11h, e);
|
|
4703
4685
|
case "Ko":
|
|
4704
|
-
return
|
|
4686
|
+
return n.ordinalNumber(e, { unit: "hour" });
|
|
4705
4687
|
default:
|
|
4706
4688
|
return C(r.length, e);
|
|
4707
4689
|
}
|
|
@@ -4709,22 +4691,22 @@ class Nn extends x {
|
|
|
4709
4691
|
validate(e, r) {
|
|
4710
4692
|
return r >= 0 && r <= 11;
|
|
4711
4693
|
}
|
|
4712
|
-
set(e, r,
|
|
4713
|
-
return e.getHours() >= 12 &&
|
|
4694
|
+
set(e, r, n) {
|
|
4695
|
+
return e.getHours() >= 12 && n < 12 ? e.setHours(n + 12, 0, 0, 0) : e.setHours(n, 0, 0, 0), e;
|
|
4714
4696
|
}
|
|
4715
4697
|
}
|
|
4716
|
-
class
|
|
4698
|
+
class Pa extends x {
|
|
4717
4699
|
constructor() {
|
|
4718
4700
|
super(...arguments);
|
|
4719
4701
|
f(this, "priority", 70);
|
|
4720
4702
|
f(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
4721
4703
|
}
|
|
4722
|
-
parse(e, r,
|
|
4704
|
+
parse(e, r, n) {
|
|
4723
4705
|
switch (r) {
|
|
4724
4706
|
case "k":
|
|
4725
4707
|
return T(M.hour24h, e);
|
|
4726
4708
|
case "ko":
|
|
4727
|
-
return
|
|
4709
|
+
return n.ordinalNumber(e, { unit: "hour" });
|
|
4728
4710
|
default:
|
|
4729
4711
|
return C(r.length, e);
|
|
4730
4712
|
}
|
|
@@ -4732,23 +4714,23 @@ class En extends x {
|
|
|
4732
4714
|
validate(e, r) {
|
|
4733
4715
|
return r >= 1 && r <= 24;
|
|
4734
4716
|
}
|
|
4735
|
-
set(e, r,
|
|
4736
|
-
const s =
|
|
4717
|
+
set(e, r, n) {
|
|
4718
|
+
const s = n <= 24 ? n % 24 : n;
|
|
4737
4719
|
return e.setHours(s, 0, 0, 0), e;
|
|
4738
4720
|
}
|
|
4739
4721
|
}
|
|
4740
|
-
class
|
|
4722
|
+
class Ca extends x {
|
|
4741
4723
|
constructor() {
|
|
4742
4724
|
super(...arguments);
|
|
4743
4725
|
f(this, "priority", 60);
|
|
4744
4726
|
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4745
4727
|
}
|
|
4746
|
-
parse(e, r,
|
|
4728
|
+
parse(e, r, n) {
|
|
4747
4729
|
switch (r) {
|
|
4748
4730
|
case "m":
|
|
4749
4731
|
return T(M.minute, e);
|
|
4750
4732
|
case "mo":
|
|
4751
|
-
return
|
|
4733
|
+
return n.ordinalNumber(e, { unit: "minute" });
|
|
4752
4734
|
default:
|
|
4753
4735
|
return C(r.length, e);
|
|
4754
4736
|
}
|
|
@@ -4756,22 +4738,22 @@ class In extends x {
|
|
|
4756
4738
|
validate(e, r) {
|
|
4757
4739
|
return r >= 0 && r <= 59;
|
|
4758
4740
|
}
|
|
4759
|
-
set(e, r,
|
|
4760
|
-
return e.setMinutes(
|
|
4741
|
+
set(e, r, n) {
|
|
4742
|
+
return e.setMinutes(n, 0, 0), e;
|
|
4761
4743
|
}
|
|
4762
4744
|
}
|
|
4763
|
-
class
|
|
4745
|
+
class Ma extends x {
|
|
4764
4746
|
constructor() {
|
|
4765
4747
|
super(...arguments);
|
|
4766
4748
|
f(this, "priority", 50);
|
|
4767
4749
|
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4768
4750
|
}
|
|
4769
|
-
parse(e, r,
|
|
4751
|
+
parse(e, r, n) {
|
|
4770
4752
|
switch (r) {
|
|
4771
4753
|
case "s":
|
|
4772
4754
|
return T(M.second, e);
|
|
4773
4755
|
case "so":
|
|
4774
|
-
return
|
|
4756
|
+
return n.ordinalNumber(e, { unit: "second" });
|
|
4775
4757
|
default:
|
|
4776
4758
|
return C(r.length, e);
|
|
4777
4759
|
}
|
|
@@ -4779,25 +4761,25 @@ class Rn extends x {
|
|
|
4779
4761
|
validate(e, r) {
|
|
4780
4762
|
return r >= 0 && r <= 59;
|
|
4781
4763
|
}
|
|
4782
|
-
set(e, r,
|
|
4783
|
-
return e.setSeconds(
|
|
4764
|
+
set(e, r, n) {
|
|
4765
|
+
return e.setSeconds(n, 0), e;
|
|
4784
4766
|
}
|
|
4785
4767
|
}
|
|
4786
|
-
class
|
|
4768
|
+
class Da extends x {
|
|
4787
4769
|
constructor() {
|
|
4788
4770
|
super(...arguments);
|
|
4789
4771
|
f(this, "priority", 30);
|
|
4790
4772
|
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4791
4773
|
}
|
|
4792
4774
|
parse(e, r) {
|
|
4793
|
-
const
|
|
4794
|
-
return D(C(r.length, e),
|
|
4775
|
+
const n = (s) => Math.trunc(s * Math.pow(10, -r.length + 3));
|
|
4776
|
+
return D(C(r.length, e), n);
|
|
4795
4777
|
}
|
|
4796
|
-
set(e, r,
|
|
4797
|
-
return e.setMilliseconds(
|
|
4778
|
+
set(e, r, n) {
|
|
4779
|
+
return e.setMilliseconds(n), e;
|
|
4798
4780
|
}
|
|
4799
4781
|
}
|
|
4800
|
-
class
|
|
4782
|
+
class Na extends x {
|
|
4801
4783
|
constructor() {
|
|
4802
4784
|
super(...arguments);
|
|
4803
4785
|
f(this, "priority", 10);
|
|
@@ -4807,34 +4789,34 @@ class Zn extends x {
|
|
|
4807
4789
|
switch (r) {
|
|
4808
4790
|
case "X":
|
|
4809
4791
|
return $(
|
|
4810
|
-
|
|
4792
|
+
W.basicOptionalMinutes,
|
|
4811
4793
|
e
|
|
4812
4794
|
);
|
|
4813
4795
|
case "XX":
|
|
4814
|
-
return $(
|
|
4796
|
+
return $(W.basic, e);
|
|
4815
4797
|
case "XXXX":
|
|
4816
4798
|
return $(
|
|
4817
|
-
|
|
4799
|
+
W.basicOptionalSeconds,
|
|
4818
4800
|
e
|
|
4819
4801
|
);
|
|
4820
4802
|
case "XXXXX":
|
|
4821
4803
|
return $(
|
|
4822
|
-
|
|
4804
|
+
W.extendedOptionalSeconds,
|
|
4823
4805
|
e
|
|
4824
4806
|
);
|
|
4825
4807
|
case "XXX":
|
|
4826
4808
|
default:
|
|
4827
|
-
return $(
|
|
4809
|
+
return $(W.extended, e);
|
|
4828
4810
|
}
|
|
4829
4811
|
}
|
|
4830
|
-
set(e, r,
|
|
4812
|
+
set(e, r, n) {
|
|
4831
4813
|
return r.timestampIsSet ? e : N(
|
|
4832
4814
|
e,
|
|
4833
|
-
e.getTime() -
|
|
4815
|
+
e.getTime() - mt(e) - n
|
|
4834
4816
|
);
|
|
4835
4817
|
}
|
|
4836
4818
|
}
|
|
4837
|
-
class
|
|
4819
|
+
class Ea extends x {
|
|
4838
4820
|
constructor() {
|
|
4839
4821
|
super(...arguments);
|
|
4840
4822
|
f(this, "priority", 10);
|
|
@@ -4844,180 +4826,180 @@ class jn extends x {
|
|
|
4844
4826
|
switch (r) {
|
|
4845
4827
|
case "x":
|
|
4846
4828
|
return $(
|
|
4847
|
-
|
|
4829
|
+
W.basicOptionalMinutes,
|
|
4848
4830
|
e
|
|
4849
4831
|
);
|
|
4850
4832
|
case "xx":
|
|
4851
|
-
return $(
|
|
4833
|
+
return $(W.basic, e);
|
|
4852
4834
|
case "xxxx":
|
|
4853
4835
|
return $(
|
|
4854
|
-
|
|
4836
|
+
W.basicOptionalSeconds,
|
|
4855
4837
|
e
|
|
4856
4838
|
);
|
|
4857
4839
|
case "xxxxx":
|
|
4858
4840
|
return $(
|
|
4859
|
-
|
|
4841
|
+
W.extendedOptionalSeconds,
|
|
4860
4842
|
e
|
|
4861
4843
|
);
|
|
4862
4844
|
case "xxx":
|
|
4863
4845
|
default:
|
|
4864
|
-
return $(
|
|
4846
|
+
return $(W.extended, e);
|
|
4865
4847
|
}
|
|
4866
4848
|
}
|
|
4867
|
-
set(e, r,
|
|
4849
|
+
set(e, r, n) {
|
|
4868
4850
|
return r.timestampIsSet ? e : N(
|
|
4869
4851
|
e,
|
|
4870
|
-
e.getTime() -
|
|
4852
|
+
e.getTime() - mt(e) - n
|
|
4871
4853
|
);
|
|
4872
4854
|
}
|
|
4873
4855
|
}
|
|
4874
|
-
class
|
|
4856
|
+
class Ia extends x {
|
|
4875
4857
|
constructor() {
|
|
4876
4858
|
super(...arguments);
|
|
4877
4859
|
f(this, "priority", 40);
|
|
4878
4860
|
f(this, "incompatibleTokens", "*");
|
|
4879
4861
|
}
|
|
4880
4862
|
parse(e) {
|
|
4881
|
-
return
|
|
4863
|
+
return _t(e);
|
|
4882
4864
|
}
|
|
4883
|
-
set(e, r,
|
|
4884
|
-
return [N(e,
|
|
4865
|
+
set(e, r, n) {
|
|
4866
|
+
return [N(e, n * 1e3), { timestampIsSet: !0 }];
|
|
4885
4867
|
}
|
|
4886
4868
|
}
|
|
4887
|
-
class
|
|
4869
|
+
class Ra extends x {
|
|
4888
4870
|
constructor() {
|
|
4889
4871
|
super(...arguments);
|
|
4890
4872
|
f(this, "priority", 20);
|
|
4891
4873
|
f(this, "incompatibleTokens", "*");
|
|
4892
4874
|
}
|
|
4893
4875
|
parse(e) {
|
|
4894
|
-
return
|
|
4895
|
-
}
|
|
4896
|
-
set(e, r,
|
|
4897
|
-
return [N(e,
|
|
4898
|
-
}
|
|
4899
|
-
}
|
|
4900
|
-
const
|
|
4901
|
-
G: new
|
|
4902
|
-
y: new
|
|
4903
|
-
Y: new
|
|
4904
|
-
R: new
|
|
4905
|
-
u: new
|
|
4906
|
-
Q: new
|
|
4907
|
-
q: new
|
|
4908
|
-
M: new
|
|
4909
|
-
L: new
|
|
4910
|
-
w: new
|
|
4911
|
-
I: new
|
|
4912
|
-
d: new
|
|
4913
|
-
D: new
|
|
4914
|
-
E: new
|
|
4915
|
-
e: new
|
|
4916
|
-
c: new
|
|
4917
|
-
i: new
|
|
4918
|
-
a: new
|
|
4919
|
-
b: new
|
|
4920
|
-
B: new
|
|
4921
|
-
h: new
|
|
4922
|
-
H: new
|
|
4923
|
-
K: new
|
|
4924
|
-
k: new
|
|
4925
|
-
m: new
|
|
4926
|
-
s: new
|
|
4927
|
-
S: new
|
|
4928
|
-
X: new
|
|
4929
|
-
x: new
|
|
4930
|
-
t: new
|
|
4931
|
-
T: new
|
|
4932
|
-
},
|
|
4933
|
-
function
|
|
4934
|
-
var
|
|
4935
|
-
const
|
|
4876
|
+
return _t(e);
|
|
4877
|
+
}
|
|
4878
|
+
set(e, r, n) {
|
|
4879
|
+
return [N(e, n), { timestampIsSet: !0 }];
|
|
4880
|
+
}
|
|
4881
|
+
}
|
|
4882
|
+
const Aa = {
|
|
4883
|
+
G: new Jr(),
|
|
4884
|
+
y: new Kr(),
|
|
4885
|
+
Y: new ea(),
|
|
4886
|
+
R: new ta(),
|
|
4887
|
+
u: new ra(),
|
|
4888
|
+
Q: new aa(),
|
|
4889
|
+
q: new na(),
|
|
4890
|
+
M: new sa(),
|
|
4891
|
+
L: new ia(),
|
|
4892
|
+
w: new ca(),
|
|
4893
|
+
I: new da(),
|
|
4894
|
+
d: new ha(),
|
|
4895
|
+
D: new ma(),
|
|
4896
|
+
E: new pa(),
|
|
4897
|
+
e: new ya(),
|
|
4898
|
+
c: new ga(),
|
|
4899
|
+
i: new va(),
|
|
4900
|
+
a: new wa(),
|
|
4901
|
+
b: new ba(),
|
|
4902
|
+
B: new xa(),
|
|
4903
|
+
h: new ka(),
|
|
4904
|
+
H: new Ta(),
|
|
4905
|
+
K: new Oa(),
|
|
4906
|
+
k: new Pa(),
|
|
4907
|
+
m: new Ca(),
|
|
4908
|
+
s: new Ma(),
|
|
4909
|
+
S: new Da(),
|
|
4910
|
+
X: new Na(),
|
|
4911
|
+
x: new Ea(),
|
|
4912
|
+
t: new Ia(),
|
|
4913
|
+
T: new Ra()
|
|
4914
|
+
}, Za = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ja = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ya = /^'([^]*?)'?$/, Wa = /''/g, $a = /\S/, La = /[a-zA-Z]/;
|
|
4915
|
+
function Zn(a, t, e, r) {
|
|
4916
|
+
var qe, He, Be, Qe;
|
|
4917
|
+
const n = () => N(e, NaN), s = qr(), i = s.locale ?? Ar, o = s.firstWeekContainsDate ?? ((He = (qe = s.locale) == null ? void 0 : qe.options) == null ? void 0 : He.firstWeekContainsDate) ?? 1, u = s.weekStartsOn ?? ((Qe = (Be = s.locale) == null ? void 0 : Be.options) == null ? void 0 : Qe.weekStartsOn) ?? 0;
|
|
4936
4918
|
if (!t)
|
|
4937
|
-
return
|
|
4919
|
+
return a ? n() : E(e, r == null ? void 0 : r.in);
|
|
4938
4920
|
const d = {
|
|
4939
4921
|
firstWeekContainsDate: o,
|
|
4940
4922
|
weekStartsOn: u,
|
|
4941
4923
|
locale: i
|
|
4942
|
-
}, p = [new
|
|
4924
|
+
}, p = [new Gr(r == null ? void 0 : r.in, e)], k = t.match(ja).map((b) => {
|
|
4943
4925
|
const O = b[0];
|
|
4944
|
-
if (O in
|
|
4945
|
-
const
|
|
4946
|
-
return
|
|
4926
|
+
if (O in st) {
|
|
4927
|
+
const Y = st[O];
|
|
4928
|
+
return Y(b, i.formatLong);
|
|
4947
4929
|
}
|
|
4948
4930
|
return b;
|
|
4949
|
-
}).join("").match(
|
|
4931
|
+
}).join("").match(Za), A = [];
|
|
4950
4932
|
for (let b of k) {
|
|
4951
|
-
|
|
4952
|
-
const O = b[0],
|
|
4953
|
-
if (
|
|
4954
|
-
const { incompatibleTokens:
|
|
4955
|
-
if (Array.isArray(
|
|
4956
|
-
const
|
|
4957
|
-
(
|
|
4933
|
+
Fr(b) && it(b, t, a), Vr(b) && it(b, t, a);
|
|
4934
|
+
const O = b[0], Y = Aa[O];
|
|
4935
|
+
if (Y) {
|
|
4936
|
+
const { incompatibleTokens: Ue } = Y;
|
|
4937
|
+
if (Array.isArray(Ue)) {
|
|
4938
|
+
const Xe = A.find(
|
|
4939
|
+
(Ge) => Ue.includes(Ge.token) || Ge.token === O
|
|
4958
4940
|
);
|
|
4959
|
-
if (
|
|
4941
|
+
if (Xe)
|
|
4960
4942
|
throw new RangeError(
|
|
4961
|
-
`The format string mustn't contain \`${
|
|
4943
|
+
`The format string mustn't contain \`${Xe.fullToken}\` and \`${b}\` at the same time`
|
|
4962
4944
|
);
|
|
4963
|
-
} else if (
|
|
4945
|
+
} else if (Y.incompatibleTokens === "*" && A.length > 0)
|
|
4964
4946
|
throw new RangeError(
|
|
4965
4947
|
`The format string mustn't contain \`${b}\` and any other token at the same time`
|
|
4966
4948
|
);
|
|
4967
4949
|
A.push({ token: O, fullToken: b });
|
|
4968
|
-
const
|
|
4969
|
-
|
|
4950
|
+
const Ne = Y.run(
|
|
4951
|
+
a,
|
|
4970
4952
|
b,
|
|
4971
4953
|
i.match,
|
|
4972
4954
|
d
|
|
4973
4955
|
);
|
|
4974
|
-
if (!
|
|
4975
|
-
return
|
|
4976
|
-
p.push(
|
|
4956
|
+
if (!Ne)
|
|
4957
|
+
return n();
|
|
4958
|
+
p.push(Ne.setter), a = Ne.rest;
|
|
4977
4959
|
} else {
|
|
4978
|
-
if (O.match(
|
|
4960
|
+
if (O.match(La))
|
|
4979
4961
|
throw new RangeError(
|
|
4980
4962
|
"Format string contains an unescaped latin alphabet character `" + O + "`"
|
|
4981
4963
|
);
|
|
4982
|
-
if (b === "''" ? b = "'" : O === "'" && (b =
|
|
4983
|
-
|
|
4964
|
+
if (b === "''" ? b = "'" : O === "'" && (b = Sa(b)), a.indexOf(b) === 0)
|
|
4965
|
+
a = a.slice(b.length);
|
|
4984
4966
|
else
|
|
4985
|
-
return
|
|
4967
|
+
return n();
|
|
4986
4968
|
}
|
|
4987
4969
|
}
|
|
4988
|
-
if (
|
|
4989
|
-
return
|
|
4990
|
-
const j = p.map((b) => b.priority).sort((b, O) => O - b).filter((b, O,
|
|
4991
|
-
(b) => p.filter((O) => O.priority === b).sort((O,
|
|
4970
|
+
if (a.length > 0 && $a.test(a))
|
|
4971
|
+
return n();
|
|
4972
|
+
const j = p.map((b) => b.priority).sort((b, O) => O - b).filter((b, O, Y) => Y.indexOf(b) === O).map(
|
|
4973
|
+
(b) => p.filter((O) => O.priority === b).sort((O, Y) => Y.subPriority - O.subPriority)
|
|
4992
4974
|
).map((b) => b[0]);
|
|
4993
|
-
let
|
|
4994
|
-
if (isNaN(+
|
|
4995
|
-
const
|
|
4975
|
+
let F = E(e, r == null ? void 0 : r.in);
|
|
4976
|
+
if (isNaN(+F)) return n();
|
|
4977
|
+
const ze = {};
|
|
4996
4978
|
for (const b of j) {
|
|
4997
|
-
if (!b.validate(
|
|
4998
|
-
return
|
|
4999
|
-
const O = b.set(
|
|
5000
|
-
Array.isArray(O) ? (
|
|
4979
|
+
if (!b.validate(F, d))
|
|
4980
|
+
return n();
|
|
4981
|
+
const O = b.set(F, ze, d);
|
|
4982
|
+
Array.isArray(O) ? (F = O[0], Object.assign(ze, O[1])) : F = O;
|
|
5001
4983
|
}
|
|
5002
|
-
return
|
|
4984
|
+
return F;
|
|
5003
4985
|
}
|
|
5004
|
-
function
|
|
5005
|
-
return
|
|
4986
|
+
function Sa(a) {
|
|
4987
|
+
return a.match(Ya)[1].replace(Wa, "'");
|
|
5006
4988
|
}
|
|
5007
|
-
const
|
|
4989
|
+
const jn = "dd.MM.yyyy", Yn = (a, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5008
4990
|
day: "2-digit",
|
|
5009
4991
|
month: "2-digit",
|
|
5010
4992
|
year: "numeric"
|
|
5011
|
-
}).format(
|
|
4993
|
+
}).format(a), Wn = (a, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5012
4994
|
year: "numeric"
|
|
5013
|
-
}).format(
|
|
4995
|
+
}).format(a), $n = (a, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5014
4996
|
month: "long"
|
|
5015
|
-
}).format(
|
|
5016
|
-
today:
|
|
4997
|
+
}).format(a), Ln = {
|
|
4998
|
+
today: Ee("text-color-primary-default"),
|
|
5017
4999
|
outside: "text-color-tetriary",
|
|
5018
5000
|
selected: "bg-color-primary-default text-color-white",
|
|
5019
|
-
range_outer:
|
|
5020
|
-
range_middle:
|
|
5001
|
+
range_outer: Ee("text-color-primary-default text-color-white"),
|
|
5002
|
+
range_middle: Ee(
|
|
5021
5003
|
"bg-color-primary-tr-hover relative text-color-dark rounded-none",
|
|
5022
5004
|
'after:absolute after:content-[""] after:top-0 after:left-0',
|
|
5023
5005
|
"after:w-full after:h-[4px] after:bg-color-white after:z-0",
|
|
@@ -5029,137 +5011,137 @@ const La = "dd.MM.yyyy", Fa = (n, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
|
5029
5011
|
day: "text-center"
|
|
5030
5012
|
};
|
|
5031
5013
|
export {
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5014
|
+
rn as $,
|
|
5015
|
+
_e as A,
|
|
5016
|
+
Ba as B,
|
|
5035
5017
|
ee as C,
|
|
5036
5018
|
ue as D,
|
|
5037
|
-
|
|
5019
|
+
Ha as E,
|
|
5038
5020
|
G as F,
|
|
5039
5021
|
P as G,
|
|
5040
5022
|
q as H,
|
|
5041
|
-
|
|
5023
|
+
y as I,
|
|
5042
5024
|
h as J,
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5025
|
+
De as K,
|
|
5026
|
+
he as L,
|
|
5027
|
+
Ce as M,
|
|
5028
|
+
In as N,
|
|
5047
5029
|
R as O,
|
|
5048
5030
|
I as P,
|
|
5049
|
-
|
|
5031
|
+
be as Q,
|
|
5050
5032
|
se as R,
|
|
5051
5033
|
L as S,
|
|
5052
|
-
|
|
5034
|
+
je as T,
|
|
5053
5035
|
H as U,
|
|
5054
|
-
|
|
5055
|
-
|
|
5036
|
+
ge as V,
|
|
5037
|
+
ve as W,
|
|
5056
5038
|
re as X,
|
|
5057
|
-
|
|
5039
|
+
Ye as Y,
|
|
5058
5040
|
c as Z,
|
|
5059
5041
|
l as _,
|
|
5060
5042
|
v as a,
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5043
|
+
Yr as a$,
|
|
5044
|
+
on as a0,
|
|
5045
|
+
Ga as a1,
|
|
5046
|
+
Qt as a2,
|
|
5047
|
+
qt as a3,
|
|
5048
|
+
Ja as a4,
|
|
5049
|
+
Lt as a5,
|
|
5050
|
+
le as a6,
|
|
5051
|
+
ln as a7,
|
|
5052
|
+
kn as a8,
|
|
5053
|
+
wn as a9,
|
|
5054
|
+
Cn as aA,
|
|
5055
|
+
Pn as aB,
|
|
5056
|
+
xn as aC,
|
|
5057
|
+
za as aD,
|
|
5058
|
+
mn as aE,
|
|
5059
|
+
yn as aF,
|
|
5060
|
+
qa as aG,
|
|
5061
|
+
un as aH,
|
|
5062
|
+
Ka as aI,
|
|
5063
|
+
hn as aJ,
|
|
5064
|
+
en as aK,
|
|
5065
|
+
dn as aL,
|
|
5066
|
+
an as aM,
|
|
5085
5067
|
w as aN,
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5068
|
+
sn as aO,
|
|
5069
|
+
Yn as aP,
|
|
5070
|
+
jn as aQ,
|
|
5071
|
+
Wn as aR,
|
|
5072
|
+
$n as aS,
|
|
5073
|
+
Ln as aT,
|
|
5092
5074
|
E as aU,
|
|
5093
5075
|
N as aV,
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5076
|
+
mt as aW,
|
|
5077
|
+
Rn as aX,
|
|
5078
|
+
ht as aY,
|
|
5079
|
+
me as aZ,
|
|
5080
|
+
Zr as a_,
|
|
5081
|
+
gn as aa,
|
|
5082
|
+
Ae as ab,
|
|
5101
5083
|
Q as ac,
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5084
|
+
Ua as ad,
|
|
5085
|
+
fn as ae,
|
|
5086
|
+
Ke as af,
|
|
5087
|
+
pe as ag,
|
|
5088
|
+
et as ah,
|
|
5089
|
+
ae as ai,
|
|
5090
|
+
Qa as aj,
|
|
5091
|
+
_n as ak,
|
|
5092
|
+
vn as al,
|
|
5093
|
+
Ze as am,
|
|
5094
|
+
pn as an,
|
|
5095
|
+
Xa as ao,
|
|
5096
|
+
bn as ap,
|
|
5097
|
+
nn as aq,
|
|
5098
|
+
tn as ar,
|
|
5099
|
+
On as as,
|
|
5100
|
+
Bt as at,
|
|
5101
|
+
cn as au,
|
|
5102
|
+
Je as av,
|
|
5103
|
+
Nn as aw,
|
|
5104
|
+
Dn as ax,
|
|
5105
|
+
Tn as ay,
|
|
5106
|
+
Mn as az,
|
|
5107
|
+
fe as b,
|
|
5108
|
+
Kt as b0,
|
|
5109
|
+
pt as b1,
|
|
5110
|
+
Ar as b2,
|
|
5111
|
+
st as b3,
|
|
5112
|
+
Fr as b4,
|
|
5113
|
+
Vr as b5,
|
|
5114
|
+
it as b6,
|
|
5133
5115
|
X as b7,
|
|
5134
|
-
|
|
5116
|
+
tr as b8,
|
|
5135
5117
|
ie as b9,
|
|
5136
|
-
|
|
5118
|
+
Re as ba,
|
|
5137
5119
|
oe as bb,
|
|
5138
5120
|
ce as bc,
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5121
|
+
wr as bd,
|
|
5122
|
+
En as c,
|
|
5123
|
+
S as d,
|
|
5142
5124
|
J as e,
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5125
|
+
ye as f,
|
|
5126
|
+
lt as g,
|
|
5127
|
+
Pe as h,
|
|
5128
|
+
An as i,
|
|
5129
|
+
ne as j,
|
|
5130
|
+
Oe as k,
|
|
5131
|
+
Se as l,
|
|
5150
5132
|
B as m,
|
|
5151
5133
|
K as n,
|
|
5152
5134
|
Z as o,
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5135
|
+
Zn as p,
|
|
5136
|
+
g as q,
|
|
5137
|
+
de as r,
|
|
5138
|
+
Ht as s,
|
|
5139
|
+
we as t,
|
|
5140
|
+
xe as u,
|
|
5141
|
+
ke as v,
|
|
5142
|
+
$e as w,
|
|
5143
|
+
Le as x,
|
|
5144
|
+
Te as y,
|
|
5163
5145
|
U as z
|
|
5164
5146
|
};
|
|
5165
|
-
//# sourceMappingURL=utils-
|
|
5147
|
+
//# sourceMappingURL=utils-CnDzHNQ6.js.map
|