@ogc-maps/storybook-components 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CollectionBrowser/CollectionBrowser.d.ts +3 -1
- package/dist/components/CollectionBrowser/CollectionBrowser.d.ts.map +1 -1
- package/dist/components/ImageryEditor/ImageryEditor.d.ts +13 -0
- package/dist/components/ImageryEditor/ImageryEditor.d.ts.map +1 -0
- package/dist/components/ImageryEditor/ImageryList.d.ts +8 -0
- package/dist/components/ImageryEditor/ImageryList.d.ts.map +1 -0
- package/dist/components/ImageryEditor/index.d.ts +5 -0
- package/dist/components/ImageryEditor/index.d.ts.map +1 -0
- package/dist/components/ImageryPanel/ImageryPanel.d.ts +10 -0
- package/dist/components/ImageryPanel/ImageryPanel.d.ts.map +1 -0
- package/dist/components/ImageryPanel/index.d.ts +3 -0
- package/dist/components/ImageryPanel/index.d.ts.map +1 -0
- package/dist/components/SourceEditor/SourceEditor.d.ts +2 -2
- package/dist/components/SourceEditor/SourceEditor.d.ts.map +1 -1
- package/dist/components/SourceEditor/SourceList.d.ts.map +1 -1
- package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{geo-BxXVSJvJ.js → geo-PA_KiJwy.js} +489 -453
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +57 -50
- package/dist/hooks/useOgcCollections.d.ts +3 -2
- package/dist/hooks/useOgcCollections.d.ts.map +1 -1
- package/dist/hooks/useOgcFeatures.d.ts +2 -2
- package/dist/hooks/useOgcFeatures.d.ts.map +1 -1
- package/dist/{index-CtbLVsqD.js → index-Cz_PEKV1.js} +434 -410
- package/dist/main.js +1927 -1428
- package/dist/schemas/config.d.ts +293 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -16
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +17 -15
- package/dist/utils/ogcApi.d.ts +42 -13
- package/dist/utils/ogcApi.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var b;
|
|
2
2
|
(function(a) {
|
|
3
3
|
a.assertEqual = (r) => {
|
|
4
4
|
};
|
|
@@ -34,7 +34,7 @@ var k;
|
|
|
34
34
|
return r.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
|
|
35
35
|
}
|
|
36
36
|
a.joinValues = n, a.jsonStringifyReplacer = (r, s) => typeof s == "bigint" ? s.toString() : s;
|
|
37
|
-
})(
|
|
37
|
+
})(b || (b = {}));
|
|
38
38
|
var be;
|
|
39
39
|
(function(a) {
|
|
40
40
|
a.mergeShapes = (e, t) => ({
|
|
@@ -43,7 +43,7 @@ var be;
|
|
|
43
43
|
// second overwrites first
|
|
44
44
|
});
|
|
45
45
|
})(be || (be = {}));
|
|
46
|
-
const u =
|
|
46
|
+
const u = b.arrayToEnum([
|
|
47
47
|
"string",
|
|
48
48
|
"nan",
|
|
49
49
|
"number",
|
|
@@ -64,7 +64,7 @@ const u = k.arrayToEnum([
|
|
|
64
64
|
"never",
|
|
65
65
|
"map",
|
|
66
66
|
"set"
|
|
67
|
-
]),
|
|
67
|
+
]), L = (a) => {
|
|
68
68
|
switch (typeof a) {
|
|
69
69
|
case "undefined":
|
|
70
70
|
return u.undefined;
|
|
@@ -85,7 +85,7 @@ const u = k.arrayToEnum([
|
|
|
85
85
|
default:
|
|
86
86
|
return u.unknown;
|
|
87
87
|
}
|
|
88
|
-
}, l =
|
|
88
|
+
}, l = b.arrayToEnum([
|
|
89
89
|
"invalid_type",
|
|
90
90
|
"invalid_literal",
|
|
91
91
|
"custom",
|
|
@@ -130,10 +130,10 @@ class $ extends Error {
|
|
|
130
130
|
else if (i.path.length === 0)
|
|
131
131
|
n._errors.push(t(i));
|
|
132
132
|
else {
|
|
133
|
-
let o = n,
|
|
134
|
-
for (;
|
|
135
|
-
const p = i.path[
|
|
136
|
-
|
|
133
|
+
let o = n, h = 0;
|
|
134
|
+
for (; h < i.path.length; ) {
|
|
135
|
+
const p = i.path[h];
|
|
136
|
+
h === i.path.length - 1 ? (o[p] = o[p] || { _errors: [] }, o[p]._errors.push(t(i))) : o[p] = o[p] || { _errors: [] }, o = o[p], h++;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
};
|
|
@@ -147,7 +147,7 @@ class $ extends Error {
|
|
|
147
147
|
return this.message;
|
|
148
148
|
}
|
|
149
149
|
get message() {
|
|
150
|
-
return JSON.stringify(this.issues,
|
|
150
|
+
return JSON.stringify(this.issues, b.jsonStringifyReplacer, 2);
|
|
151
151
|
}
|
|
152
152
|
get isEmpty() {
|
|
153
153
|
return this.issues.length === 0;
|
|
@@ -174,19 +174,19 @@ const de = (a, e) => {
|
|
|
174
174
|
a.received === u.undefined ? t = "Required" : t = `Expected ${a.expected}, received ${a.received}`;
|
|
175
175
|
break;
|
|
176
176
|
case l.invalid_literal:
|
|
177
|
-
t = `Invalid literal value, expected ${JSON.stringify(a.expected,
|
|
177
|
+
t = `Invalid literal value, expected ${JSON.stringify(a.expected, b.jsonStringifyReplacer)}`;
|
|
178
178
|
break;
|
|
179
179
|
case l.unrecognized_keys:
|
|
180
|
-
t = `Unrecognized key(s) in object: ${
|
|
180
|
+
t = `Unrecognized key(s) in object: ${b.joinValues(a.keys, ", ")}`;
|
|
181
181
|
break;
|
|
182
182
|
case l.invalid_union:
|
|
183
183
|
t = "Invalid input";
|
|
184
184
|
break;
|
|
185
185
|
case l.invalid_union_discriminator:
|
|
186
|
-
t = `Invalid discriminator value. Expected ${
|
|
186
|
+
t = `Invalid discriminator value. Expected ${b.joinValues(a.options)}`;
|
|
187
187
|
break;
|
|
188
188
|
case l.invalid_enum_value:
|
|
189
|
-
t = `Invalid enum value. Expected ${
|
|
189
|
+
t = `Invalid enum value. Expected ${b.joinValues(a.options)}, received '${a.received}'`;
|
|
190
190
|
break;
|
|
191
191
|
case l.invalid_arguments:
|
|
192
192
|
t = "Invalid function arguments";
|
|
@@ -198,7 +198,7 @@ const de = (a, e) => {
|
|
|
198
198
|
t = "Invalid date";
|
|
199
199
|
break;
|
|
200
200
|
case l.invalid_string:
|
|
201
|
-
typeof a.validation == "object" ? "includes" in a.validation ? (t = `Invalid input: must include "${a.validation.includes}"`, typeof a.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${a.validation.position}`)) : "startsWith" in a.validation ? t = `Invalid input: must start with "${a.validation.startsWith}"` : "endsWith" in a.validation ? t = `Invalid input: must end with "${a.validation.endsWith}"` :
|
|
201
|
+
typeof a.validation == "object" ? "includes" in a.validation ? (t = `Invalid input: must include "${a.validation.includes}"`, typeof a.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${a.validation.position}`)) : "startsWith" in a.validation ? t = `Invalid input: must start with "${a.validation.startsWith}"` : "endsWith" in a.validation ? t = `Invalid input: must end with "${a.validation.endsWith}"` : b.assertNever(a.validation) : a.validation !== "regex" ? t = `Invalid ${a.validation}` : t = "Invalid";
|
|
202
202
|
break;
|
|
203
203
|
case l.too_small:
|
|
204
204
|
a.type === "array" ? t = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "more than"} ${a.minimum} element(s)` : a.type === "string" ? t = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at least" : "over"} ${a.minimum} character(s)` : a.type === "number" ? t = `Number must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${a.minimum}` : a.type === "bigint" ? t = `Number must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${a.minimum}` : a.type === "date" ? t = `Date must be ${a.exact ? "exactly equal to " : a.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(a.minimum))}` : t = "Invalid input";
|
|
@@ -219,7 +219,7 @@ const de = (a, e) => {
|
|
|
219
219
|
t = "Number must be finite";
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
|
-
t = e.defaultError,
|
|
222
|
+
t = e.defaultError, b.assertNever(a);
|
|
223
223
|
}
|
|
224
224
|
return { message: t };
|
|
225
225
|
};
|
|
@@ -239,8 +239,8 @@ const Fe = (a) => {
|
|
|
239
239
|
message: r.message
|
|
240
240
|
};
|
|
241
241
|
let o = "";
|
|
242
|
-
const
|
|
243
|
-
for (const p of
|
|
242
|
+
const h = n.filter((p) => !!p).slice().reverse();
|
|
243
|
+
for (const p of h)
|
|
244
244
|
o = p(i, { data: e, defaultError: o }).message;
|
|
245
245
|
return {
|
|
246
246
|
...r,
|
|
@@ -309,11 +309,11 @@ class O {
|
|
|
309
309
|
}
|
|
310
310
|
const m = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
|
-
}), H = (a) => ({ status: "dirty", value: a }), A = (a) => ({ status: "valid", value: a }), we = (a) => a.status === "aborted", Se = (a) => a.status === "dirty",
|
|
313
|
-
var
|
|
312
|
+
}), H = (a) => ({ status: "dirty", value: a }), A = (a) => ({ status: "valid", value: a }), we = (a) => a.status === "aborted", Se = (a) => a.status === "dirty", q = (a) => a.status === "valid", Q = (a) => typeof Promise < "u" && a instanceof Promise;
|
|
313
|
+
var f;
|
|
314
314
|
(function(a) {
|
|
315
315
|
a.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, a.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
316
|
-
})(
|
|
316
|
+
})(f || (f = {}));
|
|
317
317
|
class Z {
|
|
318
318
|
constructor(e, t, n, r) {
|
|
319
319
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
@@ -323,7 +323,7 @@ class Z {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
const Te = (a, e) => {
|
|
326
|
-
if (
|
|
326
|
+
if (q(e))
|
|
327
327
|
return { success: !0, data: e.value };
|
|
328
328
|
if (!a.common.issues.length)
|
|
329
329
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -337,15 +337,15 @@ const Te = (a, e) => {
|
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
};
|
|
340
|
-
function
|
|
340
|
+
function _(a) {
|
|
341
341
|
if (!a)
|
|
342
342
|
return {};
|
|
343
343
|
const { errorMap: e, invalid_type_error: t, required_error: n, description: r } = a;
|
|
344
344
|
if (e && (t || n))
|
|
345
345
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
346
346
|
return e ? { errorMap: e, description: r } : { errorMap: (i, o) => {
|
|
347
|
-
const { message:
|
|
348
|
-
return i.code === "invalid_enum_value" ? { message:
|
|
347
|
+
const { message: h } = a;
|
|
348
|
+
return i.code === "invalid_enum_value" ? { message: h ?? o.defaultError } : typeof o.data > "u" ? { message: h ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: h ?? t ?? o.defaultError };
|
|
349
349
|
}, description: r };
|
|
350
350
|
}
|
|
351
351
|
class x {
|
|
@@ -353,13 +353,13 @@ class x {
|
|
|
353
353
|
return this._def.description;
|
|
354
354
|
}
|
|
355
355
|
_getType(e) {
|
|
356
|
-
return
|
|
356
|
+
return L(e.data);
|
|
357
357
|
}
|
|
358
358
|
_getOrReturnCtx(e, t) {
|
|
359
359
|
return t || {
|
|
360
360
|
common: e.parent.common,
|
|
361
361
|
data: e.data,
|
|
362
|
-
parsedType:
|
|
362
|
+
parsedType: L(e.data),
|
|
363
363
|
schemaErrorMap: this._def.errorMap,
|
|
364
364
|
path: e.path,
|
|
365
365
|
parent: e.parent
|
|
@@ -371,7 +371,7 @@ class x {
|
|
|
371
371
|
ctx: {
|
|
372
372
|
common: e.parent.common,
|
|
373
373
|
data: e.data,
|
|
374
|
-
parsedType:
|
|
374
|
+
parsedType: L(e.data),
|
|
375
375
|
schemaErrorMap: this._def.errorMap,
|
|
376
376
|
path: e.path,
|
|
377
377
|
parent: e.parent
|
|
@@ -405,7 +405,7 @@ class x {
|
|
|
405
405
|
schemaErrorMap: this._def.errorMap,
|
|
406
406
|
parent: null,
|
|
407
407
|
data: e,
|
|
408
|
-
parsedType:
|
|
408
|
+
parsedType: L(e)
|
|
409
409
|
}, r = this._parseSync({ data: e, path: n.path, parent: n });
|
|
410
410
|
return Te(n, r);
|
|
411
411
|
}
|
|
@@ -420,12 +420,12 @@ class x {
|
|
|
420
420
|
schemaErrorMap: this._def.errorMap,
|
|
421
421
|
parent: null,
|
|
422
422
|
data: e,
|
|
423
|
-
parsedType:
|
|
423
|
+
parsedType: L(e)
|
|
424
424
|
};
|
|
425
425
|
if (!this["~standard"].async)
|
|
426
426
|
try {
|
|
427
427
|
const s = this._parseSync({ data: e, path: [], parent: t });
|
|
428
|
-
return
|
|
428
|
+
return q(s) ? {
|
|
429
429
|
value: s.value
|
|
430
430
|
} : {
|
|
431
431
|
issues: t.common.issues
|
|
@@ -436,7 +436,7 @@ class x {
|
|
|
436
436
|
async: !0
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
return this._parseAsync({ data: e, path: [], parent: t }).then((s) =>
|
|
439
|
+
return this._parseAsync({ data: e, path: [], parent: t }).then((s) => q(s) ? {
|
|
440
440
|
value: s.value
|
|
441
441
|
} : {
|
|
442
442
|
issues: t.common.issues
|
|
@@ -459,7 +459,7 @@ class x {
|
|
|
459
459
|
schemaErrorMap: this._def.errorMap,
|
|
460
460
|
parent: null,
|
|
461
461
|
data: e,
|
|
462
|
-
parsedType:
|
|
462
|
+
parsedType: L(e)
|
|
463
463
|
}, r = this._parse({ data: e, path: n.path, parent: n }), s = await (Q(r) ? r : Promise.resolve(r));
|
|
464
464
|
return Te(n, s);
|
|
465
465
|
}
|
|
@@ -470,7 +470,7 @@ class x {
|
|
|
470
470
|
code: l.custom,
|
|
471
471
|
...n(r)
|
|
472
472
|
});
|
|
473
|
-
return typeof Promise < "u" && i instanceof Promise ? i.then((
|
|
473
|
+
return typeof Promise < "u" && i instanceof Promise ? i.then((h) => h ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
refinement(e, t) {
|
|
@@ -494,7 +494,7 @@ class x {
|
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
optional() {
|
|
497
|
-
return
|
|
497
|
+
return j.create(this, this._def);
|
|
498
498
|
}
|
|
499
499
|
nullable() {
|
|
500
500
|
return F.create(this, this._def);
|
|
@@ -516,7 +516,7 @@ class x {
|
|
|
516
516
|
}
|
|
517
517
|
transform(e) {
|
|
518
518
|
return new P({
|
|
519
|
-
...
|
|
519
|
+
..._(this._def),
|
|
520
520
|
schema: this,
|
|
521
521
|
typeName: y.ZodEffects,
|
|
522
522
|
effect: { type: "transform", transform: e }
|
|
@@ -525,23 +525,23 @@ class x {
|
|
|
525
525
|
default(e) {
|
|
526
526
|
const t = typeof e == "function" ? e : () => e;
|
|
527
527
|
return new re({
|
|
528
|
-
...
|
|
528
|
+
..._(this._def),
|
|
529
529
|
innerType: this,
|
|
530
530
|
defaultValue: t,
|
|
531
531
|
typeName: y.ZodDefault
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
534
|
brand() {
|
|
535
|
-
return new
|
|
535
|
+
return new Ee({
|
|
536
536
|
typeName: y.ZodBranded,
|
|
537
537
|
type: this,
|
|
538
|
-
...
|
|
538
|
+
..._(this._def)
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
541
|
catch(e) {
|
|
542
542
|
const t = typeof e == "function" ? e : () => e;
|
|
543
543
|
return new se({
|
|
544
|
-
...
|
|
544
|
+
..._(this._def),
|
|
545
545
|
innerType: this,
|
|
546
546
|
catchValue: t,
|
|
547
547
|
typeName: y.ZodCatch
|
|
@@ -567,20 +567,20 @@ class x {
|
|
|
567
567
|
return this.safeParse(null).success;
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
const Ue = /^c[^\s-]{8,}$/i, Be = /^[0-9a-z]+$/,
|
|
570
|
+
const Ue = /^c[^\s-]{8,}$/i, Be = /^[0-9a-z]+$/, qe = /^[0-9A-HJKMNP-TV-Z]{26}$/i, We = /^[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, Je = /^[a-z0-9_-]{21}$/i, He = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ge = /^[-+]?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)?)??$/, Ye = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
571
571
|
let ce;
|
|
572
572
|
const Xe = /^(?:(?: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])$/, Ke = /^(?:(?: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])$/, et = /^(([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]))$/, tt = /^(([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])$/, at = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Re = "((\\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])))", rt = new RegExp(`^${Re}$`);
|
|
573
|
-
function
|
|
573
|
+
function Ie(a) {
|
|
574
574
|
let e = "[0-5]\\d";
|
|
575
575
|
a.precision ? e = `${e}\\.\\d{${a.precision}}` : a.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
576
576
|
const t = a.precision ? "+" : "?";
|
|
577
577
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
578
578
|
}
|
|
579
579
|
function st(a) {
|
|
580
|
-
return new RegExp(`^${
|
|
580
|
+
return new RegExp(`^${Ie(a)}$`);
|
|
581
581
|
}
|
|
582
582
|
function it(a) {
|
|
583
|
-
let e = `${Re}T${
|
|
583
|
+
let e = `${Re}T${Ie(a)}`;
|
|
584
584
|
const t = [];
|
|
585
585
|
return t.push(a.local ? "Z?" : "Z"), a.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
586
586
|
}
|
|
@@ -603,7 +603,7 @@ function lt(a, e) {
|
|
|
603
603
|
function ct(a, e) {
|
|
604
604
|
return !!((e === "v4" || !e) && Ke.test(a) || (e === "v6" || !e) && tt.test(a));
|
|
605
605
|
}
|
|
606
|
-
class
|
|
606
|
+
class I extends x {
|
|
607
607
|
_parse(e) {
|
|
608
608
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
|
|
609
609
|
const s = this._getOrReturnCtx(e);
|
|
@@ -664,7 +664,7 @@ class j extends x {
|
|
|
664
664
|
message: s.message
|
|
665
665
|
}), n.dirty());
|
|
666
666
|
else if (s.kind === "uuid")
|
|
667
|
-
|
|
667
|
+
We.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
668
668
|
validation: "uuid",
|
|
669
669
|
code: l.invalid_string,
|
|
670
670
|
message: s.message
|
|
@@ -688,7 +688,7 @@ class j extends x {
|
|
|
688
688
|
message: s.message
|
|
689
689
|
}), n.dirty());
|
|
690
690
|
else if (s.kind === "ulid")
|
|
691
|
-
|
|
691
|
+
qe.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
692
692
|
validation: "ulid",
|
|
693
693
|
code: l.invalid_string,
|
|
694
694
|
message: s.message
|
|
@@ -755,63 +755,63 @@ class j extends x {
|
|
|
755
755
|
validation: "base64url",
|
|
756
756
|
code: l.invalid_string,
|
|
757
757
|
message: s.message
|
|
758
|
-
}), n.dirty()) :
|
|
758
|
+
}), n.dirty()) : b.assertNever(s);
|
|
759
759
|
return { status: n.value, value: e.data };
|
|
760
760
|
}
|
|
761
761
|
_regex(e, t, n) {
|
|
762
762
|
return this.refinement((r) => e.test(r), {
|
|
763
763
|
validation: t,
|
|
764
764
|
code: l.invalid_string,
|
|
765
|
-
...
|
|
765
|
+
...f.errToObj(n)
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
_addCheck(e) {
|
|
769
|
-
return new
|
|
769
|
+
return new I({
|
|
770
770
|
...this._def,
|
|
771
771
|
checks: [...this._def.checks, e]
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
email(e) {
|
|
775
|
-
return this._addCheck({ kind: "email", ...
|
|
775
|
+
return this._addCheck({ kind: "email", ...f.errToObj(e) });
|
|
776
776
|
}
|
|
777
777
|
url(e) {
|
|
778
|
-
return this._addCheck({ kind: "url", ...
|
|
778
|
+
return this._addCheck({ kind: "url", ...f.errToObj(e) });
|
|
779
779
|
}
|
|
780
780
|
emoji(e) {
|
|
781
|
-
return this._addCheck({ kind: "emoji", ...
|
|
781
|
+
return this._addCheck({ kind: "emoji", ...f.errToObj(e) });
|
|
782
782
|
}
|
|
783
783
|
uuid(e) {
|
|
784
|
-
return this._addCheck({ kind: "uuid", ...
|
|
784
|
+
return this._addCheck({ kind: "uuid", ...f.errToObj(e) });
|
|
785
785
|
}
|
|
786
786
|
nanoid(e) {
|
|
787
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
787
|
+
return this._addCheck({ kind: "nanoid", ...f.errToObj(e) });
|
|
788
788
|
}
|
|
789
789
|
cuid(e) {
|
|
790
|
-
return this._addCheck({ kind: "cuid", ...
|
|
790
|
+
return this._addCheck({ kind: "cuid", ...f.errToObj(e) });
|
|
791
791
|
}
|
|
792
792
|
cuid2(e) {
|
|
793
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
793
|
+
return this._addCheck({ kind: "cuid2", ...f.errToObj(e) });
|
|
794
794
|
}
|
|
795
795
|
ulid(e) {
|
|
796
|
-
return this._addCheck({ kind: "ulid", ...
|
|
796
|
+
return this._addCheck({ kind: "ulid", ...f.errToObj(e) });
|
|
797
797
|
}
|
|
798
798
|
base64(e) {
|
|
799
|
-
return this._addCheck({ kind: "base64", ...
|
|
799
|
+
return this._addCheck({ kind: "base64", ...f.errToObj(e) });
|
|
800
800
|
}
|
|
801
801
|
base64url(e) {
|
|
802
802
|
return this._addCheck({
|
|
803
803
|
kind: "base64url",
|
|
804
|
-
...
|
|
804
|
+
...f.errToObj(e)
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
jwt(e) {
|
|
808
|
-
return this._addCheck({ kind: "jwt", ...
|
|
808
|
+
return this._addCheck({ kind: "jwt", ...f.errToObj(e) });
|
|
809
809
|
}
|
|
810
810
|
ip(e) {
|
|
811
|
-
return this._addCheck({ kind: "ip", ...
|
|
811
|
+
return this._addCheck({ kind: "ip", ...f.errToObj(e) });
|
|
812
812
|
}
|
|
813
813
|
cidr(e) {
|
|
814
|
-
return this._addCheck({ kind: "cidr", ...
|
|
814
|
+
return this._addCheck({ kind: "cidr", ...f.errToObj(e) });
|
|
815
815
|
}
|
|
816
816
|
datetime(e) {
|
|
817
817
|
return typeof e == "string" ? this._addCheck({
|
|
@@ -825,7 +825,7 @@ class j extends x {
|
|
|
825
825
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
826
826
|
offset: (e == null ? void 0 : e.offset) ?? !1,
|
|
827
827
|
local: (e == null ? void 0 : e.local) ?? !1,
|
|
828
|
-
...
|
|
828
|
+
...f.errToObj(e == null ? void 0 : e.message)
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
date(e) {
|
|
@@ -839,17 +839,17 @@ class j extends x {
|
|
|
839
839
|
}) : this._addCheck({
|
|
840
840
|
kind: "time",
|
|
841
841
|
precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
|
|
842
|
-
...
|
|
842
|
+
...f.errToObj(e == null ? void 0 : e.message)
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
845
|
duration(e) {
|
|
846
|
-
return this._addCheck({ kind: "duration", ...
|
|
846
|
+
return this._addCheck({ kind: "duration", ...f.errToObj(e) });
|
|
847
847
|
}
|
|
848
848
|
regex(e, t) {
|
|
849
849
|
return this._addCheck({
|
|
850
850
|
kind: "regex",
|
|
851
851
|
regex: e,
|
|
852
|
-
...
|
|
852
|
+
...f.errToObj(t)
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
855
|
includes(e, t) {
|
|
@@ -857,64 +857,64 @@ class j extends x {
|
|
|
857
857
|
kind: "includes",
|
|
858
858
|
value: e,
|
|
859
859
|
position: t == null ? void 0 : t.position,
|
|
860
|
-
...
|
|
860
|
+
...f.errToObj(t == null ? void 0 : t.message)
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
startsWith(e, t) {
|
|
864
864
|
return this._addCheck({
|
|
865
865
|
kind: "startsWith",
|
|
866
866
|
value: e,
|
|
867
|
-
...
|
|
867
|
+
...f.errToObj(t)
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
870
|
endsWith(e, t) {
|
|
871
871
|
return this._addCheck({
|
|
872
872
|
kind: "endsWith",
|
|
873
873
|
value: e,
|
|
874
|
-
...
|
|
874
|
+
...f.errToObj(t)
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
min(e, t) {
|
|
878
878
|
return this._addCheck({
|
|
879
879
|
kind: "min",
|
|
880
880
|
value: e,
|
|
881
|
-
...
|
|
881
|
+
...f.errToObj(t)
|
|
882
882
|
});
|
|
883
883
|
}
|
|
884
884
|
max(e, t) {
|
|
885
885
|
return this._addCheck({
|
|
886
886
|
kind: "max",
|
|
887
887
|
value: e,
|
|
888
|
-
...
|
|
888
|
+
...f.errToObj(t)
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
length(e, t) {
|
|
892
892
|
return this._addCheck({
|
|
893
893
|
kind: "length",
|
|
894
894
|
value: e,
|
|
895
|
-
...
|
|
895
|
+
...f.errToObj(t)
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
/**
|
|
899
899
|
* Equivalent to `.min(1)`
|
|
900
900
|
*/
|
|
901
901
|
nonempty(e) {
|
|
902
|
-
return this.min(1,
|
|
902
|
+
return this.min(1, f.errToObj(e));
|
|
903
903
|
}
|
|
904
904
|
trim() {
|
|
905
|
-
return new
|
|
905
|
+
return new I({
|
|
906
906
|
...this._def,
|
|
907
907
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
910
|
toLowerCase() {
|
|
911
|
-
return new
|
|
911
|
+
return new I({
|
|
912
912
|
...this._def,
|
|
913
913
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
toUpperCase() {
|
|
917
|
-
return new
|
|
917
|
+
return new I({
|
|
918
918
|
...this._def,
|
|
919
919
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
920
920
|
});
|
|
@@ -980,17 +980,17 @@ class j extends x {
|
|
|
980
980
|
return e;
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
|
|
983
|
+
I.create = (a) => new I({
|
|
984
984
|
checks: [],
|
|
985
985
|
typeName: y.ZodString,
|
|
986
986
|
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
987
|
-
...
|
|
987
|
+
..._(a)
|
|
988
988
|
});
|
|
989
989
|
function dt(a, e) {
|
|
990
990
|
const t = (a.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = t > n ? t : n, s = Number.parseInt(a.toFixed(r).replace(".", "")), i = Number.parseInt(e.toFixed(r).replace(".", ""));
|
|
991
991
|
return s % i / 10 ** r;
|
|
992
992
|
}
|
|
993
|
-
class
|
|
993
|
+
class W extends x {
|
|
994
994
|
constructor() {
|
|
995
995
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
996
996
|
}
|
|
@@ -1006,7 +1006,7 @@ class q extends x {
|
|
|
1006
1006
|
let n;
|
|
1007
1007
|
const r = new O();
|
|
1008
1008
|
for (const s of this._def.checks)
|
|
1009
|
-
s.kind === "int" ?
|
|
1009
|
+
s.kind === "int" ? b.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1010
1010
|
code: l.invalid_type,
|
|
1011
1011
|
expected: "integer",
|
|
1012
1012
|
received: "float",
|
|
@@ -1032,23 +1032,23 @@ class q extends x {
|
|
|
1032
1032
|
}), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1033
1033
|
code: l.not_finite,
|
|
1034
1034
|
message: s.message
|
|
1035
|
-
}), r.dirty()) :
|
|
1035
|
+
}), r.dirty()) : b.assertNever(s);
|
|
1036
1036
|
return { status: r.value, value: e.data };
|
|
1037
1037
|
}
|
|
1038
1038
|
gte(e, t) {
|
|
1039
|
-
return this.setLimit("min", e, !0,
|
|
1039
|
+
return this.setLimit("min", e, !0, f.toString(t));
|
|
1040
1040
|
}
|
|
1041
1041
|
gt(e, t) {
|
|
1042
|
-
return this.setLimit("min", e, !1,
|
|
1042
|
+
return this.setLimit("min", e, !1, f.toString(t));
|
|
1043
1043
|
}
|
|
1044
1044
|
lte(e, t) {
|
|
1045
|
-
return this.setLimit("max", e, !0,
|
|
1045
|
+
return this.setLimit("max", e, !0, f.toString(t));
|
|
1046
1046
|
}
|
|
1047
1047
|
lt(e, t) {
|
|
1048
|
-
return this.setLimit("max", e, !1,
|
|
1048
|
+
return this.setLimit("max", e, !1, f.toString(t));
|
|
1049
1049
|
}
|
|
1050
1050
|
setLimit(e, t, n, r) {
|
|
1051
|
-
return new
|
|
1051
|
+
return new W({
|
|
1052
1052
|
...this._def,
|
|
1053
1053
|
checks: [
|
|
1054
1054
|
...this._def.checks,
|
|
@@ -1056,13 +1056,13 @@ class q extends x {
|
|
|
1056
1056
|
kind: e,
|
|
1057
1057
|
value: t,
|
|
1058
1058
|
inclusive: n,
|
|
1059
|
-
message:
|
|
1059
|
+
message: f.toString(r)
|
|
1060
1060
|
}
|
|
1061
1061
|
]
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
_addCheck(e) {
|
|
1065
|
-
return new
|
|
1065
|
+
return new W({
|
|
1066
1066
|
...this._def,
|
|
1067
1067
|
checks: [...this._def.checks, e]
|
|
1068
1068
|
});
|
|
@@ -1070,7 +1070,7 @@ class q extends x {
|
|
|
1070
1070
|
int(e) {
|
|
1071
1071
|
return this._addCheck({
|
|
1072
1072
|
kind: "int",
|
|
1073
|
-
message:
|
|
1073
|
+
message: f.toString(e)
|
|
1074
1074
|
});
|
|
1075
1075
|
}
|
|
1076
1076
|
positive(e) {
|
|
@@ -1078,7 +1078,7 @@ class q extends x {
|
|
|
1078
1078
|
kind: "min",
|
|
1079
1079
|
value: 0,
|
|
1080
1080
|
inclusive: !1,
|
|
1081
|
-
message:
|
|
1081
|
+
message: f.toString(e)
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
negative(e) {
|
|
@@ -1086,7 +1086,7 @@ class q extends x {
|
|
|
1086
1086
|
kind: "max",
|
|
1087
1087
|
value: 0,
|
|
1088
1088
|
inclusive: !1,
|
|
1089
|
-
message:
|
|
1089
|
+
message: f.toString(e)
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
nonpositive(e) {
|
|
@@ -1094,7 +1094,7 @@ class q extends x {
|
|
|
1094
1094
|
kind: "max",
|
|
1095
1095
|
value: 0,
|
|
1096
1096
|
inclusive: !0,
|
|
1097
|
-
message:
|
|
1097
|
+
message: f.toString(e)
|
|
1098
1098
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
nonnegative(e) {
|
|
@@ -1102,20 +1102,20 @@ class q extends x {
|
|
|
1102
1102
|
kind: "min",
|
|
1103
1103
|
value: 0,
|
|
1104
1104
|
inclusive: !0,
|
|
1105
|
-
message:
|
|
1105
|
+
message: f.toString(e)
|
|
1106
1106
|
});
|
|
1107
1107
|
}
|
|
1108
1108
|
multipleOf(e, t) {
|
|
1109
1109
|
return this._addCheck({
|
|
1110
1110
|
kind: "multipleOf",
|
|
1111
1111
|
value: e,
|
|
1112
|
-
message:
|
|
1112
|
+
message: f.toString(t)
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
1115
|
finite(e) {
|
|
1116
1116
|
return this._addCheck({
|
|
1117
1117
|
kind: "finite",
|
|
1118
|
-
message:
|
|
1118
|
+
message: f.toString(e)
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
safe(e) {
|
|
@@ -1123,12 +1123,12 @@ class q extends x {
|
|
|
1123
1123
|
kind: "min",
|
|
1124
1124
|
inclusive: !0,
|
|
1125
1125
|
value: Number.MIN_SAFE_INTEGER,
|
|
1126
|
-
message:
|
|
1126
|
+
message: f.toString(e)
|
|
1127
1127
|
})._addCheck({
|
|
1128
1128
|
kind: "max",
|
|
1129
1129
|
inclusive: !0,
|
|
1130
1130
|
value: Number.MAX_SAFE_INTEGER,
|
|
1131
|
-
message:
|
|
1131
|
+
message: f.toString(e)
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
get minValue() {
|
|
@@ -1144,7 +1144,7 @@ class q extends x {
|
|
|
1144
1144
|
return e;
|
|
1145
1145
|
}
|
|
1146
1146
|
get isInt() {
|
|
1147
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1147
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && b.isInteger(e.value));
|
|
1148
1148
|
}
|
|
1149
1149
|
get isFinite() {
|
|
1150
1150
|
let e = null, t = null;
|
|
@@ -1156,11 +1156,11 @@ class q extends x {
|
|
|
1156
1156
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
|
|
1159
|
+
W.create = (a) => new W({
|
|
1160
1160
|
checks: [],
|
|
1161
1161
|
typeName: y.ZodNumber,
|
|
1162
1162
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1163
|
-
...
|
|
1163
|
+
..._(a)
|
|
1164
1164
|
});
|
|
1165
1165
|
class G extends x {
|
|
1166
1166
|
constructor() {
|
|
@@ -1194,7 +1194,7 @@ class G extends x {
|
|
|
1194
1194
|
code: l.not_multiple_of,
|
|
1195
1195
|
multipleOf: s.value,
|
|
1196
1196
|
message: s.message
|
|
1197
|
-
}), r.dirty()) :
|
|
1197
|
+
}), r.dirty()) : b.assertNever(s);
|
|
1198
1198
|
return { status: r.value, value: e.data };
|
|
1199
1199
|
}
|
|
1200
1200
|
_getInvalidInput(e) {
|
|
@@ -1206,16 +1206,16 @@ class G extends x {
|
|
|
1206
1206
|
}), m;
|
|
1207
1207
|
}
|
|
1208
1208
|
gte(e, t) {
|
|
1209
|
-
return this.setLimit("min", e, !0,
|
|
1209
|
+
return this.setLimit("min", e, !0, f.toString(t));
|
|
1210
1210
|
}
|
|
1211
1211
|
gt(e, t) {
|
|
1212
|
-
return this.setLimit("min", e, !1,
|
|
1212
|
+
return this.setLimit("min", e, !1, f.toString(t));
|
|
1213
1213
|
}
|
|
1214
1214
|
lte(e, t) {
|
|
1215
|
-
return this.setLimit("max", e, !0,
|
|
1215
|
+
return this.setLimit("max", e, !0, f.toString(t));
|
|
1216
1216
|
}
|
|
1217
1217
|
lt(e, t) {
|
|
1218
|
-
return this.setLimit("max", e, !1,
|
|
1218
|
+
return this.setLimit("max", e, !1, f.toString(t));
|
|
1219
1219
|
}
|
|
1220
1220
|
setLimit(e, t, n, r) {
|
|
1221
1221
|
return new G({
|
|
@@ -1226,7 +1226,7 @@ class G extends x {
|
|
|
1226
1226
|
kind: e,
|
|
1227
1227
|
value: t,
|
|
1228
1228
|
inclusive: n,
|
|
1229
|
-
message:
|
|
1229
|
+
message: f.toString(r)
|
|
1230
1230
|
}
|
|
1231
1231
|
]
|
|
1232
1232
|
});
|
|
@@ -1242,7 +1242,7 @@ class G extends x {
|
|
|
1242
1242
|
kind: "min",
|
|
1243
1243
|
value: BigInt(0),
|
|
1244
1244
|
inclusive: !1,
|
|
1245
|
-
message:
|
|
1245
|
+
message: f.toString(e)
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
1248
1248
|
negative(e) {
|
|
@@ -1250,7 +1250,7 @@ class G extends x {
|
|
|
1250
1250
|
kind: "max",
|
|
1251
1251
|
value: BigInt(0),
|
|
1252
1252
|
inclusive: !1,
|
|
1253
|
-
message:
|
|
1253
|
+
message: f.toString(e)
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
nonpositive(e) {
|
|
@@ -1258,7 +1258,7 @@ class G extends x {
|
|
|
1258
1258
|
kind: "max",
|
|
1259
1259
|
value: BigInt(0),
|
|
1260
1260
|
inclusive: !0,
|
|
1261
|
-
message:
|
|
1261
|
+
message: f.toString(e)
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
1264
|
nonnegative(e) {
|
|
@@ -1266,14 +1266,14 @@ class G extends x {
|
|
|
1266
1266
|
kind: "min",
|
|
1267
1267
|
value: BigInt(0),
|
|
1268
1268
|
inclusive: !0,
|
|
1269
|
-
message:
|
|
1269
|
+
message: f.toString(e)
|
|
1270
1270
|
});
|
|
1271
1271
|
}
|
|
1272
1272
|
multipleOf(e, t) {
|
|
1273
1273
|
return this._addCheck({
|
|
1274
1274
|
kind: "multipleOf",
|
|
1275
1275
|
value: e,
|
|
1276
|
-
message:
|
|
1276
|
+
message: f.toString(t)
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
1279
|
get minValue() {
|
|
@@ -1293,7 +1293,7 @@ G.create = (a) => new G({
|
|
|
1293
1293
|
checks: [],
|
|
1294
1294
|
typeName: y.ZodBigInt,
|
|
1295
1295
|
coerce: (a == null ? void 0 : a.coerce) ?? !1,
|
|
1296
|
-
...
|
|
1296
|
+
..._(a)
|
|
1297
1297
|
});
|
|
1298
1298
|
class ue extends x {
|
|
1299
1299
|
_parse(e) {
|
|
@@ -1311,7 +1311,7 @@ class ue extends x {
|
|
|
1311
1311
|
ue.create = (a) => new ue({
|
|
1312
1312
|
typeName: y.ZodBoolean,
|
|
1313
1313
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1314
|
-
...
|
|
1314
|
+
..._(a)
|
|
1315
1315
|
});
|
|
1316
1316
|
class X extends x {
|
|
1317
1317
|
_parse(e) {
|
|
@@ -1346,7 +1346,7 @@ class X extends x {
|
|
|
1346
1346
|
exact: !1,
|
|
1347
1347
|
maximum: s.value,
|
|
1348
1348
|
type: "date"
|
|
1349
|
-
}), n.dirty()) :
|
|
1349
|
+
}), n.dirty()) : b.assertNever(s);
|
|
1350
1350
|
return {
|
|
1351
1351
|
status: n.value,
|
|
1352
1352
|
value: new Date(e.data.getTime())
|
|
@@ -1362,14 +1362,14 @@ class X extends x {
|
|
|
1362
1362
|
return this._addCheck({
|
|
1363
1363
|
kind: "min",
|
|
1364
1364
|
value: e.getTime(),
|
|
1365
|
-
message:
|
|
1365
|
+
message: f.toString(t)
|
|
1366
1366
|
});
|
|
1367
1367
|
}
|
|
1368
1368
|
max(e, t) {
|
|
1369
1369
|
return this._addCheck({
|
|
1370
1370
|
kind: "max",
|
|
1371
1371
|
value: e.getTime(),
|
|
1372
|
-
message:
|
|
1372
|
+
message: f.toString(t)
|
|
1373
1373
|
});
|
|
1374
1374
|
}
|
|
1375
1375
|
get minDate() {
|
|
@@ -1389,7 +1389,7 @@ X.create = (a) => new X({
|
|
|
1389
1389
|
checks: [],
|
|
1390
1390
|
coerce: (a == null ? void 0 : a.coerce) || !1,
|
|
1391
1391
|
typeName: y.ZodDate,
|
|
1392
|
-
...
|
|
1392
|
+
..._(a)
|
|
1393
1393
|
});
|
|
1394
1394
|
class Ce extends x {
|
|
1395
1395
|
_parse(e) {
|
|
@@ -1406,9 +1406,9 @@ class Ce extends x {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
Ce.create = (a) => new Ce({
|
|
1408
1408
|
typeName: y.ZodSymbol,
|
|
1409
|
-
...
|
|
1409
|
+
..._(a)
|
|
1410
1410
|
});
|
|
1411
|
-
class
|
|
1411
|
+
class fe extends x {
|
|
1412
1412
|
_parse(e) {
|
|
1413
1413
|
if (this._getType(e) !== u.undefined) {
|
|
1414
1414
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1421,11 +1421,11 @@ class he extends x {
|
|
|
1421
1421
|
return A(e.data);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
|
|
1424
|
+
fe.create = (a) => new fe({
|
|
1425
1425
|
typeName: y.ZodUndefined,
|
|
1426
|
-
...
|
|
1426
|
+
..._(a)
|
|
1427
1427
|
});
|
|
1428
|
-
class
|
|
1428
|
+
class he extends x {
|
|
1429
1429
|
_parse(e) {
|
|
1430
1430
|
if (this._getType(e) !== u.null) {
|
|
1431
1431
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1438,9 +1438,9 @@ class fe extends x {
|
|
|
1438
1438
|
return A(e.data);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
he.create = (a) => new he({
|
|
1442
1442
|
typeName: y.ZodNull,
|
|
1443
|
-
...
|
|
1443
|
+
..._(a)
|
|
1444
1444
|
});
|
|
1445
1445
|
class Oe extends x {
|
|
1446
1446
|
constructor() {
|
|
@@ -1452,7 +1452,7 @@ class Oe extends x {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
Oe.create = (a) => new Oe({
|
|
1454
1454
|
typeName: y.ZodAny,
|
|
1455
|
-
...
|
|
1455
|
+
..._(a)
|
|
1456
1456
|
});
|
|
1457
1457
|
class pe extends x {
|
|
1458
1458
|
constructor() {
|
|
@@ -1464,9 +1464,9 @@ class pe extends x {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
pe.create = (a) => new pe({
|
|
1466
1466
|
typeName: y.ZodUnknown,
|
|
1467
|
-
...
|
|
1467
|
+
..._(a)
|
|
1468
1468
|
});
|
|
1469
|
-
class
|
|
1469
|
+
class M extends x {
|
|
1470
1470
|
_parse(e) {
|
|
1471
1471
|
const t = this._getOrReturnCtx(e);
|
|
1472
1472
|
return c(t, {
|
|
@@ -1476,9 +1476,9 @@ class L extends x {
|
|
|
1476
1476
|
}), m;
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
|
|
1479
|
+
M.create = (a) => new M({
|
|
1480
1480
|
typeName: y.ZodNever,
|
|
1481
|
-
...
|
|
1481
|
+
..._(a)
|
|
1482
1482
|
});
|
|
1483
1483
|
class Ae extends x {
|
|
1484
1484
|
_parse(e) {
|
|
@@ -1495,7 +1495,7 @@ class Ae extends x {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
Ae.create = (a) => new Ae({
|
|
1497
1497
|
typeName: y.ZodVoid,
|
|
1498
|
-
...
|
|
1498
|
+
..._(a)
|
|
1499
1499
|
});
|
|
1500
1500
|
class N extends x {
|
|
1501
1501
|
_parse(e) {
|
|
@@ -1543,19 +1543,19 @@ class N extends x {
|
|
|
1543
1543
|
min(e, t) {
|
|
1544
1544
|
return new N({
|
|
1545
1545
|
...this._def,
|
|
1546
|
-
minLength: { value: e, message:
|
|
1546
|
+
minLength: { value: e, message: f.toString(t) }
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
max(e, t) {
|
|
1550
1550
|
return new N({
|
|
1551
1551
|
...this._def,
|
|
1552
|
-
maxLength: { value: e, message:
|
|
1552
|
+
maxLength: { value: e, message: f.toString(t) }
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
1555
1555
|
length(e, t) {
|
|
1556
1556
|
return new N({
|
|
1557
1557
|
...this._def,
|
|
1558
|
-
exactLength: { value: e, message:
|
|
1558
|
+
exactLength: { value: e, message: f.toString(t) }
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
1561
1561
|
nonempty(e) {
|
|
@@ -1568,14 +1568,14 @@ N.create = (a, e) => new N({
|
|
|
1568
1568
|
maxLength: null,
|
|
1569
1569
|
exactLength: null,
|
|
1570
1570
|
typeName: y.ZodArray,
|
|
1571
|
-
...
|
|
1571
|
+
..._(e)
|
|
1572
1572
|
});
|
|
1573
1573
|
function U(a) {
|
|
1574
1574
|
if (a instanceof T) {
|
|
1575
1575
|
const e = {};
|
|
1576
1576
|
for (const t in a.shape) {
|
|
1577
1577
|
const n = a.shape[t];
|
|
1578
|
-
e[t] =
|
|
1578
|
+
e[t] = j.create(U(n));
|
|
1579
1579
|
}
|
|
1580
1580
|
return new T({
|
|
1581
1581
|
...a._def,
|
|
@@ -1584,7 +1584,7 @@ function U(a) {
|
|
|
1584
1584
|
} else return a instanceof N ? new N({
|
|
1585
1585
|
...a._def,
|
|
1586
1586
|
type: U(a.element)
|
|
1587
|
-
}) : a instanceof
|
|
1587
|
+
}) : a instanceof j ? j.create(U(a.unwrap())) : a instanceof F ? F.create(U(a.unwrap())) : a instanceof D ? D.create(a.items.map((e) => U(e))) : a;
|
|
1588
1588
|
}
|
|
1589
1589
|
class T extends x {
|
|
1590
1590
|
constructor() {
|
|
@@ -1593,7 +1593,7 @@ class T extends x {
|
|
|
1593
1593
|
_getCached() {
|
|
1594
1594
|
if (this._cached !== null)
|
|
1595
1595
|
return this._cached;
|
|
1596
|
-
const e = this._def.shape(), t =
|
|
1596
|
+
const e = this._def.shape(), t = b.objectKeys(e);
|
|
1597
1597
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
1598
1598
|
}
|
|
1599
1599
|
_parse(e) {
|
|
@@ -1606,25 +1606,25 @@ class T extends x {
|
|
|
1606
1606
|
}), m;
|
|
1607
1607
|
}
|
|
1608
1608
|
const { status: n, ctx: r } = this._processInputParams(e), { shape: s, keys: i } = this._getCached(), o = [];
|
|
1609
|
-
if (!(this._def.catchall instanceof
|
|
1609
|
+
if (!(this._def.catchall instanceof M && this._def.unknownKeys === "strip"))
|
|
1610
1610
|
for (const p in r.data)
|
|
1611
1611
|
i.includes(p) || o.push(p);
|
|
1612
|
-
const
|
|
1612
|
+
const h = [];
|
|
1613
1613
|
for (const p of i) {
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1614
|
+
const w = s[p], J = r.data[p];
|
|
1615
|
+
h.push({
|
|
1616
1616
|
key: { status: "valid", value: p },
|
|
1617
|
-
value:
|
|
1617
|
+
value: w._parse(new Z(r, J, r.path, p)),
|
|
1618
1618
|
alwaysSet: p in r.data
|
|
1619
1619
|
});
|
|
1620
1620
|
}
|
|
1621
|
-
if (this._def.catchall instanceof
|
|
1621
|
+
if (this._def.catchall instanceof M) {
|
|
1622
1622
|
const p = this._def.unknownKeys;
|
|
1623
1623
|
if (p === "passthrough")
|
|
1624
|
-
for (const
|
|
1625
|
-
|
|
1626
|
-
key: { status: "valid", value:
|
|
1627
|
-
value: { status: "valid", value: r.data[
|
|
1624
|
+
for (const w of o)
|
|
1625
|
+
h.push({
|
|
1626
|
+
key: { status: "valid", value: w },
|
|
1627
|
+
value: { status: "valid", value: r.data[w] }
|
|
1628
1628
|
});
|
|
1629
1629
|
else if (p === "strict")
|
|
1630
1630
|
o.length > 0 && (c(r, {
|
|
@@ -1634,36 +1634,36 @@ class T extends x {
|
|
|
1634
1634
|
else if (p !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1635
1635
|
} else {
|
|
1636
1636
|
const p = this._def.catchall;
|
|
1637
|
-
for (const
|
|
1638
|
-
const J = r.data[
|
|
1639
|
-
|
|
1640
|
-
key: { status: "valid", value:
|
|
1637
|
+
for (const w of o) {
|
|
1638
|
+
const J = r.data[w];
|
|
1639
|
+
h.push({
|
|
1640
|
+
key: { status: "valid", value: w },
|
|
1641
1641
|
value: p._parse(
|
|
1642
|
-
new Z(r, J, r.path,
|
|
1642
|
+
new Z(r, J, r.path, w)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
|
-
alwaysSet:
|
|
1645
|
+
alwaysSet: w in r.data
|
|
1646
1646
|
});
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
1650
1650
|
const p = [];
|
|
1651
|
-
for (const
|
|
1652
|
-
const J = await
|
|
1651
|
+
for (const w of h) {
|
|
1652
|
+
const J = await w.key, Ve = await w.value;
|
|
1653
1653
|
p.push({
|
|
1654
1654
|
key: J,
|
|
1655
1655
|
value: Ve,
|
|
1656
|
-
alwaysSet:
|
|
1656
|
+
alwaysSet: w.alwaysSet
|
|
1657
1657
|
});
|
|
1658
1658
|
}
|
|
1659
1659
|
return p;
|
|
1660
|
-
}).then((p) => O.mergeObjectSync(n, p)) : O.mergeObjectSync(n,
|
|
1660
|
+
}).then((p) => O.mergeObjectSync(n, p)) : O.mergeObjectSync(n, h);
|
|
1661
1661
|
}
|
|
1662
1662
|
get shape() {
|
|
1663
1663
|
return this._def.shape();
|
|
1664
1664
|
}
|
|
1665
1665
|
strict(e) {
|
|
1666
|
-
return
|
|
1666
|
+
return f.errToObj, new T({
|
|
1667
1667
|
...this._def,
|
|
1668
1668
|
unknownKeys: "strict",
|
|
1669
1669
|
...e !== void 0 ? {
|
|
@@ -1671,7 +1671,7 @@ class T extends x {
|
|
|
1671
1671
|
var s, i;
|
|
1672
1672
|
const r = ((i = (s = this._def).errorMap) == null ? void 0 : i.call(s, t, n).message) ?? n.defaultError;
|
|
1673
1673
|
return t.code === "unrecognized_keys" ? {
|
|
1674
|
-
message:
|
|
1674
|
+
message: f.errToObj(e).message ?? r
|
|
1675
1675
|
} : {
|
|
1676
1676
|
message: r
|
|
1677
1677
|
};
|
|
@@ -1800,7 +1800,7 @@ class T extends x {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
pick(e) {
|
|
1802
1802
|
const t = {};
|
|
1803
|
-
for (const n of
|
|
1803
|
+
for (const n of b.objectKeys(e))
|
|
1804
1804
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
1805
1805
|
return new T({
|
|
1806
1806
|
...this._def,
|
|
@@ -1809,7 +1809,7 @@ class T extends x {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
omit(e) {
|
|
1811
1811
|
const t = {};
|
|
1812
|
-
for (const n of
|
|
1812
|
+
for (const n of b.objectKeys(this.shape))
|
|
1813
1813
|
e[n] || (t[n] = this.shape[n]);
|
|
1814
1814
|
return new T({
|
|
1815
1815
|
...this._def,
|
|
@@ -1824,7 +1824,7 @@ class T extends x {
|
|
|
1824
1824
|
}
|
|
1825
1825
|
partial(e) {
|
|
1826
1826
|
const t = {};
|
|
1827
|
-
for (const n of
|
|
1827
|
+
for (const n of b.objectKeys(this.shape)) {
|
|
1828
1828
|
const r = this.shape[n];
|
|
1829
1829
|
e && !e[n] ? t[n] = r : t[n] = r.optional();
|
|
1830
1830
|
}
|
|
@@ -1835,12 +1835,12 @@ class T extends x {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
required(e) {
|
|
1837
1837
|
const t = {};
|
|
1838
|
-
for (const n of
|
|
1838
|
+
for (const n of b.objectKeys(this.shape))
|
|
1839
1839
|
if (e && !e[n])
|
|
1840
1840
|
t[n] = this.shape[n];
|
|
1841
1841
|
else {
|
|
1842
1842
|
let s = this.shape[n];
|
|
1843
|
-
for (; s instanceof
|
|
1843
|
+
for (; s instanceof j; )
|
|
1844
1844
|
s = s._def.innerType;
|
|
1845
1845
|
t[n] = s;
|
|
1846
1846
|
}
|
|
@@ -1850,29 +1850,29 @@ class T extends x {
|
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
keyof() {
|
|
1853
|
-
return
|
|
1853
|
+
return je(b.objectKeys(this.shape));
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
T.create = (a, e) => new T({
|
|
1857
1857
|
shape: () => a,
|
|
1858
1858
|
unknownKeys: "strip",
|
|
1859
|
-
catchall:
|
|
1859
|
+
catchall: M.create(),
|
|
1860
1860
|
typeName: y.ZodObject,
|
|
1861
|
-
...
|
|
1861
|
+
..._(e)
|
|
1862
1862
|
});
|
|
1863
1863
|
T.strictCreate = (a, e) => new T({
|
|
1864
1864
|
shape: () => a,
|
|
1865
1865
|
unknownKeys: "strict",
|
|
1866
|
-
catchall:
|
|
1866
|
+
catchall: M.create(),
|
|
1867
1867
|
typeName: y.ZodObject,
|
|
1868
|
-
...
|
|
1868
|
+
..._(e)
|
|
1869
1869
|
});
|
|
1870
1870
|
T.lazycreate = (a, e) => new T({
|
|
1871
1871
|
shape: a,
|
|
1872
1872
|
unknownKeys: "strip",
|
|
1873
|
-
catchall:
|
|
1873
|
+
catchall: M.create(),
|
|
1874
1874
|
typeName: y.ZodObject,
|
|
1875
|
-
...
|
|
1875
|
+
..._(e)
|
|
1876
1876
|
});
|
|
1877
1877
|
class K extends x {
|
|
1878
1878
|
_parse(e) {
|
|
@@ -1912,7 +1912,7 @@ class K extends x {
|
|
|
1912
1912
|
{
|
|
1913
1913
|
let s;
|
|
1914
1914
|
const i = [];
|
|
1915
|
-
for (const
|
|
1915
|
+
for (const h of n) {
|
|
1916
1916
|
const p = {
|
|
1917
1917
|
...t,
|
|
1918
1918
|
common: {
|
|
@@ -1920,18 +1920,18 @@ class K extends x {
|
|
|
1920
1920
|
issues: []
|
|
1921
1921
|
},
|
|
1922
1922
|
parent: null
|
|
1923
|
-
},
|
|
1923
|
+
}, w = h._parseSync({
|
|
1924
1924
|
data: t.data,
|
|
1925
1925
|
path: t.path,
|
|
1926
1926
|
parent: p
|
|
1927
1927
|
});
|
|
1928
|
-
if (
|
|
1929
|
-
return
|
|
1930
|
-
|
|
1928
|
+
if (w.status === "valid")
|
|
1929
|
+
return w;
|
|
1930
|
+
w.status === "dirty" && !s && (s = { result: w, ctx: p }), p.common.issues.length && i.push(p.common.issues);
|
|
1931
1931
|
}
|
|
1932
1932
|
if (s)
|
|
1933
1933
|
return t.common.issues.push(...s.ctx.common.issues), s.result;
|
|
1934
|
-
const o = i.map((
|
|
1934
|
+
const o = i.map((h) => new $(h));
|
|
1935
1935
|
return c(t, {
|
|
1936
1936
|
code: l.invalid_union,
|
|
1937
1937
|
unionErrors: o
|
|
@@ -1945,9 +1945,9 @@ class K extends x {
|
|
|
1945
1945
|
K.create = (a, e) => new K({
|
|
1946
1946
|
options: a,
|
|
1947
1947
|
typeName: y.ZodUnion,
|
|
1948
|
-
...
|
|
1948
|
+
..._(e)
|
|
1949
1949
|
});
|
|
1950
|
-
const R = (a) => a instanceof ye ? R(a.schema) : a instanceof P ? R(a.innerType()) : a instanceof ae ? [a.value] : a instanceof z ? a.options : a instanceof ge ?
|
|
1950
|
+
const R = (a) => a instanceof ye ? R(a.schema) : a instanceof P ? R(a.innerType()) : a instanceof ae ? [a.value] : a instanceof z ? a.options : a instanceof ge ? b.objectValues(a.enum) : a instanceof re ? R(a._def.innerType) : a instanceof fe ? [void 0] : a instanceof he ? [null] : a instanceof j ? [void 0, ...R(a.unwrap())] : a instanceof F ? [null, ...R(a.unwrap())] : a instanceof Ee || a instanceof ie ? R(a.unwrap()) : a instanceof se ? R(a._def.innerType) : [];
|
|
1951
1951
|
class _e extends x {
|
|
1952
1952
|
_parse(e) {
|
|
1953
1953
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2006,21 +2006,21 @@ class _e extends x {
|
|
|
2006
2006
|
discriminator: e,
|
|
2007
2007
|
options: t,
|
|
2008
2008
|
optionsMap: r,
|
|
2009
|
-
...
|
|
2009
|
+
..._(n)
|
|
2010
2010
|
});
|
|
2011
2011
|
}
|
|
2012
2012
|
}
|
|
2013
2013
|
function me(a, e) {
|
|
2014
|
-
const t =
|
|
2014
|
+
const t = L(a), n = L(e);
|
|
2015
2015
|
if (a === e)
|
|
2016
2016
|
return { valid: !0, data: a };
|
|
2017
2017
|
if (t === u.object && n === u.object) {
|
|
2018
|
-
const r =
|
|
2018
|
+
const r = b.objectKeys(e), s = b.objectKeys(a).filter((o) => r.indexOf(o) !== -1), i = { ...a, ...e };
|
|
2019
2019
|
for (const o of s) {
|
|
2020
|
-
const
|
|
2021
|
-
if (!
|
|
2020
|
+
const h = me(a[o], e[o]);
|
|
2021
|
+
if (!h.valid)
|
|
2022
2022
|
return { valid: !1 };
|
|
2023
|
-
i[o] =
|
|
2023
|
+
i[o] = h.data;
|
|
2024
2024
|
}
|
|
2025
2025
|
return { valid: !0, data: i };
|
|
2026
2026
|
} else if (t === u.array && n === u.array) {
|
|
@@ -2028,10 +2028,10 @@ function me(a, e) {
|
|
|
2028
2028
|
return { valid: !1 };
|
|
2029
2029
|
const r = [];
|
|
2030
2030
|
for (let s = 0; s < a.length; s++) {
|
|
2031
|
-
const i = a[s], o = e[s],
|
|
2032
|
-
if (!
|
|
2031
|
+
const i = a[s], o = e[s], h = me(i, o);
|
|
2032
|
+
if (!h.valid)
|
|
2033
2033
|
return { valid: !1 };
|
|
2034
|
-
r.push(
|
|
2034
|
+
r.push(h.data);
|
|
2035
2035
|
}
|
|
2036
2036
|
return { valid: !0, data: r };
|
|
2037
2037
|
} else return t === u.date && n === u.date && +a == +e ? { valid: !0, data: a } : { valid: !1 };
|
|
@@ -2072,7 +2072,7 @@ ee.create = (a, e, t) => new ee({
|
|
|
2072
2072
|
left: a,
|
|
2073
2073
|
right: e,
|
|
2074
2074
|
typeName: y.ZodIntersection,
|
|
2075
|
-
...
|
|
2075
|
+
..._(t)
|
|
2076
2076
|
});
|
|
2077
2077
|
class D extends x {
|
|
2078
2078
|
_parse(e) {
|
|
@@ -2099,8 +2099,8 @@ class D extends x {
|
|
|
2099
2099
|
type: "array"
|
|
2100
2100
|
}), t.dirty());
|
|
2101
2101
|
const s = [...n.data].map((i, o) => {
|
|
2102
|
-
const
|
|
2103
|
-
return
|
|
2102
|
+
const h = this._def.items[o] || this._def.rest;
|
|
2103
|
+
return h ? h._parse(new Z(n, i, n.path, o)) : null;
|
|
2104
2104
|
}).filter((i) => !!i);
|
|
2105
2105
|
return n.common.async ? Promise.all(s).then((i) => O.mergeArray(t, i)) : O.mergeArray(t, s);
|
|
2106
2106
|
}
|
|
@@ -2121,7 +2121,7 @@ D.create = (a, e) => {
|
|
|
2121
2121
|
items: a,
|
|
2122
2122
|
typeName: y.ZodTuple,
|
|
2123
2123
|
rest: null,
|
|
2124
|
-
...
|
|
2124
|
+
..._(e)
|
|
2125
2125
|
});
|
|
2126
2126
|
};
|
|
2127
2127
|
class te extends x {
|
|
@@ -2156,12 +2156,12 @@ class te extends x {
|
|
|
2156
2156
|
keyType: e,
|
|
2157
2157
|
valueType: t,
|
|
2158
2158
|
typeName: y.ZodRecord,
|
|
2159
|
-
...
|
|
2159
|
+
..._(n)
|
|
2160
2160
|
}) : new te({
|
|
2161
|
-
keyType:
|
|
2161
|
+
keyType: I.create(),
|
|
2162
2162
|
valueType: e,
|
|
2163
2163
|
typeName: y.ZodRecord,
|
|
2164
|
-
...
|
|
2164
|
+
..._(t)
|
|
2165
2165
|
});
|
|
2166
2166
|
}
|
|
2167
2167
|
}
|
|
@@ -2180,28 +2180,28 @@ class Ne extends x {
|
|
|
2180
2180
|
expected: u.map,
|
|
2181
2181
|
received: n.parsedType
|
|
2182
2182
|
}), m;
|
|
2183
|
-
const r = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o,
|
|
2183
|
+
const r = this._def.keyType, s = this._def.valueType, i = [...n.data.entries()].map(([o, h], p) => ({
|
|
2184
2184
|
key: r._parse(new Z(n, o, n.path, [p, "key"])),
|
|
2185
|
-
value: s._parse(new Z(n,
|
|
2185
|
+
value: s._parse(new Z(n, h, n.path, [p, "value"]))
|
|
2186
2186
|
}));
|
|
2187
2187
|
if (n.common.async) {
|
|
2188
2188
|
const o = /* @__PURE__ */ new Map();
|
|
2189
2189
|
return Promise.resolve().then(async () => {
|
|
2190
|
-
for (const
|
|
2191
|
-
const p = await
|
|
2192
|
-
if (p.status === "aborted" ||
|
|
2190
|
+
for (const h of i) {
|
|
2191
|
+
const p = await h.key, w = await h.value;
|
|
2192
|
+
if (p.status === "aborted" || w.status === "aborted")
|
|
2193
2193
|
return m;
|
|
2194
|
-
(p.status === "dirty" ||
|
|
2194
|
+
(p.status === "dirty" || w.status === "dirty") && t.dirty(), o.set(p.value, w.value);
|
|
2195
2195
|
}
|
|
2196
2196
|
return { status: t.value, value: o };
|
|
2197
2197
|
});
|
|
2198
2198
|
} else {
|
|
2199
2199
|
const o = /* @__PURE__ */ new Map();
|
|
2200
|
-
for (const
|
|
2201
|
-
const p =
|
|
2202
|
-
if (p.status === "aborted" ||
|
|
2200
|
+
for (const h of i) {
|
|
2201
|
+
const p = h.key, w = h.value;
|
|
2202
|
+
if (p.status === "aborted" || w.status === "aborted")
|
|
2203
2203
|
return m;
|
|
2204
|
-
(p.status === "dirty" ||
|
|
2204
|
+
(p.status === "dirty" || w.status === "dirty") && t.dirty(), o.set(p.value, w.value);
|
|
2205
2205
|
}
|
|
2206
2206
|
return { status: t.value, value: o };
|
|
2207
2207
|
}
|
|
@@ -2211,7 +2211,7 @@ Ne.create = (a, e, t) => new Ne({
|
|
|
2211
2211
|
valueType: e,
|
|
2212
2212
|
keyType: a,
|
|
2213
2213
|
typeName: y.ZodMap,
|
|
2214
|
-
...
|
|
2214
|
+
..._(t)
|
|
2215
2215
|
});
|
|
2216
2216
|
class Y extends x {
|
|
2217
2217
|
_parse(e) {
|
|
@@ -2239,28 +2239,28 @@ class Y extends x {
|
|
|
2239
2239
|
message: r.maxSize.message
|
|
2240
2240
|
}), t.dirty());
|
|
2241
2241
|
const s = this._def.valueType;
|
|
2242
|
-
function i(
|
|
2242
|
+
function i(h) {
|
|
2243
2243
|
const p = /* @__PURE__ */ new Set();
|
|
2244
|
-
for (const
|
|
2245
|
-
if (
|
|
2244
|
+
for (const w of h) {
|
|
2245
|
+
if (w.status === "aborted")
|
|
2246
2246
|
return m;
|
|
2247
|
-
|
|
2247
|
+
w.status === "dirty" && t.dirty(), p.add(w.value);
|
|
2248
2248
|
}
|
|
2249
2249
|
return { status: t.value, value: p };
|
|
2250
2250
|
}
|
|
2251
|
-
const o = [...n.data.values()].map((
|
|
2252
|
-
return n.common.async ? Promise.all(o).then((
|
|
2251
|
+
const o = [...n.data.values()].map((h, p) => s._parse(new Z(n, h, n.path, p)));
|
|
2252
|
+
return n.common.async ? Promise.all(o).then((h) => i(h)) : i(o);
|
|
2253
2253
|
}
|
|
2254
2254
|
min(e, t) {
|
|
2255
2255
|
return new Y({
|
|
2256
2256
|
...this._def,
|
|
2257
|
-
minSize: { value: e, message:
|
|
2257
|
+
minSize: { value: e, message: f.toString(t) }
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
2260
|
max(e, t) {
|
|
2261
2261
|
return new Y({
|
|
2262
2262
|
...this._def,
|
|
2263
|
-
maxSize: { value: e, message:
|
|
2263
|
+
maxSize: { value: e, message: f.toString(t) }
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
2266
|
size(e, t) {
|
|
@@ -2275,7 +2275,7 @@ Y.create = (a, e) => new Y({
|
|
|
2275
2275
|
minSize: null,
|
|
2276
2276
|
maxSize: null,
|
|
2277
2277
|
typeName: y.ZodSet,
|
|
2278
|
-
...
|
|
2278
|
+
..._(e)
|
|
2279
2279
|
});
|
|
2280
2280
|
class ye extends x {
|
|
2281
2281
|
get schema() {
|
|
@@ -2289,7 +2289,7 @@ class ye extends x {
|
|
|
2289
2289
|
ye.create = (a, e) => new ye({
|
|
2290
2290
|
getter: a,
|
|
2291
2291
|
typeName: y.ZodLazy,
|
|
2292
|
-
...
|
|
2292
|
+
..._(e)
|
|
2293
2293
|
});
|
|
2294
2294
|
class ae extends x {
|
|
2295
2295
|
_parse(e) {
|
|
@@ -2310,13 +2310,13 @@ class ae extends x {
|
|
|
2310
2310
|
ae.create = (a, e) => new ae({
|
|
2311
2311
|
value: a,
|
|
2312
2312
|
typeName: y.ZodLiteral,
|
|
2313
|
-
...
|
|
2313
|
+
..._(e)
|
|
2314
2314
|
});
|
|
2315
|
-
function
|
|
2315
|
+
function je(a, e) {
|
|
2316
2316
|
return new z({
|
|
2317
2317
|
values: a,
|
|
2318
2318
|
typeName: y.ZodEnum,
|
|
2319
|
-
...
|
|
2319
|
+
..._(e)
|
|
2320
2320
|
});
|
|
2321
2321
|
}
|
|
2322
2322
|
class z extends x {
|
|
@@ -2324,7 +2324,7 @@ class z extends x {
|
|
|
2324
2324
|
if (typeof e.data != "string") {
|
|
2325
2325
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2326
2326
|
return c(t, {
|
|
2327
|
-
expected:
|
|
2327
|
+
expected: b.joinValues(n),
|
|
2328
2328
|
received: t.parsedType,
|
|
2329
2329
|
code: l.invalid_type
|
|
2330
2330
|
}), m;
|
|
@@ -2373,20 +2373,20 @@ class z extends x {
|
|
|
2373
2373
|
});
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
z.create =
|
|
2376
|
+
z.create = je;
|
|
2377
2377
|
class ge extends x {
|
|
2378
2378
|
_parse(e) {
|
|
2379
|
-
const t =
|
|
2379
|
+
const t = b.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2380
2380
|
if (n.parsedType !== u.string && n.parsedType !== u.number) {
|
|
2381
|
-
const r =
|
|
2381
|
+
const r = b.objectValues(t);
|
|
2382
2382
|
return c(n, {
|
|
2383
|
-
expected:
|
|
2383
|
+
expected: b.joinValues(r),
|
|
2384
2384
|
received: n.parsedType,
|
|
2385
2385
|
code: l.invalid_type
|
|
2386
2386
|
}), m;
|
|
2387
2387
|
}
|
|
2388
|
-
if (this._cache || (this._cache = new Set(
|
|
2389
|
-
const r =
|
|
2388
|
+
if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2389
|
+
const r = b.objectValues(t);
|
|
2390
2390
|
return c(n, {
|
|
2391
2391
|
received: n.data,
|
|
2392
2392
|
code: l.invalid_enum_value,
|
|
@@ -2402,7 +2402,7 @@ class ge extends x {
|
|
|
2402
2402
|
ge.create = (a, e) => new ge({
|
|
2403
2403
|
values: a,
|
|
2404
2404
|
typeName: y.ZodNativeEnum,
|
|
2405
|
-
...
|
|
2405
|
+
..._(e)
|
|
2406
2406
|
});
|
|
2407
2407
|
class ne extends x {
|
|
2408
2408
|
unwrap() {
|
|
@@ -2426,7 +2426,7 @@ class ne extends x {
|
|
|
2426
2426
|
ne.create = (a, e) => new ne({
|
|
2427
2427
|
type: a,
|
|
2428
2428
|
typeName: y.ZodPromise,
|
|
2429
|
-
...
|
|
2429
|
+
..._(e)
|
|
2430
2430
|
});
|
|
2431
2431
|
class P extends x {
|
|
2432
2432
|
innerType() {
|
|
@@ -2450,12 +2450,12 @@ class P extends x {
|
|
|
2450
2450
|
return Promise.resolve(i).then(async (o) => {
|
|
2451
2451
|
if (t.value === "aborted")
|
|
2452
2452
|
return m;
|
|
2453
|
-
const
|
|
2453
|
+
const h = await this._def.schema._parseAsync({
|
|
2454
2454
|
data: o,
|
|
2455
2455
|
path: n.path,
|
|
2456
2456
|
parent: n
|
|
2457
2457
|
});
|
|
2458
|
-
return
|
|
2458
|
+
return h.status === "aborted" ? m : h.status === "dirty" || t.value === "dirty" ? H(h.value) : h;
|
|
2459
2459
|
});
|
|
2460
2460
|
{
|
|
2461
2461
|
if (t.value === "aborted")
|
|
@@ -2470,10 +2470,10 @@ class P extends x {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
if (r.type === "refinement") {
|
|
2472
2472
|
const i = (o) => {
|
|
2473
|
-
const
|
|
2473
|
+
const h = r.refinement(o, s);
|
|
2474
2474
|
if (n.common.async)
|
|
2475
|
-
return Promise.resolve(
|
|
2476
|
-
if (
|
|
2475
|
+
return Promise.resolve(h);
|
|
2476
|
+
if (h instanceof Promise)
|
|
2477
2477
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2478
2478
|
return o;
|
|
2479
2479
|
};
|
|
@@ -2494,33 +2494,33 @@ class P extends x {
|
|
|
2494
2494
|
path: n.path,
|
|
2495
2495
|
parent: n
|
|
2496
2496
|
});
|
|
2497
|
-
if (!
|
|
2497
|
+
if (!q(i))
|
|
2498
2498
|
return m;
|
|
2499
2499
|
const o = r.transform(i.value, s);
|
|
2500
2500
|
if (o instanceof Promise)
|
|
2501
2501
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2502
2502
|
return { status: t.value, value: o };
|
|
2503
2503
|
} else
|
|
2504
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2504
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => q(i) ? Promise.resolve(r.transform(i.value, s)).then((o) => ({
|
|
2505
2505
|
status: t.value,
|
|
2506
2506
|
value: o
|
|
2507
2507
|
})) : m);
|
|
2508
|
-
|
|
2508
|
+
b.assertNever(r);
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
P.create = (a, e, t) => new P({
|
|
2512
2512
|
schema: a,
|
|
2513
2513
|
typeName: y.ZodEffects,
|
|
2514
2514
|
effect: e,
|
|
2515
|
-
...
|
|
2515
|
+
..._(t)
|
|
2516
2516
|
});
|
|
2517
2517
|
P.createWithPreprocess = (a, e, t) => new P({
|
|
2518
2518
|
schema: e,
|
|
2519
2519
|
effect: { type: "preprocess", transform: a },
|
|
2520
2520
|
typeName: y.ZodEffects,
|
|
2521
|
-
...
|
|
2521
|
+
..._(t)
|
|
2522
2522
|
});
|
|
2523
|
-
class
|
|
2523
|
+
class j extends x {
|
|
2524
2524
|
_parse(e) {
|
|
2525
2525
|
return this._getType(e) === u.undefined ? A(void 0) : this._def.innerType._parse(e);
|
|
2526
2526
|
}
|
|
@@ -2528,10 +2528,10 @@ class E extends x {
|
|
|
2528
2528
|
return this._def.innerType;
|
|
2529
2529
|
}
|
|
2530
2530
|
}
|
|
2531
|
-
|
|
2531
|
+
j.create = (a, e) => new j({
|
|
2532
2532
|
innerType: a,
|
|
2533
2533
|
typeName: y.ZodOptional,
|
|
2534
|
-
...
|
|
2534
|
+
..._(e)
|
|
2535
2535
|
});
|
|
2536
2536
|
class F extends x {
|
|
2537
2537
|
_parse(e) {
|
|
@@ -2544,7 +2544,7 @@ class F extends x {
|
|
|
2544
2544
|
F.create = (a, e) => new F({
|
|
2545
2545
|
innerType: a,
|
|
2546
2546
|
typeName: y.ZodNullable,
|
|
2547
|
-
...
|
|
2547
|
+
..._(e)
|
|
2548
2548
|
});
|
|
2549
2549
|
class re extends x {
|
|
2550
2550
|
_parse(e) {
|
|
@@ -2564,7 +2564,7 @@ re.create = (a, e) => new re({
|
|
|
2564
2564
|
innerType: a,
|
|
2565
2565
|
typeName: y.ZodDefault,
|
|
2566
2566
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2567
|
-
...
|
|
2567
|
+
..._(e)
|
|
2568
2568
|
});
|
|
2569
2569
|
class se extends x {
|
|
2570
2570
|
_parse(e) {
|
|
@@ -2607,7 +2607,7 @@ se.create = (a, e) => new se({
|
|
|
2607
2607
|
innerType: a,
|
|
2608
2608
|
typeName: y.ZodCatch,
|
|
2609
2609
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2610
|
-
...
|
|
2610
|
+
..._(e)
|
|
2611
2611
|
});
|
|
2612
2612
|
class Ze extends x {
|
|
2613
2613
|
_parse(e) {
|
|
@@ -2624,9 +2624,9 @@ class Ze extends x {
|
|
|
2624
2624
|
}
|
|
2625
2625
|
Ze.create = (a) => new Ze({
|
|
2626
2626
|
typeName: y.ZodNaN,
|
|
2627
|
-
...
|
|
2627
|
+
..._(a)
|
|
2628
2628
|
});
|
|
2629
|
-
class
|
|
2629
|
+
class Ee extends x {
|
|
2630
2630
|
_parse(e) {
|
|
2631
2631
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2632
2632
|
return this._def.type._parse({
|
|
@@ -2681,7 +2681,7 @@ class ve extends x {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
class ie extends x {
|
|
2683
2683
|
_parse(e) {
|
|
2684
|
-
const t = this._def.innerType._parse(e), n = (r) => (
|
|
2684
|
+
const t = this._def.innerType._parse(e), n = (r) => (q(r) && (r.value = Object.freeze(r.value)), r);
|
|
2685
2685
|
return Q(t) ? t.then((r) => n(r)) : n(t);
|
|
2686
2686
|
}
|
|
2687
2687
|
unwrap() {
|
|
@@ -2691,191 +2691,197 @@ class ie extends x {
|
|
|
2691
2691
|
ie.create = (a, e) => new ie({
|
|
2692
2692
|
innerType: a,
|
|
2693
2693
|
typeName: y.ZodReadonly,
|
|
2694
|
-
...
|
|
2694
|
+
..._(e)
|
|
2695
2695
|
});
|
|
2696
2696
|
var y;
|
|
2697
2697
|
(function(a) {
|
|
2698
2698
|
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";
|
|
2699
2699
|
})(y || (y = {}));
|
|
2700
|
-
const
|
|
2701
|
-
|
|
2700
|
+
const g = I.create, d = W.create, v = ue.create, ut = pe.create;
|
|
2701
|
+
M.create;
|
|
2702
2702
|
const C = N.create, S = T.create, xe = K.create, $e = _e.create;
|
|
2703
2703
|
ee.create;
|
|
2704
|
-
const
|
|
2704
|
+
const E = D.create, Le = te.create, V = ae.create, k = z.create;
|
|
2705
2705
|
ne.create;
|
|
2706
|
-
|
|
2706
|
+
j.create;
|
|
2707
2707
|
F.create;
|
|
2708
|
-
const
|
|
2708
|
+
const ft = P.createWithPreprocess, oe = k([
|
|
2709
2709
|
"Point",
|
|
2710
2710
|
"MultiPoint",
|
|
2711
2711
|
"LineString",
|
|
2712
2712
|
"MultiLineString",
|
|
2713
2713
|
"Polygon",
|
|
2714
2714
|
"MultiPolygon"
|
|
2715
|
-
]),
|
|
2715
|
+
]), Me = C(ut()), ke = (a) => xe([g(), Me]).default(a), B = () => xe([g(), Me]).optional(), ht = S({
|
|
2716
2716
|
latitude: d().min(-90).max(90),
|
|
2717
2717
|
longitude: d().min(-180).max(180),
|
|
2718
2718
|
zoom: d().min(0).max(24),
|
|
2719
2719
|
pitch: d().min(0).max(85).default(0),
|
|
2720
2720
|
bearing: d().min(-180).max(180).default(0)
|
|
2721
2721
|
}), pt = S({
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
tileMatrixSetId: _().optional().default("WebMercatorQuad")
|
|
2722
|
+
type: k(["query_param", "header"]),
|
|
2723
|
+
name: g().min(1),
|
|
2724
|
+
value: g().min(1)
|
|
2726
2725
|
}), mt = S({
|
|
2726
|
+
id: g().min(1),
|
|
2727
|
+
url: g().url(),
|
|
2728
|
+
label: g().optional(),
|
|
2729
|
+
tileMatrixSetId: g().optional().default("WebMercatorQuad"),
|
|
2730
|
+
type: k(["features", "imagery"]).optional(),
|
|
2731
|
+
auth: pt.optional()
|
|
2732
|
+
}), yt = S({
|
|
2727
2733
|
"fill-color": ke("#000000"),
|
|
2728
2734
|
"fill-opacity": d().min(0).max(1).default(1),
|
|
2729
2735
|
"fill-outline-color": B(),
|
|
2730
2736
|
"fill-antialias": v().optional(),
|
|
2731
|
-
"fill-translate":
|
|
2732
|
-
"fill-translate-anchor":
|
|
2733
|
-
"fill-pattern":
|
|
2734
|
-
}),
|
|
2737
|
+
"fill-translate": E([d(), d()]).optional(),
|
|
2738
|
+
"fill-translate-anchor": k(["map", "viewport"]).optional(),
|
|
2739
|
+
"fill-pattern": g().optional()
|
|
2740
|
+
}), gt = S({
|
|
2735
2741
|
"line-color": ke("#000000"),
|
|
2736
2742
|
"line-width": d().min(0).default(1),
|
|
2737
2743
|
"line-opacity": d().min(0).max(1).default(1),
|
|
2738
2744
|
"line-dasharray": C(d()).optional(),
|
|
2739
|
-
"line-translate":
|
|
2740
|
-
"line-translate-anchor":
|
|
2745
|
+
"line-translate": E([d(), d()]).optional(),
|
|
2746
|
+
"line-translate-anchor": k(["map", "viewport"]).optional(),
|
|
2741
2747
|
"line-gap-width": d().min(0).optional(),
|
|
2742
2748
|
"line-offset": d().optional(),
|
|
2743
2749
|
"line-blur": d().min(0).optional(),
|
|
2744
|
-
"line-pattern":
|
|
2745
|
-
"line-gradient":
|
|
2746
|
-
}),
|
|
2750
|
+
"line-pattern": g().optional(),
|
|
2751
|
+
"line-gradient": g().optional()
|
|
2752
|
+
}), _t = S({
|
|
2747
2753
|
"circle-color": ke("#000000"),
|
|
2748
2754
|
"circle-radius": d().min(0).default(5),
|
|
2749
2755
|
"circle-opacity": d().min(0).max(1).default(1),
|
|
2750
2756
|
"circle-stroke-color": B(),
|
|
2751
2757
|
"circle-stroke-width": d().min(0).optional(),
|
|
2752
2758
|
"circle-blur": d().min(0).optional(),
|
|
2753
|
-
"circle-translate":
|
|
2754
|
-
"circle-translate-anchor":
|
|
2755
|
-
"circle-pitch-scale":
|
|
2756
|
-
"circle-pitch-alignment":
|
|
2759
|
+
"circle-translate": E([d(), d()]).optional(),
|
|
2760
|
+
"circle-translate-anchor": k(["map", "viewport"]).optional(),
|
|
2761
|
+
"circle-pitch-scale": k(["map", "viewport"]).optional(),
|
|
2762
|
+
"circle-pitch-alignment": k(["map", "viewport"]).optional(),
|
|
2757
2763
|
"circle-stroke-opacity": d().min(0).max(1).optional()
|
|
2758
|
-
}),
|
|
2764
|
+
}), vt = S({
|
|
2759
2765
|
"icon-opacity": d().min(0).max(1).optional(),
|
|
2760
2766
|
"icon-color": B(),
|
|
2761
2767
|
"icon-halo-color": B(),
|
|
2762
2768
|
"icon-halo-width": d().min(0).optional(),
|
|
2763
2769
|
"icon-halo-blur": d().min(0).optional(),
|
|
2764
|
-
"icon-translate":
|
|
2765
|
-
"icon-translate-anchor":
|
|
2770
|
+
"icon-translate": E([d(), d()]).optional(),
|
|
2771
|
+
"icon-translate-anchor": k(["map", "viewport"]).optional(),
|
|
2766
2772
|
"text-opacity": d().min(0).max(1).optional(),
|
|
2767
2773
|
"text-color": B(),
|
|
2768
2774
|
"text-halo-color": B(),
|
|
2769
2775
|
"text-halo-width": d().min(0).optional(),
|
|
2770
2776
|
"text-halo-blur": d().min(0).optional(),
|
|
2771
|
-
"text-translate":
|
|
2772
|
-
"text-translate-anchor":
|
|
2773
|
-
}), vt = S({
|
|
2774
|
-
"fill-sort-key": d().optional(),
|
|
2775
|
-
visibility: w(["visible", "none"]).optional()
|
|
2777
|
+
"text-translate": E([d(), d()]).optional(),
|
|
2778
|
+
"text-translate-anchor": k(["map", "viewport"]).optional()
|
|
2776
2779
|
}), xt = S({
|
|
2777
|
-
"
|
|
2778
|
-
|
|
2780
|
+
"fill-sort-key": d().optional(),
|
|
2781
|
+
visibility: k(["visible", "none"]).optional()
|
|
2782
|
+
}), kt = S({
|
|
2783
|
+
"line-cap": k(["butt", "round", "square"]).optional(),
|
|
2784
|
+
"line-join": k(["bevel", "round", "miter"]).optional(),
|
|
2779
2785
|
"line-miter-limit": d().optional(),
|
|
2780
2786
|
"line-round-limit": d().optional(),
|
|
2781
2787
|
"line-sort-key": d().optional(),
|
|
2782
|
-
visibility:
|
|
2783
|
-
}), kt = S({
|
|
2784
|
-
"circle-sort-key": d().optional(),
|
|
2785
|
-
visibility: w(["visible", "none"]).optional()
|
|
2788
|
+
visibility: k(["visible", "none"]).optional()
|
|
2786
2789
|
}), bt = S({
|
|
2787
|
-
"
|
|
2790
|
+
"circle-sort-key": d().optional(),
|
|
2791
|
+
visibility: k(["visible", "none"]).optional()
|
|
2792
|
+
}), wt = S({
|
|
2793
|
+
"symbol-placement": k(["point", "line", "line-center"]).optional(),
|
|
2788
2794
|
"symbol-spacing": d().min(1).optional(),
|
|
2789
2795
|
"symbol-avoid-edges": v().optional(),
|
|
2790
2796
|
"symbol-sort-key": d().optional(),
|
|
2791
|
-
"symbol-z-order":
|
|
2797
|
+
"symbol-z-order": k(["auto", "viewport-y", "source"]).optional(),
|
|
2792
2798
|
"icon-allow-overlap": v().optional(),
|
|
2793
2799
|
"icon-ignore-placement": v().optional(),
|
|
2794
2800
|
"icon-optional": v().optional(),
|
|
2795
|
-
"icon-rotation-alignment":
|
|
2801
|
+
"icon-rotation-alignment": k(["map", "viewport", "auto"]).optional(),
|
|
2796
2802
|
"icon-size": d().min(0).optional(),
|
|
2797
|
-
"icon-text-fit":
|
|
2798
|
-
"icon-text-fit-padding":
|
|
2799
|
-
"icon-image":
|
|
2803
|
+
"icon-text-fit": k(["none", "width", "height", "both"]).optional(),
|
|
2804
|
+
"icon-text-fit-padding": E([d(), d(), d(), d()]).optional(),
|
|
2805
|
+
"icon-image": g().optional(),
|
|
2800
2806
|
"icon-rotate": d().optional(),
|
|
2801
2807
|
"icon-padding": d().min(0).optional(),
|
|
2802
2808
|
"icon-keep-upright": v().optional(),
|
|
2803
|
-
"icon-offset":
|
|
2804
|
-
"icon-anchor":
|
|
2805
|
-
"icon-pitch-alignment":
|
|
2806
|
-
"text-pitch-alignment":
|
|
2807
|
-
"text-rotation-alignment":
|
|
2808
|
-
"text-field":
|
|
2809
|
-
"text-font": C(
|
|
2809
|
+
"icon-offset": E([d(), d()]).optional(),
|
|
2810
|
+
"icon-anchor": k(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
|
|
2811
|
+
"icon-pitch-alignment": k(["map", "viewport", "auto"]).optional(),
|
|
2812
|
+
"text-pitch-alignment": k(["map", "viewport", "auto"]).optional(),
|
|
2813
|
+
"text-rotation-alignment": k(["map", "viewport", "viewport-glyph", "auto"]).optional(),
|
|
2814
|
+
"text-field": g().optional(),
|
|
2815
|
+
"text-font": C(g()).optional(),
|
|
2810
2816
|
"text-size": d().min(0).optional(),
|
|
2811
2817
|
"text-max-width": d().min(0).optional(),
|
|
2812
2818
|
"text-line-height": d().optional(),
|
|
2813
2819
|
"text-letter-spacing": d().optional(),
|
|
2814
|
-
"text-justify":
|
|
2815
|
-
"text-anchor":
|
|
2820
|
+
"text-justify": k(["auto", "left", "center", "right"]).optional(),
|
|
2821
|
+
"text-anchor": k(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
|
|
2816
2822
|
"text-max-angle": d().optional(),
|
|
2817
2823
|
"text-rotate": d().optional(),
|
|
2818
2824
|
"text-padding": d().min(0).optional(),
|
|
2819
2825
|
"text-keep-upright": v().optional(),
|
|
2820
|
-
"text-transform":
|
|
2821
|
-
"text-offset":
|
|
2826
|
+
"text-transform": k(["none", "uppercase", "lowercase"]).optional(),
|
|
2827
|
+
"text-offset": E([d(), d()]).optional(),
|
|
2822
2828
|
"text-allow-overlap": v().optional(),
|
|
2823
2829
|
"text-ignore-placement": v().optional(),
|
|
2824
2830
|
"text-optional": v().optional(),
|
|
2825
|
-
visibility:
|
|
2826
|
-
}), wt = S({
|
|
2827
|
-
type: V("fill"),
|
|
2828
|
-
paint: mt,
|
|
2829
|
-
layout: vt.optional(),
|
|
2830
|
-
geometryFilter: C(oe).optional()
|
|
2831
|
+
visibility: k(["visible", "none"]).optional()
|
|
2831
2832
|
}), St = S({
|
|
2832
|
-
type: V("
|
|
2833
|
+
type: V("fill"),
|
|
2833
2834
|
paint: yt,
|
|
2834
2835
|
layout: xt.optional(),
|
|
2835
2836
|
geometryFilter: C(oe).optional()
|
|
2836
2837
|
}), Tt = S({
|
|
2837
|
-
type: V("
|
|
2838
|
+
type: V("line"),
|
|
2838
2839
|
paint: gt,
|
|
2839
2840
|
layout: kt.optional(),
|
|
2840
2841
|
geometryFilter: C(oe).optional()
|
|
2841
2842
|
}), Ct = S({
|
|
2842
|
-
type: V("
|
|
2843
|
+
type: V("circle"),
|
|
2843
2844
|
paint: _t,
|
|
2844
2845
|
layout: bt.optional(),
|
|
2845
2846
|
geometryFilter: C(oe).optional()
|
|
2846
|
-
}), Ot =
|
|
2847
|
-
|
|
2847
|
+
}), Ot = S({
|
|
2848
|
+
type: V("symbol"),
|
|
2849
|
+
paint: vt,
|
|
2850
|
+
layout: wt.optional(),
|
|
2851
|
+
geometryFilter: C(oe).optional()
|
|
2852
|
+
}), At = $e("type", [
|
|
2848
2853
|
St,
|
|
2849
2854
|
Tt,
|
|
2850
|
-
Ct
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2855
|
+
Ct,
|
|
2856
|
+
Ot
|
|
2857
|
+
]), Nt = S({
|
|
2858
|
+
label: g(),
|
|
2859
|
+
color: g(),
|
|
2860
|
+
shape: k(["circle", "line", "square"]).optional()
|
|
2861
|
+
}), Zt = S({
|
|
2862
|
+
entries: C(Nt).min(1),
|
|
2863
|
+
displayMode: k(["categorical", "gradient", "simple"]).optional(),
|
|
2858
2864
|
showLabelsCollapsed: v().optional(),
|
|
2859
2865
|
showColorBar: v().optional(),
|
|
2860
2866
|
showDisclosureArrow: v().optional(),
|
|
2861
|
-
gradientProperty:
|
|
2867
|
+
gradientProperty: g().optional()
|
|
2862
2868
|
}), le = {
|
|
2863
|
-
property:
|
|
2864
|
-
label:
|
|
2865
|
-
placeholder:
|
|
2866
|
-
},
|
|
2869
|
+
property: g().min(1),
|
|
2870
|
+
label: g(),
|
|
2871
|
+
placeholder: g().optional()
|
|
2872
|
+
}, Rt = S({
|
|
2867
2873
|
...le,
|
|
2868
2874
|
type: V("text"),
|
|
2869
2875
|
autocomplete: v().default(!1),
|
|
2870
2876
|
prefetch: v().optional(),
|
|
2871
|
-
options: C(
|
|
2877
|
+
options: C(g()).optional(),
|
|
2872
2878
|
zoomTo: v().optional()
|
|
2873
|
-
}),
|
|
2879
|
+
}), It = S({
|
|
2874
2880
|
...le,
|
|
2875
2881
|
type: V("number"),
|
|
2876
|
-
inputMode:
|
|
2877
|
-
operator:
|
|
2878
|
-
operatorLabelStyle:
|
|
2882
|
+
inputMode: k(["input", "slider"]).default("input"),
|
|
2883
|
+
operator: k(["eq", "gt", "lt", "gte", "lte", "between"]).default("eq"),
|
|
2884
|
+
operatorLabelStyle: k(["symbol", "word"]).optional(),
|
|
2879
2885
|
showRange: v().optional(),
|
|
2880
2886
|
min: d().optional(),
|
|
2881
2887
|
max: d().optional(),
|
|
@@ -2887,40 +2893,40 @@ const ht = P.createWithPreprocess, oe = w([
|
|
|
2887
2893
|
}), Et = S({
|
|
2888
2894
|
...le,
|
|
2889
2895
|
type: V("select"),
|
|
2890
|
-
options: C(
|
|
2896
|
+
options: C(g()).optional(),
|
|
2891
2897
|
prefetch: v().optional(),
|
|
2892
2898
|
zoomTo: v().optional()
|
|
2893
|
-
}),
|
|
2894
|
-
Zt,
|
|
2899
|
+
}), $t = $e("type", [
|
|
2895
2900
|
Rt,
|
|
2901
|
+
It,
|
|
2896
2902
|
jt,
|
|
2897
2903
|
Et
|
|
2898
|
-
]),
|
|
2899
|
-
fields: C(
|
|
2904
|
+
]), Lt = S({
|
|
2905
|
+
fields: C($t).min(1)
|
|
2900
2906
|
}), Mt = S({
|
|
2901
|
-
label:
|
|
2907
|
+
label: g().optional(),
|
|
2902
2908
|
visible: v().optional().default(!0)
|
|
2903
|
-
}),
|
|
2904
|
-
properties:
|
|
2905
|
-
bbox:
|
|
2906
|
-
datetime:
|
|
2907
|
-
}),
|
|
2908
|
-
id:
|
|
2909
|
-
sourceId:
|
|
2910
|
-
collection:
|
|
2911
|
-
label:
|
|
2909
|
+
}), Pt = Le(g(), Mt), Vt = S({
|
|
2910
|
+
properties: Le(xe([g(), d(), v(), C(g())])).optional(),
|
|
2911
|
+
bbox: E([d(), d(), d(), d()]).optional(),
|
|
2912
|
+
datetime: g().optional()
|
|
2913
|
+
}), Dt = {
|
|
2914
|
+
id: g().min(1),
|
|
2915
|
+
sourceId: g().min(1),
|
|
2916
|
+
collection: g().min(1),
|
|
2917
|
+
label: g(),
|
|
2912
2918
|
visible: v().default(!0),
|
|
2913
|
-
dataMode:
|
|
2919
|
+
dataMode: k(["vector-tiles", "geojson"]),
|
|
2914
2920
|
minZoom: d().min(0).max(24).optional(),
|
|
2915
2921
|
maxZoom: d().min(0).max(24).optional(),
|
|
2916
|
-
styles: C(
|
|
2917
|
-
legend:
|
|
2918
|
-
filters:
|
|
2919
|
-
search:
|
|
2920
|
-
propertyDisplay:
|
|
2922
|
+
styles: C(At).optional(),
|
|
2923
|
+
legend: Zt.optional(),
|
|
2924
|
+
filters: Vt.optional(),
|
|
2925
|
+
search: Lt.optional(),
|
|
2926
|
+
propertyDisplay: Pt.optional(),
|
|
2921
2927
|
showTooltip: v().optional(),
|
|
2922
2928
|
showDetailPanel: v().optional()
|
|
2923
|
-
},
|
|
2929
|
+
}, zt = ft(
|
|
2924
2930
|
(a) => {
|
|
2925
2931
|
if (a && typeof a == "object" && "style" in a && !("styles" in a)) {
|
|
2926
2932
|
const { style: e, ...t } = a;
|
|
@@ -2928,16 +2934,16 @@ const ht = P.createWithPreprocess, oe = w([
|
|
|
2928
2934
|
}
|
|
2929
2935
|
return a;
|
|
2930
2936
|
},
|
|
2931
|
-
S(
|
|
2932
|
-
),
|
|
2933
|
-
id:
|
|
2934
|
-
label:
|
|
2935
|
-
url:
|
|
2936
|
-
thumbnail:
|
|
2937
|
-
}), Ft = S({
|
|
2938
|
-
id: _().min(1),
|
|
2939
|
-
url: _().url()
|
|
2937
|
+
S(Dt)
|
|
2938
|
+
), Ft = S({
|
|
2939
|
+
id: g().min(1),
|
|
2940
|
+
label: g(),
|
|
2941
|
+
url: g().url(),
|
|
2942
|
+
thumbnail: g().url().optional()
|
|
2940
2943
|
}), Ut = S({
|
|
2944
|
+
id: g().min(1),
|
|
2945
|
+
url: g().url()
|
|
2946
|
+
}), Bt = S({
|
|
2941
2947
|
showLayerPanel: v().default(!0),
|
|
2942
2948
|
showLegend: v().default(!0),
|
|
2943
2949
|
showBasemapSwitcher: v().default(!0),
|
|
@@ -2948,64 +2954,82 @@ const ht = P.createWithPreprocess, oe = w([
|
|
|
2948
2954
|
showExportButton: v().default(!0),
|
|
2949
2955
|
showLegendOpacity: v().default(!1),
|
|
2950
2956
|
showMeasureTool: v().default(!1),
|
|
2951
|
-
showSelectionTool: v().default(!1)
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2957
|
+
showSelectionTool: v().default(!1),
|
|
2958
|
+
showImageryPanel: v().default(!1)
|
|
2959
|
+
}), Jt = "#1e293b", qt = S({
|
|
2960
|
+
headerTitle: g().optional(),
|
|
2961
|
+
headerColor: g().optional(),
|
|
2962
|
+
browserTitle: g().optional(),
|
|
2963
|
+
faviconDataUrl: g().optional(),
|
|
2964
|
+
logoDataUrl: g().optional(),
|
|
2958
2965
|
logoHeight: d().int().min(16).max(200).optional()
|
|
2966
|
+
}), Wt = S({
|
|
2967
|
+
id: g().min(1),
|
|
2968
|
+
sourceId: g().default(""),
|
|
2969
|
+
collection: g().default(""),
|
|
2970
|
+
label: g(),
|
|
2971
|
+
visible: v().default(!1),
|
|
2972
|
+
opacity: d().min(0).max(1).default(1),
|
|
2973
|
+
exclusive: v().default(!1),
|
|
2974
|
+
minZoom: d().min(0).max(24).optional(),
|
|
2975
|
+
maxZoom: d().min(0).max(24).optional(),
|
|
2976
|
+
tileSize: d().default(256),
|
|
2977
|
+
tileUrlTemplate: g().optional()
|
|
2978
|
+
}).superRefine((a, e) => {
|
|
2979
|
+
a.tileUrlTemplate || (a.sourceId || e.addIssue({ code: l.too_small, minimum: 1, type: "string", inclusive: !0, path: ["sourceId"], message: "Source is required when not using a custom tile URL" }), a.collection || e.addIssue({ code: l.too_small, minimum: 1, type: "string", inclusive: !0, path: ["collection"], message: "Collection is required when not using a custom tile URL" }));
|
|
2959
2980
|
}), Pe = S({
|
|
2960
|
-
sources: C(
|
|
2961
|
-
layers: C(
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2981
|
+
sources: C(mt).min(1),
|
|
2982
|
+
layers: C(zt),
|
|
2983
|
+
imageryLayers: C(Wt).optional(),
|
|
2984
|
+
basemaps: C(Ft).min(1),
|
|
2985
|
+
sprites: C(Ut).optional(),
|
|
2986
|
+
ui: Bt.default({}),
|
|
2987
|
+
initialView: ht,
|
|
2988
|
+
branding: qt.optional()
|
|
2967
2989
|
});
|
|
2968
|
-
function
|
|
2990
|
+
function Ht(a) {
|
|
2969
2991
|
return Pe.parse(a);
|
|
2970
2992
|
}
|
|
2971
|
-
function
|
|
2993
|
+
function Gt(a) {
|
|
2972
2994
|
return Pe.safeParse(a);
|
|
2973
2995
|
}
|
|
2974
2996
|
export {
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2997
|
+
Ft as B,
|
|
2998
|
+
bt as C,
|
|
2999
|
+
Jt as D,
|
|
3000
|
+
xt as F,
|
|
2979
3001
|
oe as G,
|
|
2980
|
-
|
|
3002
|
+
Wt as I,
|
|
3003
|
+
zt as L,
|
|
2981
3004
|
Pe as M,
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3005
|
+
It as N,
|
|
3006
|
+
mt as O,
|
|
3007
|
+
Pt as P,
|
|
3008
|
+
Lt as S,
|
|
3009
|
+
Rt as T,
|
|
3010
|
+
Bt as U,
|
|
3011
|
+
ht as V,
|
|
3012
|
+
qt as a,
|
|
3013
|
+
_t as b,
|
|
3014
|
+
Ct as c,
|
|
2992
3015
|
jt as d,
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3016
|
+
yt as e,
|
|
3017
|
+
St as f,
|
|
3018
|
+
Vt as g,
|
|
3019
|
+
Zt as h,
|
|
3020
|
+
Nt as i,
|
|
3021
|
+
kt as j,
|
|
3022
|
+
gt as k,
|
|
3023
|
+
Tt as l,
|
|
3001
3024
|
Mt as m,
|
|
3002
|
-
|
|
3025
|
+
$t as n,
|
|
3003
3026
|
Et as o,
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3027
|
+
pt as p,
|
|
3028
|
+
Ut as q,
|
|
3029
|
+
At as r,
|
|
3030
|
+
Gt as s,
|
|
3031
|
+
wt as t,
|
|
3032
|
+
vt as u,
|
|
3033
|
+
Ot as v,
|
|
3034
|
+
Ht as w
|
|
3011
3035
|
};
|