@fiction/sdk 1.0.18 → 1.0.20
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/demo/index.d.ts +5 -5
- package/dist/demo.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/modules/self/schema.ts +6 -0
- package/dist/modules/user/schema.ts +30 -0
- package/dist/sdk.css +1 -1
- package/dist/sdk.js +4 -2813
- package/dist/sdk.js.map +1 -1
- package/dist/sdkClient-C9BL_Op4.js.map +1 -1
- package/dist/sdkClient.d.ts +10 -11
- package/dist/sdkStorage.d.ts +1 -1
- package/dist/self/ClientAudio.d.ts +1 -1
- package/dist/self/SelfController.d.ts +1 -1
- package/dist/self/schema.d.ts +1 -1
- package/dist/self/ui/ElModeHeader.vue.d.ts +1 -1
- package/dist/self/ui/ElSelfAbout.vue.d.ts +1 -1
- package/dist/self/ui/ElSelfChat.vue.d.ts +1 -1
- package/dist/self/ui/ElSelfHeader.vue.d.ts +1 -1
- package/dist/self/ui/ElSidebar.vue.d.ts +1 -1
- package/dist/self/ui/SelfAgent.vue.d.ts +2 -2
- package/dist/self/ui/SelfWrap.vue.d.ts +1 -1
- package/dist/self/utils.d.ts +1 -1
- package/dist/self.js.map +1 -1
- package/dist/types/media.ts +30 -0
- package/package.json +4 -3
- package/dist/types/SDKAppType.stub.d.ts +0 -6
package/dist/sdk.js
CHANGED
|
@@ -1,2816 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { F as rc } from "./sdkClient-C9BL_Op4.js";
|
|
4
|
-
function u(e, t, n) {
|
|
5
|
-
function o(p, h) {
|
|
6
|
-
var f;
|
|
7
|
-
Object.defineProperty(p, "_zod", {
|
|
8
|
-
value: p._zod ?? {},
|
|
9
|
-
enumerable: !1
|
|
10
|
-
}), (f = p._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), p._zod.traits.add(e), t(p, h);
|
|
11
|
-
for (const w in i.prototype)
|
|
12
|
-
w in p || Object.defineProperty(p, w, { value: i.prototype[w].bind(p) });
|
|
13
|
-
p._zod.constr = i, p._zod.def = h;
|
|
14
|
-
}
|
|
15
|
-
a(o, "init");
|
|
16
|
-
const r = n?.Parent ?? Object, s = class s extends r {
|
|
17
|
-
};
|
|
18
|
-
a(s, "Definition");
|
|
19
|
-
let c = s;
|
|
20
|
-
Object.defineProperty(c, "name", { value: e });
|
|
21
|
-
function i(p) {
|
|
22
|
-
var h;
|
|
23
|
-
const f = n?.Parent ? new c() : this;
|
|
24
|
-
o(f, p), (h = f._zod).deferred ?? (h.deferred = []);
|
|
25
|
-
for (const w of f._zod.deferred)
|
|
26
|
-
w();
|
|
27
|
-
return f;
|
|
28
|
-
}
|
|
29
|
-
return a(i, "_"), Object.defineProperty(i, "init", { value: o }), Object.defineProperty(i, Symbol.hasInstance, {
|
|
30
|
-
value: /* @__PURE__ */ a((p) => n?.Parent && p instanceof n.Parent ? !0 : p?._zod?.traits?.has(e), "value")
|
|
31
|
-
}), Object.defineProperty(i, "name", { value: e }), i;
|
|
32
|
-
}
|
|
33
|
-
a(u, "$constructor");
|
|
34
|
-
const ke = class ke extends Error {
|
|
35
|
-
constructor() {
|
|
36
|
-
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
a(ke, "$ZodAsyncError");
|
|
40
|
-
let T = ke;
|
|
41
|
-
const Ze = class Ze extends Error {
|
|
42
|
-
constructor(t) {
|
|
43
|
-
super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
a(Ze, "$ZodEncodeError");
|
|
47
|
-
let ee = Ze;
|
|
48
|
-
const Ke = {};
|
|
49
|
-
function D(e) {
|
|
50
|
-
return Ke;
|
|
51
|
-
}
|
|
52
|
-
a(D, "config");
|
|
53
|
-
function It(e) {
|
|
54
|
-
const t = Object.values(e).filter((o) => typeof o == "number");
|
|
55
|
-
return Object.entries(e).filter(([o, r]) => t.indexOf(+o) === -1).map(([o, r]) => r);
|
|
56
|
-
}
|
|
57
|
-
a(It, "getEnumValues");
|
|
58
|
-
function le(e, t) {
|
|
59
|
-
return typeof t == "bigint" ? t.toString() : t;
|
|
60
|
-
}
|
|
61
|
-
a(le, "jsonStringifyReplacer");
|
|
62
|
-
function ie(e) {
|
|
63
|
-
return {
|
|
64
|
-
get value() {
|
|
65
|
-
{
|
|
66
|
-
const t = e();
|
|
67
|
-
return Object.defineProperty(this, "value", { value: t }), t;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
a(ie, "cached");
|
|
73
|
-
function _e(e) {
|
|
74
|
-
return e == null;
|
|
75
|
-
}
|
|
76
|
-
a(_e, "nullish");
|
|
77
|
-
function ve(e) {
|
|
78
|
-
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
79
|
-
return e.slice(t, n);
|
|
80
|
-
}
|
|
81
|
-
a(ve, "cleanRegex");
|
|
82
|
-
function At(e, t) {
|
|
83
|
-
const n = (e.toString().split(".")[1] || "").length, o = t.toString();
|
|
84
|
-
let r = (o.split(".")[1] || "").length;
|
|
85
|
-
if (r === 0 && /\d?e-\d?/.test(o)) {
|
|
86
|
-
const p = o.match(/\d?e-(\d?)/);
|
|
87
|
-
p?.[1] && (r = Number.parseInt(p[1]));
|
|
88
|
-
}
|
|
89
|
-
const c = n > r ? n : r, i = Number.parseInt(e.toFixed(c).replace(".", "")), s = Number.parseInt(t.toFixed(c).replace(".", ""));
|
|
90
|
-
return i % s / 10 ** c;
|
|
91
|
-
}
|
|
92
|
-
a(At, "floatSafeRemainder");
|
|
93
|
-
const Ae = Symbol("evaluating");
|
|
94
|
-
function m(e, t, n) {
|
|
95
|
-
let o;
|
|
96
|
-
Object.defineProperty(e, t, {
|
|
97
|
-
get() {
|
|
98
|
-
if (o !== Ae)
|
|
99
|
-
return o === void 0 && (o = Ae, o = n()), o;
|
|
100
|
-
},
|
|
101
|
-
set(r) {
|
|
102
|
-
Object.defineProperty(e, t, {
|
|
103
|
-
value: r
|
|
104
|
-
// configurable: true,
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
configurable: !0
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
a(m, "defineLazy");
|
|
111
|
-
function F(e, t, n) {
|
|
112
|
-
Object.defineProperty(e, t, {
|
|
113
|
-
value: n,
|
|
114
|
-
writable: !0,
|
|
115
|
-
enumerable: !0,
|
|
116
|
-
configurable: !0
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
a(F, "assignProp");
|
|
120
|
-
function R(...e) {
|
|
121
|
-
const t = {};
|
|
122
|
-
for (const n of e) {
|
|
123
|
-
const o = Object.getOwnPropertyDescriptors(n);
|
|
124
|
-
Object.assign(t, o);
|
|
125
|
-
}
|
|
126
|
-
return Object.defineProperties({}, t);
|
|
127
|
-
}
|
|
128
|
-
a(R, "mergeDefs");
|
|
129
|
-
function Ee(e) {
|
|
130
|
-
return JSON.stringify(e);
|
|
131
|
-
}
|
|
132
|
-
a(Ee, "esc");
|
|
133
|
-
const Ye = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
134
|
-
};
|
|
135
|
-
function V(e) {
|
|
136
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
137
|
-
}
|
|
138
|
-
a(V, "isObject");
|
|
139
|
-
const Et = ie(() => {
|
|
140
|
-
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
141
|
-
return !1;
|
|
142
|
-
try {
|
|
143
|
-
const e = Function;
|
|
144
|
-
return new e(""), !0;
|
|
145
|
-
} catch {
|
|
146
|
-
return !1;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
function B(e) {
|
|
150
|
-
if (V(e) === !1)
|
|
151
|
-
return !1;
|
|
152
|
-
const t = e.constructor;
|
|
153
|
-
if (t === void 0)
|
|
154
|
-
return !0;
|
|
155
|
-
const n = t.prototype;
|
|
156
|
-
return !(V(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
157
|
-
}
|
|
158
|
-
a(B, "isPlainObject");
|
|
159
|
-
function Xe(e) {
|
|
160
|
-
return B(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
161
|
-
}
|
|
162
|
-
a(Xe, "shallowClone");
|
|
163
|
-
const St = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
164
|
-
function L(e) {
|
|
165
|
-
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
166
|
-
}
|
|
167
|
-
a(L, "escapeRegex");
|
|
168
|
-
function j(e, t, n) {
|
|
169
|
-
const o = new e._zod.constr(t ?? e._zod.def);
|
|
170
|
-
return (!t || n?.parent) && (o._zod.parent = e), o;
|
|
171
|
-
}
|
|
172
|
-
a(j, "clone");
|
|
173
|
-
function d(e) {
|
|
174
|
-
const t = e;
|
|
175
|
-
if (!t)
|
|
176
|
-
return {};
|
|
177
|
-
if (typeof t == "string")
|
|
178
|
-
return { error: /* @__PURE__ */ a(() => t, "error") };
|
|
179
|
-
if (t?.message !== void 0) {
|
|
180
|
-
if (t?.error !== void 0)
|
|
181
|
-
throw new Error("Cannot specify both `message` and `error` params");
|
|
182
|
-
t.error = t.message;
|
|
183
|
-
}
|
|
184
|
-
return delete t.message, typeof t.error == "string" ? { ...t, error: /* @__PURE__ */ a(() => t.error, "error") } : t;
|
|
185
|
-
}
|
|
186
|
-
a(d, "normalizeParams");
|
|
187
|
-
function Ot(e) {
|
|
188
|
-
return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
|
|
189
|
-
}
|
|
190
|
-
a(Ot, "optionalKeys");
|
|
191
|
-
const Pt = {
|
|
192
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
193
|
-
int32: [-2147483648, 2147483647],
|
|
194
|
-
uint32: [0, 4294967295],
|
|
195
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
196
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
197
|
-
};
|
|
198
|
-
function Tt(e, t) {
|
|
199
|
-
const n = e._zod.def, o = R(e._zod.def, {
|
|
200
|
-
get shape() {
|
|
201
|
-
const r = {};
|
|
202
|
-
for (const c in t) {
|
|
203
|
-
if (!(c in n.shape))
|
|
204
|
-
throw new Error(`Unrecognized key: "${c}"`);
|
|
205
|
-
t[c] && (r[c] = n.shape[c]);
|
|
206
|
-
}
|
|
207
|
-
return F(this, "shape", r), r;
|
|
208
|
-
},
|
|
209
|
-
checks: []
|
|
210
|
-
});
|
|
211
|
-
return j(e, o);
|
|
212
|
-
}
|
|
213
|
-
a(Tt, "pick");
|
|
214
|
-
function xt(e, t) {
|
|
215
|
-
const n = e._zod.def, o = R(e._zod.def, {
|
|
216
|
-
get shape() {
|
|
217
|
-
const r = { ...e._zod.def.shape };
|
|
218
|
-
for (const c in t) {
|
|
219
|
-
if (!(c in n.shape))
|
|
220
|
-
throw new Error(`Unrecognized key: "${c}"`);
|
|
221
|
-
t[c] && delete r[c];
|
|
222
|
-
}
|
|
223
|
-
return F(this, "shape", r), r;
|
|
224
|
-
},
|
|
225
|
-
checks: []
|
|
226
|
-
});
|
|
227
|
-
return j(e, o);
|
|
228
|
-
}
|
|
229
|
-
a(xt, "omit");
|
|
230
|
-
function Nt(e, t) {
|
|
231
|
-
if (!B(t))
|
|
232
|
-
throw new Error("Invalid input to extend: expected a plain object");
|
|
233
|
-
const n = e._zod.def.checks;
|
|
234
|
-
if (n && n.length > 0)
|
|
235
|
-
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
236
|
-
const r = R(e._zod.def, {
|
|
237
|
-
get shape() {
|
|
238
|
-
const c = { ...e._zod.def.shape, ...t };
|
|
239
|
-
return F(this, "shape", c), c;
|
|
240
|
-
},
|
|
241
|
-
checks: []
|
|
242
|
-
});
|
|
243
|
-
return j(e, r);
|
|
244
|
-
}
|
|
245
|
-
a(Nt, "extend");
|
|
246
|
-
function jt(e, t) {
|
|
247
|
-
if (!B(t))
|
|
248
|
-
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
249
|
-
const n = {
|
|
250
|
-
...e._zod.def,
|
|
251
|
-
get shape() {
|
|
252
|
-
const o = { ...e._zod.def.shape, ...t };
|
|
253
|
-
return F(this, "shape", o), o;
|
|
254
|
-
},
|
|
255
|
-
checks: e._zod.def.checks
|
|
256
|
-
};
|
|
257
|
-
return j(e, n);
|
|
258
|
-
}
|
|
259
|
-
a(jt, "safeExtend");
|
|
260
|
-
function Dt(e, t) {
|
|
261
|
-
const n = R(e._zod.def, {
|
|
262
|
-
get shape() {
|
|
263
|
-
const o = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
264
|
-
return F(this, "shape", o), o;
|
|
265
|
-
},
|
|
266
|
-
get catchall() {
|
|
267
|
-
return t._zod.def.catchall;
|
|
268
|
-
},
|
|
269
|
-
checks: []
|
|
270
|
-
// delete existing checks
|
|
271
|
-
});
|
|
272
|
-
return j(e, n);
|
|
273
|
-
}
|
|
274
|
-
a(Dt, "merge");
|
|
275
|
-
function Ct(e, t, n) {
|
|
276
|
-
const o = R(t._zod.def, {
|
|
277
|
-
get shape() {
|
|
278
|
-
const r = t._zod.def.shape, c = { ...r };
|
|
279
|
-
if (n)
|
|
280
|
-
for (const i in n) {
|
|
281
|
-
if (!(i in r))
|
|
282
|
-
throw new Error(`Unrecognized key: "${i}"`);
|
|
283
|
-
n[i] && (c[i] = e ? new e({
|
|
284
|
-
type: "optional",
|
|
285
|
-
innerType: r[i]
|
|
286
|
-
}) : r[i]);
|
|
287
|
-
}
|
|
288
|
-
else
|
|
289
|
-
for (const i in r)
|
|
290
|
-
c[i] = e ? new e({
|
|
291
|
-
type: "optional",
|
|
292
|
-
innerType: r[i]
|
|
293
|
-
}) : r[i];
|
|
294
|
-
return F(this, "shape", c), c;
|
|
295
|
-
},
|
|
296
|
-
checks: []
|
|
297
|
-
});
|
|
298
|
-
return j(t, o);
|
|
299
|
-
}
|
|
300
|
-
a(Ct, "partial");
|
|
301
|
-
function Ft(e, t, n) {
|
|
302
|
-
const o = R(t._zod.def, {
|
|
303
|
-
get shape() {
|
|
304
|
-
const r = t._zod.def.shape, c = { ...r };
|
|
305
|
-
if (n)
|
|
306
|
-
for (const i in n) {
|
|
307
|
-
if (!(i in c))
|
|
308
|
-
throw new Error(`Unrecognized key: "${i}"`);
|
|
309
|
-
n[i] && (c[i] = new e({
|
|
310
|
-
type: "nonoptional",
|
|
311
|
-
innerType: r[i]
|
|
312
|
-
}));
|
|
313
|
-
}
|
|
314
|
-
else
|
|
315
|
-
for (const i in r)
|
|
316
|
-
c[i] = new e({
|
|
317
|
-
type: "nonoptional",
|
|
318
|
-
innerType: r[i]
|
|
319
|
-
});
|
|
320
|
-
return F(this, "shape", c), c;
|
|
321
|
-
},
|
|
322
|
-
checks: []
|
|
323
|
-
});
|
|
324
|
-
return j(t, o);
|
|
325
|
-
}
|
|
326
|
-
a(Ft, "required");
|
|
327
|
-
function U(e, t = 0) {
|
|
328
|
-
if (e.aborted === !0)
|
|
329
|
-
return !0;
|
|
330
|
-
for (let n = t; n < e.issues.length; n++)
|
|
331
|
-
if (e.issues[n]?.continue !== !0)
|
|
332
|
-
return !0;
|
|
333
|
-
return !1;
|
|
334
|
-
}
|
|
335
|
-
a(U, "aborted");
|
|
336
|
-
function qe(e, t) {
|
|
337
|
-
return t.map((n) => {
|
|
338
|
-
var o;
|
|
339
|
-
return (o = n).path ?? (o.path = []), n.path.unshift(e), n;
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
a(qe, "prefixIssues");
|
|
343
|
-
function K(e) {
|
|
344
|
-
return typeof e == "string" ? e : e?.message;
|
|
345
|
-
}
|
|
346
|
-
a(K, "unwrapMessage");
|
|
347
|
-
function C(e, t, n) {
|
|
348
|
-
const o = { ...e, path: e.path ?? [] };
|
|
349
|
-
if (!e.message) {
|
|
350
|
-
const r = K(e.inst?._zod.def?.error?.(e)) ?? K(t?.error?.(e)) ?? K(n.customError?.(e)) ?? K(n.localeError?.(e)) ?? "Invalid input";
|
|
351
|
-
o.message = r;
|
|
352
|
-
}
|
|
353
|
-
return delete o.inst, delete o.continue, t?.reportInput || delete o.input, o;
|
|
354
|
-
}
|
|
355
|
-
a(C, "finalizeIssue");
|
|
356
|
-
function ge(e) {
|
|
357
|
-
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
358
|
-
}
|
|
359
|
-
a(ge, "getLengthableOrigin");
|
|
360
|
-
function W(...e) {
|
|
361
|
-
const [t, n, o] = e;
|
|
362
|
-
return typeof t == "string" ? {
|
|
363
|
-
message: t,
|
|
364
|
-
code: "custom",
|
|
365
|
-
input: n,
|
|
366
|
-
inst: o
|
|
367
|
-
} : { ...t };
|
|
368
|
-
}
|
|
369
|
-
a(W, "issue");
|
|
370
|
-
const He = /* @__PURE__ */ a((e, t) => {
|
|
371
|
-
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
372
|
-
value: e._zod,
|
|
373
|
-
enumerable: !1
|
|
374
|
-
}), Object.defineProperty(e, "issues", {
|
|
375
|
-
value: t,
|
|
376
|
-
enumerable: !1
|
|
377
|
-
}), e.message = JSON.stringify(t, le, 2), Object.defineProperty(e, "toString", {
|
|
378
|
-
value: /* @__PURE__ */ a(() => e.message, "value"),
|
|
379
|
-
enumerable: !1
|
|
380
|
-
});
|
|
381
|
-
}, "initializer$1"), Qe = u("$ZodError", He), et = u("$ZodError", He, { Parent: Error });
|
|
382
|
-
function Rt(e, t = (n) => n.message) {
|
|
383
|
-
const n = {}, o = [];
|
|
384
|
-
for (const r of e.issues)
|
|
385
|
-
r.path.length > 0 ? (n[r.path[0]] = n[r.path[0]] || [], n[r.path[0]].push(t(r))) : o.push(t(r));
|
|
386
|
-
return { formErrors: o, fieldErrors: n };
|
|
387
|
-
}
|
|
388
|
-
a(Rt, "flattenError");
|
|
389
|
-
function Ut(e, t) {
|
|
390
|
-
const n = t || function(c) {
|
|
391
|
-
return c.message;
|
|
392
|
-
}, o = { _errors: [] }, r = /* @__PURE__ */ a((c) => {
|
|
393
|
-
for (const i of c.issues)
|
|
394
|
-
if (i.code === "invalid_union" && i.errors.length)
|
|
395
|
-
i.errors.map((s) => r({ issues: s }));
|
|
396
|
-
else if (i.code === "invalid_key")
|
|
397
|
-
r({ issues: i.issues });
|
|
398
|
-
else if (i.code === "invalid_element")
|
|
399
|
-
r({ issues: i.issues });
|
|
400
|
-
else if (i.path.length === 0)
|
|
401
|
-
o._errors.push(n(i));
|
|
402
|
-
else {
|
|
403
|
-
let s = o, p = 0;
|
|
404
|
-
for (; p < i.path.length; ) {
|
|
405
|
-
const h = i.path[p];
|
|
406
|
-
p === i.path.length - 1 ? (s[h] = s[h] || { _errors: [] }, s[h]._errors.push(n(i))) : s[h] = s[h] || { _errors: [] }, s = s[h], p++;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}, "processError");
|
|
410
|
-
return r(e), o;
|
|
411
|
-
}
|
|
412
|
-
a(Ut, "formatError");
|
|
413
|
-
const be = /* @__PURE__ */ a((e) => (t, n, o, r) => {
|
|
414
|
-
const c = o ? Object.assign(o, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, c);
|
|
415
|
-
if (i instanceof Promise)
|
|
416
|
-
throw new T();
|
|
417
|
-
if (i.issues.length) {
|
|
418
|
-
const s = new (r?.Err ?? e)(i.issues.map((p) => C(p, c, D())));
|
|
419
|
-
throw Ye(s, r?.callee), s;
|
|
420
|
-
}
|
|
421
|
-
return i.value;
|
|
422
|
-
}, "_parse"), ze = /* @__PURE__ */ a((e) => async (t, n, o, r) => {
|
|
423
|
-
const c = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
424
|
-
let i = t._zod.run({ value: n, issues: [] }, c);
|
|
425
|
-
if (i instanceof Promise && (i = await i), i.issues.length) {
|
|
426
|
-
const s = new (r?.Err ?? e)(i.issues.map((p) => C(p, c, D())));
|
|
427
|
-
throw Ye(s, r?.callee), s;
|
|
428
|
-
}
|
|
429
|
-
return i.value;
|
|
430
|
-
}, "_parseAsync"), ce = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
431
|
-
const r = o ? { ...o, async: !1 } : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, r);
|
|
432
|
-
if (c instanceof Promise)
|
|
433
|
-
throw new T();
|
|
434
|
-
return c.issues.length ? {
|
|
435
|
-
success: !1,
|
|
436
|
-
error: new (e ?? Qe)(c.issues.map((i) => C(i, r, D())))
|
|
437
|
-
} : { success: !0, data: c.value };
|
|
438
|
-
}, "_safeParse"), Lt = /* @__PURE__ */ ce(et), ae = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
439
|
-
const r = o ? Object.assign(o, { async: !0 }) : { async: !0 };
|
|
440
|
-
let c = t._zod.run({ value: n, issues: [] }, r);
|
|
441
|
-
return c instanceof Promise && (c = await c), c.issues.length ? {
|
|
442
|
-
success: !1,
|
|
443
|
-
error: new e(c.issues.map((i) => C(i, r, D())))
|
|
444
|
-
} : { success: !0, data: c.value };
|
|
445
|
-
}, "_safeParseAsync"), Mt = /* @__PURE__ */ ae(et), Vt = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
446
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
447
|
-
return be(e)(t, n, r);
|
|
448
|
-
}, "_encode"), Bt = /* @__PURE__ */ a((e) => (t, n, o) => be(e)(t, n, o), "_decode"), Wt = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
449
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
450
|
-
return ze(e)(t, n, r);
|
|
451
|
-
}, "_encodeAsync"), Gt = /* @__PURE__ */ a((e) => async (t, n, o) => ze(e)(t, n, o), "_decodeAsync"), Jt = /* @__PURE__ */ a((e) => (t, n, o) => {
|
|
452
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
453
|
-
return ce(e)(t, n, r);
|
|
454
|
-
}, "_safeEncode"), Kt = /* @__PURE__ */ a((e) => (t, n, o) => ce(e)(t, n, o), "_safeDecode"), Yt = /* @__PURE__ */ a((e) => async (t, n, o) => {
|
|
455
|
-
const r = o ? Object.assign(o, { direction: "backward" }) : { direction: "backward" };
|
|
456
|
-
return ae(e)(t, n, r);
|
|
457
|
-
}, "_safeEncodeAsync"), Xt = /* @__PURE__ */ a((e) => async (t, n, o) => ae(e)(t, n, o), "_safeDecodeAsync"), qt = /^[cC][^\s-]{8,}$/, Ht = /^[0-9a-z]+$/, Qt = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, en = /^[0-9a-vA-V]{20}$/, tn = /^[A-Za-z0-9]{27}$/, nn = /^[a-zA-Z0-9_-]{21}$/, on = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, rn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Se = /* @__PURE__ */ a((e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, "uuid"), cn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, an = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
458
|
-
function un() {
|
|
459
|
-
return new RegExp(an, "u");
|
|
460
|
-
}
|
|
461
|
-
a(un, "emoji");
|
|
462
|
-
const sn = /^(?:(?: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])$/, ln = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, pn = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, dn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, hn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, tt = /^[A-Za-z0-9_-]*$/, fn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, mn = /^\+(?:[0-9]){6,14}[0-9]$/, nt = "(?:(?:\\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])))", _n = /* @__PURE__ */ new RegExp(`^${nt}$`);
|
|
463
|
-
function ot(e) {
|
|
464
|
-
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
465
|
-
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
466
|
-
}
|
|
467
|
-
a(ot, "timeSource");
|
|
468
|
-
function vn(e) {
|
|
469
|
-
return new RegExp(`^${ot(e)}$`);
|
|
470
|
-
}
|
|
471
|
-
a(vn, "time$1");
|
|
472
|
-
function gn(e) {
|
|
473
|
-
const t = ot({ precision: e.precision }), n = ["Z"];
|
|
474
|
-
e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
|
|
475
|
-
const o = `${t}(?:${n.join("|")})`;
|
|
476
|
-
return new RegExp(`^${nt}T(?:${o})$`);
|
|
477
|
-
}
|
|
478
|
-
a(gn, "datetime$1");
|
|
479
|
-
const bn = /* @__PURE__ */ a((e) => {
|
|
480
|
-
const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
|
|
481
|
-
return new RegExp(`^${t}$`);
|
|
482
|
-
}, "string$1"), zn = /^-?\d+$/, wn = /^-?\d+(?:\.\d+)?/, kn = /^(?:true|false)$/i, Zn = /^[^A-Z]*$/, $n = /^[^a-z]*$/, A = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
|
|
483
|
-
var n;
|
|
484
|
-
e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
|
|
485
|
-
}), rt = {
|
|
486
|
-
number: "number",
|
|
487
|
-
bigint: "bigint",
|
|
488
|
-
object: "date"
|
|
489
|
-
}, it = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
|
|
490
|
-
A.init(e, t);
|
|
491
|
-
const n = rt[typeof t.value];
|
|
492
|
-
e._zod.onattach.push((o) => {
|
|
493
|
-
const r = o._zod.bag, c = (t.inclusive ? r.maximum : r.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
494
|
-
t.value < c && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value);
|
|
495
|
-
}), e._zod.check = (o) => {
|
|
496
|
-
(t.inclusive ? o.value <= t.value : o.value < t.value) || o.issues.push({
|
|
497
|
-
origin: n,
|
|
498
|
-
code: "too_big",
|
|
499
|
-
maximum: t.value,
|
|
500
|
-
input: o.value,
|
|
501
|
-
inclusive: t.inclusive,
|
|
502
|
-
inst: e,
|
|
503
|
-
continue: !t.abort
|
|
504
|
-
});
|
|
505
|
-
};
|
|
506
|
-
}), ct = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
|
|
507
|
-
A.init(e, t);
|
|
508
|
-
const n = rt[typeof t.value];
|
|
509
|
-
e._zod.onattach.push((o) => {
|
|
510
|
-
const r = o._zod.bag, c = (t.inclusive ? r.minimum : r.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
511
|
-
t.value > c && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value);
|
|
512
|
-
}), e._zod.check = (o) => {
|
|
513
|
-
(t.inclusive ? o.value >= t.value : o.value > t.value) || o.issues.push({
|
|
514
|
-
origin: n,
|
|
515
|
-
code: "too_small",
|
|
516
|
-
minimum: t.value,
|
|
517
|
-
input: o.value,
|
|
518
|
-
inclusive: t.inclusive,
|
|
519
|
-
inst: e,
|
|
520
|
-
continue: !t.abort
|
|
521
|
-
});
|
|
522
|
-
};
|
|
523
|
-
}), yn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
|
|
524
|
-
A.init(e, t), e._zod.onattach.push((n) => {
|
|
525
|
-
var o;
|
|
526
|
-
(o = n._zod.bag).multipleOf ?? (o.multipleOf = t.value);
|
|
527
|
-
}), e._zod.check = (n) => {
|
|
528
|
-
if (typeof n.value != typeof t.value)
|
|
529
|
-
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
530
|
-
(typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : At(n.value, t.value) === 0) || n.issues.push({
|
|
531
|
-
origin: typeof n.value,
|
|
532
|
-
code: "not_multiple_of",
|
|
533
|
-
divisor: t.value,
|
|
534
|
-
input: n.value,
|
|
535
|
-
inst: e,
|
|
536
|
-
continue: !t.abort
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
}), In = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
|
|
540
|
-
A.init(e, t), t.format = t.format || "float64";
|
|
541
|
-
const n = t.format?.includes("int"), o = n ? "int" : "number", [r, c] = Pt[t.format];
|
|
542
|
-
e._zod.onattach.push((i) => {
|
|
543
|
-
const s = i._zod.bag;
|
|
544
|
-
s.format = t.format, s.minimum = r, s.maximum = c, n && (s.pattern = zn);
|
|
545
|
-
}), e._zod.check = (i) => {
|
|
546
|
-
const s = i.value;
|
|
547
|
-
if (n) {
|
|
548
|
-
if (!Number.isInteger(s)) {
|
|
549
|
-
i.issues.push({
|
|
550
|
-
expected: o,
|
|
551
|
-
format: t.format,
|
|
552
|
-
code: "invalid_type",
|
|
553
|
-
continue: !1,
|
|
554
|
-
input: s,
|
|
555
|
-
inst: e
|
|
556
|
-
});
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if (!Number.isSafeInteger(s)) {
|
|
560
|
-
s > 0 ? i.issues.push({
|
|
561
|
-
input: s,
|
|
562
|
-
code: "too_big",
|
|
563
|
-
maximum: Number.MAX_SAFE_INTEGER,
|
|
564
|
-
note: "Integers must be within the safe integer range.",
|
|
565
|
-
inst: e,
|
|
566
|
-
origin: o,
|
|
567
|
-
continue: !t.abort
|
|
568
|
-
}) : i.issues.push({
|
|
569
|
-
input: s,
|
|
570
|
-
code: "too_small",
|
|
571
|
-
minimum: Number.MIN_SAFE_INTEGER,
|
|
572
|
-
note: "Integers must be within the safe integer range.",
|
|
573
|
-
inst: e,
|
|
574
|
-
origin: o,
|
|
575
|
-
continue: !t.abort
|
|
576
|
-
});
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
s < r && i.issues.push({
|
|
581
|
-
origin: "number",
|
|
582
|
-
input: s,
|
|
583
|
-
code: "too_small",
|
|
584
|
-
minimum: r,
|
|
585
|
-
inclusive: !0,
|
|
586
|
-
inst: e,
|
|
587
|
-
continue: !t.abort
|
|
588
|
-
}), s > c && i.issues.push({
|
|
589
|
-
origin: "number",
|
|
590
|
-
input: s,
|
|
591
|
-
code: "too_big",
|
|
592
|
-
maximum: c,
|
|
593
|
-
inst: e
|
|
594
|
-
});
|
|
595
|
-
};
|
|
596
|
-
}), An = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
|
|
597
|
-
var n;
|
|
598
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
599
|
-
const r = o.value;
|
|
600
|
-
return !_e(r) && r.length !== void 0;
|
|
601
|
-
}), e._zod.onattach.push((o) => {
|
|
602
|
-
const r = o._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
603
|
-
t.maximum < r && (o._zod.bag.maximum = t.maximum);
|
|
604
|
-
}), e._zod.check = (o) => {
|
|
605
|
-
const r = o.value;
|
|
606
|
-
if (r.length <= t.maximum)
|
|
607
|
-
return;
|
|
608
|
-
const i = ge(r);
|
|
609
|
-
o.issues.push({
|
|
610
|
-
origin: i,
|
|
611
|
-
code: "too_big",
|
|
612
|
-
maximum: t.maximum,
|
|
613
|
-
inclusive: !0,
|
|
614
|
-
input: r,
|
|
615
|
-
inst: e,
|
|
616
|
-
continue: !t.abort
|
|
617
|
-
});
|
|
618
|
-
};
|
|
619
|
-
}), En = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
|
|
620
|
-
var n;
|
|
621
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
622
|
-
const r = o.value;
|
|
623
|
-
return !_e(r) && r.length !== void 0;
|
|
624
|
-
}), e._zod.onattach.push((o) => {
|
|
625
|
-
const r = o._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
626
|
-
t.minimum > r && (o._zod.bag.minimum = t.minimum);
|
|
627
|
-
}), e._zod.check = (o) => {
|
|
628
|
-
const r = o.value;
|
|
629
|
-
if (r.length >= t.minimum)
|
|
630
|
-
return;
|
|
631
|
-
const i = ge(r);
|
|
632
|
-
o.issues.push({
|
|
633
|
-
origin: i,
|
|
634
|
-
code: "too_small",
|
|
635
|
-
minimum: t.minimum,
|
|
636
|
-
inclusive: !0,
|
|
637
|
-
input: r,
|
|
638
|
-
inst: e,
|
|
639
|
-
continue: !t.abort
|
|
640
|
-
});
|
|
641
|
-
};
|
|
642
|
-
}), Sn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
|
|
643
|
-
var n;
|
|
644
|
-
A.init(e, t), (n = e._zod.def).when ?? (n.when = (o) => {
|
|
645
|
-
const r = o.value;
|
|
646
|
-
return !_e(r) && r.length !== void 0;
|
|
647
|
-
}), e._zod.onattach.push((o) => {
|
|
648
|
-
const r = o._zod.bag;
|
|
649
|
-
r.minimum = t.length, r.maximum = t.length, r.length = t.length;
|
|
650
|
-
}), e._zod.check = (o) => {
|
|
651
|
-
const r = o.value, c = r.length;
|
|
652
|
-
if (c === t.length)
|
|
653
|
-
return;
|
|
654
|
-
const i = ge(r), s = c > t.length;
|
|
655
|
-
o.issues.push({
|
|
656
|
-
origin: i,
|
|
657
|
-
...s ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
658
|
-
inclusive: !0,
|
|
659
|
-
exact: !0,
|
|
660
|
-
input: o.value,
|
|
661
|
-
inst: e,
|
|
662
|
-
continue: !t.abort
|
|
663
|
-
});
|
|
664
|
-
};
|
|
665
|
-
}), ue = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, t) => {
|
|
666
|
-
var n, o;
|
|
667
|
-
A.init(e, t), e._zod.onattach.push((r) => {
|
|
668
|
-
const c = r._zod.bag;
|
|
669
|
-
c.format = t.format, t.pattern && (c.patterns ?? (c.patterns = /* @__PURE__ */ new Set()), c.patterns.add(t.pattern));
|
|
670
|
-
}), t.pattern ? (n = e._zod).check ?? (n.check = (r) => {
|
|
671
|
-
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
672
|
-
origin: "string",
|
|
673
|
-
code: "invalid_format",
|
|
674
|
-
format: t.format,
|
|
675
|
-
input: r.value,
|
|
676
|
-
...t.pattern ? { pattern: t.pattern.toString() } : {},
|
|
677
|
-
inst: e,
|
|
678
|
-
continue: !t.abort
|
|
679
|
-
});
|
|
680
|
-
}) : (o = e._zod).check ?? (o.check = () => {
|
|
681
|
-
});
|
|
682
|
-
}), On = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
|
|
683
|
-
ue.init(e, t), e._zod.check = (n) => {
|
|
684
|
-
t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
|
|
685
|
-
origin: "string",
|
|
686
|
-
code: "invalid_format",
|
|
687
|
-
format: "regex",
|
|
688
|
-
input: n.value,
|
|
689
|
-
pattern: t.pattern.toString(),
|
|
690
|
-
inst: e,
|
|
691
|
-
continue: !t.abort
|
|
692
|
-
});
|
|
693
|
-
};
|
|
694
|
-
}), Pn = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
|
|
695
|
-
t.pattern ?? (t.pattern = Zn), ue.init(e, t);
|
|
696
|
-
}), Tn = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
|
|
697
|
-
t.pattern ?? (t.pattern = $n), ue.init(e, t);
|
|
698
|
-
}), xn = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
|
|
699
|
-
A.init(e, t);
|
|
700
|
-
const n = L(t.includes), o = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
701
|
-
t.pattern = o, e._zod.onattach.push((r) => {
|
|
702
|
-
const c = r._zod.bag;
|
|
703
|
-
c.patterns ?? (c.patterns = /* @__PURE__ */ new Set()), c.patterns.add(o);
|
|
704
|
-
}), e._zod.check = (r) => {
|
|
705
|
-
r.value.includes(t.includes, t.position) || r.issues.push({
|
|
706
|
-
origin: "string",
|
|
707
|
-
code: "invalid_format",
|
|
708
|
-
format: "includes",
|
|
709
|
-
includes: t.includes,
|
|
710
|
-
input: r.value,
|
|
711
|
-
inst: e,
|
|
712
|
-
continue: !t.abort
|
|
713
|
-
});
|
|
714
|
-
};
|
|
715
|
-
}), Nn = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
|
|
716
|
-
A.init(e, t);
|
|
717
|
-
const n = new RegExp(`^${L(t.prefix)}.*`);
|
|
718
|
-
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
719
|
-
const r = o._zod.bag;
|
|
720
|
-
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
721
|
-
}), e._zod.check = (o) => {
|
|
722
|
-
o.value.startsWith(t.prefix) || o.issues.push({
|
|
723
|
-
origin: "string",
|
|
724
|
-
code: "invalid_format",
|
|
725
|
-
format: "starts_with",
|
|
726
|
-
prefix: t.prefix,
|
|
727
|
-
input: o.value,
|
|
728
|
-
inst: e,
|
|
729
|
-
continue: !t.abort
|
|
730
|
-
});
|
|
731
|
-
};
|
|
732
|
-
}), jn = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
|
|
733
|
-
A.init(e, t);
|
|
734
|
-
const n = new RegExp(`.*${L(t.suffix)}$`);
|
|
735
|
-
t.pattern ?? (t.pattern = n), e._zod.onattach.push((o) => {
|
|
736
|
-
const r = o._zod.bag;
|
|
737
|
-
r.patterns ?? (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(n);
|
|
738
|
-
}), e._zod.check = (o) => {
|
|
739
|
-
o.value.endsWith(t.suffix) || o.issues.push({
|
|
740
|
-
origin: "string",
|
|
741
|
-
code: "invalid_format",
|
|
742
|
-
format: "ends_with",
|
|
743
|
-
suffix: t.suffix,
|
|
744
|
-
input: o.value,
|
|
745
|
-
inst: e,
|
|
746
|
-
continue: !t.abort
|
|
747
|
-
});
|
|
748
|
-
};
|
|
749
|
-
}), Dn = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
|
|
750
|
-
A.init(e, t), e._zod.check = (n) => {
|
|
751
|
-
n.value = t.tx(n.value);
|
|
752
|
-
};
|
|
753
|
-
}), $e = class $e {
|
|
754
|
-
constructor(t = []) {
|
|
755
|
-
this.content = [], this.indent = 0, this && (this.args = t);
|
|
756
|
-
}
|
|
757
|
-
indented(t) {
|
|
758
|
-
this.indent += 1, t(this), this.indent -= 1;
|
|
759
|
-
}
|
|
760
|
-
write(t) {
|
|
761
|
-
if (typeof t == "function") {
|
|
762
|
-
t(this, { execution: "sync" }), t(this, { execution: "async" });
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
const o = t.split(`
|
|
766
|
-
`).filter((i) => i), r = Math.min(...o.map((i) => i.length - i.trimStart().length)), c = o.map((i) => i.slice(r)).map((i) => " ".repeat(this.indent * 2) + i);
|
|
767
|
-
for (const i of c)
|
|
768
|
-
this.content.push(i);
|
|
769
|
-
}
|
|
770
|
-
compile() {
|
|
771
|
-
const t = Function, n = this?.args, r = [...(this?.content ?? [""]).map((c) => ` ${c}`)];
|
|
772
|
-
return new t(...n, r.join(`
|
|
773
|
-
`));
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
a($e, "Doc");
|
|
777
|
-
let pe = $e;
|
|
778
|
-
const Cn = {
|
|
779
|
-
major: 4,
|
|
780
|
-
minor: 1,
|
|
781
|
-
patch: 11
|
|
782
|
-
}, _ = /* @__PURE__ */ u("$ZodType", (e, t) => {
|
|
783
|
-
var n;
|
|
784
|
-
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Cn;
|
|
785
|
-
const o = [...e._zod.def.checks ?? []];
|
|
786
|
-
e._zod.traits.has("$ZodCheck") && o.unshift(e);
|
|
787
|
-
for (const r of o)
|
|
788
|
-
for (const c of r._zod.onattach)
|
|
789
|
-
c(e);
|
|
790
|
-
if (o.length === 0)
|
|
791
|
-
(n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
|
|
792
|
-
e._zod.run = e._zod.parse;
|
|
793
|
-
});
|
|
794
|
-
else {
|
|
795
|
-
const r = /* @__PURE__ */ a((i, s, p) => {
|
|
796
|
-
let h = U(i), f;
|
|
797
|
-
for (const w of s) {
|
|
798
|
-
if (w._zod.def.when) {
|
|
799
|
-
if (!w._zod.def.when(i))
|
|
800
|
-
continue;
|
|
801
|
-
} else if (h)
|
|
802
|
-
continue;
|
|
803
|
-
const z = i.issues.length, $ = w._zod.check(i);
|
|
804
|
-
if ($ instanceof Promise && p?.async === !1)
|
|
805
|
-
throw new T();
|
|
806
|
-
if (f || $ instanceof Promise)
|
|
807
|
-
f = (f ?? Promise.resolve()).then(async () => {
|
|
808
|
-
await $, i.issues.length !== z && (h || (h = U(i, z)));
|
|
809
|
-
});
|
|
810
|
-
else {
|
|
811
|
-
if (i.issues.length === z)
|
|
812
|
-
continue;
|
|
813
|
-
h || (h = U(i, z));
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
return f ? f.then(() => i) : i;
|
|
817
|
-
}, "runChecks"), c = /* @__PURE__ */ a((i, s, p) => {
|
|
818
|
-
if (U(i))
|
|
819
|
-
return i.aborted = !0, i;
|
|
820
|
-
const h = r(s, o, p);
|
|
821
|
-
if (h instanceof Promise) {
|
|
822
|
-
if (p.async === !1)
|
|
823
|
-
throw new T();
|
|
824
|
-
return h.then((f) => e._zod.parse(f, p));
|
|
825
|
-
}
|
|
826
|
-
return e._zod.parse(h, p);
|
|
827
|
-
}, "handleCanaryResult");
|
|
828
|
-
e._zod.run = (i, s) => {
|
|
829
|
-
if (s.skipChecks)
|
|
830
|
-
return e._zod.parse(i, s);
|
|
831
|
-
if (s.direction === "backward") {
|
|
832
|
-
const h = e._zod.parse({ value: i.value, issues: [] }, { ...s, skipChecks: !0 });
|
|
833
|
-
return h instanceof Promise ? h.then((f) => c(f, i, s)) : c(h, i, s);
|
|
834
|
-
}
|
|
835
|
-
const p = e._zod.parse(i, s);
|
|
836
|
-
if (p instanceof Promise) {
|
|
837
|
-
if (s.async === !1)
|
|
838
|
-
throw new T();
|
|
839
|
-
return p.then((h) => r(h, o, s));
|
|
840
|
-
}
|
|
841
|
-
return r(p, o, s);
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
e["~standard"] = {
|
|
845
|
-
validate: /* @__PURE__ */ a((r) => {
|
|
846
|
-
try {
|
|
847
|
-
const c = Lt(e, r);
|
|
848
|
-
return c.success ? { value: c.data } : { issues: c.error?.issues };
|
|
849
|
-
} catch {
|
|
850
|
-
return Mt(e, r).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
851
|
-
}
|
|
852
|
-
}, "validate"),
|
|
853
|
-
vendor: "zod",
|
|
854
|
-
version: 1
|
|
855
|
-
};
|
|
856
|
-
}), we = /* @__PURE__ */ u("$ZodString", (e, t) => {
|
|
857
|
-
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? bn(e._zod.bag), e._zod.parse = (n, o) => {
|
|
858
|
-
if (t.coerce)
|
|
859
|
-
try {
|
|
860
|
-
n.value = String(n.value);
|
|
861
|
-
} catch {
|
|
862
|
-
}
|
|
863
|
-
return typeof n.value == "string" || n.issues.push({
|
|
864
|
-
expected: "string",
|
|
865
|
-
code: "invalid_type",
|
|
866
|
-
input: n.value,
|
|
867
|
-
inst: e
|
|
868
|
-
}), n;
|
|
869
|
-
};
|
|
870
|
-
}), v = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
|
|
871
|
-
ue.init(e, t), we.init(e, t);
|
|
872
|
-
}), Fn = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
|
|
873
|
-
t.pattern ?? (t.pattern = rn), v.init(e, t);
|
|
874
|
-
}), Rn = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
|
|
875
|
-
if (t.version) {
|
|
876
|
-
const o = {
|
|
877
|
-
v1: 1,
|
|
878
|
-
v2: 2,
|
|
879
|
-
v3: 3,
|
|
880
|
-
v4: 4,
|
|
881
|
-
v5: 5,
|
|
882
|
-
v6: 6,
|
|
883
|
-
v7: 7,
|
|
884
|
-
v8: 8
|
|
885
|
-
}[t.version];
|
|
886
|
-
if (o === void 0)
|
|
887
|
-
throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
888
|
-
t.pattern ?? (t.pattern = Se(o));
|
|
889
|
-
} else
|
|
890
|
-
t.pattern ?? (t.pattern = Se());
|
|
891
|
-
v.init(e, t);
|
|
892
|
-
}), Un = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
|
|
893
|
-
t.pattern ?? (t.pattern = cn), v.init(e, t);
|
|
894
|
-
}), Ln = /* @__PURE__ */ u("$ZodURL", (e, t) => {
|
|
895
|
-
v.init(e, t), e._zod.check = (n) => {
|
|
896
|
-
try {
|
|
897
|
-
const o = n.value.trim(), r = new URL(o);
|
|
898
|
-
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(r.hostname) || n.issues.push({
|
|
899
|
-
code: "invalid_format",
|
|
900
|
-
format: "url",
|
|
901
|
-
note: "Invalid hostname",
|
|
902
|
-
pattern: fn.source,
|
|
903
|
-
input: n.value,
|
|
904
|
-
inst: e,
|
|
905
|
-
continue: !t.abort
|
|
906
|
-
})), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(r.protocol.endsWith(":") ? r.protocol.slice(0, -1) : r.protocol) || n.issues.push({
|
|
907
|
-
code: "invalid_format",
|
|
908
|
-
format: "url",
|
|
909
|
-
note: "Invalid protocol",
|
|
910
|
-
pattern: t.protocol.source,
|
|
911
|
-
input: n.value,
|
|
912
|
-
inst: e,
|
|
913
|
-
continue: !t.abort
|
|
914
|
-
})), t.normalize ? n.value = r.href : n.value = o;
|
|
915
|
-
return;
|
|
916
|
-
} catch {
|
|
917
|
-
n.issues.push({
|
|
918
|
-
code: "invalid_format",
|
|
919
|
-
format: "url",
|
|
920
|
-
input: n.value,
|
|
921
|
-
inst: e,
|
|
922
|
-
continue: !t.abort
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
}), Mn = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
|
|
927
|
-
t.pattern ?? (t.pattern = un()), v.init(e, t);
|
|
928
|
-
}), Vn = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
|
|
929
|
-
t.pattern ?? (t.pattern = nn), v.init(e, t);
|
|
930
|
-
}), Bn = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
|
|
931
|
-
t.pattern ?? (t.pattern = qt), v.init(e, t);
|
|
932
|
-
}), Wn = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
|
|
933
|
-
t.pattern ?? (t.pattern = Ht), v.init(e, t);
|
|
934
|
-
}), Gn = /* @__PURE__ */ u("$ZodULID", (e, t) => {
|
|
935
|
-
t.pattern ?? (t.pattern = Qt), v.init(e, t);
|
|
936
|
-
}), Jn = /* @__PURE__ */ u("$ZodXID", (e, t) => {
|
|
937
|
-
t.pattern ?? (t.pattern = en), v.init(e, t);
|
|
938
|
-
}), Kn = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
|
|
939
|
-
t.pattern ?? (t.pattern = tn), v.init(e, t);
|
|
940
|
-
}), Yn = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
|
|
941
|
-
t.pattern ?? (t.pattern = gn(t)), v.init(e, t);
|
|
942
|
-
}), Xn = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
|
|
943
|
-
t.pattern ?? (t.pattern = _n), v.init(e, t);
|
|
944
|
-
}), qn = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
|
|
945
|
-
t.pattern ?? (t.pattern = vn(t)), v.init(e, t);
|
|
946
|
-
}), Hn = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
|
|
947
|
-
t.pattern ?? (t.pattern = on), v.init(e, t);
|
|
948
|
-
}), Qn = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
|
|
949
|
-
t.pattern ?? (t.pattern = sn), v.init(e, t), e._zod.onattach.push((n) => {
|
|
950
|
-
const o = n._zod.bag;
|
|
951
|
-
o.format = "ipv4";
|
|
952
|
-
});
|
|
953
|
-
}), eo = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
|
|
954
|
-
t.pattern ?? (t.pattern = ln), v.init(e, t), e._zod.onattach.push((n) => {
|
|
955
|
-
const o = n._zod.bag;
|
|
956
|
-
o.format = "ipv6";
|
|
957
|
-
}), e._zod.check = (n) => {
|
|
958
|
-
try {
|
|
959
|
-
new URL(`http://[${n.value}]`);
|
|
960
|
-
} catch {
|
|
961
|
-
n.issues.push({
|
|
962
|
-
code: "invalid_format",
|
|
963
|
-
format: "ipv6",
|
|
964
|
-
input: n.value,
|
|
965
|
-
inst: e,
|
|
966
|
-
continue: !t.abort
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
}), to = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
|
|
971
|
-
t.pattern ?? (t.pattern = pn), v.init(e, t);
|
|
972
|
-
}), no = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
|
|
973
|
-
t.pattern ?? (t.pattern = dn), v.init(e, t), e._zod.check = (n) => {
|
|
974
|
-
const o = n.value.split("/");
|
|
975
|
-
try {
|
|
976
|
-
if (o.length !== 2)
|
|
977
|
-
throw new Error();
|
|
978
|
-
const [r, c] = o;
|
|
979
|
-
if (!c)
|
|
980
|
-
throw new Error();
|
|
981
|
-
const i = Number(c);
|
|
982
|
-
if (`${i}` !== c)
|
|
983
|
-
throw new Error();
|
|
984
|
-
if (i < 0 || i > 128)
|
|
985
|
-
throw new Error();
|
|
986
|
-
new URL(`http://[${r}]`);
|
|
987
|
-
} catch {
|
|
988
|
-
n.issues.push({
|
|
989
|
-
code: "invalid_format",
|
|
990
|
-
format: "cidrv6",
|
|
991
|
-
input: n.value,
|
|
992
|
-
inst: e,
|
|
993
|
-
continue: !t.abort
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
};
|
|
997
|
-
});
|
|
998
|
-
function at(e) {
|
|
999
|
-
if (e === "")
|
|
1000
|
-
return !0;
|
|
1001
|
-
if (e.length % 4 !== 0)
|
|
1002
|
-
return !1;
|
|
1003
|
-
try {
|
|
1004
|
-
return atob(e), !0;
|
|
1005
|
-
} catch {
|
|
1006
|
-
return !1;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
a(at, "isValidBase64");
|
|
1010
|
-
const oo = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
|
|
1011
|
-
t.pattern ?? (t.pattern = hn), v.init(e, t), e._zod.onattach.push((n) => {
|
|
1012
|
-
n._zod.bag.contentEncoding = "base64";
|
|
1013
|
-
}), e._zod.check = (n) => {
|
|
1014
|
-
at(n.value) || n.issues.push({
|
|
1015
|
-
code: "invalid_format",
|
|
1016
|
-
format: "base64",
|
|
1017
|
-
input: n.value,
|
|
1018
|
-
inst: e,
|
|
1019
|
-
continue: !t.abort
|
|
1020
|
-
});
|
|
1021
|
-
};
|
|
1022
|
-
});
|
|
1023
|
-
function ro(e) {
|
|
1024
|
-
if (!tt.test(e))
|
|
1025
|
-
return !1;
|
|
1026
|
-
const t = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1027
|
-
return at(n);
|
|
1028
|
-
}
|
|
1029
|
-
a(ro, "isValidBase64URL");
|
|
1030
|
-
const io = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
|
|
1031
|
-
t.pattern ?? (t.pattern = tt), v.init(e, t), e._zod.onattach.push((n) => {
|
|
1032
|
-
n._zod.bag.contentEncoding = "base64url";
|
|
1033
|
-
}), e._zod.check = (n) => {
|
|
1034
|
-
ro(n.value) || n.issues.push({
|
|
1035
|
-
code: "invalid_format",
|
|
1036
|
-
format: "base64url",
|
|
1037
|
-
input: n.value,
|
|
1038
|
-
inst: e,
|
|
1039
|
-
continue: !t.abort
|
|
1040
|
-
});
|
|
1041
|
-
};
|
|
1042
|
-
}), co = /* @__PURE__ */ u("$ZodE164", (e, t) => {
|
|
1043
|
-
t.pattern ?? (t.pattern = mn), v.init(e, t);
|
|
1044
|
-
});
|
|
1045
|
-
function ao(e, t = null) {
|
|
1046
|
-
try {
|
|
1047
|
-
const n = e.split(".");
|
|
1048
|
-
if (n.length !== 3)
|
|
1049
|
-
return !1;
|
|
1050
|
-
const [o] = n;
|
|
1051
|
-
if (!o)
|
|
1052
|
-
return !1;
|
|
1053
|
-
const r = JSON.parse(atob(o));
|
|
1054
|
-
return !("typ" in r && r?.typ !== "JWT" || !r.alg || t && (!("alg" in r) || r.alg !== t));
|
|
1055
|
-
} catch {
|
|
1056
|
-
return !1;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
a(ao, "isValidJWT");
|
|
1060
|
-
const uo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
|
|
1061
|
-
v.init(e, t), e._zod.check = (n) => {
|
|
1062
|
-
ao(n.value, t.alg) || n.issues.push({
|
|
1063
|
-
code: "invalid_format",
|
|
1064
|
-
format: "jwt",
|
|
1065
|
-
input: n.value,
|
|
1066
|
-
inst: e,
|
|
1067
|
-
continue: !t.abort
|
|
1068
|
-
});
|
|
1069
|
-
};
|
|
1070
|
-
}), ut = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1071
|
-
_.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? wn, e._zod.parse = (n, o) => {
|
|
1072
|
-
if (t.coerce)
|
|
1073
|
-
try {
|
|
1074
|
-
n.value = Number(n.value);
|
|
1075
|
-
} catch {
|
|
1076
|
-
}
|
|
1077
|
-
const r = n.value;
|
|
1078
|
-
if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
|
|
1079
|
-
return n;
|
|
1080
|
-
const c = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
|
|
1081
|
-
return n.issues.push({
|
|
1082
|
-
expected: "number",
|
|
1083
|
-
code: "invalid_type",
|
|
1084
|
-
input: r,
|
|
1085
|
-
inst: e,
|
|
1086
|
-
...c ? { received: c } : {}
|
|
1087
|
-
}), n;
|
|
1088
|
-
};
|
|
1089
|
-
}), so = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
|
|
1090
|
-
In.init(e, t), ut.init(e, t);
|
|
1091
|
-
}), lo = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
|
|
1092
|
-
_.init(e, t), e._zod.pattern = kn, e._zod.parse = (n, o) => {
|
|
1093
|
-
if (t.coerce)
|
|
1094
|
-
try {
|
|
1095
|
-
n.value = !!n.value;
|
|
1096
|
-
} catch {
|
|
1097
|
-
}
|
|
1098
|
-
const r = n.value;
|
|
1099
|
-
return typeof r == "boolean" || n.issues.push({
|
|
1100
|
-
expected: "boolean",
|
|
1101
|
-
code: "invalid_type",
|
|
1102
|
-
input: r,
|
|
1103
|
-
inst: e
|
|
1104
|
-
}), n;
|
|
1105
|
-
};
|
|
1106
|
-
}), po = /* @__PURE__ */ u("$ZodAny", (e, t) => {
|
|
1107
|
-
_.init(e, t), e._zod.parse = (n) => n;
|
|
1108
|
-
}), ho = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
|
|
1109
|
-
_.init(e, t), e._zod.parse = (n) => n;
|
|
1110
|
-
}), fo = /* @__PURE__ */ u("$ZodNever", (e, t) => {
|
|
1111
|
-
_.init(e, t), e._zod.parse = (n, o) => (n.issues.push({
|
|
1112
|
-
expected: "never",
|
|
1113
|
-
code: "invalid_type",
|
|
1114
|
-
input: n.value,
|
|
1115
|
-
inst: e
|
|
1116
|
-
}), n);
|
|
1117
|
-
}), mo = /* @__PURE__ */ u("$ZodDate", (e, t) => {
|
|
1118
|
-
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1119
|
-
if (t.coerce)
|
|
1120
|
-
try {
|
|
1121
|
-
n.value = new Date(n.value);
|
|
1122
|
-
} catch {
|
|
1123
|
-
}
|
|
1124
|
-
const r = n.value, c = r instanceof Date;
|
|
1125
|
-
return c && !Number.isNaN(r.getTime()) || n.issues.push({
|
|
1126
|
-
expected: "date",
|
|
1127
|
-
code: "invalid_type",
|
|
1128
|
-
input: r,
|
|
1129
|
-
...c ? { received: "Invalid Date" } : {},
|
|
1130
|
-
inst: e
|
|
1131
|
-
}), n;
|
|
1132
|
-
};
|
|
1133
|
-
});
|
|
1134
|
-
function Oe(e, t, n) {
|
|
1135
|
-
e.issues.length && t.issues.push(...qe(n, e.issues)), t.value[n] = e.value;
|
|
1136
|
-
}
|
|
1137
|
-
a(Oe, "handleArrayResult");
|
|
1138
|
-
const _o = /* @__PURE__ */ u("$ZodArray", (e, t) => {
|
|
1139
|
-
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1140
|
-
const r = n.value;
|
|
1141
|
-
if (!Array.isArray(r))
|
|
1142
|
-
return n.issues.push({
|
|
1143
|
-
expected: "array",
|
|
1144
|
-
code: "invalid_type",
|
|
1145
|
-
input: r,
|
|
1146
|
-
inst: e
|
|
1147
|
-
}), n;
|
|
1148
|
-
n.value = Array(r.length);
|
|
1149
|
-
const c = [];
|
|
1150
|
-
for (let i = 0; i < r.length; i++) {
|
|
1151
|
-
const s = r[i], p = t.element._zod.run({
|
|
1152
|
-
value: s,
|
|
1153
|
-
issues: []
|
|
1154
|
-
}, o);
|
|
1155
|
-
p instanceof Promise ? c.push(p.then((h) => Oe(h, n, i))) : Oe(p, n, i);
|
|
1156
|
-
}
|
|
1157
|
-
return c.length ? Promise.all(c).then(() => n) : n;
|
|
1158
|
-
};
|
|
1159
|
-
});
|
|
1160
|
-
function te(e, t, n, o) {
|
|
1161
|
-
e.issues.length && t.issues.push(...qe(n, e.issues)), e.value === void 0 ? n in o && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1162
|
-
}
|
|
1163
|
-
a(te, "handlePropertyResult");
|
|
1164
|
-
function st(e) {
|
|
1165
|
-
const t = Object.keys(e.shape);
|
|
1166
|
-
for (const o of t)
|
|
1167
|
-
if (!e.shape?.[o]?._zod?.traits?.has("$ZodType"))
|
|
1168
|
-
throw new Error(`Invalid element at key "${o}": expected a Zod schema`);
|
|
1169
|
-
const n = Ot(e.shape);
|
|
1170
|
-
return {
|
|
1171
|
-
...e,
|
|
1172
|
-
keys: t,
|
|
1173
|
-
keySet: new Set(t),
|
|
1174
|
-
numKeys: t.length,
|
|
1175
|
-
optionalKeys: new Set(n)
|
|
1176
|
-
};
|
|
1177
|
-
}
|
|
1178
|
-
a(st, "normalizeDef");
|
|
1179
|
-
function lt(e, t, n, o, r, c) {
|
|
1180
|
-
const i = [], s = r.keySet, p = r.catchall._zod, h = p.def.type;
|
|
1181
|
-
for (const f of Object.keys(t)) {
|
|
1182
|
-
if (s.has(f))
|
|
1183
|
-
continue;
|
|
1184
|
-
if (h === "never") {
|
|
1185
|
-
i.push(f);
|
|
1186
|
-
continue;
|
|
1187
|
-
}
|
|
1188
|
-
const w = p.run({ value: t[f], issues: [] }, o);
|
|
1189
|
-
w instanceof Promise ? e.push(w.then((z) => te(z, n, f, t))) : te(w, n, f, t);
|
|
1190
|
-
}
|
|
1191
|
-
return i.length && n.issues.push({
|
|
1192
|
-
code: "unrecognized_keys",
|
|
1193
|
-
keys: i,
|
|
1194
|
-
input: t,
|
|
1195
|
-
inst: c
|
|
1196
|
-
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1197
|
-
}
|
|
1198
|
-
a(lt, "handleCatchall");
|
|
1199
|
-
const vo = /* @__PURE__ */ u("$ZodObject", (e, t) => {
|
|
1200
|
-
if (_.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1201
|
-
const s = t.shape;
|
|
1202
|
-
Object.defineProperty(t, "shape", {
|
|
1203
|
-
get: /* @__PURE__ */ a(() => {
|
|
1204
|
-
const p = { ...s };
|
|
1205
|
-
return Object.defineProperty(t, "shape", {
|
|
1206
|
-
value: p
|
|
1207
|
-
}), p;
|
|
1208
|
-
}, "get")
|
|
1209
|
-
});
|
|
1210
|
-
}
|
|
1211
|
-
const o = ie(() => st(t));
|
|
1212
|
-
m(e._zod, "propValues", () => {
|
|
1213
|
-
const s = t.shape, p = {};
|
|
1214
|
-
for (const h in s) {
|
|
1215
|
-
const f = s[h]._zod;
|
|
1216
|
-
if (f.values) {
|
|
1217
|
-
p[h] ?? (p[h] = /* @__PURE__ */ new Set());
|
|
1218
|
-
for (const w of f.values)
|
|
1219
|
-
p[h].add(w);
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
return p;
|
|
1223
|
-
});
|
|
1224
|
-
const r = V, c = t.catchall;
|
|
1225
|
-
let i;
|
|
1226
|
-
e._zod.parse = (s, p) => {
|
|
1227
|
-
i ?? (i = o.value);
|
|
1228
|
-
const h = s.value;
|
|
1229
|
-
if (!r(h))
|
|
1230
|
-
return s.issues.push({
|
|
1231
|
-
expected: "object",
|
|
1232
|
-
code: "invalid_type",
|
|
1233
|
-
input: h,
|
|
1234
|
-
inst: e
|
|
1235
|
-
}), s;
|
|
1236
|
-
s.value = {};
|
|
1237
|
-
const f = [], w = i.shape;
|
|
1238
|
-
for (const z of i.keys) {
|
|
1239
|
-
const E = w[z]._zod.run({ value: h[z], issues: [] }, p);
|
|
1240
|
-
E instanceof Promise ? f.push(E.then((se) => te(se, s, z, h))) : te(E, s, z, h);
|
|
1241
|
-
}
|
|
1242
|
-
return c ? lt(f, h, s, p, o.value, e) : f.length ? Promise.all(f).then(() => s) : s;
|
|
1243
|
-
};
|
|
1244
|
-
}), go = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
|
|
1245
|
-
vo.init(e, t);
|
|
1246
|
-
const n = e._zod.parse, o = ie(() => st(t)), r = /* @__PURE__ */ a((z) => {
|
|
1247
|
-
const $ = new pe(["shape", "payload", "ctx"]), E = o.value, se = /* @__PURE__ */ a((P) => {
|
|
1248
|
-
const O = Ee(P);
|
|
1249
|
-
return `shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`;
|
|
1250
|
-
}, "parseStr");
|
|
1251
|
-
$.write("const input = payload.value;");
|
|
1252
|
-
const Ie = /* @__PURE__ */ Object.create(null);
|
|
1253
|
-
let Zt = 0;
|
|
1254
|
-
for (const P of E.keys)
|
|
1255
|
-
Ie[P] = `key_${Zt++}`;
|
|
1256
|
-
$.write("const newResult = {};");
|
|
1257
|
-
for (const P of E.keys) {
|
|
1258
|
-
const O = Ie[P], M = Ee(P);
|
|
1259
|
-
$.write(`const ${O} = ${se(P)};`), $.write(`
|
|
1260
|
-
if (${O}.issues.length) {
|
|
1261
|
-
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
1262
|
-
...iss,
|
|
1263
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
1264
|
-
})));
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
if (${O}.value === undefined) {
|
|
1269
|
-
if (${M} in input) {
|
|
1270
|
-
newResult[${M}] = undefined;
|
|
1271
|
-
}
|
|
1272
|
-
} else {
|
|
1273
|
-
newResult[${M}] = ${O}.value;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
`);
|
|
1277
|
-
}
|
|
1278
|
-
$.write("payload.value = newResult;"), $.write("return payload;");
|
|
1279
|
-
const $t = $.compile();
|
|
1280
|
-
return (P, O) => $t(z, P, O);
|
|
1281
|
-
}, "generateFastpass");
|
|
1282
|
-
let c;
|
|
1283
|
-
const i = V, s = !Ke.jitless, h = s && Et.value, f = t.catchall;
|
|
1284
|
-
let w;
|
|
1285
|
-
e._zod.parse = (z, $) => {
|
|
1286
|
-
w ?? (w = o.value);
|
|
1287
|
-
const E = z.value;
|
|
1288
|
-
return i(E) ? s && h && $?.async === !1 && $.jitless !== !0 ? (c || (c = r(t.shape)), z = c(z, $), f ? lt([], E, z, $, w, e) : z) : n(z, $) : (z.issues.push({
|
|
1289
|
-
expected: "object",
|
|
1290
|
-
code: "invalid_type",
|
|
1291
|
-
input: E,
|
|
1292
|
-
inst: e
|
|
1293
|
-
}), z);
|
|
1294
|
-
};
|
|
1295
|
-
});
|
|
1296
|
-
function Pe(e, t, n, o) {
|
|
1297
|
-
for (const c of e)
|
|
1298
|
-
if (c.issues.length === 0)
|
|
1299
|
-
return t.value = c.value, t;
|
|
1300
|
-
const r = e.filter((c) => !U(c));
|
|
1301
|
-
return r.length === 1 ? (t.value = r[0].value, r[0]) : (t.issues.push({
|
|
1302
|
-
code: "invalid_union",
|
|
1303
|
-
input: t.value,
|
|
1304
|
-
inst: n,
|
|
1305
|
-
errors: e.map((c) => c.issues.map((i) => C(i, o, D())))
|
|
1306
|
-
}), t);
|
|
1307
|
-
}
|
|
1308
|
-
a(Pe, "handleUnionResults");
|
|
1309
|
-
const pt = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
|
|
1310
|
-
_.init(e, t), m(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), m(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), m(e._zod, "values", () => {
|
|
1311
|
-
if (t.options.every((r) => r._zod.values))
|
|
1312
|
-
return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
|
|
1313
|
-
}), m(e._zod, "pattern", () => {
|
|
1314
|
-
if (t.options.every((r) => r._zod.pattern)) {
|
|
1315
|
-
const r = t.options.map((c) => c._zod.pattern);
|
|
1316
|
-
return new RegExp(`^(${r.map((c) => ve(c.source)).join("|")})$`);
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
const n = t.options.length === 1, o = t.options[0]._zod.run;
|
|
1320
|
-
e._zod.parse = (r, c) => {
|
|
1321
|
-
if (n)
|
|
1322
|
-
return o(r, c);
|
|
1323
|
-
let i = !1;
|
|
1324
|
-
const s = [];
|
|
1325
|
-
for (const p of t.options) {
|
|
1326
|
-
const h = p._zod.run({
|
|
1327
|
-
value: r.value,
|
|
1328
|
-
issues: []
|
|
1329
|
-
}, c);
|
|
1330
|
-
if (h instanceof Promise)
|
|
1331
|
-
s.push(h), i = !0;
|
|
1332
|
-
else {
|
|
1333
|
-
if (h.issues.length === 0)
|
|
1334
|
-
return h;
|
|
1335
|
-
s.push(h);
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
return i ? Promise.all(s).then((p) => Pe(p, r, e, c)) : Pe(s, r, e, c);
|
|
1339
|
-
};
|
|
1340
|
-
}), bo = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (e, t) => {
|
|
1341
|
-
pt.init(e, t);
|
|
1342
|
-
const n = e._zod.parse;
|
|
1343
|
-
m(e._zod, "propValues", () => {
|
|
1344
|
-
const r = {};
|
|
1345
|
-
for (const c of t.options) {
|
|
1346
|
-
const i = c._zod.propValues;
|
|
1347
|
-
if (!i || Object.keys(i).length === 0)
|
|
1348
|
-
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);
|
|
1349
|
-
for (const [s, p] of Object.entries(i)) {
|
|
1350
|
-
r[s] || (r[s] = /* @__PURE__ */ new Set());
|
|
1351
|
-
for (const h of p)
|
|
1352
|
-
r[s].add(h);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
return r;
|
|
1356
|
-
});
|
|
1357
|
-
const o = ie(() => {
|
|
1358
|
-
const r = t.options, c = /* @__PURE__ */ new Map();
|
|
1359
|
-
for (const i of r) {
|
|
1360
|
-
const s = i._zod.propValues?.[t.discriminator];
|
|
1361
|
-
if (!s || s.size === 0)
|
|
1362
|
-
throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);
|
|
1363
|
-
for (const p of s) {
|
|
1364
|
-
if (c.has(p))
|
|
1365
|
-
throw new Error(`Duplicate discriminator value "${String(p)}"`);
|
|
1366
|
-
c.set(p, i);
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
return c;
|
|
1370
|
-
});
|
|
1371
|
-
e._zod.parse = (r, c) => {
|
|
1372
|
-
const i = r.value;
|
|
1373
|
-
if (!V(i))
|
|
1374
|
-
return r.issues.push({
|
|
1375
|
-
code: "invalid_type",
|
|
1376
|
-
expected: "object",
|
|
1377
|
-
input: i,
|
|
1378
|
-
inst: e
|
|
1379
|
-
}), r;
|
|
1380
|
-
const s = o.value.get(i?.[t.discriminator]);
|
|
1381
|
-
return s ? s._zod.run(r, c) : t.unionFallback ? n(r, c) : (r.issues.push({
|
|
1382
|
-
code: "invalid_union",
|
|
1383
|
-
errors: [],
|
|
1384
|
-
note: "No matching discriminator",
|
|
1385
|
-
discriminator: t.discriminator,
|
|
1386
|
-
input: i,
|
|
1387
|
-
path: [t.discriminator],
|
|
1388
|
-
inst: e
|
|
1389
|
-
}), r);
|
|
1390
|
-
};
|
|
1391
|
-
}), zo = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
|
|
1392
|
-
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1393
|
-
const r = n.value, c = t.left._zod.run({ value: r, issues: [] }, o), i = t.right._zod.run({ value: r, issues: [] }, o);
|
|
1394
|
-
return c instanceof Promise || i instanceof Promise ? Promise.all([c, i]).then(([p, h]) => Te(n, p, h)) : Te(n, c, i);
|
|
1395
|
-
};
|
|
1396
|
-
});
|
|
1397
|
-
function de(e, t) {
|
|
1398
|
-
if (e === t)
|
|
1399
|
-
return { valid: !0, data: e };
|
|
1400
|
-
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
1401
|
-
return { valid: !0, data: e };
|
|
1402
|
-
if (B(e) && B(t)) {
|
|
1403
|
-
const n = Object.keys(t), o = Object.keys(e).filter((c) => n.indexOf(c) !== -1), r = { ...e, ...t };
|
|
1404
|
-
for (const c of o) {
|
|
1405
|
-
const i = de(e[c], t[c]);
|
|
1406
|
-
if (!i.valid)
|
|
1407
|
-
return {
|
|
1408
|
-
valid: !1,
|
|
1409
|
-
mergeErrorPath: [c, ...i.mergeErrorPath]
|
|
1410
|
-
};
|
|
1411
|
-
r[c] = i.data;
|
|
1412
|
-
}
|
|
1413
|
-
return { valid: !0, data: r };
|
|
1414
|
-
}
|
|
1415
|
-
if (Array.isArray(e) && Array.isArray(t)) {
|
|
1416
|
-
if (e.length !== t.length)
|
|
1417
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
1418
|
-
const n = [];
|
|
1419
|
-
for (let o = 0; o < e.length; o++) {
|
|
1420
|
-
const r = e[o], c = t[o], i = de(r, c);
|
|
1421
|
-
if (!i.valid)
|
|
1422
|
-
return {
|
|
1423
|
-
valid: !1,
|
|
1424
|
-
mergeErrorPath: [o, ...i.mergeErrorPath]
|
|
1425
|
-
};
|
|
1426
|
-
n.push(i.data);
|
|
1427
|
-
}
|
|
1428
|
-
return { valid: !0, data: n };
|
|
1429
|
-
}
|
|
1430
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
1431
|
-
}
|
|
1432
|
-
a(de, "mergeValues");
|
|
1433
|
-
function Te(e, t, n) {
|
|
1434
|
-
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), U(e))
|
|
1435
|
-
return e;
|
|
1436
|
-
const o = de(t.value, n.value);
|
|
1437
|
-
if (!o.valid)
|
|
1438
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
|
|
1439
|
-
return e.value = o.data, e;
|
|
1440
|
-
}
|
|
1441
|
-
a(Te, "handleIntersectionResults");
|
|
1442
|
-
const wo = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
|
|
1443
|
-
_.init(e, t);
|
|
1444
|
-
const n = It(t.entries), o = new Set(n);
|
|
1445
|
-
e._zod.values = o, e._zod.pattern = new RegExp(`^(${n.filter((r) => St.has(typeof r)).map((r) => typeof r == "string" ? L(r) : r.toString()).join("|")})$`), e._zod.parse = (r, c) => {
|
|
1446
|
-
const i = r.value;
|
|
1447
|
-
return o.has(i) || r.issues.push({
|
|
1448
|
-
code: "invalid_value",
|
|
1449
|
-
values: n,
|
|
1450
|
-
input: i,
|
|
1451
|
-
inst: e
|
|
1452
|
-
}), r;
|
|
1453
|
-
};
|
|
1454
|
-
}), ko = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
|
|
1455
|
-
if (_.init(e, t), t.values.length === 0)
|
|
1456
|
-
throw new Error("Cannot create literal schema with no valid values");
|
|
1457
|
-
e._zod.values = new Set(t.values), e._zod.pattern = new RegExp(`^(${t.values.map((n) => typeof n == "string" ? L(n) : n ? L(n.toString()) : String(n)).join("|")})$`), e._zod.parse = (n, o) => {
|
|
1458
|
-
const r = n.value;
|
|
1459
|
-
return e._zod.values.has(r) || n.issues.push({
|
|
1460
|
-
code: "invalid_value",
|
|
1461
|
-
values: t.values,
|
|
1462
|
-
input: r,
|
|
1463
|
-
inst: e
|
|
1464
|
-
}), n;
|
|
1465
|
-
};
|
|
1466
|
-
}), Zo = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
|
|
1467
|
-
_.init(e, t), e._zod.parse = (n, o) => {
|
|
1468
|
-
if (o.direction === "backward")
|
|
1469
|
-
throw new ee(e.constructor.name);
|
|
1470
|
-
const r = t.transform(n.value, n);
|
|
1471
|
-
if (o.async)
|
|
1472
|
-
return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (n.value = i, n));
|
|
1473
|
-
if (r instanceof Promise)
|
|
1474
|
-
throw new T();
|
|
1475
|
-
return n.value = r, n;
|
|
1476
|
-
};
|
|
1477
|
-
});
|
|
1478
|
-
function xe(e, t) {
|
|
1479
|
-
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1480
|
-
}
|
|
1481
|
-
a(xe, "handleOptionalResult");
|
|
1482
|
-
const $o = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
|
|
1483
|
-
_.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), m(e._zod, "pattern", () => {
|
|
1484
|
-
const n = t.innerType._zod.pattern;
|
|
1485
|
-
return n ? new RegExp(`^(${ve(n.source)})?$`) : void 0;
|
|
1486
|
-
}), e._zod.parse = (n, o) => {
|
|
1487
|
-
if (t.innerType._zod.optin === "optional") {
|
|
1488
|
-
const r = t.innerType._zod.run(n, o);
|
|
1489
|
-
return r instanceof Promise ? r.then((c) => xe(c, n.value)) : xe(r, n.value);
|
|
1490
|
-
}
|
|
1491
|
-
return n.value === void 0 ? n : t.innerType._zod.run(n, o);
|
|
1492
|
-
};
|
|
1493
|
-
}), yo = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
|
|
1494
|
-
_.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "pattern", () => {
|
|
1495
|
-
const n = t.innerType._zod.pattern;
|
|
1496
|
-
return n ? new RegExp(`^(${ve(n.source)}|null)$`) : void 0;
|
|
1497
|
-
}), m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, o) => n.value === null ? n : t.innerType._zod.run(n, o);
|
|
1498
|
-
}), Io = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
|
|
1499
|
-
_.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1500
|
-
if (o.direction === "backward")
|
|
1501
|
-
return t.innerType._zod.run(n, o);
|
|
1502
|
-
if (n.value === void 0)
|
|
1503
|
-
return n.value = t.defaultValue, n;
|
|
1504
|
-
const r = t.innerType._zod.run(n, o);
|
|
1505
|
-
return r instanceof Promise ? r.then((c) => Ne(c, t)) : Ne(r, t);
|
|
1506
|
-
};
|
|
1507
|
-
});
|
|
1508
|
-
function Ne(e, t) {
|
|
1509
|
-
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1510
|
-
}
|
|
1511
|
-
a(Ne, "handleDefaultResult");
|
|
1512
|
-
const Ao = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
|
|
1513
|
-
_.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => (o.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, o));
|
|
1514
|
-
}), Eo = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
|
|
1515
|
-
_.init(e, t), m(e._zod, "values", () => {
|
|
1516
|
-
const n = t.innerType._zod.values;
|
|
1517
|
-
return n ? new Set([...n].filter((o) => o !== void 0)) : void 0;
|
|
1518
|
-
}), e._zod.parse = (n, o) => {
|
|
1519
|
-
const r = t.innerType._zod.run(n, o);
|
|
1520
|
-
return r instanceof Promise ? r.then((c) => je(c, e)) : je(r, e);
|
|
1521
|
-
};
|
|
1522
|
-
});
|
|
1523
|
-
function je(e, t) {
|
|
1524
|
-
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1525
|
-
code: "invalid_type",
|
|
1526
|
-
expected: "nonoptional",
|
|
1527
|
-
input: e.value,
|
|
1528
|
-
inst: t
|
|
1529
|
-
}), e;
|
|
1530
|
-
}
|
|
1531
|
-
a(je, "handleNonOptionalResult");
|
|
1532
|
-
const So = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
|
|
1533
|
-
_.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, o) => {
|
|
1534
|
-
if (o.direction === "backward")
|
|
1535
|
-
return t.innerType._zod.run(n, o);
|
|
1536
|
-
const r = t.innerType._zod.run(n, o);
|
|
1537
|
-
return r instanceof Promise ? r.then((c) => (n.value = c.value, c.issues.length && (n.value = t.catchValue({
|
|
1538
|
-
...n,
|
|
1539
|
-
error: {
|
|
1540
|
-
issues: c.issues.map((i) => C(i, o, D()))
|
|
1541
|
-
},
|
|
1542
|
-
input: n.value
|
|
1543
|
-
}), n.issues = []), n)) : (n.value = r.value, r.issues.length && (n.value = t.catchValue({
|
|
1544
|
-
...n,
|
|
1545
|
-
error: {
|
|
1546
|
-
issues: r.issues.map((c) => C(c, o, D()))
|
|
1547
|
-
},
|
|
1548
|
-
input: n.value
|
|
1549
|
-
}), n.issues = []), n);
|
|
1550
|
-
};
|
|
1551
|
-
}), Oo = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
|
|
1552
|
-
_.init(e, t), m(e._zod, "values", () => t.in._zod.values), m(e._zod, "optin", () => t.in._zod.optin), m(e._zod, "optout", () => t.out._zod.optout), m(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, o) => {
|
|
1553
|
-
if (o.direction === "backward") {
|
|
1554
|
-
const c = t.out._zod.run(n, o);
|
|
1555
|
-
return c instanceof Promise ? c.then((i) => Y(i, t.in, o)) : Y(c, t.in, o);
|
|
1556
|
-
}
|
|
1557
|
-
const r = t.in._zod.run(n, o);
|
|
1558
|
-
return r instanceof Promise ? r.then((c) => Y(c, t.out, o)) : Y(r, t.out, o);
|
|
1559
|
-
};
|
|
1560
|
-
});
|
|
1561
|
-
function Y(e, t, n) {
|
|
1562
|
-
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1563
|
-
}
|
|
1564
|
-
a(Y, "handlePipeResult");
|
|
1565
|
-
const Po = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
|
|
1566
|
-
_.init(e, t), m(e._zod, "propValues", () => t.innerType._zod.propValues), m(e._zod, "values", () => t.innerType._zod.values), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, o) => {
|
|
1567
|
-
if (o.direction === "backward")
|
|
1568
|
-
return t.innerType._zod.run(n, o);
|
|
1569
|
-
const r = t.innerType._zod.run(n, o);
|
|
1570
|
-
return r instanceof Promise ? r.then(De) : De(r);
|
|
1571
|
-
};
|
|
1572
|
-
});
|
|
1573
|
-
function De(e) {
|
|
1574
|
-
return e.value = Object.freeze(e.value), e;
|
|
1575
|
-
}
|
|
1576
|
-
a(De, "handleReadonlyResult");
|
|
1577
|
-
const To = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
|
|
1578
|
-
A.init(e, t), _.init(e, t), e._zod.parse = (n, o) => n, e._zod.check = (n) => {
|
|
1579
|
-
const o = n.value, r = t.fn(o);
|
|
1580
|
-
if (r instanceof Promise)
|
|
1581
|
-
return r.then((c) => Ce(c, n, o, e));
|
|
1582
|
-
Ce(r, n, o, e);
|
|
1583
|
-
};
|
|
1584
|
-
});
|
|
1585
|
-
function Ce(e, t, n, o) {
|
|
1586
|
-
if (!e) {
|
|
1587
|
-
const r = {
|
|
1588
|
-
code: "custom",
|
|
1589
|
-
input: n,
|
|
1590
|
-
inst: o,
|
|
1591
|
-
// incorporates params.error into issue reporting
|
|
1592
|
-
path: [...o._zod.def.path ?? []],
|
|
1593
|
-
// incorporates params.error into issue reporting
|
|
1594
|
-
continue: !o._zod.def.abort
|
|
1595
|
-
// params: inst._zod.def.params,
|
|
1596
|
-
};
|
|
1597
|
-
o._zod.def.params && (r.params = o._zod.def.params), t.issues.push(W(r));
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
a(Ce, "handleRefineResult");
|
|
1601
|
-
const ye = class ye {
|
|
1602
|
-
constructor() {
|
|
1603
|
-
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1604
|
-
}
|
|
1605
|
-
add(t, ...n) {
|
|
1606
|
-
const o = n[0];
|
|
1607
|
-
if (this._map.set(t, o), o && typeof o == "object" && "id" in o) {
|
|
1608
|
-
if (this._idmap.has(o.id))
|
|
1609
|
-
throw new Error(`ID ${o.id} already exists in the registry`);
|
|
1610
|
-
this._idmap.set(o.id, t);
|
|
1611
|
-
}
|
|
1612
|
-
return this;
|
|
1613
|
-
}
|
|
1614
|
-
clear() {
|
|
1615
|
-
return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
|
|
1616
|
-
}
|
|
1617
|
-
remove(t) {
|
|
1618
|
-
const n = this._map.get(t);
|
|
1619
|
-
return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
|
|
1620
|
-
}
|
|
1621
|
-
get(t) {
|
|
1622
|
-
const n = t._zod.parent;
|
|
1623
|
-
if (n) {
|
|
1624
|
-
const o = { ...this.get(n) ?? {} };
|
|
1625
|
-
delete o.id;
|
|
1626
|
-
const r = { ...o, ...this._map.get(t) };
|
|
1627
|
-
return Object.keys(r).length ? r : void 0;
|
|
1628
|
-
}
|
|
1629
|
-
return this._map.get(t);
|
|
1630
|
-
}
|
|
1631
|
-
has(t) {
|
|
1632
|
-
return this._map.has(t);
|
|
1633
|
-
}
|
|
1634
|
-
};
|
|
1635
|
-
a(ye, "$ZodRegistry");
|
|
1636
|
-
let he = ye;
|
|
1637
|
-
function xo() {
|
|
1638
|
-
return new he();
|
|
1639
|
-
}
|
|
1640
|
-
a(xo, "registry");
|
|
1641
|
-
const X = /* @__PURE__ */ xo();
|
|
1642
|
-
function No(e, t) {
|
|
1643
|
-
return new e({
|
|
1644
|
-
type: "string",
|
|
1645
|
-
...d(t)
|
|
1646
|
-
});
|
|
1647
|
-
}
|
|
1648
|
-
a(No, "_string");
|
|
1649
|
-
function jo(e, t) {
|
|
1650
|
-
return new e({
|
|
1651
|
-
type: "string",
|
|
1652
|
-
format: "email",
|
|
1653
|
-
check: "string_format",
|
|
1654
|
-
abort: !1,
|
|
1655
|
-
...d(t)
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
a(jo, "_email");
|
|
1659
|
-
function Fe(e, t) {
|
|
1660
|
-
return new e({
|
|
1661
|
-
type: "string",
|
|
1662
|
-
format: "guid",
|
|
1663
|
-
check: "string_format",
|
|
1664
|
-
abort: !1,
|
|
1665
|
-
...d(t)
|
|
1666
|
-
});
|
|
1667
|
-
}
|
|
1668
|
-
a(Fe, "_guid");
|
|
1669
|
-
function Do(e, t) {
|
|
1670
|
-
return new e({
|
|
1671
|
-
type: "string",
|
|
1672
|
-
format: "uuid",
|
|
1673
|
-
check: "string_format",
|
|
1674
|
-
abort: !1,
|
|
1675
|
-
...d(t)
|
|
1676
|
-
});
|
|
1677
|
-
}
|
|
1678
|
-
a(Do, "_uuid");
|
|
1679
|
-
function Co(e, t) {
|
|
1680
|
-
return new e({
|
|
1681
|
-
type: "string",
|
|
1682
|
-
format: "uuid",
|
|
1683
|
-
check: "string_format",
|
|
1684
|
-
abort: !1,
|
|
1685
|
-
version: "v4",
|
|
1686
|
-
...d(t)
|
|
1687
|
-
});
|
|
1688
|
-
}
|
|
1689
|
-
a(Co, "_uuidv4");
|
|
1690
|
-
function Fo(e, t) {
|
|
1691
|
-
return new e({
|
|
1692
|
-
type: "string",
|
|
1693
|
-
format: "uuid",
|
|
1694
|
-
check: "string_format",
|
|
1695
|
-
abort: !1,
|
|
1696
|
-
version: "v6",
|
|
1697
|
-
...d(t)
|
|
1698
|
-
});
|
|
1699
|
-
}
|
|
1700
|
-
a(Fo, "_uuidv6");
|
|
1701
|
-
function Ro(e, t) {
|
|
1702
|
-
return new e({
|
|
1703
|
-
type: "string",
|
|
1704
|
-
format: "uuid",
|
|
1705
|
-
check: "string_format",
|
|
1706
|
-
abort: !1,
|
|
1707
|
-
version: "v7",
|
|
1708
|
-
...d(t)
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
a(Ro, "_uuidv7");
|
|
1712
|
-
function Uo(e, t) {
|
|
1713
|
-
return new e({
|
|
1714
|
-
type: "string",
|
|
1715
|
-
format: "url",
|
|
1716
|
-
check: "string_format",
|
|
1717
|
-
abort: !1,
|
|
1718
|
-
...d(t)
|
|
1719
|
-
});
|
|
1720
|
-
}
|
|
1721
|
-
a(Uo, "_url");
|
|
1722
|
-
function Lo(e, t) {
|
|
1723
|
-
return new e({
|
|
1724
|
-
type: "string",
|
|
1725
|
-
format: "emoji",
|
|
1726
|
-
check: "string_format",
|
|
1727
|
-
abort: !1,
|
|
1728
|
-
...d(t)
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1731
|
-
a(Lo, "_emoji");
|
|
1732
|
-
function Mo(e, t) {
|
|
1733
|
-
return new e({
|
|
1734
|
-
type: "string",
|
|
1735
|
-
format: "nanoid",
|
|
1736
|
-
check: "string_format",
|
|
1737
|
-
abort: !1,
|
|
1738
|
-
...d(t)
|
|
1739
|
-
});
|
|
1740
|
-
}
|
|
1741
|
-
a(Mo, "_nanoid");
|
|
1742
|
-
function Vo(e, t) {
|
|
1743
|
-
return new e({
|
|
1744
|
-
type: "string",
|
|
1745
|
-
format: "cuid",
|
|
1746
|
-
check: "string_format",
|
|
1747
|
-
abort: !1,
|
|
1748
|
-
...d(t)
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
|
-
a(Vo, "_cuid");
|
|
1752
|
-
function Bo(e, t) {
|
|
1753
|
-
return new e({
|
|
1754
|
-
type: "string",
|
|
1755
|
-
format: "cuid2",
|
|
1756
|
-
check: "string_format",
|
|
1757
|
-
abort: !1,
|
|
1758
|
-
...d(t)
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
a(Bo, "_cuid2");
|
|
1762
|
-
function Wo(e, t) {
|
|
1763
|
-
return new e({
|
|
1764
|
-
type: "string",
|
|
1765
|
-
format: "ulid",
|
|
1766
|
-
check: "string_format",
|
|
1767
|
-
abort: !1,
|
|
1768
|
-
...d(t)
|
|
1769
|
-
});
|
|
1770
|
-
}
|
|
1771
|
-
a(Wo, "_ulid");
|
|
1772
|
-
function Go(e, t) {
|
|
1773
|
-
return new e({
|
|
1774
|
-
type: "string",
|
|
1775
|
-
format: "xid",
|
|
1776
|
-
check: "string_format",
|
|
1777
|
-
abort: !1,
|
|
1778
|
-
...d(t)
|
|
1779
|
-
});
|
|
1780
|
-
}
|
|
1781
|
-
a(Go, "_xid");
|
|
1782
|
-
function Jo(e, t) {
|
|
1783
|
-
return new e({
|
|
1784
|
-
type: "string",
|
|
1785
|
-
format: "ksuid",
|
|
1786
|
-
check: "string_format",
|
|
1787
|
-
abort: !1,
|
|
1788
|
-
...d(t)
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
a(Jo, "_ksuid");
|
|
1792
|
-
function Ko(e, t) {
|
|
1793
|
-
return new e({
|
|
1794
|
-
type: "string",
|
|
1795
|
-
format: "ipv4",
|
|
1796
|
-
check: "string_format",
|
|
1797
|
-
abort: !1,
|
|
1798
|
-
...d(t)
|
|
1799
|
-
});
|
|
1800
|
-
}
|
|
1801
|
-
a(Ko, "_ipv4");
|
|
1802
|
-
function Yo(e, t) {
|
|
1803
|
-
return new e({
|
|
1804
|
-
type: "string",
|
|
1805
|
-
format: "ipv6",
|
|
1806
|
-
check: "string_format",
|
|
1807
|
-
abort: !1,
|
|
1808
|
-
...d(t)
|
|
1809
|
-
});
|
|
1810
|
-
}
|
|
1811
|
-
a(Yo, "_ipv6");
|
|
1812
|
-
function Xo(e, t) {
|
|
1813
|
-
return new e({
|
|
1814
|
-
type: "string",
|
|
1815
|
-
format: "cidrv4",
|
|
1816
|
-
check: "string_format",
|
|
1817
|
-
abort: !1,
|
|
1818
|
-
...d(t)
|
|
1819
|
-
});
|
|
1820
|
-
}
|
|
1821
|
-
a(Xo, "_cidrv4");
|
|
1822
|
-
function qo(e, t) {
|
|
1823
|
-
return new e({
|
|
1824
|
-
type: "string",
|
|
1825
|
-
format: "cidrv6",
|
|
1826
|
-
check: "string_format",
|
|
1827
|
-
abort: !1,
|
|
1828
|
-
...d(t)
|
|
1829
|
-
});
|
|
1830
|
-
}
|
|
1831
|
-
a(qo, "_cidrv6");
|
|
1832
|
-
function Ho(e, t) {
|
|
1833
|
-
return new e({
|
|
1834
|
-
type: "string",
|
|
1835
|
-
format: "base64",
|
|
1836
|
-
check: "string_format",
|
|
1837
|
-
abort: !1,
|
|
1838
|
-
...d(t)
|
|
1839
|
-
});
|
|
1840
|
-
}
|
|
1841
|
-
a(Ho, "_base64");
|
|
1842
|
-
function Qo(e, t) {
|
|
1843
|
-
return new e({
|
|
1844
|
-
type: "string",
|
|
1845
|
-
format: "base64url",
|
|
1846
|
-
check: "string_format",
|
|
1847
|
-
abort: !1,
|
|
1848
|
-
...d(t)
|
|
1849
|
-
});
|
|
1850
|
-
}
|
|
1851
|
-
a(Qo, "_base64url");
|
|
1852
|
-
function er(e, t) {
|
|
1853
|
-
return new e({
|
|
1854
|
-
type: "string",
|
|
1855
|
-
format: "e164",
|
|
1856
|
-
check: "string_format",
|
|
1857
|
-
abort: !1,
|
|
1858
|
-
...d(t)
|
|
1859
|
-
});
|
|
1860
|
-
}
|
|
1861
|
-
a(er, "_e164");
|
|
1862
|
-
function tr(e, t) {
|
|
1863
|
-
return new e({
|
|
1864
|
-
type: "string",
|
|
1865
|
-
format: "jwt",
|
|
1866
|
-
check: "string_format",
|
|
1867
|
-
abort: !1,
|
|
1868
|
-
...d(t)
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
a(tr, "_jwt");
|
|
1872
|
-
function nr(e, t) {
|
|
1873
|
-
return new e({
|
|
1874
|
-
type: "string",
|
|
1875
|
-
format: "datetime",
|
|
1876
|
-
check: "string_format",
|
|
1877
|
-
offset: !1,
|
|
1878
|
-
local: !1,
|
|
1879
|
-
precision: null,
|
|
1880
|
-
...d(t)
|
|
1881
|
-
});
|
|
1882
|
-
}
|
|
1883
|
-
a(nr, "_isoDateTime");
|
|
1884
|
-
function or(e, t) {
|
|
1885
|
-
return new e({
|
|
1886
|
-
type: "string",
|
|
1887
|
-
format: "date",
|
|
1888
|
-
check: "string_format",
|
|
1889
|
-
...d(t)
|
|
1890
|
-
});
|
|
1891
|
-
}
|
|
1892
|
-
a(or, "_isoDate");
|
|
1893
|
-
function rr(e, t) {
|
|
1894
|
-
return new e({
|
|
1895
|
-
type: "string",
|
|
1896
|
-
format: "time",
|
|
1897
|
-
check: "string_format",
|
|
1898
|
-
precision: null,
|
|
1899
|
-
...d(t)
|
|
1900
|
-
});
|
|
1901
|
-
}
|
|
1902
|
-
a(rr, "_isoTime");
|
|
1903
|
-
function ir(e, t) {
|
|
1904
|
-
return new e({
|
|
1905
|
-
type: "string",
|
|
1906
|
-
format: "duration",
|
|
1907
|
-
check: "string_format",
|
|
1908
|
-
...d(t)
|
|
1909
|
-
});
|
|
1910
|
-
}
|
|
1911
|
-
a(ir, "_isoDuration");
|
|
1912
|
-
function cr(e, t) {
|
|
1913
|
-
return new e({
|
|
1914
|
-
type: "number",
|
|
1915
|
-
checks: [],
|
|
1916
|
-
...d(t)
|
|
1917
|
-
});
|
|
1918
|
-
}
|
|
1919
|
-
a(cr, "_number");
|
|
1920
|
-
function ar(e, t) {
|
|
1921
|
-
return new e({
|
|
1922
|
-
type: "number",
|
|
1923
|
-
check: "number_format",
|
|
1924
|
-
abort: !1,
|
|
1925
|
-
format: "safeint",
|
|
1926
|
-
...d(t)
|
|
1927
|
-
});
|
|
1928
|
-
}
|
|
1929
|
-
a(ar, "_int");
|
|
1930
|
-
function ur(e, t) {
|
|
1931
|
-
return new e({
|
|
1932
|
-
type: "boolean",
|
|
1933
|
-
...d(t)
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1936
|
-
a(ur, "_boolean");
|
|
1937
|
-
function sr(e) {
|
|
1938
|
-
return new e({
|
|
1939
|
-
type: "any"
|
|
1940
|
-
});
|
|
1941
|
-
}
|
|
1942
|
-
a(sr, "_any");
|
|
1943
|
-
function lr(e) {
|
|
1944
|
-
return new e({
|
|
1945
|
-
type: "unknown"
|
|
1946
|
-
});
|
|
1947
|
-
}
|
|
1948
|
-
a(lr, "_unknown");
|
|
1949
|
-
function pr(e, t) {
|
|
1950
|
-
return new e({
|
|
1951
|
-
type: "never",
|
|
1952
|
-
...d(t)
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
a(pr, "_never");
|
|
1956
|
-
function dr(e, t) {
|
|
1957
|
-
return new e({
|
|
1958
|
-
type: "date",
|
|
1959
|
-
...d(t)
|
|
1960
|
-
});
|
|
1961
|
-
}
|
|
1962
|
-
a(dr, "_date");
|
|
1963
|
-
function Re(e, t) {
|
|
1964
|
-
return new it({
|
|
1965
|
-
check: "less_than",
|
|
1966
|
-
...d(t),
|
|
1967
|
-
value: e,
|
|
1968
|
-
inclusive: !1
|
|
1969
|
-
});
|
|
1970
|
-
}
|
|
1971
|
-
a(Re, "_lt");
|
|
1972
|
-
function H(e, t) {
|
|
1973
|
-
return new it({
|
|
1974
|
-
check: "less_than",
|
|
1975
|
-
...d(t),
|
|
1976
|
-
value: e,
|
|
1977
|
-
inclusive: !0
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
a(H, "_lte");
|
|
1981
|
-
function Ue(e, t) {
|
|
1982
|
-
return new ct({
|
|
1983
|
-
check: "greater_than",
|
|
1984
|
-
...d(t),
|
|
1985
|
-
value: e,
|
|
1986
|
-
inclusive: !1
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
a(Ue, "_gt");
|
|
1990
|
-
function Q(e, t) {
|
|
1991
|
-
return new ct({
|
|
1992
|
-
check: "greater_than",
|
|
1993
|
-
...d(t),
|
|
1994
|
-
value: e,
|
|
1995
|
-
inclusive: !0
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
1998
|
-
a(Q, "_gte");
|
|
1999
|
-
function Le(e, t) {
|
|
2000
|
-
return new yn({
|
|
2001
|
-
check: "multiple_of",
|
|
2002
|
-
...d(t),
|
|
2003
|
-
value: e
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
a(Le, "_multipleOf");
|
|
2007
|
-
function dt(e, t) {
|
|
2008
|
-
return new An({
|
|
2009
|
-
check: "max_length",
|
|
2010
|
-
...d(t),
|
|
2011
|
-
maximum: e
|
|
2012
|
-
});
|
|
2013
|
-
}
|
|
2014
|
-
a(dt, "_maxLength");
|
|
2015
|
-
function ne(e, t) {
|
|
2016
|
-
return new En({
|
|
2017
|
-
check: "min_length",
|
|
2018
|
-
...d(t),
|
|
2019
|
-
minimum: e
|
|
2020
|
-
});
|
|
2021
|
-
}
|
|
2022
|
-
a(ne, "_minLength");
|
|
2023
|
-
function ht(e, t) {
|
|
2024
|
-
return new Sn({
|
|
2025
|
-
check: "length_equals",
|
|
2026
|
-
...d(t),
|
|
2027
|
-
length: e
|
|
2028
|
-
});
|
|
2029
|
-
}
|
|
2030
|
-
a(ht, "_length");
|
|
2031
|
-
function hr(e, t) {
|
|
2032
|
-
return new On({
|
|
2033
|
-
check: "string_format",
|
|
2034
|
-
format: "regex",
|
|
2035
|
-
...d(t),
|
|
2036
|
-
pattern: e
|
|
2037
|
-
});
|
|
2038
|
-
}
|
|
2039
|
-
a(hr, "_regex");
|
|
2040
|
-
function fr(e) {
|
|
2041
|
-
return new Pn({
|
|
2042
|
-
check: "string_format",
|
|
2043
|
-
format: "lowercase",
|
|
2044
|
-
...d(e)
|
|
2045
|
-
});
|
|
2046
|
-
}
|
|
2047
|
-
a(fr, "_lowercase");
|
|
2048
|
-
function mr(e) {
|
|
2049
|
-
return new Tn({
|
|
2050
|
-
check: "string_format",
|
|
2051
|
-
format: "uppercase",
|
|
2052
|
-
...d(e)
|
|
2053
|
-
});
|
|
2054
|
-
}
|
|
2055
|
-
a(mr, "_uppercase");
|
|
2056
|
-
function _r(e, t) {
|
|
2057
|
-
return new xn({
|
|
2058
|
-
check: "string_format",
|
|
2059
|
-
format: "includes",
|
|
2060
|
-
...d(t),
|
|
2061
|
-
includes: e
|
|
2062
|
-
});
|
|
2063
|
-
}
|
|
2064
|
-
a(_r, "_includes");
|
|
2065
|
-
function vr(e, t) {
|
|
2066
|
-
return new Nn({
|
|
2067
|
-
check: "string_format",
|
|
2068
|
-
format: "starts_with",
|
|
2069
|
-
...d(t),
|
|
2070
|
-
prefix: e
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
a(vr, "_startsWith");
|
|
2074
|
-
function gr(e, t) {
|
|
2075
|
-
return new jn({
|
|
2076
|
-
check: "string_format",
|
|
2077
|
-
format: "ends_with",
|
|
2078
|
-
...d(t),
|
|
2079
|
-
suffix: e
|
|
2080
|
-
});
|
|
2081
|
-
}
|
|
2082
|
-
a(gr, "_endsWith");
|
|
2083
|
-
function J(e) {
|
|
2084
|
-
return new Dn({
|
|
2085
|
-
check: "overwrite",
|
|
2086
|
-
tx: e
|
|
2087
|
-
});
|
|
2088
|
-
}
|
|
2089
|
-
a(J, "_overwrite");
|
|
2090
|
-
function br(e) {
|
|
2091
|
-
return J((t) => t.normalize(e));
|
|
2092
|
-
}
|
|
2093
|
-
a(br, "_normalize");
|
|
2094
|
-
function zr() {
|
|
2095
|
-
return J((e) => e.trim());
|
|
2096
|
-
}
|
|
2097
|
-
a(zr, "_trim");
|
|
2098
|
-
function wr() {
|
|
2099
|
-
return J((e) => e.toLowerCase());
|
|
2100
|
-
}
|
|
2101
|
-
a(wr, "_toLowerCase");
|
|
2102
|
-
function kr() {
|
|
2103
|
-
return J((e) => e.toUpperCase());
|
|
2104
|
-
}
|
|
2105
|
-
a(kr, "_toUpperCase");
|
|
2106
|
-
function Zr(e, t, n) {
|
|
2107
|
-
return new e({
|
|
2108
|
-
type: "array",
|
|
2109
|
-
element: t,
|
|
2110
|
-
// get element() {
|
|
2111
|
-
// return element;
|
|
2112
|
-
// },
|
|
2113
|
-
...d(n)
|
|
2114
|
-
});
|
|
2115
|
-
}
|
|
2116
|
-
a(Zr, "_array");
|
|
2117
|
-
function $r(e, t, n) {
|
|
2118
|
-
return new e({
|
|
2119
|
-
type: "custom",
|
|
2120
|
-
check: "custom",
|
|
2121
|
-
fn: t,
|
|
2122
|
-
...d(n)
|
|
2123
|
-
});
|
|
2124
|
-
}
|
|
2125
|
-
a($r, "_refine");
|
|
2126
|
-
function yr(e) {
|
|
2127
|
-
const t = Ir((n) => (n.addIssue = (o) => {
|
|
2128
|
-
if (typeof o == "string")
|
|
2129
|
-
n.issues.push(W(o, n.value, t._zod.def));
|
|
2130
|
-
else {
|
|
2131
|
-
const r = o;
|
|
2132
|
-
r.fatal && (r.continue = !1), r.code ?? (r.code = "custom"), r.input ?? (r.input = n.value), r.inst ?? (r.inst = t), r.continue ?? (r.continue = !t._zod.def.abort), n.issues.push(W(r));
|
|
2133
|
-
}
|
|
2134
|
-
}, e(n.value, n)));
|
|
2135
|
-
return t;
|
|
2136
|
-
}
|
|
2137
|
-
a(yr, "_superRefine");
|
|
2138
|
-
function Ir(e, t) {
|
|
2139
|
-
const n = new A({
|
|
2140
|
-
check: "custom",
|
|
2141
|
-
...d(t)
|
|
2142
|
-
});
|
|
2143
|
-
return n._zod.check = e, n;
|
|
2144
|
-
}
|
|
2145
|
-
a(Ir, "_check");
|
|
2146
|
-
const Ar = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
|
|
2147
|
-
Yn.init(e, t), b.init(e, t);
|
|
2148
|
-
});
|
|
2149
|
-
function Er(e) {
|
|
2150
|
-
return nr(Ar, e);
|
|
2151
|
-
}
|
|
2152
|
-
a(Er, "datetime");
|
|
2153
|
-
const Sr = /* @__PURE__ */ u("ZodISODate", (e, t) => {
|
|
2154
|
-
Xn.init(e, t), b.init(e, t);
|
|
2155
|
-
});
|
|
2156
|
-
function Or(e) {
|
|
2157
|
-
return or(Sr, e);
|
|
2158
|
-
}
|
|
2159
|
-
a(Or, "date$1");
|
|
2160
|
-
const Pr = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
|
|
2161
|
-
qn.init(e, t), b.init(e, t);
|
|
2162
|
-
});
|
|
2163
|
-
function Tr(e) {
|
|
2164
|
-
return rr(Pr, e);
|
|
2165
|
-
}
|
|
2166
|
-
a(Tr, "time");
|
|
2167
|
-
const xr = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
|
|
2168
|
-
Hn.init(e, t), b.init(e, t);
|
|
2169
|
-
});
|
|
2170
|
-
function Nr(e) {
|
|
2171
|
-
return ir(xr, e);
|
|
2172
|
-
}
|
|
2173
|
-
a(Nr, "duration");
|
|
2174
|
-
const jr = /* @__PURE__ */ a((e, t) => {
|
|
2175
|
-
Qe.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2176
|
-
format: {
|
|
2177
|
-
value: /* @__PURE__ */ a((n) => Ut(e, n), "value")
|
|
2178
|
-
// enumerable: false,
|
|
2179
|
-
},
|
|
2180
|
-
flatten: {
|
|
2181
|
-
value: /* @__PURE__ */ a((n) => Rt(e, n), "value")
|
|
2182
|
-
// enumerable: false,
|
|
2183
|
-
},
|
|
2184
|
-
addIssue: {
|
|
2185
|
-
value: /* @__PURE__ */ a((n) => {
|
|
2186
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues, le, 2);
|
|
2187
|
-
}, "value")
|
|
2188
|
-
// enumerable: false,
|
|
2189
|
-
},
|
|
2190
|
-
addIssues: {
|
|
2191
|
-
value: /* @__PURE__ */ a((n) => {
|
|
2192
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues, le, 2);
|
|
2193
|
-
}, "value")
|
|
2194
|
-
// enumerable: false,
|
|
2195
|
-
},
|
|
2196
|
-
isEmpty: {
|
|
2197
|
-
get() {
|
|
2198
|
-
return e.issues.length === 0;
|
|
2199
|
-
}
|
|
2200
|
-
// enumerable: false,
|
|
2201
|
-
}
|
|
2202
|
-
});
|
|
2203
|
-
}, "initializer"), S = u("ZodError", jr, {
|
|
2204
|
-
Parent: Error
|
|
2205
|
-
}), Dr = /* @__PURE__ */ be(S), Cr = /* @__PURE__ */ ze(S), Fr = /* @__PURE__ */ ce(S), Rr = /* @__PURE__ */ ae(S), Ur = /* @__PURE__ */ Vt(S), Lr = /* @__PURE__ */ Bt(S), Mr = /* @__PURE__ */ Wt(S), Vr = /* @__PURE__ */ Gt(S), Br = /* @__PURE__ */ Jt(S), Wr = /* @__PURE__ */ Kt(S), Gr = /* @__PURE__ */ Yt(S), Jr = /* @__PURE__ */ Xt(S), g = /* @__PURE__ */ u("ZodType", (e, t) => (_.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(R(t, {
|
|
2206
|
-
checks: [
|
|
2207
|
-
...t.checks ?? [],
|
|
2208
|
-
...n.map((o) => typeof o == "function" ? { _zod: { check: o, def: { check: "custom" }, onattach: [] } } : o)
|
|
2209
|
-
]
|
|
2210
|
-
})), e.clone = (n, o) => j(e, n, o), e.brand = () => e, e.register = ((n, o) => (n.add(e, o), e)), e.parse = (n, o) => Dr(e, n, o, { callee: e.parse }), e.safeParse = (n, o) => Fr(e, n, o), e.parseAsync = async (n, o) => Cr(e, n, o, { callee: e.parseAsync }), e.safeParseAsync = async (n, o) => Rr(e, n, o), e.spa = e.safeParseAsync, e.encode = (n, o) => Ur(e, n, o), e.decode = (n, o) => Lr(e, n, o), e.encodeAsync = async (n, o) => Mr(e, n, o), e.decodeAsync = async (n, o) => Vr(e, n, o), e.safeEncode = (n, o) => Br(e, n, o), e.safeDecode = (n, o) => Wr(e, n, o), e.safeEncodeAsync = async (n, o) => Gr(e, n, o), e.safeDecodeAsync = async (n, o) => Jr(e, n, o), e.refine = (n, o) => e.check(Ri(n, o)), e.superRefine = (n) => e.check(Ui(n)), e.overwrite = (n) => e.check(J(n)), e.optional = () => We(e), e.nullable = () => Ge(e), e.nullish = () => We(Ge(e)), e.nonoptional = (n) => Ti(e, n), e.array = () => N(e), e.or = (n) => re([e, n]), e.and = (n) => Zi(e, n), e.transform = (n) => Je(e, Ii(n)), e.default = (n) => Si(e, n), e.prefault = (n) => Pi(e, n), e.catch = (n) => Ni(e, n), e.pipe = (n) => Je(e, n), e.readonly = () => Ci(e), e.describe = (n) => {
|
|
2211
|
-
const o = e.clone();
|
|
2212
|
-
return X.add(o, { description: n }), o;
|
|
2213
|
-
}, Object.defineProperty(e, "description", {
|
|
2214
|
-
get() {
|
|
2215
|
-
return X.get(e)?.description;
|
|
2216
|
-
},
|
|
2217
|
-
configurable: !0
|
|
2218
|
-
}), e.meta = (...n) => {
|
|
2219
|
-
if (n.length === 0)
|
|
2220
|
-
return X.get(e);
|
|
2221
|
-
const o = e.clone();
|
|
2222
|
-
return X.add(o, n[0]), o;
|
|
2223
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), ft = /* @__PURE__ */ u("_ZodString", (e, t) => {
|
|
2224
|
-
we.init(e, t), g.init(e, t);
|
|
2225
|
-
const n = e._zod.bag;
|
|
2226
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...o) => e.check(hr(...o)), e.includes = (...o) => e.check(_r(...o)), e.startsWith = (...o) => e.check(vr(...o)), e.endsWith = (...o) => e.check(gr(...o)), e.min = (...o) => e.check(ne(...o)), e.max = (...o) => e.check(dt(...o)), e.length = (...o) => e.check(ht(...o)), e.nonempty = (...o) => e.check(ne(1, ...o)), e.lowercase = (o) => e.check(fr(o)), e.uppercase = (o) => e.check(mr(o)), e.trim = () => e.check(zr()), e.normalize = (...o) => e.check(br(...o)), e.toLowerCase = () => e.check(wr()), e.toUpperCase = () => e.check(kr());
|
|
2227
|
-
}), Kr = /* @__PURE__ */ u("ZodString", (e, t) => {
|
|
2228
|
-
we.init(e, t), ft.init(e, t), e.email = (n) => e.check(jo(Yr, n)), e.url = (n) => e.check(Uo(Xr, n)), e.jwt = (n) => e.check(tr(pi, n)), e.emoji = (n) => e.check(Lo(qr, n)), e.guid = (n) => e.check(Fe(Me, n)), e.uuid = (n) => e.check(Do(q, n)), e.uuidv4 = (n) => e.check(Co(q, n)), e.uuidv6 = (n) => e.check(Fo(q, n)), e.uuidv7 = (n) => e.check(Ro(q, n)), e.nanoid = (n) => e.check(Mo(Hr, n)), e.guid = (n) => e.check(Fe(Me, n)), e.cuid = (n) => e.check(Vo(Qr, n)), e.cuid2 = (n) => e.check(Bo(ei, n)), e.ulid = (n) => e.check(Wo(ti, n)), e.base64 = (n) => e.check(Ho(ui, n)), e.base64url = (n) => e.check(Qo(si, n)), e.xid = (n) => e.check(Go(ni, n)), e.ksuid = (n) => e.check(Jo(oi, n)), e.ipv4 = (n) => e.check(Ko(ri, n)), e.ipv6 = (n) => e.check(Yo(ii, n)), e.cidrv4 = (n) => e.check(Xo(ci, n)), e.cidrv6 = (n) => e.check(qo(ai, n)), e.e164 = (n) => e.check(er(li, n)), e.datetime = (n) => e.check(Er(n)), e.date = (n) => e.check(Or(n)), e.time = (n) => e.check(Tr(n)), e.duration = (n) => e.check(Nr(n));
|
|
2229
|
-
});
|
|
2230
|
-
function l(e) {
|
|
2231
|
-
return No(Kr, e);
|
|
2232
|
-
}
|
|
2233
|
-
a(l, "string");
|
|
2234
|
-
const b = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
|
|
2235
|
-
v.init(e, t), ft.init(e, t);
|
|
2236
|
-
}), Yr = /* @__PURE__ */ u("ZodEmail", (e, t) => {
|
|
2237
|
-
Un.init(e, t), b.init(e, t);
|
|
2238
|
-
}), Me = /* @__PURE__ */ u("ZodGUID", (e, t) => {
|
|
2239
|
-
Fn.init(e, t), b.init(e, t);
|
|
2240
|
-
}), q = /* @__PURE__ */ u("ZodUUID", (e, t) => {
|
|
2241
|
-
Rn.init(e, t), b.init(e, t);
|
|
2242
|
-
}), Xr = /* @__PURE__ */ u("ZodURL", (e, t) => {
|
|
2243
|
-
Ln.init(e, t), b.init(e, t);
|
|
2244
|
-
}), qr = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
|
|
2245
|
-
Mn.init(e, t), b.init(e, t);
|
|
2246
|
-
}), Hr = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
|
|
2247
|
-
Vn.init(e, t), b.init(e, t);
|
|
2248
|
-
}), Qr = /* @__PURE__ */ u("ZodCUID", (e, t) => {
|
|
2249
|
-
Bn.init(e, t), b.init(e, t);
|
|
2250
|
-
}), ei = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
|
|
2251
|
-
Wn.init(e, t), b.init(e, t);
|
|
2252
|
-
}), ti = /* @__PURE__ */ u("ZodULID", (e, t) => {
|
|
2253
|
-
Gn.init(e, t), b.init(e, t);
|
|
2254
|
-
}), ni = /* @__PURE__ */ u("ZodXID", (e, t) => {
|
|
2255
|
-
Jn.init(e, t), b.init(e, t);
|
|
2256
|
-
}), oi = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
|
|
2257
|
-
Kn.init(e, t), b.init(e, t);
|
|
2258
|
-
}), ri = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
|
|
2259
|
-
Qn.init(e, t), b.init(e, t);
|
|
2260
|
-
}), ii = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
|
|
2261
|
-
eo.init(e, t), b.init(e, t);
|
|
2262
|
-
}), ci = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
|
|
2263
|
-
to.init(e, t), b.init(e, t);
|
|
2264
|
-
}), ai = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
|
|
2265
|
-
no.init(e, t), b.init(e, t);
|
|
2266
|
-
}), ui = /* @__PURE__ */ u("ZodBase64", (e, t) => {
|
|
2267
|
-
oo.init(e, t), b.init(e, t);
|
|
2268
|
-
}), si = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
|
|
2269
|
-
io.init(e, t), b.init(e, t);
|
|
2270
|
-
}), li = /* @__PURE__ */ u("ZodE164", (e, t) => {
|
|
2271
|
-
co.init(e, t), b.init(e, t);
|
|
2272
|
-
}), pi = /* @__PURE__ */ u("ZodJWT", (e, t) => {
|
|
2273
|
-
uo.init(e, t), b.init(e, t);
|
|
2274
|
-
}), mt = /* @__PURE__ */ u("ZodNumber", (e, t) => {
|
|
2275
|
-
ut.init(e, t), g.init(e, t), e.gt = (o, r) => e.check(Ue(o, r)), e.gte = (o, r) => e.check(Q(o, r)), e.min = (o, r) => e.check(Q(o, r)), e.lt = (o, r) => e.check(Re(o, r)), e.lte = (o, r) => e.check(H(o, r)), e.max = (o, r) => e.check(H(o, r)), e.int = (o) => e.check(Ve(o)), e.safe = (o) => e.check(Ve(o)), e.positive = (o) => e.check(Ue(0, o)), e.nonnegative = (o) => e.check(Q(0, o)), e.negative = (o) => e.check(Re(0, o)), e.nonpositive = (o) => e.check(H(0, o)), e.multipleOf = (o, r) => e.check(Le(o, r)), e.step = (o, r) => e.check(Le(o, r)), e.finite = () => e;
|
|
2276
|
-
const n = e._zod.bag;
|
|
2277
|
-
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2278
|
-
});
|
|
2279
|
-
function I(e) {
|
|
2280
|
-
return cr(mt, e);
|
|
2281
|
-
}
|
|
2282
|
-
a(I, "number");
|
|
2283
|
-
const di = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
|
|
2284
|
-
so.init(e, t), mt.init(e, t);
|
|
2285
|
-
});
|
|
2286
|
-
function Ve(e) {
|
|
2287
|
-
return ar(di, e);
|
|
2288
|
-
}
|
|
2289
|
-
a(Ve, "int");
|
|
2290
|
-
const hi = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
|
|
2291
|
-
lo.init(e, t), g.init(e, t);
|
|
2292
|
-
});
|
|
2293
|
-
function y(e) {
|
|
2294
|
-
return ur(hi, e);
|
|
2295
|
-
}
|
|
2296
|
-
a(y, "boolean");
|
|
2297
|
-
const fi = /* @__PURE__ */ u("ZodAny", (e, t) => {
|
|
2298
|
-
po.init(e, t), g.init(e, t);
|
|
2299
|
-
});
|
|
2300
|
-
function oe() {
|
|
2301
|
-
return sr(fi);
|
|
2302
|
-
}
|
|
2303
|
-
a(oe, "any");
|
|
2304
|
-
const mi = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
|
|
2305
|
-
ho.init(e, t), g.init(e, t);
|
|
2306
|
-
});
|
|
2307
|
-
function Be() {
|
|
2308
|
-
return lr(mi);
|
|
2309
|
-
}
|
|
2310
|
-
a(Be, "unknown");
|
|
2311
|
-
const _i = /* @__PURE__ */ u("ZodNever", (e, t) => {
|
|
2312
|
-
fo.init(e, t), g.init(e, t);
|
|
2313
|
-
});
|
|
2314
|
-
function vi(e) {
|
|
2315
|
-
return pr(_i, e);
|
|
2316
|
-
}
|
|
2317
|
-
a(vi, "never");
|
|
2318
|
-
const gi = /* @__PURE__ */ u("ZodDate", (e, t) => {
|
|
2319
|
-
mo.init(e, t), g.init(e, t), e.min = (o, r) => e.check(Q(o, r)), e.max = (o, r) => e.check(H(o, r));
|
|
2320
|
-
const n = e._zod.bag;
|
|
2321
|
-
e.minDate = n.minimum ? new Date(n.minimum) : null, e.maxDate = n.maximum ? new Date(n.maximum) : null;
|
|
2322
|
-
});
|
|
2323
|
-
function fe(e) {
|
|
2324
|
-
return dr(gi, e);
|
|
2325
|
-
}
|
|
2326
|
-
a(fe, "date");
|
|
2327
|
-
const bi = /* @__PURE__ */ u("ZodArray", (e, t) => {
|
|
2328
|
-
_o.init(e, t), g.init(e, t), e.element = t.element, e.min = (n, o) => e.check(ne(n, o)), e.nonempty = (n) => e.check(ne(1, n)), e.max = (n, o) => e.check(dt(n, o)), e.length = (n, o) => e.check(ht(n, o)), e.unwrap = () => e.element;
|
|
2329
|
-
});
|
|
2330
|
-
function N(e, t) {
|
|
2331
|
-
return Zr(bi, e, t);
|
|
2332
|
-
}
|
|
2333
|
-
a(N, "array");
|
|
2334
|
-
const zi = /* @__PURE__ */ u("ZodObject", (e, t) => {
|
|
2335
|
-
go.init(e, t), g.init(e, t), m(e, "shape", () => t.shape), e.keyof = () => k(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), 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: vi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Nt(e, n), e.safeExtend = (n) => jt(e, n), e.merge = (n) => Dt(e, n), e.pick = (n) => Tt(e, n), e.omit = (n) => xt(e, n), e.partial = (...n) => Ct(gt, e, n[0]), e.required = (...n) => Ft(bt, e, n[0]);
|
|
2336
|
-
});
|
|
2337
|
-
function Z(e, t) {
|
|
2338
|
-
const n = {
|
|
2339
|
-
type: "object",
|
|
2340
|
-
shape: e ?? {},
|
|
2341
|
-
...d(t)
|
|
2342
|
-
};
|
|
2343
|
-
return new zi(n);
|
|
2344
|
-
}
|
|
2345
|
-
a(Z, "object");
|
|
2346
|
-
const _t = /* @__PURE__ */ u("ZodUnion", (e, t) => {
|
|
2347
|
-
pt.init(e, t), g.init(e, t), e.options = t.options;
|
|
2348
|
-
});
|
|
2349
|
-
function re(e, t) {
|
|
2350
|
-
return new _t({
|
|
2351
|
-
type: "union",
|
|
2352
|
-
options: e,
|
|
2353
|
-
...d(t)
|
|
2354
|
-
});
|
|
2355
|
-
}
|
|
2356
|
-
a(re, "union");
|
|
2357
|
-
const wi = /* @__PURE__ */ u("ZodDiscriminatedUnion", (e, t) => {
|
|
2358
|
-
_t.init(e, t), bo.init(e, t);
|
|
2359
|
-
});
|
|
2360
|
-
function vt(e, t, n) {
|
|
2361
|
-
return new wi({
|
|
2362
|
-
type: "union",
|
|
2363
|
-
options: t,
|
|
2364
|
-
discriminator: e,
|
|
2365
|
-
...d(n)
|
|
2366
|
-
});
|
|
2367
|
-
}
|
|
2368
|
-
a(vt, "discriminatedUnion");
|
|
2369
|
-
const ki = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
|
|
2370
|
-
zo.init(e, t), g.init(e, t);
|
|
2371
|
-
});
|
|
2372
|
-
function Zi(e, t) {
|
|
2373
|
-
return new ki({
|
|
2374
|
-
type: "intersection",
|
|
2375
|
-
left: e,
|
|
2376
|
-
right: t
|
|
2377
|
-
});
|
|
2378
|
-
}
|
|
2379
|
-
a(Zi, "intersection");
|
|
2380
|
-
const me = /* @__PURE__ */ u("ZodEnum", (e, t) => {
|
|
2381
|
-
wo.init(e, t), g.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2382
|
-
const n = new Set(Object.keys(t.entries));
|
|
2383
|
-
e.extract = (o, r) => {
|
|
2384
|
-
const c = {};
|
|
2385
|
-
for (const i of o)
|
|
2386
|
-
if (n.has(i))
|
|
2387
|
-
c[i] = t.entries[i];
|
|
2388
|
-
else
|
|
2389
|
-
throw new Error(`Key ${i} not found in enum`);
|
|
2390
|
-
return new me({
|
|
2391
|
-
...t,
|
|
2392
|
-
checks: [],
|
|
2393
|
-
...d(r),
|
|
2394
|
-
entries: c
|
|
2395
|
-
});
|
|
2396
|
-
}, e.exclude = (o, r) => {
|
|
2397
|
-
const c = { ...t.entries };
|
|
2398
|
-
for (const i of o)
|
|
2399
|
-
if (n.has(i))
|
|
2400
|
-
delete c[i];
|
|
2401
|
-
else
|
|
2402
|
-
throw new Error(`Key ${i} not found in enum`);
|
|
2403
|
-
return new me({
|
|
2404
|
-
...t,
|
|
2405
|
-
checks: [],
|
|
2406
|
-
...d(r),
|
|
2407
|
-
entries: c
|
|
2408
|
-
});
|
|
2409
|
-
};
|
|
2410
|
-
});
|
|
2411
|
-
function k(e, t) {
|
|
2412
|
-
const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
|
|
2413
|
-
return new me({
|
|
2414
|
-
type: "enum",
|
|
2415
|
-
entries: n,
|
|
2416
|
-
...d(t)
|
|
2417
|
-
});
|
|
2418
|
-
}
|
|
2419
|
-
a(k, "_enum");
|
|
2420
|
-
const $i = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
|
|
2421
|
-
ko.init(e, t), g.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
2422
|
-
get() {
|
|
2423
|
-
if (t.values.length > 1)
|
|
2424
|
-
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
2425
|
-
return t.values[0];
|
|
2426
|
-
}
|
|
2427
|
-
});
|
|
2428
|
-
});
|
|
2429
|
-
function G(e, t) {
|
|
2430
|
-
return new $i({
|
|
2431
|
-
type: "literal",
|
|
2432
|
-
values: Array.isArray(e) ? e : [e],
|
|
2433
|
-
...d(t)
|
|
2434
|
-
});
|
|
2435
|
-
}
|
|
2436
|
-
a(G, "literal");
|
|
2437
|
-
const yi = /* @__PURE__ */ u("ZodTransform", (e, t) => {
|
|
2438
|
-
Zo.init(e, t), g.init(e, t), e._zod.parse = (n, o) => {
|
|
2439
|
-
if (o.direction === "backward")
|
|
2440
|
-
throw new ee(e.constructor.name);
|
|
2441
|
-
n.addIssue = (c) => {
|
|
2442
|
-
if (typeof c == "string")
|
|
2443
|
-
n.issues.push(W(c, n.value, t));
|
|
2444
|
-
else {
|
|
2445
|
-
const i = c;
|
|
2446
|
-
i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), n.issues.push(W(i));
|
|
2447
|
-
}
|
|
2448
|
-
};
|
|
2449
|
-
const r = t.transform(n.value, n);
|
|
2450
|
-
return r instanceof Promise ? r.then((c) => (n.value = c, n)) : (n.value = r, n);
|
|
2451
|
-
};
|
|
2452
|
-
});
|
|
2453
|
-
function Ii(e) {
|
|
2454
|
-
return new yi({
|
|
2455
|
-
type: "transform",
|
|
2456
|
-
transform: e
|
|
2457
|
-
});
|
|
2458
|
-
}
|
|
2459
|
-
a(Ii, "transform");
|
|
2460
|
-
const gt = /* @__PURE__ */ u("ZodOptional", (e, t) => {
|
|
2461
|
-
$o.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2462
|
-
});
|
|
2463
|
-
function We(e) {
|
|
2464
|
-
return new gt({
|
|
2465
|
-
type: "optional",
|
|
2466
|
-
innerType: e
|
|
2467
|
-
});
|
|
2468
|
-
}
|
|
2469
|
-
a(We, "optional");
|
|
2470
|
-
const Ai = /* @__PURE__ */ u("ZodNullable", (e, t) => {
|
|
2471
|
-
yo.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2472
|
-
});
|
|
2473
|
-
function Ge(e) {
|
|
2474
|
-
return new Ai({
|
|
2475
|
-
type: "nullable",
|
|
2476
|
-
innerType: e
|
|
2477
|
-
});
|
|
2478
|
-
}
|
|
2479
|
-
a(Ge, "nullable");
|
|
2480
|
-
const Ei = /* @__PURE__ */ u("ZodDefault", (e, t) => {
|
|
2481
|
-
Io.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2482
|
-
});
|
|
2483
|
-
function Si(e, t) {
|
|
2484
|
-
return new Ei({
|
|
2485
|
-
type: "default",
|
|
2486
|
-
innerType: e,
|
|
2487
|
-
get defaultValue() {
|
|
2488
|
-
return typeof t == "function" ? t() : Xe(t);
|
|
2489
|
-
}
|
|
2490
|
-
});
|
|
2491
|
-
}
|
|
2492
|
-
a(Si, "_default");
|
|
2493
|
-
const Oi = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
|
|
2494
|
-
Ao.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2495
|
-
});
|
|
2496
|
-
function Pi(e, t) {
|
|
2497
|
-
return new Oi({
|
|
2498
|
-
type: "prefault",
|
|
2499
|
-
innerType: e,
|
|
2500
|
-
get defaultValue() {
|
|
2501
|
-
return typeof t == "function" ? t() : Xe(t);
|
|
2502
|
-
}
|
|
2503
|
-
});
|
|
2504
|
-
}
|
|
2505
|
-
a(Pi, "prefault");
|
|
2506
|
-
const bt = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
|
|
2507
|
-
Eo.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2508
|
-
});
|
|
2509
|
-
function Ti(e, t) {
|
|
2510
|
-
return new bt({
|
|
2511
|
-
type: "nonoptional",
|
|
2512
|
-
innerType: e,
|
|
2513
|
-
...d(t)
|
|
2514
|
-
});
|
|
2515
|
-
}
|
|
2516
|
-
a(Ti, "nonoptional");
|
|
2517
|
-
const xi = /* @__PURE__ */ u("ZodCatch", (e, t) => {
|
|
2518
|
-
So.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2519
|
-
});
|
|
2520
|
-
function Ni(e, t) {
|
|
2521
|
-
return new xi({
|
|
2522
|
-
type: "catch",
|
|
2523
|
-
innerType: e,
|
|
2524
|
-
catchValue: typeof t == "function" ? t : () => t
|
|
2525
|
-
});
|
|
2526
|
-
}
|
|
2527
|
-
a(Ni, "_catch");
|
|
2528
|
-
const ji = /* @__PURE__ */ u("ZodPipe", (e, t) => {
|
|
2529
|
-
Oo.init(e, t), g.init(e, t), e.in = t.in, e.out = t.out;
|
|
2530
|
-
});
|
|
2531
|
-
function Je(e, t) {
|
|
2532
|
-
return new ji({
|
|
2533
|
-
type: "pipe",
|
|
2534
|
-
in: e,
|
|
2535
|
-
out: t
|
|
2536
|
-
// ...util.normalizeParams(params),
|
|
2537
|
-
});
|
|
2538
|
-
}
|
|
2539
|
-
a(Je, "pipe");
|
|
2540
|
-
const Di = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
|
|
2541
|
-
Po.init(e, t), g.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2542
|
-
});
|
|
2543
|
-
function Ci(e) {
|
|
2544
|
-
return new Di({
|
|
2545
|
-
type: "readonly",
|
|
2546
|
-
innerType: e
|
|
2547
|
-
});
|
|
2548
|
-
}
|
|
2549
|
-
a(Ci, "readonly");
|
|
2550
|
-
const Fi = /* @__PURE__ */ u("ZodCustom", (e, t) => {
|
|
2551
|
-
To.init(e, t), g.init(e, t);
|
|
2552
|
-
});
|
|
2553
|
-
function Ri(e, t = {}) {
|
|
2554
|
-
return $r(Fi, e, t);
|
|
2555
|
-
}
|
|
2556
|
-
a(Ri, "refine");
|
|
2557
|
-
function Ui(e) {
|
|
2558
|
-
return yr(e);
|
|
2559
|
-
}
|
|
2560
|
-
a(Ui, "superRefine");
|
|
2561
|
-
const Li = k(["image", "video", "audio"]), Mi = k(["avatar", "cover", "voice", "general"]), Vi = k(["processing", "active", "failed", "deleted"]), Bi = k(["jpg", "jpeg", "png", "gif", "webp", "svg"]), Wi = k(["mp4", "webm", "ogg", "mov", "avi"]), Gi = k(["mp3", "wav", "ogg", "aac", "flac"]), Ji = Z({
|
|
2562
|
-
mediaId: l(),
|
|
2563
|
-
userId: l(),
|
|
2564
|
-
orgId: l(),
|
|
2565
|
-
selfId: l().nullable().optional(),
|
|
2566
|
-
filename: l(),
|
|
2567
|
-
mimeType: l(),
|
|
2568
|
-
size: I(),
|
|
2569
|
-
src: l(),
|
|
2570
|
-
alt: l().optional(),
|
|
2571
|
-
context: Mi.default("general"),
|
|
2572
|
-
status: Vi.default("processing"),
|
|
2573
|
-
createdAt: l().optional(),
|
|
2574
|
-
// ISO string for JSON compatibility
|
|
2575
|
-
updatedAt: l().optional()
|
|
2576
|
-
// ISO string for JSON compatibility
|
|
2577
|
-
}), x = Ji.extend({
|
|
2578
|
-
// Additional UI fields not in database
|
|
2579
|
-
format: Li.optional(),
|
|
2580
|
-
// Derived from mimeType
|
|
2581
|
-
className: l().optional(),
|
|
2582
|
-
// CSS classes for rendering
|
|
2583
|
-
// Image/video dimensions
|
|
2584
|
-
width: I().optional(),
|
|
2585
|
-
height: I().optional(),
|
|
2586
|
-
// Audio/video duration
|
|
2587
|
-
duration: I().optional(),
|
|
2588
|
-
// Image blur hash for loading placeholders
|
|
2589
|
-
blurhash: l().optional()
|
|
2590
|
-
}).partial(), Ki = Z({
|
|
2591
|
-
duration: I().optional(),
|
|
2592
|
-
// in seconds
|
|
2593
|
-
thumbnail: l().optional(),
|
|
2594
|
-
autoplay: y().optional(),
|
|
2595
|
-
loop: y().optional(),
|
|
2596
|
-
muted: y().optional(),
|
|
2597
|
-
controls: y().optional()
|
|
2598
|
-
}), Yi = Z({
|
|
2599
|
-
duration: I().optional(),
|
|
2600
|
-
// in seconds
|
|
2601
|
-
autoplay: y().optional(),
|
|
2602
|
-
loop: y().optional(),
|
|
2603
|
-
muted: y().optional(),
|
|
2604
|
-
controls: y().optional()
|
|
2605
|
-
}), Xi = x.extend({
|
|
2606
|
-
format: G("image"),
|
|
2607
|
-
imageFormat: Bi
|
|
2608
|
-
}), qi = x.extend({
|
|
2609
|
-
format: G("video"),
|
|
2610
|
-
videoFormat: Wi,
|
|
2611
|
-
video: Ki.optional()
|
|
2612
|
-
}), Hi = x.extend({
|
|
2613
|
-
format: G("audio"),
|
|
2614
|
-
audioFormat: Gi,
|
|
2615
|
-
audio: Yi.optional()
|
|
2616
|
-
});
|
|
2617
|
-
vt("format", [
|
|
2618
|
-
Xi,
|
|
2619
|
-
qi,
|
|
2620
|
-
Hi
|
|
2621
|
-
]);
|
|
2622
|
-
const zt = k(["xxs", "xs", "sm", "md", "lg", "xl"]), wt = k(["primary", "default", "overlay", "red", "green", "indigo", "orange"]), kt = k(["ghost", "link", "outline", "solid"]), Qi = Z({
|
|
2623
|
-
key: l().optional(),
|
|
2624
|
-
label: l().optional(),
|
|
2625
|
-
href: l().optional(),
|
|
2626
|
-
size: zt.optional(),
|
|
2627
|
-
theme: wt.optional(),
|
|
2628
|
-
design: kt.optional(),
|
|
2629
|
-
icon: re([l(), x]).optional(),
|
|
2630
|
-
iconAfter: re([l(), x]).optional(),
|
|
2631
|
-
rounding: k(["full", "md", "lg"]).optional(),
|
|
2632
|
-
loading: y().optional(),
|
|
2633
|
-
disabled: y().optional(),
|
|
2634
|
-
onClick: oe().optional(),
|
|
2635
|
-
// Function type
|
|
2636
|
-
testId: l().optional(),
|
|
2637
|
-
target: k(["_blank", "_self"]).optional(),
|
|
2638
|
-
type: k(["button", "submit", "reset"]).optional()
|
|
2639
|
-
});
|
|
2640
|
-
Z({
|
|
2641
|
-
buttons: N(Qi).optional(),
|
|
2642
|
-
size: zt.optional(),
|
|
2643
|
-
theme: wt.optional(),
|
|
2644
|
-
design: kt.optional()
|
|
2645
|
-
});
|
|
2646
|
-
Z({
|
|
2647
|
-
// Database fields (core identity)
|
|
2648
|
-
userId: l(),
|
|
2649
|
-
email: l(),
|
|
2650
|
-
handle: l().optional(),
|
|
2651
|
-
fullName: l().optional(),
|
|
2652
|
-
avatar: l().optional(),
|
|
2653
|
-
// Authentication & verification
|
|
2654
|
-
emailVerified: y().optional(),
|
|
2655
|
-
hasPassword: y().optional(),
|
|
2656
|
-
// Primary relationships
|
|
2657
|
-
primaryOrgId: l().optional(),
|
|
2658
|
-
primarySelfId: l().optional(),
|
|
2659
|
-
// Status & activity
|
|
2660
|
-
status: l().optional(),
|
|
2661
|
-
lastSeenAt: fe().optional(),
|
|
2662
|
-
// Virtual/computed fields
|
|
2663
|
-
onboarded: y().optional(),
|
|
2664
|
-
selfCount: I().optional(),
|
|
2665
|
-
// Nested relationships (for enriched responses)
|
|
2666
|
-
memberships: N(Z({
|
|
2667
|
-
membershipId: l(),
|
|
2668
|
-
orgId: l(),
|
|
2669
|
-
orgName: l(),
|
|
2670
|
-
orgHandle: l(),
|
|
2671
|
-
role: k(["admin", "member"]),
|
|
2672
|
-
joinedAt: fe()
|
|
2673
|
-
})).optional(),
|
|
2674
|
-
selves: N(Z({
|
|
2675
|
-
selfId: l(),
|
|
2676
|
-
handle: l(),
|
|
2677
|
-
title: l().optional(),
|
|
2678
|
-
visibility: k(["public", "private"]).optional(),
|
|
2679
|
-
orgId: l().optional()
|
|
2680
|
-
})).optional(),
|
|
2681
|
-
// Timestamps
|
|
2682
|
-
createdAt: l().optional(),
|
|
2683
|
-
updatedAt: l().optional()
|
|
2684
|
-
}).partial();
|
|
2685
|
-
Z({
|
|
2686
|
-
// Database fields
|
|
2687
|
-
orgId: l(),
|
|
2688
|
-
name: l(),
|
|
2689
|
-
handle: l(),
|
|
2690
|
-
ownerId: l(),
|
|
2691
|
-
// Settings & configuration
|
|
2692
|
-
isPersonal: y().optional(),
|
|
2693
|
-
description: l().optional(),
|
|
2694
|
-
website: l().optional(),
|
|
2695
|
-
avatar: l().optional(),
|
|
2696
|
-
// Billing & subscription
|
|
2697
|
-
stripeCustomerId: l().optional(),
|
|
2698
|
-
subscriptionStatus: k(["trial", "active", "canceled", "past_due"]).optional(),
|
|
2699
|
-
trialEndsAt: l().optional(),
|
|
2700
|
-
// Virtual/computed fields
|
|
2701
|
-
memberCount: I().optional(),
|
|
2702
|
-
selfCount: I().optional(),
|
|
2703
|
-
// Nested relationships
|
|
2704
|
-
members: N(Z({
|
|
2705
|
-
userId: l(),
|
|
2706
|
-
fullName: l().optional(),
|
|
2707
|
-
email: l(),
|
|
2708
|
-
role: k(["admin", "member"]),
|
|
2709
|
-
joinedAt: l()
|
|
2710
|
-
})).optional(),
|
|
2711
|
-
selves: N(Z({
|
|
2712
|
-
selfId: l(),
|
|
2713
|
-
handle: l(),
|
|
2714
|
-
title: l().optional(),
|
|
2715
|
-
visibility: k(["public", "private"]).optional()
|
|
2716
|
-
})).optional(),
|
|
2717
|
-
// Timestamps
|
|
2718
|
-
createdAt: l().optional(),
|
|
2719
|
-
updatedAt: l().optional()
|
|
2720
|
-
}).partial();
|
|
2721
|
-
Z({
|
|
2722
|
-
// Database fields
|
|
2723
|
-
selfId: l(),
|
|
2724
|
-
handle: l(),
|
|
2725
|
-
title: l().optional(),
|
|
2726
|
-
description: l().optional(),
|
|
2727
|
-
// Ownership
|
|
2728
|
-
userId: l(),
|
|
2729
|
-
orgId: l().optional(),
|
|
2730
|
-
// Configuration
|
|
2731
|
-
visibility: k(["public", "private"]).optional(),
|
|
2732
|
-
prompt: l().optional(),
|
|
2733
|
-
// Media & voice
|
|
2734
|
-
avatar: l().optional(),
|
|
2735
|
-
voiceId: l().optional(),
|
|
2736
|
-
voiceSettings: Z({
|
|
2737
|
-
speed: I().optional(),
|
|
2738
|
-
pitch: I().optional(),
|
|
2739
|
-
volume: I().optional()
|
|
2740
|
-
}).optional(),
|
|
2741
|
-
// Virtual/computed fields
|
|
2742
|
-
interactionCount: I().optional(),
|
|
2743
|
-
lastActiveAt: fe().optional(),
|
|
2744
|
-
// Nested relationships
|
|
2745
|
-
owner: Z({
|
|
2746
|
-
userId: l(),
|
|
2747
|
-
fullName: l().optional(),
|
|
2748
|
-
handle: l().optional()
|
|
2749
|
-
}).optional(),
|
|
2750
|
-
org: Z({
|
|
2751
|
-
orgId: l(),
|
|
2752
|
-
name: l(),
|
|
2753
|
-
handle: l()
|
|
2754
|
-
}).optional(),
|
|
2755
|
-
// Timestamps
|
|
2756
|
-
createdAt: l().optional(),
|
|
2757
|
-
updatedAt: l().optional()
|
|
2758
|
-
}).partial();
|
|
2759
|
-
vt("ok", [
|
|
2760
|
-
Z({
|
|
2761
|
-
ok: G(!0),
|
|
2762
|
-
data: oe(),
|
|
2763
|
-
message: l().optional()
|
|
2764
|
-
}),
|
|
2765
|
-
Z({
|
|
2766
|
-
ok: G(!1),
|
|
2767
|
-
error: l(),
|
|
2768
|
-
code: l().optional()
|
|
2769
|
-
})
|
|
2770
|
-
]);
|
|
2771
|
-
const ec = Z({
|
|
2772
|
-
// Core content
|
|
2773
|
-
key: l().optional(),
|
|
2774
|
-
id: l().optional(),
|
|
2775
|
-
label: l().optional(),
|
|
2776
|
-
srLabel: l().optional(),
|
|
2777
|
-
// Screen reader label
|
|
2778
|
-
subLabel: l().optional(),
|
|
2779
|
-
// Secondary text
|
|
2780
|
-
value: re([l(), I()]).optional(),
|
|
2781
|
-
description: l().optional(),
|
|
2782
|
-
info: l().optional(),
|
|
2783
|
-
count: I().optional(),
|
|
2784
|
-
className: l().optional(),
|
|
2785
|
-
// Visual elements
|
|
2786
|
-
media: x.optional(),
|
|
2787
|
-
icon: x.optional(),
|
|
2788
|
-
iconAfter: x.optional(),
|
|
2789
|
-
// Navigation
|
|
2790
|
-
href: l().optional(),
|
|
2791
|
-
target: k(["_self", "_blank"]).optional(),
|
|
2792
|
-
onClick: oe().optional(),
|
|
2793
|
-
// Function type
|
|
2794
|
-
// Styling
|
|
2795
|
-
theme: k(["primary", "default"]).optional(),
|
|
2796
|
-
// State
|
|
2797
|
-
isActive: y().optional(),
|
|
2798
|
-
isDisabled: y().optional(),
|
|
2799
|
-
isHidden: y().optional(),
|
|
2800
|
-
// Organization
|
|
2801
|
-
priority: I().optional(),
|
|
2802
|
-
testId: l().optional(),
|
|
2803
|
-
// Simple nested items (one level only)
|
|
2804
|
-
items: N(oe()).optional()
|
|
2805
|
-
// Avoid recursive schema issues
|
|
2806
|
-
});
|
|
2807
|
-
Z({
|
|
2808
|
-
title: l().optional(),
|
|
2809
|
-
description: l().optional(),
|
|
2810
|
-
items: N(ec).optional()
|
|
2811
|
-
});
|
|
1
|
+
import { F as r } from "./sdkClient-C9BL_Op4.js";
|
|
2
|
+
import { MediaSchema as i } from "@fiction/types";
|
|
2812
3
|
export {
|
|
2813
|
-
|
|
2814
|
-
|
|
4
|
+
r as FictionSDK,
|
|
5
|
+
i as MediaSchema
|
|
2815
6
|
};
|
|
2816
7
|
//# sourceMappingURL=sdk.js.map
|