@jsfsi-core/ts-crossplatform 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +446 -412
- package/dist/src/datetime/datetime.d.ts +11 -0
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
const
|
|
1
|
+
const or = (e = {}) => e, ur = (e) => [e, void 0], sr = (e) => [
|
|
2
2
|
void 0,
|
|
3
3
|
e
|
|
4
4
|
];
|
|
5
|
-
class
|
|
5
|
+
class ir {
|
|
6
6
|
name;
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = this.constructor.name;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const cr = (
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
((e) => (n) => !(n instanceof e))
|
|
14
|
-
),
|
|
14
|
+
), ar = (
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
((e) => (n) => n instanceof e)
|
|
17
|
-
),
|
|
17
|
+
), lr = (e, n = process.env) => {
|
|
18
18
|
const t = e.safeParse(n);
|
|
19
19
|
if (!t.success)
|
|
20
20
|
throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
|
|
21
21
|
return t.data;
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function fr(e) {
|
|
24
24
|
return new Promise((n) => setTimeout(n, e));
|
|
25
25
|
}
|
|
26
26
|
function Ke(e, n) {
|
|
@@ -38,14 +38,46 @@ function Ye(e, n) {
|
|
|
38
38
|
second: "2-digit"
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function dr(e, n) {
|
|
42
42
|
return `${Ke(e, n)} ${Ye(e, n)}`;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
function hr({
|
|
45
|
+
allDay: e,
|
|
46
|
+
startDate: n,
|
|
47
|
+
startTime: t,
|
|
48
|
+
endTime: r
|
|
49
|
+
}) {
|
|
50
|
+
const o = {
|
|
51
|
+
startDate: new Date(new Date(n).setHours(0, 0, 0, 0)),
|
|
52
|
+
endDate: new Date(new Date(n).setHours(23, 59, 59, 999))
|
|
53
|
+
};
|
|
54
|
+
if (e)
|
|
55
|
+
return o;
|
|
56
|
+
if (t) {
|
|
57
|
+
const u = new Date(n);
|
|
58
|
+
u.setHours(
|
|
59
|
+
t.getHours(),
|
|
60
|
+
t.getMinutes(),
|
|
61
|
+
t.getSeconds(),
|
|
62
|
+
t.getMilliseconds()
|
|
63
|
+
), o.startDate = u;
|
|
64
|
+
}
|
|
65
|
+
if (r) {
|
|
66
|
+
const u = new Date(n);
|
|
67
|
+
u.setHours(
|
|
68
|
+
r.getHours(),
|
|
69
|
+
r.getMinutes(),
|
|
70
|
+
r.getSeconds(),
|
|
71
|
+
r.getMilliseconds()
|
|
72
|
+
), o.endDate = u;
|
|
73
|
+
}
|
|
74
|
+
return o;
|
|
75
|
+
}
|
|
76
|
+
const He = "00000000-0000-0000-0000-000000000000", qe = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
45
77
|
function Ee(e) {
|
|
46
|
-
return typeof e == "string" &&
|
|
78
|
+
return typeof e == "string" && qe.test(e);
|
|
47
79
|
}
|
|
48
|
-
function
|
|
80
|
+
function Be(e) {
|
|
49
81
|
if (!Ee(e))
|
|
50
82
|
throw TypeError("Invalid UUID");
|
|
51
83
|
let n;
|
|
@@ -54,33 +86,34 @@ function Xe(e) {
|
|
|
54
86
|
const v = [];
|
|
55
87
|
for (let e = 0; e < 256; ++e)
|
|
56
88
|
v.push((e + 256).toString(16).slice(1));
|
|
57
|
-
function
|
|
89
|
+
function Xe(e, n = 0) {
|
|
58
90
|
return (v[e[n + 0]] + v[e[n + 1]] + v[e[n + 2]] + v[e[n + 3]] + "-" + v[e[n + 4]] + v[e[n + 5]] + "-" + v[e[n + 6]] + v[e[n + 7]] + "-" + v[e[n + 8]] + v[e[n + 9]] + "-" + v[e[n + 10]] + v[e[n + 11]] + v[e[n + 12]] + v[e[n + 13]] + v[e[n + 14]] + v[e[n + 15]]).toLowerCase();
|
|
59
91
|
}
|
|
60
92
|
let J;
|
|
61
|
-
const
|
|
93
|
+
const We = new Uint8Array(16);
|
|
62
94
|
function Qe() {
|
|
63
95
|
if (!J) {
|
|
64
96
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
65
97
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
66
98
|
J = crypto.getRandomValues.bind(crypto);
|
|
67
99
|
}
|
|
68
|
-
return J(
|
|
100
|
+
return J(We);
|
|
69
101
|
}
|
|
70
102
|
const en = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: en };
|
|
71
103
|
function nn(e, n, t) {
|
|
72
|
-
if (oe.randomUUID && !e)
|
|
73
|
-
return oe.randomUUID();
|
|
74
104
|
e = e || {};
|
|
75
105
|
const r = e.random ?? e.rng?.() ?? Qe();
|
|
76
106
|
if (r.length < 16)
|
|
77
107
|
throw new Error("Random bytes length must be >= 16");
|
|
78
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
108
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Xe(r);
|
|
109
|
+
}
|
|
110
|
+
function tn(e, n, t) {
|
|
111
|
+
return oe.randomUUID && !e ? oe.randomUUID() : nn(e);
|
|
79
112
|
}
|
|
80
113
|
class S {
|
|
81
114
|
uuid;
|
|
82
115
|
constructor(n) {
|
|
83
|
-
|
|
116
|
+
Be(n), this.uuid = n;
|
|
84
117
|
}
|
|
85
118
|
toString() {
|
|
86
119
|
return this.uuid;
|
|
@@ -89,10 +122,10 @@ class S {
|
|
|
89
122
|
return this.uuid === n.toString();
|
|
90
123
|
}
|
|
91
124
|
static new() {
|
|
92
|
-
return new S(
|
|
125
|
+
return new S(tn());
|
|
93
126
|
}
|
|
94
127
|
static empty() {
|
|
95
|
-
return new S(
|
|
128
|
+
return new S(He);
|
|
96
129
|
}
|
|
97
130
|
static isValid(n) {
|
|
98
131
|
return !!(n && Ee(n));
|
|
@@ -108,25 +141,25 @@ function a(e, n, t) {
|
|
|
108
141
|
value: i._zod ?? {},
|
|
109
142
|
enumerable: !1
|
|
110
143
|
}), (l = i._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), i._zod.traits.add(e), n(i, c);
|
|
111
|
-
for (const f in
|
|
112
|
-
f in i || Object.defineProperty(i, f, { value:
|
|
113
|
-
i._zod.constr =
|
|
144
|
+
for (const f in s.prototype)
|
|
145
|
+
f in i || Object.defineProperty(i, f, { value: s.prototype[f].bind(i) });
|
|
146
|
+
i._zod.constr = s, i._zod.def = c;
|
|
114
147
|
}
|
|
115
148
|
const o = t?.Parent ?? Object;
|
|
116
|
-
class
|
|
149
|
+
class u extends o {
|
|
117
150
|
}
|
|
118
|
-
Object.defineProperty(
|
|
119
|
-
function
|
|
151
|
+
Object.defineProperty(u, "name", { value: e });
|
|
152
|
+
function s(i) {
|
|
120
153
|
var c;
|
|
121
|
-
const l = t?.Parent ? new
|
|
154
|
+
const l = t?.Parent ? new u() : this;
|
|
122
155
|
r(l, i), (c = l._zod).deferred ?? (c.deferred = []);
|
|
123
156
|
for (const f of l._zod.deferred)
|
|
124
157
|
f();
|
|
125
158
|
return l;
|
|
126
159
|
}
|
|
127
|
-
return Object.defineProperty(
|
|
160
|
+
return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
|
|
128
161
|
value: (i) => t?.Parent && i instanceof t.Parent ? !0 : i?._zod?.traits?.has(e)
|
|
129
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(s, "name", { value: e }), s;
|
|
130
163
|
}
|
|
131
164
|
class j extends Error {
|
|
132
165
|
constructor() {
|
|
@@ -142,14 +175,14 @@ const Ze = {};
|
|
|
142
175
|
function P(e) {
|
|
143
176
|
return Ze;
|
|
144
177
|
}
|
|
145
|
-
function
|
|
178
|
+
function rn(e) {
|
|
146
179
|
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
147
180
|
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
|
|
148
181
|
}
|
|
149
|
-
function
|
|
182
|
+
function H(e, n) {
|
|
150
183
|
return typeof n == "bigint" ? n.toString() : n;
|
|
151
184
|
}
|
|
152
|
-
function
|
|
185
|
+
function X(e) {
|
|
153
186
|
return {
|
|
154
187
|
get value() {
|
|
155
188
|
{
|
|
@@ -159,22 +192,22 @@ function W(e) {
|
|
|
159
192
|
}
|
|
160
193
|
};
|
|
161
194
|
}
|
|
162
|
-
function
|
|
195
|
+
function W(e) {
|
|
163
196
|
return e == null;
|
|
164
197
|
}
|
|
165
198
|
function Q(e) {
|
|
166
199
|
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
167
200
|
return e.slice(n, t);
|
|
168
201
|
}
|
|
169
|
-
function
|
|
202
|
+
function on(e, n) {
|
|
170
203
|
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
|
|
171
204
|
let o = (r.split(".")[1] || "").length;
|
|
172
205
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
173
206
|
const c = r.match(/\d?e-(\d?)/);
|
|
174
207
|
c?.[1] && (o = Number.parseInt(c[1]));
|
|
175
208
|
}
|
|
176
|
-
const
|
|
177
|
-
return
|
|
209
|
+
const u = t > o ? t : o, s = Number.parseInt(e.toFixed(u).replace(".", "")), i = Number.parseInt(n.toFixed(u).replace(".", ""));
|
|
210
|
+
return s % i / 10 ** u;
|
|
178
211
|
}
|
|
179
212
|
const ue = Symbol("evaluating");
|
|
180
213
|
function d(e, n, t) {
|
|
@@ -193,7 +226,7 @@ function d(e, n, t) {
|
|
|
193
226
|
configurable: !0
|
|
194
227
|
});
|
|
195
228
|
}
|
|
196
|
-
function
|
|
229
|
+
function I(e, n, t) {
|
|
197
230
|
Object.defineProperty(e, n, {
|
|
198
231
|
value: t,
|
|
199
232
|
writable: !0,
|
|
@@ -201,7 +234,7 @@ function T(e, n, t) {
|
|
|
201
234
|
configurable: !0
|
|
202
235
|
});
|
|
203
236
|
}
|
|
204
|
-
function
|
|
237
|
+
function T(...e) {
|
|
205
238
|
const n = {};
|
|
206
239
|
for (const t of e) {
|
|
207
240
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
@@ -214,10 +247,10 @@ function se(e) {
|
|
|
214
247
|
}
|
|
215
248
|
const Pe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
216
249
|
};
|
|
217
|
-
function
|
|
250
|
+
function U(e) {
|
|
218
251
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
219
252
|
}
|
|
220
|
-
const
|
|
253
|
+
const un = X(() => {
|
|
221
254
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
222
255
|
return !1;
|
|
223
256
|
try {
|
|
@@ -228,19 +261,19 @@ const on = W(() => {
|
|
|
228
261
|
}
|
|
229
262
|
});
|
|
230
263
|
function x(e) {
|
|
231
|
-
if (
|
|
264
|
+
if (U(e) === !1)
|
|
232
265
|
return !1;
|
|
233
266
|
const n = e.constructor;
|
|
234
267
|
if (n === void 0)
|
|
235
268
|
return !0;
|
|
236
269
|
const t = n.prototype;
|
|
237
|
-
return !(
|
|
270
|
+
return !(U(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
238
271
|
}
|
|
239
272
|
function Oe(e) {
|
|
240
273
|
return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
241
274
|
}
|
|
242
|
-
const
|
|
243
|
-
function
|
|
275
|
+
const sn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
276
|
+
function cn(e) {
|
|
244
277
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
245
278
|
}
|
|
246
279
|
function $(e, n, t) {
|
|
@@ -260,79 +293,79 @@ function p(e) {
|
|
|
260
293
|
}
|
|
261
294
|
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
262
295
|
}
|
|
263
|
-
function
|
|
296
|
+
function an(e) {
|
|
264
297
|
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
265
298
|
}
|
|
266
|
-
const
|
|
299
|
+
const ln = {
|
|
267
300
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
268
301
|
int32: [-2147483648, 2147483647],
|
|
269
302
|
uint32: [0, 4294967295],
|
|
270
303
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
271
304
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
272
305
|
};
|
|
273
|
-
function
|
|
274
|
-
const t = e._zod.def, r =
|
|
306
|
+
function fn(e, n) {
|
|
307
|
+
const t = e._zod.def, r = T(e._zod.def, {
|
|
275
308
|
get shape() {
|
|
276
309
|
const o = {};
|
|
277
|
-
for (const
|
|
278
|
-
if (!(
|
|
279
|
-
throw new Error(`Unrecognized key: "${
|
|
280
|
-
n[
|
|
310
|
+
for (const u in n) {
|
|
311
|
+
if (!(u in t.shape))
|
|
312
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
313
|
+
n[u] && (o[u] = t.shape[u]);
|
|
281
314
|
}
|
|
282
|
-
return
|
|
315
|
+
return I(this, "shape", o), o;
|
|
283
316
|
},
|
|
284
317
|
checks: []
|
|
285
318
|
});
|
|
286
319
|
return $(e, r);
|
|
287
320
|
}
|
|
288
|
-
function
|
|
289
|
-
const t = e._zod.def, r =
|
|
321
|
+
function dn(e, n) {
|
|
322
|
+
const t = e._zod.def, r = T(e._zod.def, {
|
|
290
323
|
get shape() {
|
|
291
324
|
const o = { ...e._zod.def.shape };
|
|
292
|
-
for (const
|
|
293
|
-
if (!(
|
|
294
|
-
throw new Error(`Unrecognized key: "${
|
|
295
|
-
n[
|
|
325
|
+
for (const u in n) {
|
|
326
|
+
if (!(u in t.shape))
|
|
327
|
+
throw new Error(`Unrecognized key: "${u}"`);
|
|
328
|
+
n[u] && delete o[u];
|
|
296
329
|
}
|
|
297
|
-
return
|
|
330
|
+
return I(this, "shape", o), o;
|
|
298
331
|
},
|
|
299
332
|
checks: []
|
|
300
333
|
});
|
|
301
334
|
return $(e, r);
|
|
302
335
|
}
|
|
303
|
-
function
|
|
336
|
+
function hn(e, n) {
|
|
304
337
|
if (!x(n))
|
|
305
338
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
306
339
|
const t = e._zod.def.checks;
|
|
307
340
|
if (t && t.length > 0)
|
|
308
341
|
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
309
|
-
const o =
|
|
342
|
+
const o = T(e._zod.def, {
|
|
310
343
|
get shape() {
|
|
311
|
-
const
|
|
312
|
-
return
|
|
344
|
+
const u = { ...e._zod.def.shape, ...n };
|
|
345
|
+
return I(this, "shape", u), u;
|
|
313
346
|
},
|
|
314
347
|
checks: []
|
|
315
348
|
});
|
|
316
349
|
return $(e, o);
|
|
317
350
|
}
|
|
318
|
-
function
|
|
351
|
+
function pn(e, n) {
|
|
319
352
|
if (!x(n))
|
|
320
353
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
321
354
|
const t = {
|
|
322
355
|
...e._zod.def,
|
|
323
356
|
get shape() {
|
|
324
357
|
const r = { ...e._zod.def.shape, ...n };
|
|
325
|
-
return
|
|
358
|
+
return I(this, "shape", r), r;
|
|
326
359
|
},
|
|
327
360
|
checks: e._zod.def.checks
|
|
328
361
|
};
|
|
329
362
|
return $(e, t);
|
|
330
363
|
}
|
|
331
|
-
function
|
|
332
|
-
const t =
|
|
364
|
+
function mn(e, n) {
|
|
365
|
+
const t = T(e._zod.def, {
|
|
333
366
|
get shape() {
|
|
334
367
|
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
335
|
-
return
|
|
368
|
+
return I(this, "shape", r), r;
|
|
336
369
|
},
|
|
337
370
|
get catchall() {
|
|
338
371
|
return n._zod.def.catchall;
|
|
@@ -342,51 +375,51 @@ function pn(e, n) {
|
|
|
342
375
|
});
|
|
343
376
|
return $(e, t);
|
|
344
377
|
}
|
|
345
|
-
function
|
|
346
|
-
const r =
|
|
378
|
+
function _n(e, n, t) {
|
|
379
|
+
const r = T(n._zod.def, {
|
|
347
380
|
get shape() {
|
|
348
|
-
const o = n._zod.def.shape,
|
|
381
|
+
const o = n._zod.def.shape, u = { ...o };
|
|
349
382
|
if (t)
|
|
350
|
-
for (const
|
|
351
|
-
if (!(
|
|
352
|
-
throw new Error(`Unrecognized key: "${
|
|
353
|
-
t[
|
|
383
|
+
for (const s in t) {
|
|
384
|
+
if (!(s in o))
|
|
385
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
386
|
+
t[s] && (u[s] = e ? new e({
|
|
354
387
|
type: "optional",
|
|
355
|
-
innerType: o[
|
|
356
|
-
}) : o[
|
|
388
|
+
innerType: o[s]
|
|
389
|
+
}) : o[s]);
|
|
357
390
|
}
|
|
358
391
|
else
|
|
359
|
-
for (const
|
|
360
|
-
s
|
|
392
|
+
for (const s in o)
|
|
393
|
+
u[s] = e ? new e({
|
|
361
394
|
type: "optional",
|
|
362
|
-
innerType: o[
|
|
363
|
-
}) : o[
|
|
364
|
-
return
|
|
395
|
+
innerType: o[s]
|
|
396
|
+
}) : o[s];
|
|
397
|
+
return I(this, "shape", u), u;
|
|
365
398
|
},
|
|
366
399
|
checks: []
|
|
367
400
|
});
|
|
368
401
|
return $(n, r);
|
|
369
402
|
}
|
|
370
|
-
function
|
|
371
|
-
const r =
|
|
403
|
+
function gn(e, n, t) {
|
|
404
|
+
const r = T(n._zod.def, {
|
|
372
405
|
get shape() {
|
|
373
|
-
const o = n._zod.def.shape,
|
|
406
|
+
const o = n._zod.def.shape, u = { ...o };
|
|
374
407
|
if (t)
|
|
375
|
-
for (const
|
|
376
|
-
if (!(
|
|
377
|
-
throw new Error(`Unrecognized key: "${
|
|
378
|
-
t[
|
|
408
|
+
for (const s in t) {
|
|
409
|
+
if (!(s in u))
|
|
410
|
+
throw new Error(`Unrecognized key: "${s}"`);
|
|
411
|
+
t[s] && (u[s] = new e({
|
|
379
412
|
type: "nonoptional",
|
|
380
|
-
innerType: o[
|
|
413
|
+
innerType: o[s]
|
|
381
414
|
}));
|
|
382
415
|
}
|
|
383
416
|
else
|
|
384
|
-
for (const
|
|
385
|
-
s
|
|
417
|
+
for (const s in o)
|
|
418
|
+
u[s] = new e({
|
|
386
419
|
type: "nonoptional",
|
|
387
|
-
innerType: o[
|
|
420
|
+
innerType: o[s]
|
|
388
421
|
});
|
|
389
|
-
return
|
|
422
|
+
return I(this, "shape", u), u;
|
|
390
423
|
},
|
|
391
424
|
checks: []
|
|
392
425
|
});
|
|
@@ -400,19 +433,19 @@ function N(e, n = 0) {
|
|
|
400
433
|
return !0;
|
|
401
434
|
return !1;
|
|
402
435
|
}
|
|
403
|
-
function
|
|
436
|
+
function Ie(e, n) {
|
|
404
437
|
return n.map((t) => {
|
|
405
438
|
var r;
|
|
406
439
|
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
|
|
407
440
|
});
|
|
408
441
|
}
|
|
409
|
-
function
|
|
442
|
+
function D(e) {
|
|
410
443
|
return typeof e == "string" ? e : e?.message;
|
|
411
444
|
}
|
|
412
445
|
function O(e, n, t) {
|
|
413
446
|
const r = { ...e, path: e.path ?? [] };
|
|
414
447
|
if (!e.message) {
|
|
415
|
-
const o =
|
|
448
|
+
const o = D(e.inst?._zod.def?.error?.(e)) ?? D(n?.error?.(e)) ?? D(t.customError?.(e)) ?? D(t.localeError?.(e)) ?? "Invalid input";
|
|
416
449
|
r.message = o;
|
|
417
450
|
}
|
|
418
451
|
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
|
|
@@ -429,90 +462,90 @@ function R(...e) {
|
|
|
429
462
|
inst: r
|
|
430
463
|
} : { ...n };
|
|
431
464
|
}
|
|
432
|
-
const
|
|
465
|
+
const Te = (e, n) => {
|
|
433
466
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
434
467
|
value: e._zod,
|
|
435
468
|
enumerable: !1
|
|
436
469
|
}), Object.defineProperty(e, "issues", {
|
|
437
470
|
value: n,
|
|
438
471
|
enumerable: !1
|
|
439
|
-
}), e.message = JSON.stringify(n,
|
|
472
|
+
}), e.message = JSON.stringify(n, H, 2), Object.defineProperty(e, "toString", {
|
|
440
473
|
value: () => e.message,
|
|
441
474
|
enumerable: !1
|
|
442
475
|
});
|
|
443
|
-
}, Ne = a("$ZodError",
|
|
444
|
-
function
|
|
476
|
+
}, Ne = a("$ZodError", Te), je = a("$ZodError", Te, { Parent: Error });
|
|
477
|
+
function vn(e, n = (t) => t.message) {
|
|
445
478
|
const t = {}, r = [];
|
|
446
479
|
for (const o of e.issues)
|
|
447
480
|
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
448
481
|
return { formErrors: r, fieldErrors: t };
|
|
449
482
|
}
|
|
450
|
-
function
|
|
483
|
+
function zn(e, n = (t) => t.message) {
|
|
451
484
|
const t = { _errors: [] }, r = (o) => {
|
|
452
|
-
for (const
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
else if (
|
|
456
|
-
r({ issues:
|
|
457
|
-
else if (
|
|
458
|
-
r({ issues:
|
|
459
|
-
else if (
|
|
460
|
-
t._errors.push(n(
|
|
485
|
+
for (const u of o.issues)
|
|
486
|
+
if (u.code === "invalid_union" && u.errors.length)
|
|
487
|
+
u.errors.map((s) => r({ issues: s }));
|
|
488
|
+
else if (u.code === "invalid_key")
|
|
489
|
+
r({ issues: u.issues });
|
|
490
|
+
else if (u.code === "invalid_element")
|
|
491
|
+
r({ issues: u.issues });
|
|
492
|
+
else if (u.path.length === 0)
|
|
493
|
+
t._errors.push(n(u));
|
|
461
494
|
else {
|
|
462
|
-
let
|
|
463
|
-
for (; i <
|
|
464
|
-
const c =
|
|
465
|
-
i ===
|
|
495
|
+
let s = t, i = 0;
|
|
496
|
+
for (; i < u.path.length; ) {
|
|
497
|
+
const c = u.path[i];
|
|
498
|
+
i === u.path.length - 1 ? (s[c] = s[c] || { _errors: [] }, s[c]._errors.push(n(u))) : s[c] = s[c] || { _errors: [] }, s = s[c], i++;
|
|
466
499
|
}
|
|
467
500
|
}
|
|
468
501
|
};
|
|
469
502
|
return r(e), t;
|
|
470
503
|
}
|
|
471
504
|
const ne = (e) => (n, t, r, o) => {
|
|
472
|
-
const
|
|
473
|
-
if (
|
|
505
|
+
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, u);
|
|
506
|
+
if (s instanceof Promise)
|
|
474
507
|
throw new j();
|
|
475
|
-
if (
|
|
476
|
-
const i = new (o?.Err ?? e)(
|
|
508
|
+
if (s.issues.length) {
|
|
509
|
+
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
477
510
|
throw Pe(i, o?.callee), i;
|
|
478
511
|
}
|
|
479
|
-
return
|
|
512
|
+
return s.value;
|
|
480
513
|
}, te = (e) => async (n, t, r, o) => {
|
|
481
|
-
const
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
const i = new (o?.Err ?? e)(
|
|
514
|
+
const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
515
|
+
let s = n._zod.run({ value: t, issues: [] }, u);
|
|
516
|
+
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
517
|
+
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
485
518
|
throw Pe(i, o?.callee), i;
|
|
486
519
|
}
|
|
487
|
-
return
|
|
520
|
+
return s.value;
|
|
488
521
|
}, V = (e) => (n, t, r) => {
|
|
489
|
-
const o = r ? { ...r, async: !1 } : { async: !1 },
|
|
490
|
-
if (
|
|
522
|
+
const o = r ? { ...r, async: !1 } : { async: !1 }, u = n._zod.run({ value: t, issues: [] }, o);
|
|
523
|
+
if (u instanceof Promise)
|
|
491
524
|
throw new j();
|
|
492
|
-
return
|
|
525
|
+
return u.issues.length ? {
|
|
493
526
|
success: !1,
|
|
494
|
-
error: new (e ?? Ne)(
|
|
495
|
-
} : { success: !0, data:
|
|
496
|
-
},
|
|
527
|
+
error: new (e ?? Ne)(u.issues.map((s) => O(s, o, P())))
|
|
528
|
+
} : { success: !0, data: u.value };
|
|
529
|
+
}, bn = /* @__PURE__ */ V(je), L = (e) => async (n, t, r) => {
|
|
497
530
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
498
|
-
let
|
|
499
|
-
return
|
|
531
|
+
let u = n._zod.run({ value: t, issues: [] }, o);
|
|
532
|
+
return u instanceof Promise && (u = await u), u.issues.length ? {
|
|
500
533
|
success: !1,
|
|
501
|
-
error: new e(
|
|
502
|
-
} : { success: !0, data:
|
|
503
|
-
},
|
|
534
|
+
error: new e(u.issues.map((s) => O(s, o, P())))
|
|
535
|
+
} : { success: !0, data: u.value };
|
|
536
|
+
}, wn = /* @__PURE__ */ L(je), yn = (e) => (n, t, r) => {
|
|
504
537
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
505
538
|
return ne(e)(n, t, o);
|
|
506
|
-
},
|
|
539
|
+
}, kn = (e) => (n, t, r) => ne(e)(n, t, r), En = (e) => async (n, t, r) => {
|
|
507
540
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
508
541
|
return te(e)(n, t, o);
|
|
509
|
-
},
|
|
542
|
+
}, $n = (e) => async (n, t, r) => te(e)(n, t, r), Zn = (e) => (n, t, r) => {
|
|
510
543
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
511
544
|
return V(e)(n, t, o);
|
|
512
|
-
},
|
|
545
|
+
}, Pn = (e) => (n, t, r) => V(e)(n, t, r), On = (e) => async (n, t, r) => {
|
|
513
546
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
514
547
|
return L(e)(n, t, o);
|
|
515
|
-
},
|
|
548
|
+
}, In = (e) => async (n, t, r) => L(e)(n, t, r), Tn = /^-?\d+$/, Nn = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
|
|
516
549
|
var t;
|
|
517
550
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
518
551
|
}), Ae = {
|
|
@@ -523,8 +556,8 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
523
556
|
k.init(e, n);
|
|
524
557
|
const t = Ae[typeof n.value];
|
|
525
558
|
e._zod.onattach.push((r) => {
|
|
526
|
-
const o = r._zod.bag,
|
|
527
|
-
n.value <
|
|
559
|
+
const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
560
|
+
n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
528
561
|
}), e._zod.check = (r) => {
|
|
529
562
|
(n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
|
|
530
563
|
origin: t,
|
|
@@ -540,8 +573,8 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
540
573
|
k.init(e, n);
|
|
541
574
|
const t = Ae[typeof n.value];
|
|
542
575
|
e._zod.onattach.push((r) => {
|
|
543
|
-
const o = r._zod.bag,
|
|
544
|
-
n.value >
|
|
576
|
+
const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
577
|
+
n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
545
578
|
}), e._zod.check = (r) => {
|
|
546
579
|
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
|
|
547
580
|
origin: t,
|
|
@@ -553,14 +586,14 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
553
586
|
continue: !n.abort
|
|
554
587
|
});
|
|
555
588
|
};
|
|
556
|
-
}),
|
|
589
|
+
}), jn = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
|
|
557
590
|
k.init(e, n), e._zod.onattach.push((t) => {
|
|
558
591
|
var r;
|
|
559
592
|
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
|
|
560
593
|
}), e._zod.check = (t) => {
|
|
561
594
|
if (typeof t.value != typeof n.value)
|
|
562
595
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
563
|
-
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) :
|
|
596
|
+
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : on(t.value, n.value) === 0) || t.issues.push({
|
|
564
597
|
origin: typeof t.value,
|
|
565
598
|
code: "not_multiple_of",
|
|
566
599
|
divisor: n.value,
|
|
@@ -569,17 +602,17 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
569
602
|
continue: !n.abort
|
|
570
603
|
});
|
|
571
604
|
};
|
|
572
|
-
}),
|
|
605
|
+
}), An = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
|
|
573
606
|
k.init(e, n), n.format = n.format || "float64";
|
|
574
|
-
const t = n.format?.includes("int"), r = t ? "int" : "number", [o,
|
|
575
|
-
e._zod.onattach.push((
|
|
576
|
-
const i =
|
|
577
|
-
i.format = n.format, i.minimum = o, i.maximum =
|
|
578
|
-
}), e._zod.check = (
|
|
579
|
-
const i =
|
|
607
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = ln[n.format];
|
|
608
|
+
e._zod.onattach.push((s) => {
|
|
609
|
+
const i = s._zod.bag;
|
|
610
|
+
i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = Tn);
|
|
611
|
+
}), e._zod.check = (s) => {
|
|
612
|
+
const i = s.value;
|
|
580
613
|
if (t) {
|
|
581
614
|
if (!Number.isInteger(i)) {
|
|
582
|
-
|
|
615
|
+
s.issues.push({
|
|
583
616
|
expected: r,
|
|
584
617
|
format: n.format,
|
|
585
618
|
code: "invalid_type",
|
|
@@ -590,7 +623,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
590
623
|
return;
|
|
591
624
|
}
|
|
592
625
|
if (!Number.isSafeInteger(i)) {
|
|
593
|
-
i > 0 ?
|
|
626
|
+
i > 0 ? s.issues.push({
|
|
594
627
|
input: i,
|
|
595
628
|
code: "too_big",
|
|
596
629
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
@@ -598,7 +631,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
598
631
|
inst: e,
|
|
599
632
|
origin: r,
|
|
600
633
|
continue: !n.abort
|
|
601
|
-
}) :
|
|
634
|
+
}) : s.issues.push({
|
|
602
635
|
input: i,
|
|
603
636
|
code: "too_small",
|
|
604
637
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
@@ -610,7 +643,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
610
643
|
return;
|
|
611
644
|
}
|
|
612
645
|
}
|
|
613
|
-
i < o &&
|
|
646
|
+
i < o && s.issues.push({
|
|
614
647
|
origin: "number",
|
|
615
648
|
input: i,
|
|
616
649
|
code: "too_small",
|
|
@@ -618,19 +651,19 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
618
651
|
inclusive: !0,
|
|
619
652
|
inst: e,
|
|
620
653
|
continue: !n.abort
|
|
621
|
-
}), i >
|
|
654
|
+
}), i > u && s.issues.push({
|
|
622
655
|
origin: "number",
|
|
623
656
|
input: i,
|
|
624
657
|
code: "too_big",
|
|
625
|
-
maximum:
|
|
658
|
+
maximum: u,
|
|
626
659
|
inst: e
|
|
627
660
|
});
|
|
628
661
|
};
|
|
629
|
-
}),
|
|
662
|
+
}), Sn = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
|
|
630
663
|
var t;
|
|
631
664
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
632
665
|
const o = r.value;
|
|
633
|
-
return !
|
|
666
|
+
return !W(o) && o.length !== void 0;
|
|
634
667
|
}), e._zod.onattach.push((r) => {
|
|
635
668
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
636
669
|
n.maximum < o && (r._zod.bag.maximum = n.maximum);
|
|
@@ -638,9 +671,9 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
638
671
|
const o = r.value;
|
|
639
672
|
if (o.length <= n.maximum)
|
|
640
673
|
return;
|
|
641
|
-
const
|
|
674
|
+
const s = ee(o);
|
|
642
675
|
r.issues.push({
|
|
643
|
-
origin:
|
|
676
|
+
origin: s,
|
|
644
677
|
code: "too_big",
|
|
645
678
|
maximum: n.maximum,
|
|
646
679
|
inclusive: !0,
|
|
@@ -649,11 +682,11 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
649
682
|
continue: !n.abort
|
|
650
683
|
});
|
|
651
684
|
};
|
|
652
|
-
}),
|
|
685
|
+
}), xn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
|
|
653
686
|
var t;
|
|
654
687
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
655
688
|
const o = r.value;
|
|
656
|
-
return !
|
|
689
|
+
return !W(o) && o.length !== void 0;
|
|
657
690
|
}), e._zod.onattach.push((r) => {
|
|
658
691
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
659
692
|
n.minimum > o && (r._zod.bag.minimum = n.minimum);
|
|
@@ -661,9 +694,9 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
661
694
|
const o = r.value;
|
|
662
695
|
if (o.length >= n.minimum)
|
|
663
696
|
return;
|
|
664
|
-
const
|
|
697
|
+
const s = ee(o);
|
|
665
698
|
r.issues.push({
|
|
666
|
-
origin:
|
|
699
|
+
origin: s,
|
|
667
700
|
code: "too_small",
|
|
668
701
|
minimum: n.minimum,
|
|
669
702
|
inclusive: !0,
|
|
@@ -672,21 +705,21 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
672
705
|
continue: !n.abort
|
|
673
706
|
});
|
|
674
707
|
};
|
|
675
|
-
}),
|
|
708
|
+
}), Rn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
|
|
676
709
|
var t;
|
|
677
710
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
678
711
|
const o = r.value;
|
|
679
|
-
return !
|
|
712
|
+
return !W(o) && o.length !== void 0;
|
|
680
713
|
}), e._zod.onattach.push((r) => {
|
|
681
714
|
const o = r._zod.bag;
|
|
682
715
|
o.minimum = n.length, o.maximum = n.length, o.length = n.length;
|
|
683
716
|
}), e._zod.check = (r) => {
|
|
684
|
-
const o = r.value,
|
|
685
|
-
if (
|
|
717
|
+
const o = r.value, u = o.length;
|
|
718
|
+
if (u === n.length)
|
|
686
719
|
return;
|
|
687
|
-
const
|
|
720
|
+
const s = ee(o), i = u > n.length;
|
|
688
721
|
r.issues.push({
|
|
689
|
-
origin:
|
|
722
|
+
origin: s,
|
|
690
723
|
...i ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
|
|
691
724
|
inclusive: !0,
|
|
692
725
|
exact: !0,
|
|
@@ -695,7 +728,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
695
728
|
continue: !n.abort
|
|
696
729
|
});
|
|
697
730
|
};
|
|
698
|
-
}),
|
|
731
|
+
}), Dn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
|
|
699
732
|
k.init(e, n), e._zod.check = (t) => {
|
|
700
733
|
t.value = n.tx(t.value);
|
|
701
734
|
};
|
|
@@ -713,58 +746,58 @@ class Cn {
|
|
|
713
746
|
return;
|
|
714
747
|
}
|
|
715
748
|
const r = n.split(`
|
|
716
|
-
`).filter((
|
|
717
|
-
for (const
|
|
718
|
-
this.content.push(
|
|
749
|
+
`).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), u = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
|
|
750
|
+
for (const s of u)
|
|
751
|
+
this.content.push(s);
|
|
719
752
|
}
|
|
720
753
|
compile() {
|
|
721
|
-
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((
|
|
754
|
+
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
|
|
722
755
|
return new n(...t, o.join(`
|
|
723
756
|
`));
|
|
724
757
|
}
|
|
725
758
|
}
|
|
726
|
-
const
|
|
759
|
+
const Mn = {
|
|
727
760
|
major: 4,
|
|
728
761
|
minor: 1,
|
|
729
762
|
patch: 12
|
|
730
763
|
}, m = /* @__PURE__ */ a("$ZodType", (e, n) => {
|
|
731
764
|
var t;
|
|
732
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
765
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Mn;
|
|
733
766
|
const r = [...e._zod.def.checks ?? []];
|
|
734
767
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
735
768
|
for (const o of r)
|
|
736
|
-
for (const
|
|
737
|
-
|
|
769
|
+
for (const u of o._zod.onattach)
|
|
770
|
+
u(e);
|
|
738
771
|
if (r.length === 0)
|
|
739
772
|
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
|
|
740
773
|
e._zod.run = e._zod.parse;
|
|
741
774
|
});
|
|
742
775
|
else {
|
|
743
|
-
const o = (
|
|
744
|
-
let l = N(
|
|
776
|
+
const o = (s, i, c) => {
|
|
777
|
+
let l = N(s), f;
|
|
745
778
|
for (const z of i) {
|
|
746
779
|
if (z._zod.def.when) {
|
|
747
|
-
if (!z._zod.def.when(
|
|
780
|
+
if (!z._zod.def.when(s))
|
|
748
781
|
continue;
|
|
749
782
|
} else if (l)
|
|
750
783
|
continue;
|
|
751
|
-
const h =
|
|
784
|
+
const h = s.issues.length, _ = z._zod.check(s);
|
|
752
785
|
if (_ instanceof Promise && c?.async === !1)
|
|
753
786
|
throw new j();
|
|
754
787
|
if (f || _ instanceof Promise)
|
|
755
788
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
756
|
-
await _,
|
|
789
|
+
await _, s.issues.length !== h && (l || (l = N(s, h)));
|
|
757
790
|
});
|
|
758
791
|
else {
|
|
759
|
-
if (
|
|
792
|
+
if (s.issues.length === h)
|
|
760
793
|
continue;
|
|
761
|
-
l || (l = N(
|
|
794
|
+
l || (l = N(s, h));
|
|
762
795
|
}
|
|
763
796
|
}
|
|
764
|
-
return f ? f.then(() =>
|
|
765
|
-
},
|
|
766
|
-
if (N(
|
|
767
|
-
return
|
|
797
|
+
return f ? f.then(() => s) : s;
|
|
798
|
+
}, u = (s, i, c) => {
|
|
799
|
+
if (N(s))
|
|
800
|
+
return s.aborted = !0, s;
|
|
768
801
|
const l = o(i, r, c);
|
|
769
802
|
if (l instanceof Promise) {
|
|
770
803
|
if (c.async === !1)
|
|
@@ -773,14 +806,14 @@ const Dn = {
|
|
|
773
806
|
}
|
|
774
807
|
return e._zod.parse(l, c);
|
|
775
808
|
};
|
|
776
|
-
e._zod.run = (
|
|
809
|
+
e._zod.run = (s, i) => {
|
|
777
810
|
if (i.skipChecks)
|
|
778
|
-
return e._zod.parse(
|
|
811
|
+
return e._zod.parse(s, i);
|
|
779
812
|
if (i.direction === "backward") {
|
|
780
|
-
const l = e._zod.parse({ value:
|
|
781
|
-
return l instanceof Promise ? l.then((f) =>
|
|
813
|
+
const l = e._zod.parse({ value: s.value, issues: [] }, { ...i, skipChecks: !0 });
|
|
814
|
+
return l instanceof Promise ? l.then((f) => u(f, s, i)) : u(l, s, i);
|
|
782
815
|
}
|
|
783
|
-
const c = e._zod.parse(
|
|
816
|
+
const c = e._zod.parse(s, i);
|
|
784
817
|
if (c instanceof Promise) {
|
|
785
818
|
if (i.async === !1)
|
|
786
819
|
throw new j();
|
|
@@ -792,17 +825,17 @@ const Dn = {
|
|
|
792
825
|
e["~standard"] = {
|
|
793
826
|
validate: (o) => {
|
|
794
827
|
try {
|
|
795
|
-
const
|
|
796
|
-
return
|
|
828
|
+
const u = bn(e, o);
|
|
829
|
+
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
797
830
|
} catch {
|
|
798
|
-
return
|
|
831
|
+
return wn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
799
832
|
}
|
|
800
833
|
},
|
|
801
834
|
vendor: "zod",
|
|
802
835
|
version: 1
|
|
803
836
|
};
|
|
804
837
|
}), Re = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
805
|
-
m.init(e, n), e._zod.pattern = e._zod.bag.pattern ??
|
|
838
|
+
m.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? Nn, e._zod.parse = (t, r) => {
|
|
806
839
|
if (n.coerce)
|
|
807
840
|
try {
|
|
808
841
|
t.value = Number(t.value);
|
|
@@ -811,20 +844,20 @@ const Dn = {
|
|
|
811
844
|
const o = t.value;
|
|
812
845
|
if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
|
|
813
846
|
return t;
|
|
814
|
-
const
|
|
847
|
+
const u = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
|
|
815
848
|
return t.issues.push({
|
|
816
849
|
expected: "number",
|
|
817
850
|
code: "invalid_type",
|
|
818
851
|
input: o,
|
|
819
852
|
inst: e,
|
|
820
|
-
...
|
|
853
|
+
...u ? { received: u } : {}
|
|
821
854
|
}), t;
|
|
822
855
|
};
|
|
823
856
|
}), Un = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
824
|
-
|
|
857
|
+
An.init(e, n), Re.init(e, n);
|
|
825
858
|
}), Fn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
|
|
826
859
|
m.init(e, n), e._zod.parse = (t) => t;
|
|
827
|
-
}),
|
|
860
|
+
}), Vn = /* @__PURE__ */ a("$ZodNever", (e, n) => {
|
|
828
861
|
m.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
829
862
|
expected: "never",
|
|
830
863
|
code: "invalid_type",
|
|
@@ -833,9 +866,9 @@ const Dn = {
|
|
|
833
866
|
}), t);
|
|
834
867
|
});
|
|
835
868
|
function ie(e, n, t) {
|
|
836
|
-
e.issues.length && n.issues.push(...
|
|
869
|
+
e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
|
|
837
870
|
}
|
|
838
|
-
const
|
|
871
|
+
const Ln = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
839
872
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
840
873
|
const o = t.value;
|
|
841
874
|
if (!Array.isArray(o))
|
|
@@ -846,26 +879,26 @@ const Vn = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
|
846
879
|
inst: e
|
|
847
880
|
}), t;
|
|
848
881
|
t.value = Array(o.length);
|
|
849
|
-
const
|
|
850
|
-
for (let
|
|
851
|
-
const i = o[
|
|
882
|
+
const u = [];
|
|
883
|
+
for (let s = 0; s < o.length; s++) {
|
|
884
|
+
const i = o[s], c = n.element._zod.run({
|
|
852
885
|
value: i,
|
|
853
886
|
issues: []
|
|
854
887
|
}, r);
|
|
855
|
-
c instanceof Promise ?
|
|
888
|
+
c instanceof Promise ? u.push(c.then((l) => ie(l, t, s))) : ie(c, t, s);
|
|
856
889
|
}
|
|
857
|
-
return
|
|
890
|
+
return u.length ? Promise.all(u).then(() => t) : t;
|
|
858
891
|
};
|
|
859
892
|
});
|
|
860
|
-
function
|
|
861
|
-
e.issues.length && n.issues.push(...
|
|
893
|
+
function F(e, n, t, r) {
|
|
894
|
+
e.issues.length && n.issues.push(...Ie(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
862
895
|
}
|
|
863
|
-
function
|
|
896
|
+
function De(e) {
|
|
864
897
|
const n = Object.keys(e.shape);
|
|
865
898
|
for (const r of n)
|
|
866
899
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
867
900
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
868
|
-
const t =
|
|
901
|
+
const t = an(e.shape);
|
|
869
902
|
return {
|
|
870
903
|
...e,
|
|
871
904
|
keys: n,
|
|
@@ -874,26 +907,26 @@ function Ce(e) {
|
|
|
874
907
|
optionalKeys: new Set(t)
|
|
875
908
|
};
|
|
876
909
|
}
|
|
877
|
-
function
|
|
878
|
-
const
|
|
910
|
+
function Ce(e, n, t, r, o, u) {
|
|
911
|
+
const s = [], i = o.keySet, c = o.catchall._zod, l = c.def.type;
|
|
879
912
|
for (const f of Object.keys(n)) {
|
|
880
913
|
if (i.has(f))
|
|
881
914
|
continue;
|
|
882
915
|
if (l === "never") {
|
|
883
|
-
|
|
916
|
+
s.push(f);
|
|
884
917
|
continue;
|
|
885
918
|
}
|
|
886
919
|
const z = c.run({ value: n[f], issues: [] }, r);
|
|
887
|
-
z instanceof Promise ? e.push(z.then((h) =>
|
|
920
|
+
z instanceof Promise ? e.push(z.then((h) => F(h, t, f, n))) : F(z, t, f, n);
|
|
888
921
|
}
|
|
889
|
-
return
|
|
922
|
+
return s.length && t.issues.push({
|
|
890
923
|
code: "unrecognized_keys",
|
|
891
|
-
keys:
|
|
924
|
+
keys: s,
|
|
892
925
|
input: n,
|
|
893
|
-
inst:
|
|
926
|
+
inst: u
|
|
894
927
|
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
895
928
|
}
|
|
896
|
-
const
|
|
929
|
+
const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
897
930
|
if (m.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
898
931
|
const i = n.shape;
|
|
899
932
|
Object.defineProperty(n, "shape", {
|
|
@@ -905,7 +938,7 @@ const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
905
938
|
}
|
|
906
939
|
});
|
|
907
940
|
}
|
|
908
|
-
const r =
|
|
941
|
+
const r = X(() => De(n));
|
|
909
942
|
d(e._zod, "propValues", () => {
|
|
910
943
|
const i = n.shape, c = {};
|
|
911
944
|
for (const l in i) {
|
|
@@ -918,10 +951,10 @@ const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
918
951
|
}
|
|
919
952
|
return c;
|
|
920
953
|
});
|
|
921
|
-
const o =
|
|
922
|
-
let
|
|
954
|
+
const o = U, u = n.catchall;
|
|
955
|
+
let s;
|
|
923
956
|
e._zod.parse = (i, c) => {
|
|
924
|
-
|
|
957
|
+
s ?? (s = r.value);
|
|
925
958
|
const l = i.value;
|
|
926
959
|
if (!o(l))
|
|
927
960
|
return i.issues.push({
|
|
@@ -931,16 +964,16 @@ const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
931
964
|
inst: e
|
|
932
965
|
}), i;
|
|
933
966
|
i.value = {};
|
|
934
|
-
const f = [], z =
|
|
935
|
-
for (const h of
|
|
967
|
+
const f = [], z = s.shape;
|
|
968
|
+
for (const h of s.keys) {
|
|
936
969
|
const b = z[h]._zod.run({ value: l[h], issues: [] }, c);
|
|
937
|
-
b instanceof Promise ? f.push(b.then((G) =>
|
|
970
|
+
b instanceof Promise ? f.push(b.then((G) => F(G, i, h, l))) : F(b, i, h, l);
|
|
938
971
|
}
|
|
939
|
-
return
|
|
972
|
+
return u ? Ce(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
|
|
940
973
|
};
|
|
941
|
-
}),
|
|
942
|
-
|
|
943
|
-
const t = e._zod.parse, r =
|
|
974
|
+
}), Jn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
|
|
975
|
+
Gn.init(e, n);
|
|
976
|
+
const t = e._zod.parse, r = X(() => De(n)), o = (h) => {
|
|
944
977
|
const _ = new Cn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
|
|
945
978
|
const y = se(E);
|
|
946
979
|
return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
|
|
@@ -976,13 +1009,13 @@ const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
976
1009
|
const Je = _.compile();
|
|
977
1010
|
return (E, y) => Je(h, E, y);
|
|
978
1011
|
};
|
|
979
|
-
let
|
|
980
|
-
const
|
|
1012
|
+
let u;
|
|
1013
|
+
const s = U, i = !Ze.jitless, l = i && un.value, f = n.catchall;
|
|
981
1014
|
let z;
|
|
982
1015
|
e._zod.parse = (h, _) => {
|
|
983
1016
|
z ?? (z = r.value);
|
|
984
1017
|
const b = h.value;
|
|
985
|
-
return
|
|
1018
|
+
return s(b) ? i && l && _?.async === !1 && _.jitless !== !0 ? (u || (u = o(n.shape)), h = u(h, _), f ? Ce([], b, h, _, z, e) : h) : t(h, _) : (h.issues.push({
|
|
986
1019
|
expected: "object",
|
|
987
1020
|
code: "invalid_type",
|
|
988
1021
|
input: b,
|
|
@@ -991,69 +1024,69 @@ const Ln = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
991
1024
|
};
|
|
992
1025
|
});
|
|
993
1026
|
function ce(e, n, t, r) {
|
|
994
|
-
for (const
|
|
995
|
-
if (
|
|
996
|
-
return n.value =
|
|
997
|
-
const o = e.filter((
|
|
1027
|
+
for (const u of e)
|
|
1028
|
+
if (u.issues.length === 0)
|
|
1029
|
+
return n.value = u.value, n;
|
|
1030
|
+
const o = e.filter((u) => !N(u));
|
|
998
1031
|
return o.length === 1 ? (n.value = o[0].value, o[0]) : (n.issues.push({
|
|
999
1032
|
code: "invalid_union",
|
|
1000
1033
|
input: n.value,
|
|
1001
1034
|
inst: t,
|
|
1002
|
-
errors: e.map((
|
|
1035
|
+
errors: e.map((u) => u.issues.map((s) => O(s, r, P())))
|
|
1003
1036
|
}), n);
|
|
1004
1037
|
}
|
|
1005
|
-
const
|
|
1038
|
+
const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
1006
1039
|
m.init(e, n), d(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), d(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), d(e._zod, "values", () => {
|
|
1007
1040
|
if (n.options.every((o) => o._zod.values))
|
|
1008
1041
|
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1009
1042
|
}), d(e._zod, "pattern", () => {
|
|
1010
1043
|
if (n.options.every((o) => o._zod.pattern)) {
|
|
1011
|
-
const o = n.options.map((
|
|
1012
|
-
return new RegExp(`^(${o.map((
|
|
1044
|
+
const o = n.options.map((u) => u._zod.pattern);
|
|
1045
|
+
return new RegExp(`^(${o.map((u) => Q(u.source)).join("|")})$`);
|
|
1013
1046
|
}
|
|
1014
1047
|
});
|
|
1015
1048
|
const t = n.options.length === 1, r = n.options[0]._zod.run;
|
|
1016
|
-
e._zod.parse = (o,
|
|
1049
|
+
e._zod.parse = (o, u) => {
|
|
1017
1050
|
if (t)
|
|
1018
|
-
return r(o,
|
|
1019
|
-
let
|
|
1051
|
+
return r(o, u);
|
|
1052
|
+
let s = !1;
|
|
1020
1053
|
const i = [];
|
|
1021
1054
|
for (const c of n.options) {
|
|
1022
1055
|
const l = c._zod.run({
|
|
1023
1056
|
value: o.value,
|
|
1024
1057
|
issues: []
|
|
1025
|
-
},
|
|
1058
|
+
}, u);
|
|
1026
1059
|
if (l instanceof Promise)
|
|
1027
|
-
i.push(l),
|
|
1060
|
+
i.push(l), s = !0;
|
|
1028
1061
|
else {
|
|
1029
1062
|
if (l.issues.length === 0)
|
|
1030
1063
|
return l;
|
|
1031
1064
|
i.push(l);
|
|
1032
1065
|
}
|
|
1033
1066
|
}
|
|
1034
|
-
return
|
|
1067
|
+
return s ? Promise.all(i).then((c) => ce(c, o, e, u)) : ce(i, o, e, u);
|
|
1035
1068
|
};
|
|
1036
|
-
}),
|
|
1069
|
+
}), Yn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
|
|
1037
1070
|
m.init(e, n), e._zod.parse = (t, r) => {
|
|
1038
|
-
const o = t.value,
|
|
1039
|
-
return
|
|
1071
|
+
const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
|
|
1072
|
+
return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([c, l]) => ae(t, c, l)) : ae(t, u, s);
|
|
1040
1073
|
};
|
|
1041
1074
|
});
|
|
1042
|
-
function
|
|
1075
|
+
function q(e, n) {
|
|
1043
1076
|
if (e === n)
|
|
1044
1077
|
return { valid: !0, data: e };
|
|
1045
1078
|
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
1046
1079
|
return { valid: !0, data: e };
|
|
1047
1080
|
if (x(e) && x(n)) {
|
|
1048
|
-
const t = Object.keys(n), r = Object.keys(e).filter((
|
|
1049
|
-
for (const
|
|
1050
|
-
const
|
|
1051
|
-
if (!
|
|
1081
|
+
const t = Object.keys(n), r = Object.keys(e).filter((u) => t.indexOf(u) !== -1), o = { ...e, ...n };
|
|
1082
|
+
for (const u of r) {
|
|
1083
|
+
const s = q(e[u], n[u]);
|
|
1084
|
+
if (!s.valid)
|
|
1052
1085
|
return {
|
|
1053
1086
|
valid: !1,
|
|
1054
|
-
mergeErrorPath: [
|
|
1087
|
+
mergeErrorPath: [u, ...s.mergeErrorPath]
|
|
1055
1088
|
};
|
|
1056
|
-
o[
|
|
1089
|
+
o[u] = s.data;
|
|
1057
1090
|
}
|
|
1058
1091
|
return { valid: !0, data: o };
|
|
1059
1092
|
}
|
|
@@ -1062,13 +1095,13 @@ function B(e, n) {
|
|
|
1062
1095
|
return { valid: !1, mergeErrorPath: [] };
|
|
1063
1096
|
const t = [];
|
|
1064
1097
|
for (let r = 0; r < e.length; r++) {
|
|
1065
|
-
const o = e[r],
|
|
1066
|
-
if (!
|
|
1098
|
+
const o = e[r], u = n[r], s = q(o, u);
|
|
1099
|
+
if (!s.valid)
|
|
1067
1100
|
return {
|
|
1068
1101
|
valid: !1,
|
|
1069
|
-
mergeErrorPath: [r, ...
|
|
1102
|
+
mergeErrorPath: [r, ...s.mergeErrorPath]
|
|
1070
1103
|
};
|
|
1071
|
-
t.push(
|
|
1104
|
+
t.push(s.data);
|
|
1072
1105
|
}
|
|
1073
1106
|
return { valid: !0, data: t };
|
|
1074
1107
|
}
|
|
@@ -1077,20 +1110,20 @@ function B(e, n) {
|
|
|
1077
1110
|
function ae(e, n, t) {
|
|
1078
1111
|
if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), N(e))
|
|
1079
1112
|
return e;
|
|
1080
|
-
const r =
|
|
1113
|
+
const r = q(n.value, t.value);
|
|
1081
1114
|
if (!r.valid)
|
|
1082
1115
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1083
1116
|
return e.value = r.data, e;
|
|
1084
1117
|
}
|
|
1085
|
-
const
|
|
1118
|
+
const Hn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
1086
1119
|
m.init(e, n);
|
|
1087
|
-
const t =
|
|
1088
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) =>
|
|
1089
|
-
const
|
|
1090
|
-
return r.has(
|
|
1120
|
+
const t = rn(n.entries), r = new Set(t);
|
|
1121
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => sn.has(typeof o)).map((o) => typeof o == "string" ? cn(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
|
|
1122
|
+
const s = o.value;
|
|
1123
|
+
return r.has(s) || o.issues.push({
|
|
1091
1124
|
code: "invalid_value",
|
|
1092
1125
|
values: t,
|
|
1093
|
-
input:
|
|
1126
|
+
input: s,
|
|
1094
1127
|
inst: e
|
|
1095
1128
|
}), o;
|
|
1096
1129
|
};
|
|
@@ -1100,7 +1133,7 @@ const Yn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1100
1133
|
throw new $e(e.constructor.name);
|
|
1101
1134
|
const o = n.transform(t.value, t);
|
|
1102
1135
|
if (r.async)
|
|
1103
|
-
return (o instanceof Promise ? o : Promise.resolve(o)).then((
|
|
1136
|
+
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
|
|
1104
1137
|
if (o instanceof Promise)
|
|
1105
1138
|
throw new j();
|
|
1106
1139
|
return t.value = o, t;
|
|
@@ -1116,7 +1149,7 @@ const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1116
1149
|
}), e._zod.parse = (t, r) => {
|
|
1117
1150
|
if (n.innerType._zod.optin === "optional") {
|
|
1118
1151
|
const o = n.innerType._zod.run(t, r);
|
|
1119
|
-
return o instanceof Promise ? o.then((
|
|
1152
|
+
return o instanceof Promise ? o.then((u) => le(u, t.value)) : le(o, t.value);
|
|
1120
1153
|
}
|
|
1121
1154
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1122
1155
|
};
|
|
@@ -1132,21 +1165,21 @@ const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1132
1165
|
if (t.value === void 0)
|
|
1133
1166
|
return t.value = n.defaultValue, t;
|
|
1134
1167
|
const o = n.innerType._zod.run(t, r);
|
|
1135
|
-
return o instanceof Promise ? o.then((
|
|
1168
|
+
return o instanceof Promise ? o.then((u) => fe(u, n)) : fe(o, n);
|
|
1136
1169
|
};
|
|
1137
1170
|
});
|
|
1138
1171
|
function fe(e, n) {
|
|
1139
1172
|
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1140
1173
|
}
|
|
1141
|
-
const
|
|
1174
|
+
const Qn = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
|
|
1142
1175
|
m.init(e, n), e._zod.optin = "optional", d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
1143
|
-
}),
|
|
1176
|
+
}), et = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
|
|
1144
1177
|
m.init(e, n), d(e._zod, "values", () => {
|
|
1145
1178
|
const t = n.innerType._zod.values;
|
|
1146
1179
|
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
1147
1180
|
}), e._zod.parse = (t, r) => {
|
|
1148
1181
|
const o = n.innerType._zod.run(t, r);
|
|
1149
|
-
return o instanceof Promise ? o.then((
|
|
1182
|
+
return o instanceof Promise ? o.then((u) => de(u, e)) : de(o, e);
|
|
1150
1183
|
};
|
|
1151
1184
|
});
|
|
1152
1185
|
function de(e, n) {
|
|
@@ -1157,39 +1190,39 @@ function de(e, n) {
|
|
|
1157
1190
|
inst: n
|
|
1158
1191
|
}), e;
|
|
1159
1192
|
}
|
|
1160
|
-
const
|
|
1193
|
+
const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
1161
1194
|
m.init(e, n), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), d(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1162
1195
|
if (r.direction === "backward")
|
|
1163
1196
|
return n.innerType._zod.run(t, r);
|
|
1164
1197
|
const o = n.innerType._zod.run(t, r);
|
|
1165
|
-
return o instanceof Promise ? o.then((
|
|
1198
|
+
return o instanceof Promise ? o.then((u) => (t.value = u.value, u.issues.length && (t.value = n.catchValue({
|
|
1166
1199
|
...t,
|
|
1167
1200
|
error: {
|
|
1168
|
-
issues:
|
|
1201
|
+
issues: u.issues.map((s) => O(s, r, P()))
|
|
1169
1202
|
},
|
|
1170
1203
|
input: t.value
|
|
1171
1204
|
}), t.issues = []), t)) : (t.value = o.value, o.issues.length && (t.value = n.catchValue({
|
|
1172
1205
|
...t,
|
|
1173
1206
|
error: {
|
|
1174
|
-
issues: o.issues.map((
|
|
1207
|
+
issues: o.issues.map((u) => O(u, r, P()))
|
|
1175
1208
|
},
|
|
1176
1209
|
input: t.value
|
|
1177
1210
|
}), t.issues = []), t);
|
|
1178
1211
|
};
|
|
1179
|
-
}),
|
|
1212
|
+
}), tt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
|
|
1180
1213
|
m.init(e, n), d(e._zod, "values", () => n.in._zod.values), d(e._zod, "optin", () => n.in._zod.optin), d(e._zod, "optout", () => n.out._zod.optout), d(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1181
1214
|
if (r.direction === "backward") {
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1215
|
+
const u = n.out._zod.run(t, r);
|
|
1216
|
+
return u instanceof Promise ? u.then((s) => C(s, n.in, r)) : C(u, n.in, r);
|
|
1184
1217
|
}
|
|
1185
1218
|
const o = n.in._zod.run(t, r);
|
|
1186
|
-
return o instanceof Promise ? o.then((
|
|
1219
|
+
return o instanceof Promise ? o.then((u) => C(u, n.out, r)) : C(o, n.out, r);
|
|
1187
1220
|
};
|
|
1188
1221
|
});
|
|
1189
|
-
function
|
|
1222
|
+
function C(e, n, t) {
|
|
1190
1223
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1191
1224
|
}
|
|
1192
|
-
const
|
|
1225
|
+
const rt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
1193
1226
|
m.init(e, n), d(e._zod, "propValues", () => n.innerType._zod.propValues), d(e._zod, "values", () => n.innerType._zod.values), d(e._zod, "optin", () => n.innerType._zod.optin), d(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
|
|
1194
1227
|
if (r.direction === "backward")
|
|
1195
1228
|
return n.innerType._zod.run(t, r);
|
|
@@ -1200,11 +1233,11 @@ const tt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
|
1200
1233
|
function he(e) {
|
|
1201
1234
|
return e.value = Object.freeze(e.value), e;
|
|
1202
1235
|
}
|
|
1203
|
-
const
|
|
1236
|
+
const ot = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
|
|
1204
1237
|
k.init(e, n), m.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1205
1238
|
const r = t.value, o = n.fn(r);
|
|
1206
1239
|
if (o instanceof Promise)
|
|
1207
|
-
return o.then((
|
|
1240
|
+
return o.then((u) => pe(u, t, r, e));
|
|
1208
1241
|
pe(o, t, r, e);
|
|
1209
1242
|
};
|
|
1210
1243
|
});
|
|
@@ -1223,7 +1256,7 @@ function pe(e, n, t, r) {
|
|
|
1223
1256
|
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(R(o));
|
|
1224
1257
|
}
|
|
1225
1258
|
}
|
|
1226
|
-
class
|
|
1259
|
+
class ut {
|
|
1227
1260
|
constructor() {
|
|
1228
1261
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1229
1262
|
}
|
|
@@ -1257,18 +1290,18 @@ class ot {
|
|
|
1257
1290
|
return this._map.has(n);
|
|
1258
1291
|
}
|
|
1259
1292
|
}
|
|
1260
|
-
function
|
|
1261
|
-
return new
|
|
1293
|
+
function st() {
|
|
1294
|
+
return new ut();
|
|
1262
1295
|
}
|
|
1263
|
-
const
|
|
1264
|
-
function
|
|
1296
|
+
const M = /* @__PURE__ */ st();
|
|
1297
|
+
function it(e, n) {
|
|
1265
1298
|
return new e({
|
|
1266
1299
|
type: "number",
|
|
1267
1300
|
checks: [],
|
|
1268
1301
|
...p(n)
|
|
1269
1302
|
});
|
|
1270
1303
|
}
|
|
1271
|
-
function
|
|
1304
|
+
function ct(e, n) {
|
|
1272
1305
|
return new e({
|
|
1273
1306
|
type: "number",
|
|
1274
1307
|
check: "number_format",
|
|
@@ -1277,12 +1310,12 @@ function it(e, n) {
|
|
|
1277
1310
|
...p(n)
|
|
1278
1311
|
});
|
|
1279
1312
|
}
|
|
1280
|
-
function
|
|
1313
|
+
function at(e) {
|
|
1281
1314
|
return new e({
|
|
1282
1315
|
type: "unknown"
|
|
1283
1316
|
});
|
|
1284
1317
|
}
|
|
1285
|
-
function
|
|
1318
|
+
function lt(e, n) {
|
|
1286
1319
|
return new e({
|
|
1287
1320
|
type: "never",
|
|
1288
1321
|
...p(n)
|
|
@@ -1321,40 +1354,40 @@ function Y(e, n) {
|
|
|
1321
1354
|
});
|
|
1322
1355
|
}
|
|
1323
1356
|
function ge(e, n) {
|
|
1324
|
-
return new
|
|
1357
|
+
return new jn({
|
|
1325
1358
|
check: "multiple_of",
|
|
1326
1359
|
...p(n),
|
|
1327
1360
|
value: e
|
|
1328
1361
|
});
|
|
1329
1362
|
}
|
|
1330
|
-
function
|
|
1331
|
-
return new
|
|
1363
|
+
function ft(e, n) {
|
|
1364
|
+
return new Sn({
|
|
1332
1365
|
check: "max_length",
|
|
1333
1366
|
...p(n),
|
|
1334
1367
|
maximum: e
|
|
1335
1368
|
});
|
|
1336
1369
|
}
|
|
1337
1370
|
function ve(e, n) {
|
|
1338
|
-
return new
|
|
1371
|
+
return new xn({
|
|
1339
1372
|
check: "min_length",
|
|
1340
1373
|
...p(n),
|
|
1341
1374
|
minimum: e
|
|
1342
1375
|
});
|
|
1343
1376
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return new
|
|
1377
|
+
function dt(e, n) {
|
|
1378
|
+
return new Rn({
|
|
1346
1379
|
check: "length_equals",
|
|
1347
1380
|
...p(n),
|
|
1348
1381
|
length: e
|
|
1349
1382
|
});
|
|
1350
1383
|
}
|
|
1351
|
-
function
|
|
1352
|
-
return new
|
|
1384
|
+
function ht(e) {
|
|
1385
|
+
return new Dn({
|
|
1353
1386
|
check: "overwrite",
|
|
1354
1387
|
tx: e
|
|
1355
1388
|
});
|
|
1356
1389
|
}
|
|
1357
|
-
function
|
|
1390
|
+
function pt(e, n, t) {
|
|
1358
1391
|
return new e({
|
|
1359
1392
|
type: "array",
|
|
1360
1393
|
element: n,
|
|
@@ -1364,7 +1397,7 @@ function ht(e, n, t) {
|
|
|
1364
1397
|
...p(t)
|
|
1365
1398
|
});
|
|
1366
1399
|
}
|
|
1367
|
-
function
|
|
1400
|
+
function mt(e, n, t) {
|
|
1368
1401
|
return new e({
|
|
1369
1402
|
type: "custom",
|
|
1370
1403
|
check: "custom",
|
|
@@ -1372,8 +1405,8 @@ function pt(e, n, t) {
|
|
|
1372
1405
|
...p(t)
|
|
1373
1406
|
});
|
|
1374
1407
|
}
|
|
1375
|
-
function
|
|
1376
|
-
const n =
|
|
1408
|
+
function _t(e) {
|
|
1409
|
+
const n = gt((t) => (t.addIssue = (r) => {
|
|
1377
1410
|
if (typeof r == "string")
|
|
1378
1411
|
t.issues.push(R(r, t.value, n._zod.def));
|
|
1379
1412
|
else {
|
|
@@ -1383,32 +1416,32 @@ function mt(e) {
|
|
|
1383
1416
|
}, e(t.value, t)));
|
|
1384
1417
|
return n;
|
|
1385
1418
|
}
|
|
1386
|
-
function
|
|
1419
|
+
function gt(e, n) {
|
|
1387
1420
|
const t = new k({
|
|
1388
1421
|
check: "custom",
|
|
1389
1422
|
...p(n)
|
|
1390
1423
|
});
|
|
1391
1424
|
return t._zod.check = e, t;
|
|
1392
1425
|
}
|
|
1393
|
-
const
|
|
1426
|
+
const vt = (e, n) => {
|
|
1394
1427
|
Ne.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
1395
1428
|
format: {
|
|
1396
|
-
value: (t) =>
|
|
1429
|
+
value: (t) => zn(e, t)
|
|
1397
1430
|
// enumerable: false,
|
|
1398
1431
|
},
|
|
1399
1432
|
flatten: {
|
|
1400
|
-
value: (t) =>
|
|
1433
|
+
value: (t) => vn(e, t)
|
|
1401
1434
|
// enumerable: false,
|
|
1402
1435
|
},
|
|
1403
1436
|
addIssue: {
|
|
1404
1437
|
value: (t) => {
|
|
1405
|
-
e.issues.push(t), e.message = JSON.stringify(e.issues,
|
|
1438
|
+
e.issues.push(t), e.message = JSON.stringify(e.issues, H, 2);
|
|
1406
1439
|
}
|
|
1407
1440
|
// enumerable: false,
|
|
1408
1441
|
},
|
|
1409
1442
|
addIssues: {
|
|
1410
1443
|
value: (t) => {
|
|
1411
|
-
e.issues.push(...t), e.message = JSON.stringify(e.issues,
|
|
1444
|
+
e.issues.push(...t), e.message = JSON.stringify(e.issues, H, 2);
|
|
1412
1445
|
}
|
|
1413
1446
|
// enumerable: false,
|
|
1414
1447
|
},
|
|
@@ -1419,146 +1452,146 @@ const gt = (e, n) => {
|
|
|
1419
1452
|
// enumerable: false,
|
|
1420
1453
|
}
|
|
1421
1454
|
});
|
|
1422
|
-
}, w = a("ZodError",
|
|
1455
|
+
}, w = a("ZodError", vt, {
|
|
1423
1456
|
Parent: Error
|
|
1424
|
-
}),
|
|
1457
|
+
}), zt = /* @__PURE__ */ ne(w), bt = /* @__PURE__ */ te(w), wt = /* @__PURE__ */ V(w), yt = /* @__PURE__ */ L(w), kt = /* @__PURE__ */ yn(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w), It = /* @__PURE__ */ On(w), Tt = /* @__PURE__ */ In(w), g = /* @__PURE__ */ a("ZodType", (e, n) => (m.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(T(n, {
|
|
1425
1458
|
checks: [
|
|
1426
1459
|
...n.checks ?? [],
|
|
1427
1460
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1428
1461
|
]
|
|
1429
|
-
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) =>
|
|
1462
|
+
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => zt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => wt(e, t, r), e.parseAsync = async (t, r) => bt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => yt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => kt(e, t, r), e.decode = (t, r) => Et(e, t, r), e.encodeAsync = async (t, r) => $t(e, t, r), e.decodeAsync = async (t, r) => Zt(e, t, r), e.safeEncode = (t, r) => Pt(e, t, r), e.safeDecode = (t, r) => Ot(e, t, r), e.safeEncodeAsync = async (t, r) => It(e, t, r), e.safeDecodeAsync = async (t, r) => Tt(e, t, r), e.refine = (t, r) => e.check(tr(t, r)), e.superRefine = (t) => e.check(rr(t)), e.overwrite = (t) => e.check(ht(t)), e.optional = () => we(e), e.nullable = () => ye(e), e.nullish = () => we(ye(e)), e.nonoptional = (t) => qt(e, t), e.array = () => Ue(e), e.or = (t) => Ct([e, t]), e.and = (t) => Ut(e, t), e.transform = (t) => ke(e, Lt(t)), e.default = (t) => Kt(e, t), e.prefault = (t) => Ht(e, t), e.catch = (t) => Xt(e, t), e.pipe = (t) => ke(e, t), e.readonly = () => er(e), e.describe = (t) => {
|
|
1430
1463
|
const r = e.clone();
|
|
1431
|
-
return
|
|
1464
|
+
return M.add(r, { description: t }), r;
|
|
1432
1465
|
}, Object.defineProperty(e, "description", {
|
|
1433
1466
|
get() {
|
|
1434
|
-
return
|
|
1467
|
+
return M.get(e)?.description;
|
|
1435
1468
|
},
|
|
1436
1469
|
configurable: !0
|
|
1437
1470
|
}), e.meta = (...t) => {
|
|
1438
1471
|
if (t.length === 0)
|
|
1439
|
-
return
|
|
1472
|
+
return M.get(e);
|
|
1440
1473
|
const r = e.clone();
|
|
1441
|
-
return
|
|
1442
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
1474
|
+
return M.add(r, t[0]), r;
|
|
1475
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Me = /* @__PURE__ */ a("ZodNumber", (e, n) => {
|
|
1443
1476
|
Re.init(e, n), g.init(e, n), e.gt = (r, o) => e.check(_e(r, o)), e.gte = (r, o) => e.check(Y(r, o)), e.min = (r, o) => e.check(Y(r, o)), e.lt = (r, o) => e.check(me(r, o)), e.lte = (r, o) => e.check(K(r, o)), e.max = (r, o) => e.check(K(r, o)), e.int = (r) => e.check(ze(r)), e.safe = (r) => e.check(ze(r)), e.positive = (r) => e.check(_e(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(me(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(ge(r, o)), e.step = (r, o) => e.check(ge(r, o)), e.finite = () => e;
|
|
1444
1477
|
const t = e._zod.bag;
|
|
1445
1478
|
e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
|
|
1446
1479
|
});
|
|
1447
1480
|
function Z(e) {
|
|
1448
|
-
return
|
|
1481
|
+
return it(Me, e);
|
|
1449
1482
|
}
|
|
1450
|
-
const
|
|
1451
|
-
Un.init(e, n),
|
|
1483
|
+
const Nt = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
|
|
1484
|
+
Un.init(e, n), Me.init(e, n);
|
|
1452
1485
|
});
|
|
1453
1486
|
function ze(e) {
|
|
1454
|
-
return
|
|
1487
|
+
return ct(Nt, e);
|
|
1455
1488
|
}
|
|
1456
|
-
const
|
|
1489
|
+
const jt = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
|
|
1457
1490
|
Fn.init(e, n), g.init(e, n);
|
|
1458
1491
|
});
|
|
1459
1492
|
function be() {
|
|
1460
|
-
return
|
|
1493
|
+
return at(jt);
|
|
1461
1494
|
}
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1495
|
+
const At = /* @__PURE__ */ a("ZodNever", (e, n) => {
|
|
1496
|
+
Vn.init(e, n), g.init(e, n);
|
|
1464
1497
|
});
|
|
1465
|
-
function
|
|
1466
|
-
return
|
|
1498
|
+
function St(e) {
|
|
1499
|
+
return lt(At, e);
|
|
1467
1500
|
}
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1501
|
+
const xt = /* @__PURE__ */ a("ZodArray", (e, n) => {
|
|
1502
|
+
Ln.init(e, n), g.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ve(t, r)), e.nonempty = (t) => e.check(ve(1, t)), e.max = (t, r) => e.check(ft(t, r)), e.length = (t, r) => e.check(dt(t, r)), e.unwrap = () => e.element;
|
|
1470
1503
|
});
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1504
|
+
function Ue(e, n) {
|
|
1505
|
+
return pt(xt, e, n);
|
|
1473
1506
|
}
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1507
|
+
const Rt = /* @__PURE__ */ a("ZodObject", (e, n) => {
|
|
1508
|
+
Jn.init(e, n), g.init(e, n), d(e, "shape", () => n.shape), e.keyof = () => Ft(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: be() }), e.loose = () => e.clone({ ...e._zod.def, catchall: be() }), e.strict = () => e.clone({ ...e._zod.def, catchall: St() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => hn(e, t), e.safeExtend = (t) => pn(e, t), e.merge = (t) => mn(e, t), e.pick = (t) => fn(e, t), e.omit = (t) => dn(e, t), e.partial = (...t) => _n(Ve, e, t[0]), e.required = (...t) => gn(Le, e, t[0]);
|
|
1476
1509
|
});
|
|
1477
|
-
function
|
|
1510
|
+
function Fe(e, n) {
|
|
1478
1511
|
const t = {
|
|
1479
1512
|
type: "object",
|
|
1480
1513
|
shape: e ?? {},
|
|
1481
1514
|
...p(n)
|
|
1482
1515
|
};
|
|
1483
|
-
return new
|
|
1516
|
+
return new Rt(t);
|
|
1484
1517
|
}
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1518
|
+
const Dt = /* @__PURE__ */ a("ZodUnion", (e, n) => {
|
|
1519
|
+
Kn.init(e, n), g.init(e, n), e.options = n.options;
|
|
1487
1520
|
});
|
|
1488
1521
|
function Ct(e, n) {
|
|
1489
|
-
return new
|
|
1522
|
+
return new Dt({
|
|
1490
1523
|
type: "union",
|
|
1491
1524
|
options: e,
|
|
1492
1525
|
...p(n)
|
|
1493
1526
|
});
|
|
1494
1527
|
}
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1528
|
+
const Mt = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
|
|
1529
|
+
Yn.init(e, n), g.init(e, n);
|
|
1497
1530
|
});
|
|
1498
1531
|
function Ut(e, n) {
|
|
1499
|
-
return new
|
|
1532
|
+
return new Mt({
|
|
1500
1533
|
type: "intersection",
|
|
1501
1534
|
left: e,
|
|
1502
1535
|
right: n
|
|
1503
1536
|
});
|
|
1504
1537
|
}
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1538
|
+
const B = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
1539
|
+
Hn.init(e, n), g.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
1507
1540
|
const t = new Set(Object.keys(n.entries));
|
|
1508
1541
|
e.extract = (r, o) => {
|
|
1509
|
-
const
|
|
1510
|
-
for (const
|
|
1511
|
-
if (t.has(
|
|
1512
|
-
s
|
|
1542
|
+
const u = {};
|
|
1543
|
+
for (const s of r)
|
|
1544
|
+
if (t.has(s))
|
|
1545
|
+
u[s] = n.entries[s];
|
|
1513
1546
|
else
|
|
1514
|
-
throw new Error(`Key ${
|
|
1515
|
-
return new
|
|
1547
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1548
|
+
return new B({
|
|
1516
1549
|
...n,
|
|
1517
1550
|
checks: [],
|
|
1518
1551
|
...p(o),
|
|
1519
|
-
entries:
|
|
1552
|
+
entries: u
|
|
1520
1553
|
});
|
|
1521
1554
|
}, e.exclude = (r, o) => {
|
|
1522
|
-
const
|
|
1523
|
-
for (const
|
|
1524
|
-
if (t.has(
|
|
1525
|
-
delete s
|
|
1555
|
+
const u = { ...n.entries };
|
|
1556
|
+
for (const s of r)
|
|
1557
|
+
if (t.has(s))
|
|
1558
|
+
delete u[s];
|
|
1526
1559
|
else
|
|
1527
|
-
throw new Error(`Key ${
|
|
1528
|
-
return new
|
|
1560
|
+
throw new Error(`Key ${s} not found in enum`);
|
|
1561
|
+
return new B({
|
|
1529
1562
|
...n,
|
|
1530
1563
|
checks: [],
|
|
1531
1564
|
...p(o),
|
|
1532
|
-
entries:
|
|
1565
|
+
entries: u
|
|
1533
1566
|
});
|
|
1534
1567
|
};
|
|
1535
1568
|
});
|
|
1536
1569
|
function Ft(e, n) {
|
|
1537
1570
|
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
1538
|
-
return new
|
|
1571
|
+
return new B({
|
|
1539
1572
|
type: "enum",
|
|
1540
1573
|
entries: t,
|
|
1541
1574
|
...p(n)
|
|
1542
1575
|
});
|
|
1543
1576
|
}
|
|
1544
|
-
const
|
|
1577
|
+
const Vt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
1545
1578
|
qn.init(e, n), g.init(e, n), e._zod.parse = (t, r) => {
|
|
1546
1579
|
if (r.direction === "backward")
|
|
1547
1580
|
throw new $e(e.constructor.name);
|
|
1548
|
-
t.addIssue = (
|
|
1549
|
-
if (typeof
|
|
1550
|
-
t.issues.push(R(
|
|
1581
|
+
t.addIssue = (u) => {
|
|
1582
|
+
if (typeof u == "string")
|
|
1583
|
+
t.issues.push(R(u, t.value, n));
|
|
1551
1584
|
else {
|
|
1552
|
-
const
|
|
1553
|
-
|
|
1585
|
+
const s = u;
|
|
1586
|
+
s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(R(s));
|
|
1554
1587
|
}
|
|
1555
1588
|
};
|
|
1556
1589
|
const o = n.transform(t.value, t);
|
|
1557
|
-
return o instanceof Promise ? o.then((
|
|
1590
|
+
return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
|
|
1558
1591
|
};
|
|
1559
1592
|
});
|
|
1560
|
-
function
|
|
1561
|
-
return new
|
|
1593
|
+
function Lt(e) {
|
|
1594
|
+
return new Vt({
|
|
1562
1595
|
type: "transform",
|
|
1563
1596
|
transform: e
|
|
1564
1597
|
});
|
|
@@ -1572,20 +1605,20 @@ function we(e) {
|
|
|
1572
1605
|
innerType: e
|
|
1573
1606
|
});
|
|
1574
1607
|
}
|
|
1575
|
-
const
|
|
1608
|
+
const Gt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
|
|
1576
1609
|
Xn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1577
1610
|
});
|
|
1578
1611
|
function ye(e) {
|
|
1579
|
-
return new
|
|
1612
|
+
return new Gt({
|
|
1580
1613
|
type: "nullable",
|
|
1581
1614
|
innerType: e
|
|
1582
1615
|
});
|
|
1583
1616
|
}
|
|
1584
|
-
const
|
|
1617
|
+
const Jt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
|
|
1585
1618
|
Wn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1586
1619
|
});
|
|
1587
|
-
function
|
|
1588
|
-
return new
|
|
1620
|
+
function Kt(e, n) {
|
|
1621
|
+
return new Jt({
|
|
1589
1622
|
type: "default",
|
|
1590
1623
|
innerType: e,
|
|
1591
1624
|
get defaultValue() {
|
|
@@ -1593,11 +1626,11 @@ function Jt(e, n) {
|
|
|
1593
1626
|
}
|
|
1594
1627
|
});
|
|
1595
1628
|
}
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1629
|
+
const Yt = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
|
|
1630
|
+
Qn.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1598
1631
|
});
|
|
1599
|
-
function
|
|
1600
|
-
return new
|
|
1632
|
+
function Ht(e, n) {
|
|
1633
|
+
return new Yt({
|
|
1601
1634
|
type: "prefault",
|
|
1602
1635
|
innerType: e,
|
|
1603
1636
|
get defaultValue() {
|
|
@@ -1606,7 +1639,7 @@ function Yt(e, n) {
|
|
|
1606
1639
|
});
|
|
1607
1640
|
}
|
|
1608
1641
|
const Le = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
|
|
1609
|
-
|
|
1642
|
+
et.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1610
1643
|
});
|
|
1611
1644
|
function qt(e, n) {
|
|
1612
1645
|
return new Le({
|
|
@@ -1616,7 +1649,7 @@ function qt(e, n) {
|
|
|
1616
1649
|
});
|
|
1617
1650
|
}
|
|
1618
1651
|
const Bt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
|
|
1619
|
-
|
|
1652
|
+
nt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1620
1653
|
});
|
|
1621
1654
|
function Xt(e, n) {
|
|
1622
1655
|
return new Bt({
|
|
@@ -1626,7 +1659,7 @@ function Xt(e, n) {
|
|
|
1626
1659
|
});
|
|
1627
1660
|
}
|
|
1628
1661
|
const Wt = /* @__PURE__ */ a("ZodPipe", (e, n) => {
|
|
1629
|
-
|
|
1662
|
+
tt.init(e, n), g.init(e, n), e.in = n.in, e.out = n.out;
|
|
1630
1663
|
});
|
|
1631
1664
|
function ke(e, n) {
|
|
1632
1665
|
return new Wt({
|
|
@@ -1636,48 +1669,49 @@ function ke(e, n) {
|
|
|
1636
1669
|
// ...util.normalizeParams(params),
|
|
1637
1670
|
});
|
|
1638
1671
|
}
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1672
|
+
const Qt = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
|
|
1673
|
+
rt.init(e, n), g.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1641
1674
|
});
|
|
1642
|
-
function
|
|
1643
|
-
return new
|
|
1675
|
+
function er(e) {
|
|
1676
|
+
return new Qt({
|
|
1644
1677
|
type: "readonly",
|
|
1645
1678
|
innerType: e
|
|
1646
1679
|
});
|
|
1647
1680
|
}
|
|
1648
|
-
const
|
|
1649
|
-
|
|
1681
|
+
const nr = /* @__PURE__ */ a("ZodCustom", (e, n) => {
|
|
1682
|
+
ot.init(e, n), g.init(e, n);
|
|
1650
1683
|
});
|
|
1651
|
-
function
|
|
1652
|
-
return
|
|
1684
|
+
function tr(e, n = {}) {
|
|
1685
|
+
return mt(nr, e, n);
|
|
1653
1686
|
}
|
|
1654
|
-
function
|
|
1655
|
-
return
|
|
1687
|
+
function rr(e) {
|
|
1688
|
+
return _t(e);
|
|
1656
1689
|
}
|
|
1657
|
-
const
|
|
1690
|
+
const pr = (e) => Fe({
|
|
1658
1691
|
pages: Z(),
|
|
1659
1692
|
nextPage: Z().optional(),
|
|
1660
1693
|
totalElements: Z(),
|
|
1661
1694
|
currentPage: Z(),
|
|
1662
1695
|
pageSize: Z(),
|
|
1663
|
-
elements:
|
|
1664
|
-
}),
|
|
1696
|
+
elements: Ue(e)
|
|
1697
|
+
}), mr = Fe({
|
|
1665
1698
|
page: Z(),
|
|
1666
1699
|
pageSize: Z()
|
|
1667
1700
|
});
|
|
1668
1701
|
export {
|
|
1669
|
-
|
|
1670
|
-
|
|
1702
|
+
sr as Fail,
|
|
1703
|
+
ir as Failure,
|
|
1671
1704
|
S as Guid,
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1705
|
+
ur as Ok,
|
|
1706
|
+
mr as PageQuery,
|
|
1707
|
+
hr as convertDateInfoToDateRange,
|
|
1708
|
+
pr as createPageSchema,
|
|
1675
1709
|
Ke as formatDate,
|
|
1676
|
-
|
|
1710
|
+
dr as formatDateTime,
|
|
1677
1711
|
Ye as formatTime,
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1712
|
+
ar as isFailure,
|
|
1713
|
+
or as mock,
|
|
1714
|
+
cr as notFailure,
|
|
1715
|
+
lr as parseConfig,
|
|
1716
|
+
fr as sleep
|
|
1683
1717
|
};
|