@ogc-maps/storybook-components 0.8.0 → 0.10.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/{CollapsibleControl-CGRNPpCw.js → CollapsibleControl-qo9daiD8.js} +5 -5
- package/dist/ExportButton-BsNrOvRE.js +25 -0
- package/dist/Legend-BLWBzD7Y.js +275 -0
- package/dist/SearchPanel-4Y12jfuP.js +401 -0
- package/dist/components/CollapsibleControl/index.js +1 -1
- package/dist/components/ExportButton/ExportButton.d.ts +2 -8
- package/dist/components/ExportButton/ExportButton.d.ts.map +1 -1
- package/dist/components/ExportButton/index.d.ts +1 -1
- package/dist/components/ExportButton/index.d.ts.map +1 -1
- package/dist/components/ExportButton/index.js +1 -1
- package/dist/components/ExportModal/ExportModal.d.ts +29 -0
- package/dist/components/ExportModal/ExportModal.d.ts.map +1 -0
- package/dist/components/ExportModal/index.d.ts +3 -0
- package/dist/components/ExportModal/index.d.ts.map +1 -0
- package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/Legend/Legend.d.ts.map +1 -1
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/LegendEditor/LegendEditor.d.ts.map +1 -1
- package/dist/components/MeasurePanel/MeasurePanel.d.ts +13 -0
- package/dist/components/MeasurePanel/MeasurePanel.d.ts.map +1 -0
- package/dist/components/MeasurePanel/index.d.ts +3 -0
- package/dist/components/MeasurePanel/index.d.ts.map +1 -0
- package/dist/components/SearchFieldEditor/SearchFieldEditor.d.ts.map +1 -1
- package/dist/components/SearchPanel/NumberInput.d.ts.map +1 -1
- package/dist/components/SearchPanel/SearchPanel.d.ts +2 -1
- package/dist/components/SearchPanel/SearchPanel.d.ts.map +1 -1
- package/dist/components/SearchPanel/index.js +1 -1
- package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts.map +1 -1
- package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/geo-CIJBPCVe.js +1038 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +40 -35
- package/dist/hooks/useExport.d.ts +22 -0
- package/dist/hooks/useExport.d.ts.map +1 -0
- package/dist/hooks/useMeasure.d.ts +15 -0
- package/dist/hooks/useMeasure.d.ts.map +1 -0
- package/dist/{index-RzZtWlUz.js → index-DA_GGs_P.js} +444 -437
- package/dist/main.js +1301 -936
- package/dist/schemas/config.d.ts +167 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/cql2.d.ts.map +1 -1
- package/dist/utils/csvExport.d.ts.map +1 -1
- package/dist/utils/download.d.ts +2 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/expressionColors.d.ts.map +1 -1
- package/dist/utils/geo.d.ts +3 -0
- package/dist/utils/geo.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/measure.d.ts +49 -0
- package/dist/utils/measure.d.ts.map +1 -0
- package/package.json +6 -3
- package/dist/ExportButton-CLsWoW4m.js +0 -77
- package/dist/Legend-BiRyrZL1.js +0 -239
- package/dist/SearchPanel-DtLXMoVs.js +0 -363
- package/dist/cql2-DOJnQwcv.js +0 -440
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var k;
|
|
2
2
|
(function(a) {
|
|
3
3
|
a.assertEqual = (r) => {
|
|
4
4
|
};
|
|
@@ -34,7 +34,7 @@ var x;
|
|
|
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
|
+
})(k || (k = {}));
|
|
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 = k.arrayToEnum([
|
|
47
47
|
"string",
|
|
48
48
|
"nan",
|
|
49
49
|
"number",
|
|
@@ -85,7 +85,7 @@ const u = x.arrayToEnum([
|
|
|
85
85
|
default:
|
|
86
86
|
return u.unknown;
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, l = k.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, f = 0;
|
|
134
|
+
for (; f < i.path.length; ) {
|
|
135
|
+
const p = i.path[f];
|
|
136
|
+
f === i.path.length - 1 ? (o[p] = o[p] || { _errors: [] }, o[p]._errors.push(t(i))) : o[p] = o[p] || { _errors: [] }, o = o[p], f++;
|
|
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, k.jsonStringifyReplacer, 2);
|
|
151
151
|
}
|
|
152
152
|
get isEmpty() {
|
|
153
153
|
return this.issues.length === 0;
|
|
@@ -170,56 +170,56 @@ $.create = (a) => new $(a);
|
|
|
170
170
|
const de = (a, e) => {
|
|
171
171
|
let t;
|
|
172
172
|
switch (a.code) {
|
|
173
|
-
case
|
|
173
|
+
case l.invalid_type:
|
|
174
174
|
a.received === u.undefined ? t = "Required" : t = `Expected ${a.expected}, received ${a.received}`;
|
|
175
175
|
break;
|
|
176
|
-
case
|
|
177
|
-
t = `Invalid literal value, expected ${JSON.stringify(a.expected,
|
|
176
|
+
case l.invalid_literal:
|
|
177
|
+
t = `Invalid literal value, expected ${JSON.stringify(a.expected, k.jsonStringifyReplacer)}`;
|
|
178
178
|
break;
|
|
179
|
-
case
|
|
180
|
-
t = `Unrecognized key(s) in object: ${
|
|
179
|
+
case l.unrecognized_keys:
|
|
180
|
+
t = `Unrecognized key(s) in object: ${k.joinValues(a.keys, ", ")}`;
|
|
181
181
|
break;
|
|
182
|
-
case
|
|
182
|
+
case l.invalid_union:
|
|
183
183
|
t = "Invalid input";
|
|
184
184
|
break;
|
|
185
|
-
case
|
|
186
|
-
t = `Invalid discriminator value. Expected ${
|
|
185
|
+
case l.invalid_union_discriminator:
|
|
186
|
+
t = `Invalid discriminator value. Expected ${k.joinValues(a.options)}`;
|
|
187
187
|
break;
|
|
188
|
-
case
|
|
189
|
-
t = `Invalid enum value. Expected ${
|
|
188
|
+
case l.invalid_enum_value:
|
|
189
|
+
t = `Invalid enum value. Expected ${k.joinValues(a.options)}, received '${a.received}'`;
|
|
190
190
|
break;
|
|
191
|
-
case
|
|
191
|
+
case l.invalid_arguments:
|
|
192
192
|
t = "Invalid function arguments";
|
|
193
193
|
break;
|
|
194
|
-
case
|
|
194
|
+
case l.invalid_return_type:
|
|
195
195
|
t = "Invalid function return type";
|
|
196
196
|
break;
|
|
197
|
-
case
|
|
197
|
+
case l.invalid_date:
|
|
198
198
|
t = "Invalid date";
|
|
199
199
|
break;
|
|
200
|
-
case
|
|
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}"` :
|
|
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}"` : k.assertNever(a.validation) : a.validation !== "regex" ? t = `Invalid ${a.validation}` : t = "Invalid";
|
|
202
202
|
break;
|
|
203
|
-
case
|
|
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";
|
|
205
205
|
break;
|
|
206
|
-
case
|
|
206
|
+
case l.too_big:
|
|
207
207
|
a.type === "array" ? t = `Array must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "less than"} ${a.maximum} element(s)` : a.type === "string" ? t = `String must contain ${a.exact ? "exactly" : a.inclusive ? "at most" : "under"} ${a.maximum} character(s)` : a.type === "number" ? t = `Number must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "bigint" ? t = `BigInt must be ${a.exact ? "exactly" : a.inclusive ? "less than or equal to" : "less than"} ${a.maximum}` : a.type === "date" ? t = `Date must be ${a.exact ? "exactly" : a.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(a.maximum))}` : t = "Invalid input";
|
|
208
208
|
break;
|
|
209
|
-
case
|
|
209
|
+
case l.custom:
|
|
210
210
|
t = "Invalid input";
|
|
211
211
|
break;
|
|
212
|
-
case
|
|
212
|
+
case l.invalid_intersection_types:
|
|
213
213
|
t = "Intersection results could not be merged";
|
|
214
214
|
break;
|
|
215
|
-
case
|
|
215
|
+
case l.not_multiple_of:
|
|
216
216
|
t = `Number must be a multiple of ${a.multipleOf}`;
|
|
217
217
|
break;
|
|
218
|
-
case
|
|
218
|
+
case l.not_finite:
|
|
219
219
|
t = "Number must be finite";
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
|
-
t = e.defaultError,
|
|
222
|
+
t = e.defaultError, k.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 f = n.filter((p) => !!p).slice().reverse();
|
|
243
|
+
for (const p of f)
|
|
244
244
|
o = p(i, { data: e, defaultError: o }).message;
|
|
245
245
|
return {
|
|
246
246
|
...r,
|
|
@@ -248,7 +248,7 @@ const Fe = (a) => {
|
|
|
248
248
|
message: o
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
|
-
function
|
|
251
|
+
function c(a, e) {
|
|
252
252
|
const t = De(), n = Fe({
|
|
253
253
|
issueData: e,
|
|
254
254
|
data: a.data,
|
|
@@ -310,10 +310,10 @@ class O {
|
|
|
310
310
|
const m = Object.freeze({
|
|
311
311
|
status: "aborted"
|
|
312
312
|
}), G = (a) => ({ status: "dirty", value: a }), N = (a) => ({ status: "valid", value: a }), we = (a) => a.status === "aborted", Se = (a) => a.status === "dirty", W = (a) => a.status === "valid", Q = (a) => typeof Promise < "u" && a instanceof Promise;
|
|
313
|
-
var
|
|
313
|
+
var h;
|
|
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
|
+
})(h || (h = {}));
|
|
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;
|
|
@@ -344,8 +344,8 @@ function g(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: f } = a;
|
|
348
|
+
return i.code === "invalid_enum_value" ? { message: f ?? o.defaultError } : typeof o.data > "u" ? { message: f ?? n ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: f ?? t ?? o.defaultError };
|
|
349
349
|
}, description: r };
|
|
350
350
|
}
|
|
351
351
|
class _ {
|
|
@@ -467,10 +467,10 @@ class _ {
|
|
|
467
467
|
const n = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
468
468
|
return this._refinement((r, s) => {
|
|
469
469
|
const i = e(r), o = () => s.addIssue({
|
|
470
|
-
code:
|
|
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((f) => f ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
refinement(e, t) {
|
|
@@ -567,8 +567,8 @@ class _ {
|
|
|
567
567
|
return this.safeParse(null).success;
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
const
|
|
571
|
-
let
|
|
570
|
+
const Be = /^c[^\s-]{8,}$/i, Ue = /^[0-9a-z]+$/, We = /^[0-9A-HJKMNP-TV-Z]{26}$/i, qe = /^[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, Ge = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ye = /^[-+]?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)?)??$/, He = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
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
573
|
function je(a) {
|
|
574
574
|
let e = "[0-5]\\d";
|
|
@@ -587,7 +587,7 @@ function it(a) {
|
|
|
587
587
|
function ot(a, e) {
|
|
588
588
|
return !!((e === "v4" || !e) && Xe.test(a) || (e === "v6" || !e) && et.test(a));
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function lt(a, e) {
|
|
591
591
|
if (!Ge.test(a))
|
|
592
592
|
return !1;
|
|
593
593
|
try {
|
|
@@ -600,15 +600,15 @@ function ct(a, e) {
|
|
|
600
600
|
return !1;
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function ct(a, e) {
|
|
604
604
|
return !!((e === "v4" || !e) && Ke.test(a) || (e === "v6" || !e) && tt.test(a));
|
|
605
605
|
}
|
|
606
606
|
class j extends _ {
|
|
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);
|
|
610
|
-
return
|
|
611
|
-
code:
|
|
610
|
+
return c(s, {
|
|
611
|
+
code: l.invalid_type,
|
|
612
612
|
expected: u.string,
|
|
613
613
|
received: s.parsedType
|
|
614
614
|
}), m;
|
|
@@ -617,8 +617,8 @@ class j extends _ {
|
|
|
617
617
|
let r;
|
|
618
618
|
for (const s of this._def.checks)
|
|
619
619
|
if (s.kind === "min")
|
|
620
|
-
e.data.length < s.value && (r = this._getOrReturnCtx(e, r),
|
|
621
|
-
code:
|
|
620
|
+
e.data.length < s.value && (r = this._getOrReturnCtx(e, r), c(r, {
|
|
621
|
+
code: l.too_small,
|
|
622
622
|
minimum: s.value,
|
|
623
623
|
type: "string",
|
|
624
624
|
inclusive: !0,
|
|
@@ -626,8 +626,8 @@ class j extends _ {
|
|
|
626
626
|
message: s.message
|
|
627
627
|
}), n.dirty());
|
|
628
628
|
else if (s.kind === "max")
|
|
629
|
-
e.data.length > s.value && (r = this._getOrReturnCtx(e, r),
|
|
630
|
-
code:
|
|
629
|
+
e.data.length > s.value && (r = this._getOrReturnCtx(e, r), c(r, {
|
|
630
|
+
code: l.too_big,
|
|
631
631
|
maximum: s.value,
|
|
632
632
|
type: "string",
|
|
633
633
|
inclusive: !0,
|
|
@@ -636,15 +636,15 @@ class j extends _ {
|
|
|
636
636
|
}), n.dirty());
|
|
637
637
|
else if (s.kind === "length") {
|
|
638
638
|
const i = e.data.length > s.value, o = e.data.length < s.value;
|
|
639
|
-
(i || o) && (r = this._getOrReturnCtx(e, r), i ?
|
|
640
|
-
code:
|
|
639
|
+
(i || o) && (r = this._getOrReturnCtx(e, r), i ? c(r, {
|
|
640
|
+
code: l.too_big,
|
|
641
641
|
maximum: s.value,
|
|
642
642
|
type: "string",
|
|
643
643
|
inclusive: !0,
|
|
644
644
|
exact: !0,
|
|
645
645
|
message: s.message
|
|
646
|
-
}) : o &&
|
|
647
|
-
code:
|
|
646
|
+
}) : o && c(r, {
|
|
647
|
+
code: l.too_small,
|
|
648
648
|
minimum: s.value,
|
|
649
649
|
type: "string",
|
|
650
650
|
inclusive: !0,
|
|
@@ -652,117 +652,117 @@ class j extends _ {
|
|
|
652
652
|
message: s.message
|
|
653
653
|
}), n.dirty());
|
|
654
654
|
} else if (s.kind === "email")
|
|
655
|
-
He.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
655
|
+
He.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
656
656
|
validation: "email",
|
|
657
|
-
code:
|
|
657
|
+
code: l.invalid_string,
|
|
658
658
|
message: s.message
|
|
659
659
|
}), n.dirty());
|
|
660
660
|
else if (s.kind === "emoji")
|
|
661
|
-
|
|
661
|
+
ce || (ce = new RegExp(Qe, "u")), ce.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
662
662
|
validation: "emoji",
|
|
663
|
-
code:
|
|
663
|
+
code: l.invalid_string,
|
|
664
664
|
message: s.message
|
|
665
665
|
}), n.dirty());
|
|
666
666
|
else if (s.kind === "uuid")
|
|
667
|
-
qe.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
667
|
+
qe.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
668
668
|
validation: "uuid",
|
|
669
|
-
code:
|
|
669
|
+
code: l.invalid_string,
|
|
670
670
|
message: s.message
|
|
671
671
|
}), n.dirty());
|
|
672
672
|
else if (s.kind === "nanoid")
|
|
673
|
-
Je.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
673
|
+
Je.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
674
674
|
validation: "nanoid",
|
|
675
|
-
code:
|
|
675
|
+
code: l.invalid_string,
|
|
676
676
|
message: s.message
|
|
677
677
|
}), n.dirty());
|
|
678
678
|
else if (s.kind === "cuid")
|
|
679
|
-
|
|
679
|
+
Be.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
680
680
|
validation: "cuid",
|
|
681
|
-
code:
|
|
681
|
+
code: l.invalid_string,
|
|
682
682
|
message: s.message
|
|
683
683
|
}), n.dirty());
|
|
684
684
|
else if (s.kind === "cuid2")
|
|
685
|
-
|
|
685
|
+
Ue.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
686
686
|
validation: "cuid2",
|
|
687
|
-
code:
|
|
687
|
+
code: l.invalid_string,
|
|
688
688
|
message: s.message
|
|
689
689
|
}), n.dirty());
|
|
690
690
|
else if (s.kind === "ulid")
|
|
691
|
-
We.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
691
|
+
We.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
692
692
|
validation: "ulid",
|
|
693
|
-
code:
|
|
693
|
+
code: l.invalid_string,
|
|
694
694
|
message: s.message
|
|
695
695
|
}), n.dirty());
|
|
696
696
|
else if (s.kind === "url")
|
|
697
697
|
try {
|
|
698
698
|
new URL(e.data);
|
|
699
699
|
} catch {
|
|
700
|
-
r = this._getOrReturnCtx(e, r),
|
|
700
|
+
r = this._getOrReturnCtx(e, r), c(r, {
|
|
701
701
|
validation: "url",
|
|
702
|
-
code:
|
|
702
|
+
code: l.invalid_string,
|
|
703
703
|
message: s.message
|
|
704
704
|
}), n.dirty();
|
|
705
705
|
}
|
|
706
|
-
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
706
|
+
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
707
707
|
validation: "regex",
|
|
708
|
-
code:
|
|
708
|
+
code: l.invalid_string,
|
|
709
709
|
message: s.message
|
|
710
|
-
}), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r),
|
|
711
|
-
code:
|
|
710
|
+
}), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
711
|
+
code: l.invalid_string,
|
|
712
712
|
validation: { includes: s.value, position: s.position },
|
|
713
713
|
message: s.message
|
|
714
|
-
}), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r),
|
|
715
|
-
code:
|
|
714
|
+
}), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
715
|
+
code: l.invalid_string,
|
|
716
716
|
validation: { startsWith: s.value },
|
|
717
717
|
message: s.message
|
|
718
|
-
}), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r),
|
|
719
|
-
code:
|
|
718
|
+
}), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
719
|
+
code: l.invalid_string,
|
|
720
720
|
validation: { endsWith: s.value },
|
|
721
721
|
message: s.message
|
|
722
|
-
}), n.dirty()) : s.kind === "datetime" ? it(s).test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
723
|
-
code:
|
|
722
|
+
}), n.dirty()) : s.kind === "datetime" ? it(s).test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
723
|
+
code: l.invalid_string,
|
|
724
724
|
validation: "datetime",
|
|
725
725
|
message: s.message
|
|
726
|
-
}), n.dirty()) : s.kind === "date" ? rt.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
727
|
-
code:
|
|
726
|
+
}), n.dirty()) : s.kind === "date" ? rt.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
727
|
+
code: l.invalid_string,
|
|
728
728
|
validation: "date",
|
|
729
729
|
message: s.message
|
|
730
|
-
}), n.dirty()) : s.kind === "time" ? st(s).test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
731
|
-
code:
|
|
730
|
+
}), n.dirty()) : s.kind === "time" ? st(s).test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
731
|
+
code: l.invalid_string,
|
|
732
732
|
validation: "time",
|
|
733
733
|
message: s.message
|
|
734
|
-
}), n.dirty()) : s.kind === "duration" ? Ye.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
734
|
+
}), n.dirty()) : s.kind === "duration" ? Ye.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
735
735
|
validation: "duration",
|
|
736
|
-
code:
|
|
736
|
+
code: l.invalid_string,
|
|
737
737
|
message: s.message
|
|
738
|
-
}), n.dirty()) : s.kind === "ip" ? ot(e.data, s.version) || (r = this._getOrReturnCtx(e, r),
|
|
738
|
+
}), n.dirty()) : s.kind === "ip" ? ot(e.data, s.version) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
739
739
|
validation: "ip",
|
|
740
|
-
code:
|
|
740
|
+
code: l.invalid_string,
|
|
741
741
|
message: s.message
|
|
742
|
-
}), n.dirty()) : s.kind === "jwt" ?
|
|
742
|
+
}), n.dirty()) : s.kind === "jwt" ? lt(e.data, s.alg) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
743
743
|
validation: "jwt",
|
|
744
|
-
code:
|
|
744
|
+
code: l.invalid_string,
|
|
745
745
|
message: s.message
|
|
746
|
-
}), n.dirty()) : s.kind === "cidr" ?
|
|
746
|
+
}), n.dirty()) : s.kind === "cidr" ? ct(e.data, s.version) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
747
747
|
validation: "cidr",
|
|
748
|
-
code:
|
|
748
|
+
code: l.invalid_string,
|
|
749
749
|
message: s.message
|
|
750
|
-
}), n.dirty()) : s.kind === "base64" ? at.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
750
|
+
}), n.dirty()) : s.kind === "base64" ? at.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
751
751
|
validation: "base64",
|
|
752
|
-
code:
|
|
752
|
+
code: l.invalid_string,
|
|
753
753
|
message: s.message
|
|
754
|
-
}), n.dirty()) : s.kind === "base64url" ? nt.test(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
754
|
+
}), n.dirty()) : s.kind === "base64url" ? nt.test(e.data) || (r = this._getOrReturnCtx(e, r), c(r, {
|
|
755
755
|
validation: "base64url",
|
|
756
|
-
code:
|
|
756
|
+
code: l.invalid_string,
|
|
757
757
|
message: s.message
|
|
758
|
-
}), n.dirty()) :
|
|
758
|
+
}), n.dirty()) : k.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
|
-
code:
|
|
765
|
-
...
|
|
764
|
+
code: l.invalid_string,
|
|
765
|
+
...h.errToObj(n)
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
_addCheck(e) {
|
|
@@ -772,46 +772,46 @@ class j extends _ {
|
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
email(e) {
|
|
775
|
-
return this._addCheck({ kind: "email", ...
|
|
775
|
+
return this._addCheck({ kind: "email", ...h.errToObj(e) });
|
|
776
776
|
}
|
|
777
777
|
url(e) {
|
|
778
|
-
return this._addCheck({ kind: "url", ...
|
|
778
|
+
return this._addCheck({ kind: "url", ...h.errToObj(e) });
|
|
779
779
|
}
|
|
780
780
|
emoji(e) {
|
|
781
|
-
return this._addCheck({ kind: "emoji", ...
|
|
781
|
+
return this._addCheck({ kind: "emoji", ...h.errToObj(e) });
|
|
782
782
|
}
|
|
783
783
|
uuid(e) {
|
|
784
|
-
return this._addCheck({ kind: "uuid", ...
|
|
784
|
+
return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
|
|
785
785
|
}
|
|
786
786
|
nanoid(e) {
|
|
787
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
787
|
+
return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
|
|
788
788
|
}
|
|
789
789
|
cuid(e) {
|
|
790
|
-
return this._addCheck({ kind: "cuid", ...
|
|
790
|
+
return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
|
|
791
791
|
}
|
|
792
792
|
cuid2(e) {
|
|
793
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
793
|
+
return this._addCheck({ kind: "cuid2", ...h.errToObj(e) });
|
|
794
794
|
}
|
|
795
795
|
ulid(e) {
|
|
796
|
-
return this._addCheck({ kind: "ulid", ...
|
|
796
|
+
return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
|
|
797
797
|
}
|
|
798
798
|
base64(e) {
|
|
799
|
-
return this._addCheck({ kind: "base64", ...
|
|
799
|
+
return this._addCheck({ kind: "base64", ...h.errToObj(e) });
|
|
800
800
|
}
|
|
801
801
|
base64url(e) {
|
|
802
802
|
return this._addCheck({
|
|
803
803
|
kind: "base64url",
|
|
804
|
-
...
|
|
804
|
+
...h.errToObj(e)
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
jwt(e) {
|
|
808
|
-
return this._addCheck({ kind: "jwt", ...
|
|
808
|
+
return this._addCheck({ kind: "jwt", ...h.errToObj(e) });
|
|
809
809
|
}
|
|
810
810
|
ip(e) {
|
|
811
|
-
return this._addCheck({ kind: "ip", ...
|
|
811
|
+
return this._addCheck({ kind: "ip", ...h.errToObj(e) });
|
|
812
812
|
}
|
|
813
813
|
cidr(e) {
|
|
814
|
-
return this._addCheck({ kind: "cidr", ...
|
|
814
|
+
return this._addCheck({ kind: "cidr", ...h.errToObj(e) });
|
|
815
815
|
}
|
|
816
816
|
datetime(e) {
|
|
817
817
|
return typeof e == "string" ? this._addCheck({
|
|
@@ -825,7 +825,7 @@ class j extends _ {
|
|
|
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
|
+
...h.errToObj(e == null ? void 0 : e.message)
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
831
|
date(e) {
|
|
@@ -839,17 +839,17 @@ class j extends _ {
|
|
|
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
|
+
...h.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", ...h.errToObj(e) });
|
|
847
847
|
}
|
|
848
848
|
regex(e, t) {
|
|
849
849
|
return this._addCheck({
|
|
850
850
|
kind: "regex",
|
|
851
851
|
regex: e,
|
|
852
|
-
...
|
|
852
|
+
...h.errToObj(t)
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
855
|
includes(e, t) {
|
|
@@ -857,49 +857,49 @@ class j extends _ {
|
|
|
857
857
|
kind: "includes",
|
|
858
858
|
value: e,
|
|
859
859
|
position: t == null ? void 0 : t.position,
|
|
860
|
-
...
|
|
860
|
+
...h.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
|
+
...h.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
|
+
...h.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
|
+
...h.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
|
+
...h.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
|
+
...h.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, h.errToObj(e));
|
|
903
903
|
}
|
|
904
904
|
trim() {
|
|
905
905
|
return new j({
|
|
@@ -997,8 +997,8 @@ class q extends _ {
|
|
|
997
997
|
_parse(e) {
|
|
998
998
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== u.number) {
|
|
999
999
|
const s = this._getOrReturnCtx(e);
|
|
1000
|
-
return
|
|
1001
|
-
code:
|
|
1000
|
+
return c(s, {
|
|
1001
|
+
code: l.invalid_type,
|
|
1002
1002
|
expected: u.number,
|
|
1003
1003
|
received: s.parsedType
|
|
1004
1004
|
}), m;
|
|
@@ -1006,46 +1006,46 @@ class q extends _ {
|
|
|
1006
1006
|
let n;
|
|
1007
1007
|
const r = new O();
|
|
1008
1008
|
for (const s of this._def.checks)
|
|
1009
|
-
s.kind === "int" ?
|
|
1010
|
-
code:
|
|
1009
|
+
s.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1010
|
+
code: l.invalid_type,
|
|
1011
1011
|
expected: "integer",
|
|
1012
1012
|
received: "float",
|
|
1013
1013
|
message: s.message
|
|
1014
|
-
}), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n),
|
|
1015
|
-
code:
|
|
1014
|
+
}), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1015
|
+
code: l.too_small,
|
|
1016
1016
|
minimum: s.value,
|
|
1017
1017
|
type: "number",
|
|
1018
1018
|
inclusive: s.inclusive,
|
|
1019
1019
|
exact: !1,
|
|
1020
1020
|
message: s.message
|
|
1021
|
-
}), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n),
|
|
1022
|
-
code:
|
|
1021
|
+
}), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1022
|
+
code: l.too_big,
|
|
1023
1023
|
maximum: s.value,
|
|
1024
1024
|
type: "number",
|
|
1025
1025
|
inclusive: s.inclusive,
|
|
1026
1026
|
exact: !1,
|
|
1027
1027
|
message: s.message
|
|
1028
|
-
}), r.dirty()) : s.kind === "multipleOf" ? dt(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n),
|
|
1029
|
-
code:
|
|
1028
|
+
}), r.dirty()) : s.kind === "multipleOf" ? dt(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1029
|
+
code: l.not_multiple_of,
|
|
1030
1030
|
multipleOf: s.value,
|
|
1031
1031
|
message: s.message
|
|
1032
|
-
}), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
1033
|
-
code:
|
|
1032
|
+
}), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1033
|
+
code: l.not_finite,
|
|
1034
1034
|
message: s.message
|
|
1035
|
-
}), r.dirty()) :
|
|
1035
|
+
}), r.dirty()) : k.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, h.toString(t));
|
|
1040
1040
|
}
|
|
1041
1041
|
gt(e, t) {
|
|
1042
|
-
return this.setLimit("min", e, !1,
|
|
1042
|
+
return this.setLimit("min", e, !1, h.toString(t));
|
|
1043
1043
|
}
|
|
1044
1044
|
lte(e, t) {
|
|
1045
|
-
return this.setLimit("max", e, !0,
|
|
1045
|
+
return this.setLimit("max", e, !0, h.toString(t));
|
|
1046
1046
|
}
|
|
1047
1047
|
lt(e, t) {
|
|
1048
|
-
return this.setLimit("max", e, !1,
|
|
1048
|
+
return this.setLimit("max", e, !1, h.toString(t));
|
|
1049
1049
|
}
|
|
1050
1050
|
setLimit(e, t, n, r) {
|
|
1051
1051
|
return new q({
|
|
@@ -1056,7 +1056,7 @@ class q extends _ {
|
|
|
1056
1056
|
kind: e,
|
|
1057
1057
|
value: t,
|
|
1058
1058
|
inclusive: n,
|
|
1059
|
-
message:
|
|
1059
|
+
message: h.toString(r)
|
|
1060
1060
|
}
|
|
1061
1061
|
]
|
|
1062
1062
|
});
|
|
@@ -1070,7 +1070,7 @@ class q extends _ {
|
|
|
1070
1070
|
int(e) {
|
|
1071
1071
|
return this._addCheck({
|
|
1072
1072
|
kind: "int",
|
|
1073
|
-
message:
|
|
1073
|
+
message: h.toString(e)
|
|
1074
1074
|
});
|
|
1075
1075
|
}
|
|
1076
1076
|
positive(e) {
|
|
@@ -1078,7 +1078,7 @@ class q extends _ {
|
|
|
1078
1078
|
kind: "min",
|
|
1079
1079
|
value: 0,
|
|
1080
1080
|
inclusive: !1,
|
|
1081
|
-
message:
|
|
1081
|
+
message: h.toString(e)
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
negative(e) {
|
|
@@ -1086,7 +1086,7 @@ class q extends _ {
|
|
|
1086
1086
|
kind: "max",
|
|
1087
1087
|
value: 0,
|
|
1088
1088
|
inclusive: !1,
|
|
1089
|
-
message:
|
|
1089
|
+
message: h.toString(e)
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
1092
|
nonpositive(e) {
|
|
@@ -1094,7 +1094,7 @@ class q extends _ {
|
|
|
1094
1094
|
kind: "max",
|
|
1095
1095
|
value: 0,
|
|
1096
1096
|
inclusive: !0,
|
|
1097
|
-
message:
|
|
1097
|
+
message: h.toString(e)
|
|
1098
1098
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
nonnegative(e) {
|
|
@@ -1102,20 +1102,20 @@ class q extends _ {
|
|
|
1102
1102
|
kind: "min",
|
|
1103
1103
|
value: 0,
|
|
1104
1104
|
inclusive: !0,
|
|
1105
|
-
message:
|
|
1105
|
+
message: h.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: h.toString(t)
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
1115
|
finite(e) {
|
|
1116
1116
|
return this._addCheck({
|
|
1117
1117
|
kind: "finite",
|
|
1118
|
-
message:
|
|
1118
|
+
message: h.toString(e)
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
safe(e) {
|
|
@@ -1123,12 +1123,12 @@ class q extends _ {
|
|
|
1123
1123
|
kind: "min",
|
|
1124
1124
|
inclusive: !0,
|
|
1125
1125
|
value: Number.MIN_SAFE_INTEGER,
|
|
1126
|
-
message:
|
|
1126
|
+
message: h.toString(e)
|
|
1127
1127
|
})._addCheck({
|
|
1128
1128
|
kind: "max",
|
|
1129
1129
|
inclusive: !0,
|
|
1130
1130
|
value: Number.MAX_SAFE_INTEGER,
|
|
1131
|
-
message:
|
|
1131
|
+
message: h.toString(e)
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
get minValue() {
|
|
@@ -1144,7 +1144,7 @@ class q extends _ {
|
|
|
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" && k.isInteger(e.value));
|
|
1148
1148
|
}
|
|
1149
1149
|
get isFinite() {
|
|
1150
1150
|
let e = null, t = null;
|
|
@@ -1178,44 +1178,44 @@ class Y extends _ {
|
|
|
1178
1178
|
let n;
|
|
1179
1179
|
const r = new O();
|
|
1180
1180
|
for (const s of this._def.checks)
|
|
1181
|
-
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n),
|
|
1182
|
-
code:
|
|
1181
|
+
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1182
|
+
code: l.too_small,
|
|
1183
1183
|
type: "bigint",
|
|
1184
1184
|
minimum: s.value,
|
|
1185
1185
|
inclusive: s.inclusive,
|
|
1186
1186
|
message: s.message
|
|
1187
|
-
}), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n),
|
|
1188
|
-
code:
|
|
1187
|
+
}), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1188
|
+
code: l.too_big,
|
|
1189
1189
|
type: "bigint",
|
|
1190
1190
|
maximum: s.value,
|
|
1191
1191
|
inclusive: s.inclusive,
|
|
1192
1192
|
message: s.message
|
|
1193
|
-
}), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n),
|
|
1194
|
-
code:
|
|
1193
|
+
}), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), c(n, {
|
|
1194
|
+
code: l.not_multiple_of,
|
|
1195
1195
|
multipleOf: s.value,
|
|
1196
1196
|
message: s.message
|
|
1197
|
-
}), r.dirty()) :
|
|
1197
|
+
}), r.dirty()) : k.assertNever(s);
|
|
1198
1198
|
return { status: r.value, value: e.data };
|
|
1199
1199
|
}
|
|
1200
1200
|
_getInvalidInput(e) {
|
|
1201
1201
|
const t = this._getOrReturnCtx(e);
|
|
1202
|
-
return
|
|
1203
|
-
code:
|
|
1202
|
+
return c(t, {
|
|
1203
|
+
code: l.invalid_type,
|
|
1204
1204
|
expected: u.bigint,
|
|
1205
1205
|
received: t.parsedType
|
|
1206
1206
|
}), m;
|
|
1207
1207
|
}
|
|
1208
1208
|
gte(e, t) {
|
|
1209
|
-
return this.setLimit("min", e, !0,
|
|
1209
|
+
return this.setLimit("min", e, !0, h.toString(t));
|
|
1210
1210
|
}
|
|
1211
1211
|
gt(e, t) {
|
|
1212
|
-
return this.setLimit("min", e, !1,
|
|
1212
|
+
return this.setLimit("min", e, !1, h.toString(t));
|
|
1213
1213
|
}
|
|
1214
1214
|
lte(e, t) {
|
|
1215
|
-
return this.setLimit("max", e, !0,
|
|
1215
|
+
return this.setLimit("max", e, !0, h.toString(t));
|
|
1216
1216
|
}
|
|
1217
1217
|
lt(e, t) {
|
|
1218
|
-
return this.setLimit("max", e, !1,
|
|
1218
|
+
return this.setLimit("max", e, !1, h.toString(t));
|
|
1219
1219
|
}
|
|
1220
1220
|
setLimit(e, t, n, r) {
|
|
1221
1221
|
return new Y({
|
|
@@ -1226,7 +1226,7 @@ class Y extends _ {
|
|
|
1226
1226
|
kind: e,
|
|
1227
1227
|
value: t,
|
|
1228
1228
|
inclusive: n,
|
|
1229
|
-
message:
|
|
1229
|
+
message: h.toString(r)
|
|
1230
1230
|
}
|
|
1231
1231
|
]
|
|
1232
1232
|
});
|
|
@@ -1242,7 +1242,7 @@ class Y extends _ {
|
|
|
1242
1242
|
kind: "min",
|
|
1243
1243
|
value: BigInt(0),
|
|
1244
1244
|
inclusive: !1,
|
|
1245
|
-
message:
|
|
1245
|
+
message: h.toString(e)
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
1248
1248
|
negative(e) {
|
|
@@ -1250,7 +1250,7 @@ class Y extends _ {
|
|
|
1250
1250
|
kind: "max",
|
|
1251
1251
|
value: BigInt(0),
|
|
1252
1252
|
inclusive: !1,
|
|
1253
|
-
message:
|
|
1253
|
+
message: h.toString(e)
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
nonpositive(e) {
|
|
@@ -1258,7 +1258,7 @@ class Y extends _ {
|
|
|
1258
1258
|
kind: "max",
|
|
1259
1259
|
value: BigInt(0),
|
|
1260
1260
|
inclusive: !0,
|
|
1261
|
-
message:
|
|
1261
|
+
message: h.toString(e)
|
|
1262
1262
|
});
|
|
1263
1263
|
}
|
|
1264
1264
|
nonnegative(e) {
|
|
@@ -1266,14 +1266,14 @@ class Y extends _ {
|
|
|
1266
1266
|
kind: "min",
|
|
1267
1267
|
value: BigInt(0),
|
|
1268
1268
|
inclusive: !0,
|
|
1269
|
-
message:
|
|
1269
|
+
message: h.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: h.toString(t)
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
1279
|
get minValue() {
|
|
@@ -1299,8 +1299,8 @@ class ue extends _ {
|
|
|
1299
1299
|
_parse(e) {
|
|
1300
1300
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
1301
1301
|
const n = this._getOrReturnCtx(e);
|
|
1302
|
-
return
|
|
1303
|
-
code:
|
|
1302
|
+
return c(n, {
|
|
1303
|
+
code: l.invalid_type,
|
|
1304
1304
|
expected: u.boolean,
|
|
1305
1305
|
received: n.parsedType
|
|
1306
1306
|
}), m;
|
|
@@ -1317,36 +1317,36 @@ class X extends _ {
|
|
|
1317
1317
|
_parse(e) {
|
|
1318
1318
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
|
|
1319
1319
|
const s = this._getOrReturnCtx(e);
|
|
1320
|
-
return
|
|
1321
|
-
code:
|
|
1320
|
+
return c(s, {
|
|
1321
|
+
code: l.invalid_type,
|
|
1322
1322
|
expected: u.date,
|
|
1323
1323
|
received: s.parsedType
|
|
1324
1324
|
}), m;
|
|
1325
1325
|
}
|
|
1326
1326
|
if (Number.isNaN(e.data.getTime())) {
|
|
1327
1327
|
const s = this._getOrReturnCtx(e);
|
|
1328
|
-
return
|
|
1329
|
-
code:
|
|
1328
|
+
return c(s, {
|
|
1329
|
+
code: l.invalid_date
|
|
1330
1330
|
}), m;
|
|
1331
1331
|
}
|
|
1332
1332
|
const n = new O();
|
|
1333
1333
|
let r;
|
|
1334
1334
|
for (const s of this._def.checks)
|
|
1335
|
-
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r),
|
|
1336
|
-
code:
|
|
1335
|
+
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), c(r, {
|
|
1336
|
+
code: l.too_small,
|
|
1337
1337
|
message: s.message,
|
|
1338
1338
|
inclusive: !0,
|
|
1339
1339
|
exact: !1,
|
|
1340
1340
|
minimum: s.value,
|
|
1341
1341
|
type: "date"
|
|
1342
|
-
}), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r),
|
|
1343
|
-
code:
|
|
1342
|
+
}), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r), c(r, {
|
|
1343
|
+
code: l.too_big,
|
|
1344
1344
|
message: s.message,
|
|
1345
1345
|
inclusive: !0,
|
|
1346
1346
|
exact: !1,
|
|
1347
1347
|
maximum: s.value,
|
|
1348
1348
|
type: "date"
|
|
1349
|
-
}), n.dirty()) :
|
|
1349
|
+
}), n.dirty()) : k.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 _ {
|
|
|
1362
1362
|
return this._addCheck({
|
|
1363
1363
|
kind: "min",
|
|
1364
1364
|
value: e.getTime(),
|
|
1365
|
-
message:
|
|
1365
|
+
message: h.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: h.toString(t)
|
|
1373
1373
|
});
|
|
1374
1374
|
}
|
|
1375
1375
|
get minDate() {
|
|
@@ -1395,8 +1395,8 @@ class Ce extends _ {
|
|
|
1395
1395
|
_parse(e) {
|
|
1396
1396
|
if (this._getType(e) !== u.symbol) {
|
|
1397
1397
|
const n = this._getOrReturnCtx(e);
|
|
1398
|
-
return
|
|
1399
|
-
code:
|
|
1398
|
+
return c(n, {
|
|
1399
|
+
code: l.invalid_type,
|
|
1400
1400
|
expected: u.symbol,
|
|
1401
1401
|
received: n.parsedType
|
|
1402
1402
|
}), m;
|
|
@@ -1408,12 +1408,12 @@ Ce.create = (a) => new Ce({
|
|
|
1408
1408
|
typeName: y.ZodSymbol,
|
|
1409
1409
|
...g(a)
|
|
1410
1410
|
});
|
|
1411
|
-
class
|
|
1411
|
+
class he extends _ {
|
|
1412
1412
|
_parse(e) {
|
|
1413
1413
|
if (this._getType(e) !== u.undefined) {
|
|
1414
1414
|
const n = this._getOrReturnCtx(e);
|
|
1415
|
-
return
|
|
1416
|
-
code:
|
|
1415
|
+
return c(n, {
|
|
1416
|
+
code: l.invalid_type,
|
|
1417
1417
|
expected: u.undefined,
|
|
1418
1418
|
received: n.parsedType
|
|
1419
1419
|
}), m;
|
|
@@ -1421,16 +1421,16 @@ class fe extends _ {
|
|
|
1421
1421
|
return N(e.data);
|
|
1422
1422
|
}
|
|
1423
1423
|
}
|
|
1424
|
-
|
|
1424
|
+
he.create = (a) => new he({
|
|
1425
1425
|
typeName: y.ZodUndefined,
|
|
1426
1426
|
...g(a)
|
|
1427
1427
|
});
|
|
1428
|
-
class
|
|
1428
|
+
class fe extends _ {
|
|
1429
1429
|
_parse(e) {
|
|
1430
1430
|
if (this._getType(e) !== u.null) {
|
|
1431
1431
|
const n = this._getOrReturnCtx(e);
|
|
1432
|
-
return
|
|
1433
|
-
code:
|
|
1432
|
+
return c(n, {
|
|
1433
|
+
code: l.invalid_type,
|
|
1434
1434
|
expected: u.null,
|
|
1435
1435
|
received: n.parsedType
|
|
1436
1436
|
}), m;
|
|
@@ -1438,7 +1438,7 @@ class he extends _ {
|
|
|
1438
1438
|
return N(e.data);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
|
|
1441
|
+
fe.create = (a) => new fe({
|
|
1442
1442
|
typeName: y.ZodNull,
|
|
1443
1443
|
...g(a)
|
|
1444
1444
|
});
|
|
@@ -1469,8 +1469,8 @@ pe.create = (a) => new pe({
|
|
|
1469
1469
|
class L extends _ {
|
|
1470
1470
|
_parse(e) {
|
|
1471
1471
|
const t = this._getOrReturnCtx(e);
|
|
1472
|
-
return
|
|
1473
|
-
code:
|
|
1472
|
+
return c(t, {
|
|
1473
|
+
code: l.invalid_type,
|
|
1474
1474
|
expected: u.never,
|
|
1475
1475
|
received: t.parsedType
|
|
1476
1476
|
}), m;
|
|
@@ -1484,8 +1484,8 @@ class Ne extends _ {
|
|
|
1484
1484
|
_parse(e) {
|
|
1485
1485
|
if (this._getType(e) !== u.undefined) {
|
|
1486
1486
|
const n = this._getOrReturnCtx(e);
|
|
1487
|
-
return
|
|
1488
|
-
code:
|
|
1487
|
+
return c(n, {
|
|
1488
|
+
code: l.invalid_type,
|
|
1489
1489
|
expected: u.void,
|
|
1490
1490
|
received: n.parsedType
|
|
1491
1491
|
}), m;
|
|
@@ -1501,15 +1501,15 @@ class A extends _ {
|
|
|
1501
1501
|
_parse(e) {
|
|
1502
1502
|
const { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1503
1503
|
if (t.parsedType !== u.array)
|
|
1504
|
-
return
|
|
1505
|
-
code:
|
|
1504
|
+
return c(t, {
|
|
1505
|
+
code: l.invalid_type,
|
|
1506
1506
|
expected: u.array,
|
|
1507
1507
|
received: t.parsedType
|
|
1508
1508
|
}), m;
|
|
1509
1509
|
if (r.exactLength !== null) {
|
|
1510
1510
|
const i = t.data.length > r.exactLength.value, o = t.data.length < r.exactLength.value;
|
|
1511
|
-
(i || o) && (
|
|
1512
|
-
code: i ?
|
|
1511
|
+
(i || o) && (c(t, {
|
|
1512
|
+
code: i ? l.too_big : l.too_small,
|
|
1513
1513
|
minimum: o ? r.exactLength.value : void 0,
|
|
1514
1514
|
maximum: i ? r.exactLength.value : void 0,
|
|
1515
1515
|
type: "array",
|
|
@@ -1518,15 +1518,15 @@ class A extends _ {
|
|
|
1518
1518
|
message: r.exactLength.message
|
|
1519
1519
|
}), n.dirty());
|
|
1520
1520
|
}
|
|
1521
|
-
if (r.minLength !== null && t.data.length < r.minLength.value && (
|
|
1522
|
-
code:
|
|
1521
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (c(t, {
|
|
1522
|
+
code: l.too_small,
|
|
1523
1523
|
minimum: r.minLength.value,
|
|
1524
1524
|
type: "array",
|
|
1525
1525
|
inclusive: !0,
|
|
1526
1526
|
exact: !1,
|
|
1527
1527
|
message: r.minLength.message
|
|
1528
|
-
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (
|
|
1529
|
-
code:
|
|
1528
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (c(t, {
|
|
1529
|
+
code: l.too_big,
|
|
1530
1530
|
maximum: r.maxLength.value,
|
|
1531
1531
|
type: "array",
|
|
1532
1532
|
inclusive: !0,
|
|
@@ -1543,19 +1543,19 @@ class A extends _ {
|
|
|
1543
1543
|
min(e, t) {
|
|
1544
1544
|
return new A({
|
|
1545
1545
|
...this._def,
|
|
1546
|
-
minLength: { value: e, message:
|
|
1546
|
+
minLength: { value: e, message: h.toString(t) }
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
max(e, t) {
|
|
1550
1550
|
return new A({
|
|
1551
1551
|
...this._def,
|
|
1552
|
-
maxLength: { value: e, message:
|
|
1552
|
+
maxLength: { value: e, message: h.toString(t) }
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
1555
1555
|
length(e, t) {
|
|
1556
1556
|
return new A({
|
|
1557
1557
|
...this._def,
|
|
1558
|
-
exactLength: { value: e, message:
|
|
1558
|
+
exactLength: { value: e, message: h.toString(t) }
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
1561
1561
|
nonempty(e) {
|
|
@@ -1570,12 +1570,12 @@ A.create = (a, e) => new A({
|
|
|
1570
1570
|
typeName: y.ZodArray,
|
|
1571
1571
|
...g(e)
|
|
1572
1572
|
});
|
|
1573
|
-
function
|
|
1573
|
+
function B(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] = I.create(
|
|
1578
|
+
e[t] = I.create(B(n));
|
|
1579
1579
|
}
|
|
1580
1580
|
return new T({
|
|
1581
1581
|
...a._def,
|
|
@@ -1583,8 +1583,8 @@ function U(a) {
|
|
|
1583
1583
|
});
|
|
1584
1584
|
} else return a instanceof A ? new A({
|
|
1585
1585
|
...a._def,
|
|
1586
|
-
type:
|
|
1587
|
-
}) : a instanceof I ? I.create(
|
|
1586
|
+
type: B(a.element)
|
|
1587
|
+
}) : a instanceof I ? I.create(B(a.unwrap())) : a instanceof F ? F.create(B(a.unwrap())) : a instanceof z ? z.create(a.items.map((e) => B(e))) : a;
|
|
1588
1588
|
}
|
|
1589
1589
|
class T extends _ {
|
|
1590
1590
|
constructor() {
|
|
@@ -1593,14 +1593,14 @@ class T extends _ {
|
|
|
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 = k.objectKeys(e);
|
|
1597
1597
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
1598
1598
|
}
|
|
1599
1599
|
_parse(e) {
|
|
1600
1600
|
if (this._getType(e) !== u.object) {
|
|
1601
1601
|
const p = this._getOrReturnCtx(e);
|
|
1602
|
-
return
|
|
1603
|
-
code:
|
|
1602
|
+
return c(p, {
|
|
1603
|
+
code: l.invalid_type,
|
|
1604
1604
|
expected: u.object,
|
|
1605
1605
|
received: p.parsedType
|
|
1606
1606
|
}), m;
|
|
@@ -1609,61 +1609,61 @@ class T extends _ {
|
|
|
1609
1609
|
if (!(this._def.catchall instanceof L && this._def.unknownKeys === "strip"))
|
|
1610
1610
|
for (const p in r.data)
|
|
1611
1611
|
i.includes(p) || o.push(p);
|
|
1612
|
-
const
|
|
1612
|
+
const f = [];
|
|
1613
1613
|
for (const p of i) {
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1614
|
+
const b = s[p], J = r.data[p];
|
|
1615
|
+
f.push({
|
|
1616
1616
|
key: { status: "valid", value: p },
|
|
1617
|
-
value:
|
|
1617
|
+
value: b._parse(new Z(r, J, r.path, p)),
|
|
1618
1618
|
alwaysSet: p in r.data
|
|
1619
1619
|
});
|
|
1620
1620
|
}
|
|
1621
1621
|
if (this._def.catchall instanceof L) {
|
|
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 b of o)
|
|
1625
|
+
f.push({
|
|
1626
|
+
key: { status: "valid", value: b },
|
|
1627
|
+
value: { status: "valid", value: r.data[b] }
|
|
1628
1628
|
});
|
|
1629
1629
|
else if (p === "strict")
|
|
1630
|
-
o.length > 0 && (
|
|
1631
|
-
code:
|
|
1630
|
+
o.length > 0 && (c(r, {
|
|
1631
|
+
code: l.unrecognized_keys,
|
|
1632
1632
|
keys: o
|
|
1633
1633
|
}), n.dirty());
|
|
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 b of o) {
|
|
1638
|
+
const J = r.data[b];
|
|
1639
|
+
f.push({
|
|
1640
|
+
key: { status: "valid", value: b },
|
|
1641
1641
|
value: p._parse(
|
|
1642
|
-
new Z(r, J, r.path,
|
|
1642
|
+
new Z(r, J, r.path, b)
|
|
1643
1643
|
//, ctx.child(key), value, getParsedType(value)
|
|
1644
1644
|
),
|
|
1645
|
-
alwaysSet:
|
|
1645
|
+
alwaysSet: b 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 b of f) {
|
|
1652
|
+
const J = await b.key, Ve = await b.value;
|
|
1653
1653
|
p.push({
|
|
1654
1654
|
key: J,
|
|
1655
1655
|
value: Ve,
|
|
1656
|
-
alwaysSet:
|
|
1656
|
+
alwaysSet: b.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, f);
|
|
1661
1661
|
}
|
|
1662
1662
|
get shape() {
|
|
1663
1663
|
return this._def.shape();
|
|
1664
1664
|
}
|
|
1665
1665
|
strict(e) {
|
|
1666
|
-
return
|
|
1666
|
+
return h.errToObj, new T({
|
|
1667
1667
|
...this._def,
|
|
1668
1668
|
unknownKeys: "strict",
|
|
1669
1669
|
...e !== void 0 ? {
|
|
@@ -1671,7 +1671,7 @@ class T extends _ {
|
|
|
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: h.errToObj(e).message ?? r
|
|
1675
1675
|
} : {
|
|
1676
1676
|
message: r
|
|
1677
1677
|
};
|
|
@@ -1800,7 +1800,7 @@ class T extends _ {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
pick(e) {
|
|
1802
1802
|
const t = {};
|
|
1803
|
-
for (const n of
|
|
1803
|
+
for (const n of k.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 _ {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
omit(e) {
|
|
1811
1811
|
const t = {};
|
|
1812
|
-
for (const n of
|
|
1812
|
+
for (const n of k.objectKeys(this.shape))
|
|
1813
1813
|
e[n] || (t[n] = this.shape[n]);
|
|
1814
1814
|
return new T({
|
|
1815
1815
|
...this._def,
|
|
@@ -1820,11 +1820,11 @@ class T extends _ {
|
|
|
1820
1820
|
* @deprecated
|
|
1821
1821
|
*/
|
|
1822
1822
|
deepPartial() {
|
|
1823
|
-
return
|
|
1823
|
+
return B(this);
|
|
1824
1824
|
}
|
|
1825
1825
|
partial(e) {
|
|
1826
1826
|
const t = {};
|
|
1827
|
-
for (const n of
|
|
1827
|
+
for (const n of k.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,7 +1835,7 @@ class T extends _ {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
required(e) {
|
|
1837
1837
|
const t = {};
|
|
1838
|
-
for (const n of
|
|
1838
|
+
for (const n of k.objectKeys(this.shape))
|
|
1839
1839
|
if (e && !e[n])
|
|
1840
1840
|
t[n] = this.shape[n];
|
|
1841
1841
|
else {
|
|
@@ -1850,7 +1850,7 @@ class T extends _ {
|
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
1852
|
keyof() {
|
|
1853
|
-
return Ie(
|
|
1853
|
+
return Ie(k.objectKeys(this.shape));
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
T.create = (a, e) => new T({
|
|
@@ -1885,8 +1885,8 @@ class K extends _ {
|
|
|
1885
1885
|
if (o.result.status === "dirty")
|
|
1886
1886
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1887
1887
|
const i = s.map((o) => new $(o.ctx.common.issues));
|
|
1888
|
-
return
|
|
1889
|
-
code:
|
|
1888
|
+
return c(t, {
|
|
1889
|
+
code: l.invalid_union,
|
|
1890
1890
|
unionErrors: i
|
|
1891
1891
|
}), m;
|
|
1892
1892
|
}
|
|
@@ -1912,7 +1912,7 @@ class K extends _ {
|
|
|
1912
1912
|
{
|
|
1913
1913
|
let s;
|
|
1914
1914
|
const i = [];
|
|
1915
|
-
for (const
|
|
1915
|
+
for (const f of n) {
|
|
1916
1916
|
const p = {
|
|
1917
1917
|
...t,
|
|
1918
1918
|
common: {
|
|
@@ -1920,20 +1920,20 @@ class K extends _ {
|
|
|
1920
1920
|
issues: []
|
|
1921
1921
|
},
|
|
1922
1922
|
parent: null
|
|
1923
|
-
},
|
|
1923
|
+
}, b = f._parseSync({
|
|
1924
1924
|
data: t.data,
|
|
1925
1925
|
path: t.path,
|
|
1926
1926
|
parent: p
|
|
1927
1927
|
});
|
|
1928
|
-
if (
|
|
1929
|
-
return
|
|
1930
|
-
|
|
1928
|
+
if (b.status === "valid")
|
|
1929
|
+
return b;
|
|
1930
|
+
b.status === "dirty" && !s && (s = { result: b, 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((
|
|
1935
|
-
return
|
|
1936
|
-
code:
|
|
1934
|
+
const o = i.map((f) => new $(f));
|
|
1935
|
+
return c(t, {
|
|
1936
|
+
code: l.invalid_union,
|
|
1937
1937
|
unionErrors: o
|
|
1938
1938
|
}), m;
|
|
1939
1939
|
}
|
|
@@ -1947,13 +1947,13 @@ K.create = (a, e) => new K({
|
|
|
1947
1947
|
typeName: y.ZodUnion,
|
|
1948
1948
|
...g(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 D ? 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 D ? a.options : a instanceof ge ? k.objectValues(a.enum) : a instanceof re ? R(a._def.innerType) : a instanceof he ? [void 0] : a instanceof fe ? [null] : a instanceof I ? [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 _ {
|
|
1952
1952
|
_parse(e) {
|
|
1953
1953
|
const { ctx: t } = this._processInputParams(e);
|
|
1954
1954
|
if (t.parsedType !== u.object)
|
|
1955
|
-
return
|
|
1956
|
-
code:
|
|
1955
|
+
return c(t, {
|
|
1956
|
+
code: l.invalid_type,
|
|
1957
1957
|
expected: u.object,
|
|
1958
1958
|
received: t.parsedType
|
|
1959
1959
|
}), m;
|
|
@@ -1966,8 +1966,8 @@ class _e extends _ {
|
|
|
1966
1966
|
data: t.data,
|
|
1967
1967
|
path: t.path,
|
|
1968
1968
|
parent: t
|
|
1969
|
-
}) : (
|
|
1970
|
-
code:
|
|
1969
|
+
}) : (c(t, {
|
|
1970
|
+
code: l.invalid_union_discriminator,
|
|
1971
1971
|
options: Array.from(this.optionsMap.keys()),
|
|
1972
1972
|
path: [n]
|
|
1973
1973
|
}), m);
|
|
@@ -2015,12 +2015,12 @@ function me(a, 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 = k.objectKeys(e), s = k.objectKeys(a).filter((o) => r.indexOf(o) !== -1), i = { ...a, ...e };
|
|
2019
2019
|
for (const o of s) {
|
|
2020
|
-
const
|
|
2021
|
-
if (!
|
|
2020
|
+
const f = me(a[o], e[o]);
|
|
2021
|
+
if (!f.valid)
|
|
2022
2022
|
return { valid: !1 };
|
|
2023
|
-
i[o] =
|
|
2023
|
+
i[o] = f.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], f = me(i, o);
|
|
2032
|
+
if (!f.valid)
|
|
2033
2033
|
return { valid: !1 };
|
|
2034
|
-
r.push(
|
|
2034
|
+
r.push(f.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 };
|
|
@@ -2042,8 +2042,8 @@ class ee extends _ {
|
|
|
2042
2042
|
if (we(s) || we(i))
|
|
2043
2043
|
return m;
|
|
2044
2044
|
const o = me(s.value, i.value);
|
|
2045
|
-
return o.valid ? ((Se(s) || Se(i)) && t.dirty(), { status: t.value, value: o.data }) : (
|
|
2046
|
-
code:
|
|
2045
|
+
return o.valid ? ((Se(s) || Se(i)) && t.dirty(), { status: t.value, value: o.data }) : (c(n, {
|
|
2046
|
+
code: l.invalid_intersection_types
|
|
2047
2047
|
}), m);
|
|
2048
2048
|
};
|
|
2049
2049
|
return n.common.async ? Promise.all([
|
|
@@ -2078,29 +2078,29 @@ class z extends _ {
|
|
|
2078
2078
|
_parse(e) {
|
|
2079
2079
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2080
2080
|
if (n.parsedType !== u.array)
|
|
2081
|
-
return
|
|
2082
|
-
code:
|
|
2081
|
+
return c(n, {
|
|
2082
|
+
code: l.invalid_type,
|
|
2083
2083
|
expected: u.array,
|
|
2084
2084
|
received: n.parsedType
|
|
2085
2085
|
}), m;
|
|
2086
2086
|
if (n.data.length < this._def.items.length)
|
|
2087
|
-
return
|
|
2088
|
-
code:
|
|
2087
|
+
return c(n, {
|
|
2088
|
+
code: l.too_small,
|
|
2089
2089
|
minimum: this._def.items.length,
|
|
2090
2090
|
inclusive: !0,
|
|
2091
2091
|
exact: !1,
|
|
2092
2092
|
type: "array"
|
|
2093
2093
|
}), m;
|
|
2094
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
2095
|
-
code:
|
|
2094
|
+
!this._def.rest && n.data.length > this._def.items.length && (c(n, {
|
|
2095
|
+
code: l.too_big,
|
|
2096
2096
|
maximum: this._def.items.length,
|
|
2097
2097
|
inclusive: !0,
|
|
2098
2098
|
exact: !1,
|
|
2099
2099
|
type: "array"
|
|
2100
2100
|
}), t.dirty());
|
|
2101
2101
|
const s = [...n.data].map((i, o) => {
|
|
2102
|
-
const
|
|
2103
|
-
return
|
|
2102
|
+
const f = this._def.items[o] || this._def.rest;
|
|
2103
|
+
return f ? f._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
|
}
|
|
@@ -2134,8 +2134,8 @@ class te extends _ {
|
|
|
2134
2134
|
_parse(e) {
|
|
2135
2135
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2136
2136
|
if (n.parsedType !== u.object)
|
|
2137
|
-
return
|
|
2138
|
-
code:
|
|
2137
|
+
return c(n, {
|
|
2138
|
+
code: l.invalid_type,
|
|
2139
2139
|
expected: u.object,
|
|
2140
2140
|
received: n.parsedType
|
|
2141
2141
|
}), m;
|
|
@@ -2175,33 +2175,33 @@ class Ae extends _ {
|
|
|
2175
2175
|
_parse(e) {
|
|
2176
2176
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2177
2177
|
if (n.parsedType !== u.map)
|
|
2178
|
-
return
|
|
2179
|
-
code:
|
|
2178
|
+
return c(n, {
|
|
2179
|
+
code: l.invalid_type,
|
|
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, f], 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, f, 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 f of i) {
|
|
2191
|
+
const p = await f.key, b = await f.value;
|
|
2192
|
+
if (p.status === "aborted" || b.status === "aborted")
|
|
2193
2193
|
return m;
|
|
2194
|
-
(p.status === "dirty" ||
|
|
2194
|
+
(p.status === "dirty" || b.status === "dirty") && t.dirty(), o.set(p.value, b.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 f of i) {
|
|
2201
|
+
const p = f.key, b = f.value;
|
|
2202
|
+
if (p.status === "aborted" || b.status === "aborted")
|
|
2203
2203
|
return m;
|
|
2204
|
-
(p.status === "dirty" ||
|
|
2204
|
+
(p.status === "dirty" || b.status === "dirty") && t.dirty(), o.set(p.value, b.value);
|
|
2205
2205
|
}
|
|
2206
2206
|
return { status: t.value, value: o };
|
|
2207
2207
|
}
|
|
@@ -2217,21 +2217,21 @@ class H extends _ {
|
|
|
2217
2217
|
_parse(e) {
|
|
2218
2218
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2219
2219
|
if (n.parsedType !== u.set)
|
|
2220
|
-
return
|
|
2221
|
-
code:
|
|
2220
|
+
return c(n, {
|
|
2221
|
+
code: l.invalid_type,
|
|
2222
2222
|
expected: u.set,
|
|
2223
2223
|
received: n.parsedType
|
|
2224
2224
|
}), m;
|
|
2225
2225
|
const r = this._def;
|
|
2226
|
-
r.minSize !== null && n.data.size < r.minSize.value && (
|
|
2227
|
-
code:
|
|
2226
|
+
r.minSize !== null && n.data.size < r.minSize.value && (c(n, {
|
|
2227
|
+
code: l.too_small,
|
|
2228
2228
|
minimum: r.minSize.value,
|
|
2229
2229
|
type: "set",
|
|
2230
2230
|
inclusive: !0,
|
|
2231
2231
|
exact: !1,
|
|
2232
2232
|
message: r.minSize.message
|
|
2233
|
-
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (
|
|
2234
|
-
code:
|
|
2233
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (c(n, {
|
|
2234
|
+
code: l.too_big,
|
|
2235
2235
|
maximum: r.maxSize.value,
|
|
2236
2236
|
type: "set",
|
|
2237
2237
|
inclusive: !0,
|
|
@@ -2239,28 +2239,28 @@ class H extends _ {
|
|
|
2239
2239
|
message: r.maxSize.message
|
|
2240
2240
|
}), t.dirty());
|
|
2241
2241
|
const s = this._def.valueType;
|
|
2242
|
-
function i(
|
|
2242
|
+
function i(f) {
|
|
2243
2243
|
const p = /* @__PURE__ */ new Set();
|
|
2244
|
-
for (const
|
|
2245
|
-
if (
|
|
2244
|
+
for (const b of f) {
|
|
2245
|
+
if (b.status === "aborted")
|
|
2246
2246
|
return m;
|
|
2247
|
-
|
|
2247
|
+
b.status === "dirty" && t.dirty(), p.add(b.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((f, p) => s._parse(new Z(n, f, n.path, p)));
|
|
2252
|
+
return n.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
|
|
2253
2253
|
}
|
|
2254
2254
|
min(e, t) {
|
|
2255
2255
|
return new H({
|
|
2256
2256
|
...this._def,
|
|
2257
|
-
minSize: { value: e, message:
|
|
2257
|
+
minSize: { value: e, message: h.toString(t) }
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
2260
|
max(e, t) {
|
|
2261
2261
|
return new H({
|
|
2262
2262
|
...this._def,
|
|
2263
|
-
maxSize: { value: e, message:
|
|
2263
|
+
maxSize: { value: e, message: h.toString(t) }
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
2266
|
size(e, t) {
|
|
@@ -2295,9 +2295,9 @@ class ae extends _ {
|
|
|
2295
2295
|
_parse(e) {
|
|
2296
2296
|
if (e.data !== this._def.value) {
|
|
2297
2297
|
const t = this._getOrReturnCtx(e);
|
|
2298
|
-
return
|
|
2298
|
+
return c(t, {
|
|
2299
2299
|
received: t.data,
|
|
2300
|
-
code:
|
|
2300
|
+
code: l.invalid_literal,
|
|
2301
2301
|
expected: this._def.value
|
|
2302
2302
|
}), m;
|
|
2303
2303
|
}
|
|
@@ -2323,17 +2323,17 @@ class D extends _ {
|
|
|
2323
2323
|
_parse(e) {
|
|
2324
2324
|
if (typeof e.data != "string") {
|
|
2325
2325
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2326
|
-
return
|
|
2327
|
-
expected:
|
|
2326
|
+
return c(t, {
|
|
2327
|
+
expected: k.joinValues(n),
|
|
2328
2328
|
received: t.parsedType,
|
|
2329
|
-
code:
|
|
2329
|
+
code: l.invalid_type
|
|
2330
2330
|
}), m;
|
|
2331
2331
|
}
|
|
2332
2332
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
2333
2333
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2334
|
-
return
|
|
2334
|
+
return c(t, {
|
|
2335
2335
|
received: t.data,
|
|
2336
|
-
code:
|
|
2336
|
+
code: l.invalid_enum_value,
|
|
2337
2337
|
options: n
|
|
2338
2338
|
}), m;
|
|
2339
2339
|
}
|
|
@@ -2376,20 +2376,20 @@ class D extends _ {
|
|
|
2376
2376
|
D.create = Ie;
|
|
2377
2377
|
class ge extends _ {
|
|
2378
2378
|
_parse(e) {
|
|
2379
|
-
const t =
|
|
2379
|
+
const t = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2380
2380
|
if (n.parsedType !== u.string && n.parsedType !== u.number) {
|
|
2381
|
-
const r =
|
|
2382
|
-
return
|
|
2383
|
-
expected:
|
|
2381
|
+
const r = k.objectValues(t);
|
|
2382
|
+
return c(n, {
|
|
2383
|
+
expected: k.joinValues(r),
|
|
2384
2384
|
received: n.parsedType,
|
|
2385
|
-
code:
|
|
2385
|
+
code: l.invalid_type
|
|
2386
2386
|
}), m;
|
|
2387
2387
|
}
|
|
2388
|
-
if (this._cache || (this._cache = new Set(
|
|
2389
|
-
const r =
|
|
2390
|
-
return
|
|
2388
|
+
if (this._cache || (this._cache = new Set(k.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2389
|
+
const r = k.objectValues(t);
|
|
2390
|
+
return c(n, {
|
|
2391
2391
|
received: n.data,
|
|
2392
|
-
code:
|
|
2392
|
+
code: l.invalid_enum_value,
|
|
2393
2393
|
options: r
|
|
2394
2394
|
}), m;
|
|
2395
2395
|
}
|
|
@@ -2411,8 +2411,8 @@ class ne extends _ {
|
|
|
2411
2411
|
_parse(e) {
|
|
2412
2412
|
const { ctx: t } = this._processInputParams(e);
|
|
2413
2413
|
if (t.parsedType !== u.promise && t.common.async === !1)
|
|
2414
|
-
return
|
|
2415
|
-
code:
|
|
2414
|
+
return c(t, {
|
|
2415
|
+
code: l.invalid_type,
|
|
2416
2416
|
expected: u.promise,
|
|
2417
2417
|
received: t.parsedType
|
|
2418
2418
|
}), m;
|
|
@@ -2438,7 +2438,7 @@ class P extends _ {
|
|
|
2438
2438
|
_parse(e) {
|
|
2439
2439
|
const { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, s = {
|
|
2440
2440
|
addIssue: (i) => {
|
|
2441
|
-
|
|
2441
|
+
c(n, i), i.fatal ? t.abort() : t.dirty();
|
|
2442
2442
|
},
|
|
2443
2443
|
get path() {
|
|
2444
2444
|
return n.path;
|
|
@@ -2450,12 +2450,12 @@ class P extends _ {
|
|
|
2450
2450
|
return Promise.resolve(i).then(async (o) => {
|
|
2451
2451
|
if (t.value === "aborted")
|
|
2452
2452
|
return m;
|
|
2453
|
-
const
|
|
2453
|
+
const f = await this._def.schema._parseAsync({
|
|
2454
2454
|
data: o,
|
|
2455
2455
|
path: n.path,
|
|
2456
2456
|
parent: n
|
|
2457
2457
|
});
|
|
2458
|
-
return
|
|
2458
|
+
return f.status === "aborted" ? m : f.status === "dirty" || t.value === "dirty" ? G(f.value) : f;
|
|
2459
2459
|
});
|
|
2460
2460
|
{
|
|
2461
2461
|
if (t.value === "aborted")
|
|
@@ -2470,10 +2470,10 @@ class P extends _ {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
if (r.type === "refinement") {
|
|
2472
2472
|
const i = (o) => {
|
|
2473
|
-
const
|
|
2473
|
+
const f = r.refinement(o, s);
|
|
2474
2474
|
if (n.common.async)
|
|
2475
|
-
return Promise.resolve(
|
|
2476
|
-
if (
|
|
2475
|
+
return Promise.resolve(f);
|
|
2476
|
+
if (f instanceof Promise)
|
|
2477
2477
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2478
2478
|
return o;
|
|
2479
2479
|
};
|
|
@@ -2505,7 +2505,7 @@ class P extends _ {
|
|
|
2505
2505
|
status: t.value,
|
|
2506
2506
|
value: o
|
|
2507
2507
|
})) : m);
|
|
2508
|
-
|
|
2508
|
+
k.assertNever(r);
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
P.create = (a, e, t) => new P({
|
|
@@ -2613,8 +2613,8 @@ class Ze extends _ {
|
|
|
2613
2613
|
_parse(e) {
|
|
2614
2614
|
if (this._getType(e) !== u.nan) {
|
|
2615
2615
|
const n = this._getOrReturnCtx(e);
|
|
2616
|
-
return
|
|
2617
|
-
code:
|
|
2616
|
+
return c(n, {
|
|
2617
|
+
code: l.invalid_type,
|
|
2618
2618
|
expected: u.nan,
|
|
2619
2619
|
received: n.parsedType
|
|
2620
2620
|
}), m;
|
|
@@ -2697,148 +2697,148 @@ 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 v = j.create, d = q.create,
|
|
2700
|
+
const v = j.create, d = q.create, x = ue.create, ut = pe.create;
|
|
2701
2701
|
L.create;
|
|
2702
|
-
const C = A.create,
|
|
2702
|
+
const C = A.create, S = T.create, xe = K.create, $e = _e.create;
|
|
2703
2703
|
ee.create;
|
|
2704
|
-
const E = z.create, Me = te.create, V = ae.create,
|
|
2704
|
+
const E = z.create, Me = te.create, V = ae.create, w = D.create;
|
|
2705
2705
|
ne.create;
|
|
2706
2706
|
I.create;
|
|
2707
2707
|
F.create;
|
|
2708
|
-
const
|
|
2708
|
+
const ht = P.createWithPreprocess, oe = w([
|
|
2709
2709
|
"Point",
|
|
2710
2710
|
"MultiPoint",
|
|
2711
2711
|
"LineString",
|
|
2712
2712
|
"MultiLineString",
|
|
2713
2713
|
"Polygon",
|
|
2714
2714
|
"MultiPolygon"
|
|
2715
|
-
]), Le = C(ut()), ke = (a) => xe([v(), Le]).default(a),
|
|
2715
|
+
]), Le = C(ut()), ke = (a) => xe([v(), Le]).default(a), U = () => xe([v(), Le]).optional(), ft = 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
|
-
}), pt =
|
|
2721
|
+
}), pt = S({
|
|
2722
2722
|
id: v().min(1),
|
|
2723
2723
|
url: v().url(),
|
|
2724
2724
|
label: v().optional(),
|
|
2725
2725
|
tileMatrixSetId: v().optional().default("WebMercatorQuad")
|
|
2726
|
-
}), mt =
|
|
2726
|
+
}), mt = S({
|
|
2727
2727
|
"fill-color": ke("#000000"),
|
|
2728
2728
|
"fill-opacity": d().min(0).max(1).default(1),
|
|
2729
|
-
"fill-outline-color":
|
|
2730
|
-
"fill-antialias":
|
|
2729
|
+
"fill-outline-color": U(),
|
|
2730
|
+
"fill-antialias": x().optional(),
|
|
2731
2731
|
"fill-translate": E([d(), d()]).optional(),
|
|
2732
|
-
"fill-translate-anchor":
|
|
2732
|
+
"fill-translate-anchor": w(["map", "viewport"]).optional(),
|
|
2733
2733
|
"fill-pattern": v().optional()
|
|
2734
|
-
}), yt =
|
|
2734
|
+
}), yt = S({
|
|
2735
2735
|
"line-color": ke("#000000"),
|
|
2736
2736
|
"line-width": d().min(0).default(1),
|
|
2737
2737
|
"line-opacity": d().min(0).max(1).default(1),
|
|
2738
2738
|
"line-dasharray": C(d()).optional(),
|
|
2739
2739
|
"line-translate": E([d(), d()]).optional(),
|
|
2740
|
-
"line-translate-anchor":
|
|
2740
|
+
"line-translate-anchor": w(["map", "viewport"]).optional(),
|
|
2741
2741
|
"line-gap-width": d().min(0).optional(),
|
|
2742
2742
|
"line-offset": d().optional(),
|
|
2743
2743
|
"line-blur": d().min(0).optional(),
|
|
2744
2744
|
"line-pattern": v().optional(),
|
|
2745
2745
|
"line-gradient": v().optional()
|
|
2746
|
-
}), gt =
|
|
2746
|
+
}), gt = S({
|
|
2747
2747
|
"circle-color": ke("#000000"),
|
|
2748
2748
|
"circle-radius": d().min(0).default(5),
|
|
2749
2749
|
"circle-opacity": d().min(0).max(1).default(1),
|
|
2750
|
-
"circle-stroke-color":
|
|
2750
|
+
"circle-stroke-color": U(),
|
|
2751
2751
|
"circle-stroke-width": d().min(0).optional(),
|
|
2752
2752
|
"circle-blur": d().min(0).optional(),
|
|
2753
2753
|
"circle-translate": E([d(), d()]).optional(),
|
|
2754
|
-
"circle-translate-anchor":
|
|
2755
|
-
"circle-pitch-scale":
|
|
2756
|
-
"circle-pitch-alignment":
|
|
2754
|
+
"circle-translate-anchor": w(["map", "viewport"]).optional(),
|
|
2755
|
+
"circle-pitch-scale": w(["map", "viewport"]).optional(),
|
|
2756
|
+
"circle-pitch-alignment": w(["map", "viewport"]).optional(),
|
|
2757
2757
|
"circle-stroke-opacity": d().min(0).max(1).optional()
|
|
2758
|
-
}), _t =
|
|
2758
|
+
}), _t = S({
|
|
2759
2759
|
"icon-opacity": d().min(0).max(1).optional(),
|
|
2760
|
-
"icon-color":
|
|
2761
|
-
"icon-halo-color":
|
|
2760
|
+
"icon-color": U(),
|
|
2761
|
+
"icon-halo-color": U(),
|
|
2762
2762
|
"icon-halo-width": d().min(0).optional(),
|
|
2763
2763
|
"icon-halo-blur": d().min(0).optional(),
|
|
2764
2764
|
"icon-translate": E([d(), d()]).optional(),
|
|
2765
|
-
"icon-translate-anchor":
|
|
2765
|
+
"icon-translate-anchor": w(["map", "viewport"]).optional(),
|
|
2766
2766
|
"text-opacity": d().min(0).max(1).optional(),
|
|
2767
|
-
"text-color":
|
|
2768
|
-
"text-halo-color":
|
|
2767
|
+
"text-color": U(),
|
|
2768
|
+
"text-halo-color": U(),
|
|
2769
2769
|
"text-halo-width": d().min(0).optional(),
|
|
2770
2770
|
"text-halo-blur": d().min(0).optional(),
|
|
2771
2771
|
"text-translate": E([d(), d()]).optional(),
|
|
2772
|
-
"text-translate-anchor":
|
|
2773
|
-
}), vt =
|
|
2772
|
+
"text-translate-anchor": w(["map", "viewport"]).optional()
|
|
2773
|
+
}), vt = S({
|
|
2774
2774
|
"fill-sort-key": d().optional(),
|
|
2775
|
-
visibility:
|
|
2776
|
-
}), xt =
|
|
2777
|
-
"line-cap":
|
|
2778
|
-
"line-join":
|
|
2775
|
+
visibility: w(["visible", "none"]).optional()
|
|
2776
|
+
}), xt = S({
|
|
2777
|
+
"line-cap": w(["butt", "round", "square"]).optional(),
|
|
2778
|
+
"line-join": w(["bevel", "round", "miter"]).optional(),
|
|
2779
2779
|
"line-miter-limit": d().optional(),
|
|
2780
2780
|
"line-round-limit": d().optional(),
|
|
2781
2781
|
"line-sort-key": d().optional(),
|
|
2782
|
-
visibility:
|
|
2783
|
-
}), kt =
|
|
2782
|
+
visibility: w(["visible", "none"]).optional()
|
|
2783
|
+
}), kt = S({
|
|
2784
2784
|
"circle-sort-key": d().optional(),
|
|
2785
|
-
visibility:
|
|
2786
|
-
}), bt =
|
|
2787
|
-
"symbol-placement":
|
|
2785
|
+
visibility: w(["visible", "none"]).optional()
|
|
2786
|
+
}), bt = S({
|
|
2787
|
+
"symbol-placement": w(["point", "line", "line-center"]).optional(),
|
|
2788
2788
|
"symbol-spacing": d().min(1).optional(),
|
|
2789
|
-
"symbol-avoid-edges":
|
|
2789
|
+
"symbol-avoid-edges": x().optional(),
|
|
2790
2790
|
"symbol-sort-key": d().optional(),
|
|
2791
|
-
"symbol-z-order":
|
|
2792
|
-
"icon-allow-overlap":
|
|
2793
|
-
"icon-ignore-placement":
|
|
2794
|
-
"icon-optional":
|
|
2795
|
-
"icon-rotation-alignment":
|
|
2791
|
+
"symbol-z-order": w(["auto", "viewport-y", "source"]).optional(),
|
|
2792
|
+
"icon-allow-overlap": x().optional(),
|
|
2793
|
+
"icon-ignore-placement": x().optional(),
|
|
2794
|
+
"icon-optional": x().optional(),
|
|
2795
|
+
"icon-rotation-alignment": w(["map", "viewport", "auto"]).optional(),
|
|
2796
2796
|
"icon-size": d().min(0).optional(),
|
|
2797
|
-
"icon-text-fit":
|
|
2797
|
+
"icon-text-fit": w(["none", "width", "height", "both"]).optional(),
|
|
2798
2798
|
"icon-text-fit-padding": E([d(), d(), d(), d()]).optional(),
|
|
2799
2799
|
"icon-image": v().optional(),
|
|
2800
2800
|
"icon-rotate": d().optional(),
|
|
2801
2801
|
"icon-padding": d().min(0).optional(),
|
|
2802
|
-
"icon-keep-upright":
|
|
2802
|
+
"icon-keep-upright": x().optional(),
|
|
2803
2803
|
"icon-offset": E([d(), d()]).optional(),
|
|
2804
|
-
"icon-anchor":
|
|
2805
|
-
"icon-pitch-alignment":
|
|
2806
|
-
"text-pitch-alignment":
|
|
2807
|
-
"text-rotation-alignment":
|
|
2804
|
+
"icon-anchor": w(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
|
|
2805
|
+
"icon-pitch-alignment": w(["map", "viewport", "auto"]).optional(),
|
|
2806
|
+
"text-pitch-alignment": w(["map", "viewport", "auto"]).optional(),
|
|
2807
|
+
"text-rotation-alignment": w(["map", "viewport", "viewport-glyph", "auto"]).optional(),
|
|
2808
2808
|
"text-field": v().optional(),
|
|
2809
2809
|
"text-font": C(v()).optional(),
|
|
2810
2810
|
"text-size": d().min(0).optional(),
|
|
2811
2811
|
"text-max-width": d().min(0).optional(),
|
|
2812
2812
|
"text-line-height": d().optional(),
|
|
2813
2813
|
"text-letter-spacing": d().optional(),
|
|
2814
|
-
"text-justify":
|
|
2815
|
-
"text-anchor":
|
|
2814
|
+
"text-justify": w(["auto", "left", "center", "right"]).optional(),
|
|
2815
|
+
"text-anchor": w(["center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"]).optional(),
|
|
2816
2816
|
"text-max-angle": d().optional(),
|
|
2817
2817
|
"text-rotate": d().optional(),
|
|
2818
2818
|
"text-padding": d().min(0).optional(),
|
|
2819
|
-
"text-keep-upright":
|
|
2820
|
-
"text-transform":
|
|
2819
|
+
"text-keep-upright": x().optional(),
|
|
2820
|
+
"text-transform": w(["none", "uppercase", "lowercase"]).optional(),
|
|
2821
2821
|
"text-offset": E([d(), d()]).optional(),
|
|
2822
|
-
"text-allow-overlap":
|
|
2823
|
-
"text-ignore-placement":
|
|
2824
|
-
"text-optional":
|
|
2825
|
-
visibility:
|
|
2826
|
-
}), wt =
|
|
2822
|
+
"text-allow-overlap": x().optional(),
|
|
2823
|
+
"text-ignore-placement": x().optional(),
|
|
2824
|
+
"text-optional": x().optional(),
|
|
2825
|
+
visibility: w(["visible", "none"]).optional()
|
|
2826
|
+
}), wt = S({
|
|
2827
2827
|
type: V("fill"),
|
|
2828
2828
|
paint: mt,
|
|
2829
2829
|
layout: vt.optional(),
|
|
2830
2830
|
geometryFilter: C(oe).optional()
|
|
2831
|
-
}), St =
|
|
2831
|
+
}), St = S({
|
|
2832
2832
|
type: V("line"),
|
|
2833
2833
|
paint: yt,
|
|
2834
2834
|
layout: xt.optional(),
|
|
2835
2835
|
geometryFilter: C(oe).optional()
|
|
2836
|
-
}), Tt =
|
|
2836
|
+
}), Tt = S({
|
|
2837
2837
|
type: V("circle"),
|
|
2838
2838
|
paint: gt,
|
|
2839
2839
|
layout: kt.optional(),
|
|
2840
2840
|
geometryFilter: C(oe).optional()
|
|
2841
|
-
}), Ct =
|
|
2841
|
+
}), Ct = S({
|
|
2842
2842
|
type: V("symbol"),
|
|
2843
2843
|
paint: _t,
|
|
2844
2844
|
layout: bt.optional(),
|
|
@@ -2848,54 +2848,60 @@ const ft = P.createWithPreprocess, oe = b([
|
|
|
2848
2848
|
St,
|
|
2849
2849
|
Tt,
|
|
2850
2850
|
Ct
|
|
2851
|
-
]), Nt =
|
|
2851
|
+
]), Nt = S({
|
|
2852
2852
|
label: v(),
|
|
2853
2853
|
color: v(),
|
|
2854
|
-
shape:
|
|
2855
|
-
}), At =
|
|
2854
|
+
shape: w(["circle", "line", "square"]).optional()
|
|
2855
|
+
}), At = S({
|
|
2856
2856
|
entries: C(Nt).min(1),
|
|
2857
|
-
displayMode:
|
|
2858
|
-
showLabelsCollapsed:
|
|
2857
|
+
displayMode: w(["categorical", "gradient", "simple"]).optional(),
|
|
2858
|
+
showLabelsCollapsed: x().optional(),
|
|
2859
|
+
showColorBar: x().optional(),
|
|
2860
|
+
showDisclosureArrow: x().optional(),
|
|
2859
2861
|
gradientProperty: v().optional()
|
|
2860
|
-
}),
|
|
2862
|
+
}), le = {
|
|
2861
2863
|
property: v().min(1),
|
|
2862
2864
|
label: v(),
|
|
2863
2865
|
placeholder: v().optional()
|
|
2864
|
-
}, Zt =
|
|
2865
|
-
...
|
|
2866
|
+
}, Zt = S({
|
|
2867
|
+
...le,
|
|
2866
2868
|
type: V("text"),
|
|
2867
|
-
autocomplete:
|
|
2868
|
-
prefetch:
|
|
2869
|
-
options: C(v()).optional()
|
|
2870
|
-
|
|
2871
|
-
|
|
2869
|
+
autocomplete: x().default(!1),
|
|
2870
|
+
prefetch: x().optional(),
|
|
2871
|
+
options: C(v()).optional(),
|
|
2872
|
+
zoomTo: x().optional()
|
|
2873
|
+
}), Rt = S({
|
|
2874
|
+
...le,
|
|
2872
2875
|
type: V("number"),
|
|
2873
|
-
inputMode:
|
|
2874
|
-
operator:
|
|
2876
|
+
inputMode: w(["input", "slider"]).default("input"),
|
|
2877
|
+
operator: w(["eq", "gt", "lt", "gte", "lte", "between"]).default("eq"),
|
|
2878
|
+
operatorLabelStyle: w(["symbol", "word"]).optional(),
|
|
2879
|
+
showRange: x().optional(),
|
|
2875
2880
|
min: d().optional(),
|
|
2876
2881
|
max: d().optional(),
|
|
2877
2882
|
step: d().optional()
|
|
2878
|
-
}), jt =
|
|
2879
|
-
...
|
|
2883
|
+
}), jt = S({
|
|
2884
|
+
...le,
|
|
2880
2885
|
type: V("datetime"),
|
|
2881
|
-
range:
|
|
2882
|
-
}), It =
|
|
2883
|
-
...
|
|
2886
|
+
range: x().default(!1)
|
|
2887
|
+
}), It = S({
|
|
2888
|
+
...le,
|
|
2884
2889
|
type: V("select"),
|
|
2885
2890
|
options: C(v()).optional(),
|
|
2886
|
-
prefetch:
|
|
2891
|
+
prefetch: x().optional(),
|
|
2892
|
+
zoomTo: x().optional()
|
|
2887
2893
|
}), Et = $e("type", [
|
|
2888
2894
|
Zt,
|
|
2889
2895
|
Rt,
|
|
2890
2896
|
jt,
|
|
2891
2897
|
It
|
|
2892
|
-
]), $t =
|
|
2898
|
+
]), $t = S({
|
|
2893
2899
|
fields: C(Et).min(1)
|
|
2894
|
-
}), Mt =
|
|
2900
|
+
}), Mt = S({
|
|
2895
2901
|
label: v().optional(),
|
|
2896
|
-
visible:
|
|
2897
|
-
}), Lt = Me(v(), Mt), Pt =
|
|
2898
|
-
properties: Me(xe([v(), d(),
|
|
2902
|
+
visible: x().optional().default(!0)
|
|
2903
|
+
}), Lt = Me(v(), Mt), Pt = S({
|
|
2904
|
+
properties: Me(xe([v(), d(), x(), C(v())])).optional(),
|
|
2899
2905
|
bbox: E([d(), d(), d(), d()]).optional(),
|
|
2900
2906
|
datetime: v().optional()
|
|
2901
2907
|
}), Vt = {
|
|
@@ -2903,14 +2909,14 @@ const ft = P.createWithPreprocess, oe = b([
|
|
|
2903
2909
|
sourceId: v().min(1),
|
|
2904
2910
|
collection: v().min(1),
|
|
2905
2911
|
label: v(),
|
|
2906
|
-
visible:
|
|
2907
|
-
dataMode:
|
|
2912
|
+
visible: x().default(!0),
|
|
2913
|
+
dataMode: w(["vector-tiles", "geojson"]),
|
|
2908
2914
|
styles: C(Ot).optional(),
|
|
2909
2915
|
legend: At.optional(),
|
|
2910
2916
|
filters: Pt.optional(),
|
|
2911
2917
|
search: $t.optional(),
|
|
2912
2918
|
propertyDisplay: Lt.optional()
|
|
2913
|
-
}, zt =
|
|
2919
|
+
}, zt = ht(
|
|
2914
2920
|
(a) => {
|
|
2915
2921
|
if (a && typeof a == "object" && "style" in a && !("styles" in a)) {
|
|
2916
2922
|
const { style: e, ...t } = a;
|
|
@@ -2918,34 +2924,35 @@ const ft = P.createWithPreprocess, oe = b([
|
|
|
2918
2924
|
}
|
|
2919
2925
|
return a;
|
|
2920
2926
|
},
|
|
2921
|
-
|
|
2922
|
-
), Dt =
|
|
2927
|
+
S(Vt)
|
|
2928
|
+
), Dt = S({
|
|
2923
2929
|
id: v().min(1),
|
|
2924
2930
|
label: v(),
|
|
2925
2931
|
url: v().url(),
|
|
2926
2932
|
thumbnail: v().url().optional()
|
|
2927
|
-
}), Ft =
|
|
2933
|
+
}), Ft = S({
|
|
2928
2934
|
id: v().min(1),
|
|
2929
2935
|
url: v().url()
|
|
2930
|
-
}),
|
|
2931
|
-
showLayerPanel:
|
|
2932
|
-
showLegend:
|
|
2933
|
-
showBasemapSwitcher:
|
|
2934
|
-
showSearchPanel:
|
|
2935
|
-
showCoordinateDisplay:
|
|
2936
|
-
showFeatureDetail:
|
|
2937
|
-
showFeatureTooltip:
|
|
2938
|
-
showExportButton:
|
|
2939
|
-
showLegendOpacity:
|
|
2940
|
-
|
|
2936
|
+
}), Bt = S({
|
|
2937
|
+
showLayerPanel: x().default(!0),
|
|
2938
|
+
showLegend: x().default(!0),
|
|
2939
|
+
showBasemapSwitcher: x().default(!0),
|
|
2940
|
+
showSearchPanel: x().default(!1),
|
|
2941
|
+
showCoordinateDisplay: x().default(!0),
|
|
2942
|
+
showFeatureDetail: x().default(!0),
|
|
2943
|
+
showFeatureTooltip: x().default(!0),
|
|
2944
|
+
showExportButton: x().default(!0),
|
|
2945
|
+
showLegendOpacity: x().default(!1),
|
|
2946
|
+
showMeasureTool: x().default(!1)
|
|
2947
|
+
}), Pe = S({
|
|
2941
2948
|
sources: C(pt).min(1),
|
|
2942
2949
|
layers: C(zt),
|
|
2943
2950
|
basemaps: C(Dt).min(1),
|
|
2944
2951
|
sprites: C(Ft).optional(),
|
|
2945
|
-
ui:
|
|
2946
|
-
initialView:
|
|
2952
|
+
ui: Bt.default({}),
|
|
2953
|
+
initialView: ft
|
|
2947
2954
|
});
|
|
2948
|
-
function
|
|
2955
|
+
function Ut(a) {
|
|
2949
2956
|
return Pe.parse(a);
|
|
2950
2957
|
}
|
|
2951
2958
|
function Wt(a) {
|
|
@@ -2964,8 +2971,8 @@ export {
|
|
|
2964
2971
|
Lt as P,
|
|
2965
2972
|
$t as S,
|
|
2966
2973
|
Zt as T,
|
|
2967
|
-
|
|
2968
|
-
|
|
2974
|
+
Bt as U,
|
|
2975
|
+
ft as V,
|
|
2969
2976
|
gt as a,
|
|
2970
2977
|
Tt as b,
|
|
2971
2978
|
mt as c,
|
|
@@ -2985,5 +2992,5 @@ export {
|
|
|
2985
2992
|
_t as q,
|
|
2986
2993
|
Ct as r,
|
|
2987
2994
|
Wt as s,
|
|
2988
|
-
|
|
2995
|
+
Ut as v
|
|
2989
2996
|
};
|