@rpcbase/server 0.537.0 → 0.539.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/email-DK8uUU4X.js +8045 -0
  2. package/dist/email-DK8uUU4X.js.map +1 -0
  3. package/dist/handler--FFBJMl6.js +153 -0
  4. package/dist/handler--FFBJMl6.js.map +1 -0
  5. package/dist/handler-0rPClEv4.js +663 -0
  6. package/dist/handler-0rPClEv4.js.map +1 -0
  7. package/dist/handler-COnCnprN.js +203 -0
  8. package/dist/handler-COnCnprN.js.map +1 -0
  9. package/dist/handler-ClQF4MOn.js +931 -0
  10. package/dist/handler-ClQF4MOn.js.map +1 -0
  11. package/dist/index.js +4988 -4830
  12. package/dist/index.js.map +1 -1
  13. package/dist/notifications.js +199 -134
  14. package/dist/notifications.js.map +1 -1
  15. package/dist/queryExecutor-Bol_iR8f.js +453 -0
  16. package/dist/queryExecutor-Bol_iR8f.js.map +1 -0
  17. package/dist/render_resend_false-MiC__Smr.js +6 -0
  18. package/dist/render_resend_false-MiC__Smr.js.map +1 -0
  19. package/dist/rts/index.d.ts +0 -1
  20. package/dist/rts/index.d.ts.map +1 -1
  21. package/dist/rts/index.js +1003 -842
  22. package/dist/rts/index.js.map +1 -1
  23. package/dist/schemas-Cjdjgehl.js +4225 -0
  24. package/dist/schemas-Cjdjgehl.js.map +1 -0
  25. package/dist/shared-nE84Or5W.js +111 -0
  26. package/dist/shared-nE84Or5W.js.map +1 -0
  27. package/dist/ssrMiddleware.d.ts +1 -1
  28. package/dist/uploads/api/file-uploads/handlers/completeUpload.d.ts.map +1 -1
  29. package/dist/uploads/api/file-uploads/postProcessors.d.ts +2 -0
  30. package/dist/uploads/api/file-uploads/postProcessors.d.ts.map +1 -1
  31. package/dist/uploads.js +103 -71
  32. package/dist/uploads.js.map +1 -1
  33. package/package.json +11 -10
  34. package/dist/email-H8nTAGxe.js +0 -12449
  35. package/dist/email-H8nTAGxe.js.map +0 -1
  36. package/dist/handler-BBzEodA0.js +0 -182
  37. package/dist/handler-BBzEodA0.js.map +0 -1
  38. package/dist/handler-BLwgdQv-.js +0 -544
  39. package/dist/handler-BLwgdQv-.js.map +0 -1
  40. package/dist/handler-BU_tEK6x.js +0 -749
  41. package/dist/handler-BU_tEK6x.js.map +0 -1
  42. package/dist/handler-CZD5p1Jv.js +0 -28
  43. package/dist/handler-CZD5p1Jv.js.map +0 -1
  44. package/dist/handler-Cq6MsoD4.js +0 -124
  45. package/dist/handler-Cq6MsoD4.js.map +0 -1
  46. package/dist/queryExecutor-JadZcQSQ.js +0 -318
  47. package/dist/queryExecutor-JadZcQSQ.js.map +0 -1
  48. package/dist/render_resend-DQANggpW.js +0 -7
  49. package/dist/render_resend-DQANggpW.js.map +0 -1
  50. package/dist/rts/api/cleanup/handler.d.ts +0 -9
  51. package/dist/rts/api/cleanup/handler.d.ts.map +0 -1
  52. package/dist/rts/api/cleanup/index.d.ts +0 -11
  53. package/dist/rts/api/cleanup/index.d.ts.map +0 -1
  54. package/dist/schemas-BR3K5Luo.js +0 -3824
  55. package/dist/schemas-BR3K5Luo.js.map +0 -1
  56. package/dist/shared-DhZ_rDdo.js +0 -87
  57. package/dist/shared-DhZ_rDdo.js.map +0 -1
@@ -1,3824 +0,0 @@
1
- Object.freeze({ status: "aborted" });
2
- function $constructor(name, initializer, params) {
3
- function init(inst, def) {
4
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
5
- value: {
6
- def,
7
- constr: _,
8
- traits: /* @__PURE__ */ new Set()
9
- },
10
- enumerable: false
11
- });
12
- if (inst._zod.traits.has(name)) return;
13
- inst._zod.traits.add(name);
14
- initializer(inst, def);
15
- const proto = _.prototype;
16
- const keys = Object.keys(proto);
17
- for (let i = 0; i < keys.length; i++) {
18
- const k = keys[i];
19
- if (!(k in inst)) inst[k] = proto[k].bind(inst);
20
- }
21
- }
22
- const Parent = params?.Parent ?? Object;
23
- class Definition extends Parent {}
24
- Object.defineProperty(Definition, "name", { value: name });
25
- function _(def) {
26
- var _a;
27
- const inst = params?.Parent ? new Definition() : this;
28
- init(inst, def);
29
- (_a = inst._zod).deferred ?? (_a.deferred = []);
30
- for (const fn of inst._zod.deferred) fn();
31
- return inst;
32
- }
33
- Object.defineProperty(_, "init", { value: init });
34
- Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
35
- if (params?.Parent && inst instanceof params.Parent) return true;
36
- return inst?._zod?.traits?.has(name);
37
- } });
38
- Object.defineProperty(_, "name", { value: name });
39
- return _;
40
- }
41
- var $ZodAsyncError = class extends Error {
42
- constructor() {
43
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
44
- }
45
- };
46
- var $ZodEncodeError = class extends Error {
47
- constructor(name) {
48
- super(`Encountered unidirectional transform during encode: ${name}`);
49
- this.name = "ZodEncodeError";
50
- }
51
- };
52
- var globalConfig = {};
53
- function config(newConfig) {
54
- if (newConfig) Object.assign(globalConfig, newConfig);
55
- return globalConfig;
56
- }
57
- //#endregion
58
- //#region ../../node_modules/zod/v4/core/util.js
59
- function getEnumValues(entries) {
60
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
61
- return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
62
- }
63
- function jsonStringifyReplacer(_, value) {
64
- if (typeof value === "bigint") return value.toString();
65
- return value;
66
- }
67
- function cached(getter) {
68
- return { get value() {
69
- {
70
- const value = getter();
71
- Object.defineProperty(this, "value", { value });
72
- return value;
73
- }
74
- throw new Error("cached value already set");
75
- } };
76
- }
77
- function nullish(input) {
78
- return input === null || input === void 0;
79
- }
80
- function cleanRegex(source) {
81
- const start = source.startsWith("^") ? 1 : 0;
82
- const end = source.endsWith("$") ? source.length - 1 : source.length;
83
- return source.slice(start, end);
84
- }
85
- function floatSafeRemainder(val, step) {
86
- const valDecCount = (val.toString().split(".")[1] || "").length;
87
- const stepString = step.toString();
88
- let stepDecCount = (stepString.split(".")[1] || "").length;
89
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
90
- const match = stepString.match(/\d?e-(\d?)/);
91
- if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
92
- }
93
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
94
- return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
95
- }
96
- var EVALUATING = Symbol("evaluating");
97
- function defineLazy(object, key, getter) {
98
- let value = void 0;
99
- Object.defineProperty(object, key, {
100
- get() {
101
- if (value === EVALUATING) return;
102
- if (value === void 0) {
103
- value = EVALUATING;
104
- value = getter();
105
- }
106
- return value;
107
- },
108
- set(v) {
109
- Object.defineProperty(object, key, { value: v });
110
- },
111
- configurable: true
112
- });
113
- }
114
- function assignProp(target, prop, value) {
115
- Object.defineProperty(target, prop, {
116
- value,
117
- writable: true,
118
- enumerable: true,
119
- configurable: true
120
- });
121
- }
122
- function mergeDefs(...defs) {
123
- const mergedDescriptors = {};
124
- for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
125
- return Object.defineProperties({}, mergedDescriptors);
126
- }
127
- function esc(str) {
128
- return JSON.stringify(str);
129
- }
130
- function slugify(input) {
131
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
132
- }
133
- var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
134
- function isObject(data) {
135
- return typeof data === "object" && data !== null && !Array.isArray(data);
136
- }
137
- var allowsEval = cached(() => {
138
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
139
- try {
140
- new Function("");
141
- return true;
142
- } catch (_) {
143
- return false;
144
- }
145
- });
146
- function isPlainObject(o) {
147
- if (isObject(o) === false) return false;
148
- const ctor = o.constructor;
149
- if (ctor === void 0) return true;
150
- if (typeof ctor !== "function") return true;
151
- const prot = ctor.prototype;
152
- if (isObject(prot) === false) return false;
153
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
154
- return true;
155
- }
156
- function shallowClone(o) {
157
- if (isPlainObject(o)) return { ...o };
158
- if (Array.isArray(o)) return [...o];
159
- return o;
160
- }
161
- var propertyKeyTypes = new Set([
162
- "string",
163
- "number",
164
- "symbol"
165
- ]);
166
- function escapeRegex(str) {
167
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
168
- }
169
- function clone(inst, def, params) {
170
- const cl = new inst._zod.constr(def ?? inst._zod.def);
171
- if (!def || params?.parent) cl._zod.parent = inst;
172
- return cl;
173
- }
174
- function normalizeParams(_params) {
175
- const params = _params;
176
- if (!params) return {};
177
- if (typeof params === "string") return { error: () => params };
178
- if (params?.message !== void 0) {
179
- if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
180
- params.error = params.message;
181
- }
182
- delete params.message;
183
- if (typeof params.error === "string") return {
184
- ...params,
185
- error: () => params.error
186
- };
187
- return params;
188
- }
189
- function optionalKeys(shape) {
190
- return Object.keys(shape).filter((k) => {
191
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
192
- });
193
- }
194
- var NUMBER_FORMAT_RANGES = {
195
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
196
- int32: [-2147483648, 2147483647],
197
- uint32: [0, 4294967295],
198
- float32: [-34028234663852886e22, 34028234663852886e22],
199
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
200
- };
201
- function pick(schema, mask) {
202
- const currDef = schema._zod.def;
203
- const checks = currDef.checks;
204
- if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
205
- return clone(schema, mergeDefs(schema._zod.def, {
206
- get shape() {
207
- const newShape = {};
208
- for (const key in mask) {
209
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
210
- if (!mask[key]) continue;
211
- newShape[key] = currDef.shape[key];
212
- }
213
- assignProp(this, "shape", newShape);
214
- return newShape;
215
- },
216
- checks: []
217
- }));
218
- }
219
- function omit(schema, mask) {
220
- const currDef = schema._zod.def;
221
- const checks = currDef.checks;
222
- if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
223
- return clone(schema, mergeDefs(schema._zod.def, {
224
- get shape() {
225
- const newShape = { ...schema._zod.def.shape };
226
- for (const key in mask) {
227
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
228
- if (!mask[key]) continue;
229
- delete newShape[key];
230
- }
231
- assignProp(this, "shape", newShape);
232
- return newShape;
233
- },
234
- checks: []
235
- }));
236
- }
237
- function extend(schema, shape) {
238
- if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
239
- const checks = schema._zod.def.checks;
240
- if (checks && checks.length > 0) {
241
- const existingShape = schema._zod.def.shape;
242
- for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
243
- }
244
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
245
- const _shape = {
246
- ...schema._zod.def.shape,
247
- ...shape
248
- };
249
- assignProp(this, "shape", _shape);
250
- return _shape;
251
- } }));
252
- }
253
- function safeExtend(schema, shape) {
254
- if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
255
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
256
- const _shape = {
257
- ...schema._zod.def.shape,
258
- ...shape
259
- };
260
- assignProp(this, "shape", _shape);
261
- return _shape;
262
- } }));
263
- }
264
- function merge(a, b) {
265
- return clone(a, mergeDefs(a._zod.def, {
266
- get shape() {
267
- const _shape = {
268
- ...a._zod.def.shape,
269
- ...b._zod.def.shape
270
- };
271
- assignProp(this, "shape", _shape);
272
- return _shape;
273
- },
274
- get catchall() {
275
- return b._zod.def.catchall;
276
- },
277
- checks: []
278
- }));
279
- }
280
- function partial(Class, schema, mask) {
281
- const checks = schema._zod.def.checks;
282
- if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
283
- return clone(schema, mergeDefs(schema._zod.def, {
284
- get shape() {
285
- const oldShape = schema._zod.def.shape;
286
- const shape = { ...oldShape };
287
- if (mask) for (const key in mask) {
288
- if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
289
- if (!mask[key]) continue;
290
- shape[key] = Class ? new Class({
291
- type: "optional",
292
- innerType: oldShape[key]
293
- }) : oldShape[key];
294
- }
295
- else for (const key in oldShape) shape[key] = Class ? new Class({
296
- type: "optional",
297
- innerType: oldShape[key]
298
- }) : oldShape[key];
299
- assignProp(this, "shape", shape);
300
- return shape;
301
- },
302
- checks: []
303
- }));
304
- }
305
- function required(Class, schema, mask) {
306
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
307
- const oldShape = schema._zod.def.shape;
308
- const shape = { ...oldShape };
309
- if (mask) for (const key in mask) {
310
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
311
- if (!mask[key]) continue;
312
- shape[key] = new Class({
313
- type: "nonoptional",
314
- innerType: oldShape[key]
315
- });
316
- }
317
- else for (const key in oldShape) shape[key] = new Class({
318
- type: "nonoptional",
319
- innerType: oldShape[key]
320
- });
321
- assignProp(this, "shape", shape);
322
- return shape;
323
- } }));
324
- }
325
- function aborted(x, startIndex = 0) {
326
- if (x.aborted === true) return true;
327
- for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
328
- return false;
329
- }
330
- function prefixIssues(path, issues) {
331
- return issues.map((iss) => {
332
- var _a;
333
- (_a = iss).path ?? (_a.path = []);
334
- iss.path.unshift(path);
335
- return iss;
336
- });
337
- }
338
- function unwrapMessage(message) {
339
- return typeof message === "string" ? message : message?.message;
340
- }
341
- function finalizeIssue(iss, ctx, config) {
342
- const full = {
343
- ...iss,
344
- path: iss.path ?? []
345
- };
346
- if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
347
- delete full.inst;
348
- delete full.continue;
349
- if (!ctx?.reportInput) delete full.input;
350
- return full;
351
- }
352
- function getLengthableOrigin(input) {
353
- if (Array.isArray(input)) return "array";
354
- if (typeof input === "string") return "string";
355
- return "unknown";
356
- }
357
- function issue(...args) {
358
- const [iss, input, inst] = args;
359
- if (typeof iss === "string") return {
360
- message: iss,
361
- code: "custom",
362
- input,
363
- inst
364
- };
365
- return { ...iss };
366
- }
367
- //#endregion
368
- //#region ../../node_modules/zod/v4/core/errors.js
369
- var initializer$1 = (inst, def) => {
370
- inst.name = "$ZodError";
371
- Object.defineProperty(inst, "_zod", {
372
- value: inst._zod,
373
- enumerable: false
374
- });
375
- Object.defineProperty(inst, "issues", {
376
- value: def,
377
- enumerable: false
378
- });
379
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
380
- Object.defineProperty(inst, "toString", {
381
- value: () => inst.message,
382
- enumerable: false
383
- });
384
- };
385
- var $ZodError = $constructor("$ZodError", initializer$1);
386
- var $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
387
- function flattenError(error, mapper = (issue) => issue.message) {
388
- const fieldErrors = {};
389
- const formErrors = [];
390
- for (const sub of error.issues) if (sub.path.length > 0) {
391
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
392
- fieldErrors[sub.path[0]].push(mapper(sub));
393
- } else formErrors.push(mapper(sub));
394
- return {
395
- formErrors,
396
- fieldErrors
397
- };
398
- }
399
- function formatError(error, mapper = (issue) => issue.message) {
400
- const fieldErrors = { _errors: [] };
401
- const processError = (error) => {
402
- for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
403
- else if (issue.code === "invalid_key") processError({ issues: issue.issues });
404
- else if (issue.code === "invalid_element") processError({ issues: issue.issues });
405
- else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
406
- else {
407
- let curr = fieldErrors;
408
- let i = 0;
409
- while (i < issue.path.length) {
410
- const el = issue.path[i];
411
- if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
412
- else {
413
- curr[el] = curr[el] || { _errors: [] };
414
- curr[el]._errors.push(mapper(issue));
415
- }
416
- curr = curr[el];
417
- i++;
418
- }
419
- }
420
- };
421
- processError(error);
422
- return fieldErrors;
423
- }
424
- //#endregion
425
- //#region ../../node_modules/zod/v4/core/parse.js
426
- var _parse = (_Err) => (schema, value, _ctx, _params) => {
427
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
428
- const result = schema._zod.run({
429
- value,
430
- issues: []
431
- }, ctx);
432
- if (result instanceof Promise) throw new $ZodAsyncError();
433
- if (result.issues.length) {
434
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
435
- captureStackTrace(e, _params?.callee);
436
- throw e;
437
- }
438
- return result.value;
439
- };
440
- var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
441
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
442
- let result = schema._zod.run({
443
- value,
444
- issues: []
445
- }, ctx);
446
- if (result instanceof Promise) result = await result;
447
- if (result.issues.length) {
448
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
449
- captureStackTrace(e, params?.callee);
450
- throw e;
451
- }
452
- return result.value;
453
- };
454
- var _safeParse = (_Err) => (schema, value, _ctx) => {
455
- const ctx = _ctx ? {
456
- ..._ctx,
457
- async: false
458
- } : { async: false };
459
- const result = schema._zod.run({
460
- value,
461
- issues: []
462
- }, ctx);
463
- if (result instanceof Promise) throw new $ZodAsyncError();
464
- return result.issues.length ? {
465
- success: false,
466
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
467
- } : {
468
- success: true,
469
- data: result.value
470
- };
471
- };
472
- var safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
473
- var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
474
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
475
- let result = schema._zod.run({
476
- value,
477
- issues: []
478
- }, ctx);
479
- if (result instanceof Promise) result = await result;
480
- return result.issues.length ? {
481
- success: false,
482
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
483
- } : {
484
- success: true,
485
- data: result.value
486
- };
487
- };
488
- var safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
489
- var _encode = (_Err) => (schema, value, _ctx) => {
490
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
491
- return _parse(_Err)(schema, value, ctx);
492
- };
493
- var _decode = (_Err) => (schema, value, _ctx) => {
494
- return _parse(_Err)(schema, value, _ctx);
495
- };
496
- var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
497
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
498
- return _parseAsync(_Err)(schema, value, ctx);
499
- };
500
- var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
501
- return _parseAsync(_Err)(schema, value, _ctx);
502
- };
503
- var _safeEncode = (_Err) => (schema, value, _ctx) => {
504
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
505
- return _safeParse(_Err)(schema, value, ctx);
506
- };
507
- var _safeDecode = (_Err) => (schema, value, _ctx) => {
508
- return _safeParse(_Err)(schema, value, _ctx);
509
- };
510
- var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
511
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
512
- return _safeParseAsync(_Err)(schema, value, ctx);
513
- };
514
- var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
515
- return _safeParseAsync(_Err)(schema, value, _ctx);
516
- };
517
- //#endregion
518
- //#region ../../node_modules/zod/v4/core/regexes.js
519
- var cuid = /^[cC][^\s-]{8,}$/;
520
- var cuid2 = /^[0-9a-z]+$/;
521
- var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
522
- var xid = /^[0-9a-vA-V]{20}$/;
523
- var ksuid = /^[A-Za-z0-9]{27}$/;
524
- var nanoid = /^[a-zA-Z0-9_-]{21}$/;
525
- /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
526
- var duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
527
- /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
528
- var guid = /^([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})$/;
529
- /** Returns a regex for validating an RFC 9562/4122 UUID.
530
- *
531
- * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
532
- var uuid = (version) => {
533
- if (!version) return /^([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)$/;
534
- return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
535
- };
536
- /** Practical email validation */
537
- var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
538
- var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
539
- function emoji() {
540
- return new RegExp(_emoji$1, "u");
541
- }
542
- var ipv4 = /^(?:(?: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])$/;
543
- var ipv6 = /^(([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}|:))$/;
544
- var cidrv4 = /^((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])$/;
545
- var cidrv6 = /^(([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])$/;
546
- var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
547
- var base64url = /^[A-Za-z0-9_-]*$/;
548
- var e164 = /^\+[1-9]\d{6,14}$/;
549
- var dateSource = `(?:(?:\\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])))`;
550
- var date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
551
- function timeSource(args) {
552
- const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
553
- return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
554
- }
555
- function time$1(args) {
556
- return new RegExp(`^${timeSource(args)}$`);
557
- }
558
- function datetime$1(args) {
559
- const time = timeSource({ precision: args.precision });
560
- const opts = ["Z"];
561
- if (args.local) opts.push("");
562
- if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
563
- const timeRegex = `${time}(?:${opts.join("|")})`;
564
- return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
565
- }
566
- var string$1 = (params) => {
567
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
568
- return new RegExp(`^${regex}$`);
569
- };
570
- var integer = /^-?\d+$/;
571
- var number$1 = /^-?\d+(?:\.\d+)?$/;
572
- var boolean$1 = /^(?:true|false)$/i;
573
- var lowercase = /^[^A-Z]*$/;
574
- var uppercase = /^[^a-z]*$/;
575
- //#endregion
576
- //#region ../../node_modules/zod/v4/core/checks.js
577
- var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
578
- var _a;
579
- inst._zod ?? (inst._zod = {});
580
- inst._zod.def = def;
581
- (_a = inst._zod).onattach ?? (_a.onattach = []);
582
- });
583
- var numericOriginMap = {
584
- number: "number",
585
- bigint: "bigint",
586
- object: "date"
587
- };
588
- var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
589
- $ZodCheck.init(inst, def);
590
- const origin = numericOriginMap[typeof def.value];
591
- inst._zod.onattach.push((inst) => {
592
- const bag = inst._zod.bag;
593
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
594
- if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
595
- else bag.exclusiveMaximum = def.value;
596
- });
597
- inst._zod.check = (payload) => {
598
- if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
599
- payload.issues.push({
600
- origin,
601
- code: "too_big",
602
- maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
603
- input: payload.value,
604
- inclusive: def.inclusive,
605
- inst,
606
- continue: !def.abort
607
- });
608
- };
609
- });
610
- var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
611
- $ZodCheck.init(inst, def);
612
- const origin = numericOriginMap[typeof def.value];
613
- inst._zod.onattach.push((inst) => {
614
- const bag = inst._zod.bag;
615
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
616
- if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
617
- else bag.exclusiveMinimum = def.value;
618
- });
619
- inst._zod.check = (payload) => {
620
- if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
621
- payload.issues.push({
622
- origin,
623
- code: "too_small",
624
- minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
625
- input: payload.value,
626
- inclusive: def.inclusive,
627
- inst,
628
- continue: !def.abort
629
- });
630
- };
631
- });
632
- var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
633
- $ZodCheck.init(inst, def);
634
- inst._zod.onattach.push((inst) => {
635
- var _a;
636
- (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
637
- });
638
- inst._zod.check = (payload) => {
639
- if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
640
- if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
641
- payload.issues.push({
642
- origin: typeof payload.value,
643
- code: "not_multiple_of",
644
- divisor: def.value,
645
- input: payload.value,
646
- inst,
647
- continue: !def.abort
648
- });
649
- };
650
- });
651
- var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
652
- $ZodCheck.init(inst, def);
653
- def.format = def.format || "float64";
654
- const isInt = def.format?.includes("int");
655
- const origin = isInt ? "int" : "number";
656
- const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
657
- inst._zod.onattach.push((inst) => {
658
- const bag = inst._zod.bag;
659
- bag.format = def.format;
660
- bag.minimum = minimum;
661
- bag.maximum = maximum;
662
- if (isInt) bag.pattern = integer;
663
- });
664
- inst._zod.check = (payload) => {
665
- const input = payload.value;
666
- if (isInt) {
667
- if (!Number.isInteger(input)) {
668
- payload.issues.push({
669
- expected: origin,
670
- format: def.format,
671
- code: "invalid_type",
672
- continue: false,
673
- input,
674
- inst
675
- });
676
- return;
677
- }
678
- if (!Number.isSafeInteger(input)) {
679
- if (input > 0) payload.issues.push({
680
- input,
681
- code: "too_big",
682
- maximum: Number.MAX_SAFE_INTEGER,
683
- note: "Integers must be within the safe integer range.",
684
- inst,
685
- origin,
686
- inclusive: true,
687
- continue: !def.abort
688
- });
689
- else payload.issues.push({
690
- input,
691
- code: "too_small",
692
- minimum: Number.MIN_SAFE_INTEGER,
693
- note: "Integers must be within the safe integer range.",
694
- inst,
695
- origin,
696
- inclusive: true,
697
- continue: !def.abort
698
- });
699
- return;
700
- }
701
- }
702
- if (input < minimum) payload.issues.push({
703
- origin: "number",
704
- input,
705
- code: "too_small",
706
- minimum,
707
- inclusive: true,
708
- inst,
709
- continue: !def.abort
710
- });
711
- if (input > maximum) payload.issues.push({
712
- origin: "number",
713
- input,
714
- code: "too_big",
715
- maximum,
716
- inclusive: true,
717
- inst,
718
- continue: !def.abort
719
- });
720
- };
721
- });
722
- var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
723
- var _a;
724
- $ZodCheck.init(inst, def);
725
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
726
- const val = payload.value;
727
- return !nullish(val) && val.length !== void 0;
728
- });
729
- inst._zod.onattach.push((inst) => {
730
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
731
- if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
732
- });
733
- inst._zod.check = (payload) => {
734
- const input = payload.value;
735
- if (input.length <= def.maximum) return;
736
- const origin = getLengthableOrigin(input);
737
- payload.issues.push({
738
- origin,
739
- code: "too_big",
740
- maximum: def.maximum,
741
- inclusive: true,
742
- input,
743
- inst,
744
- continue: !def.abort
745
- });
746
- };
747
- });
748
- var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
749
- var _a;
750
- $ZodCheck.init(inst, def);
751
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
752
- const val = payload.value;
753
- return !nullish(val) && val.length !== void 0;
754
- });
755
- inst._zod.onattach.push((inst) => {
756
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
757
- if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
758
- });
759
- inst._zod.check = (payload) => {
760
- const input = payload.value;
761
- if (input.length >= def.minimum) return;
762
- const origin = getLengthableOrigin(input);
763
- payload.issues.push({
764
- origin,
765
- code: "too_small",
766
- minimum: def.minimum,
767
- inclusive: true,
768
- input,
769
- inst,
770
- continue: !def.abort
771
- });
772
- };
773
- });
774
- var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
775
- var _a;
776
- $ZodCheck.init(inst, def);
777
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
778
- const val = payload.value;
779
- return !nullish(val) && val.length !== void 0;
780
- });
781
- inst._zod.onattach.push((inst) => {
782
- const bag = inst._zod.bag;
783
- bag.minimum = def.length;
784
- bag.maximum = def.length;
785
- bag.length = def.length;
786
- });
787
- inst._zod.check = (payload) => {
788
- const input = payload.value;
789
- const length = input.length;
790
- if (length === def.length) return;
791
- const origin = getLengthableOrigin(input);
792
- const tooBig = length > def.length;
793
- payload.issues.push({
794
- origin,
795
- ...tooBig ? {
796
- code: "too_big",
797
- maximum: def.length
798
- } : {
799
- code: "too_small",
800
- minimum: def.length
801
- },
802
- inclusive: true,
803
- exact: true,
804
- input: payload.value,
805
- inst,
806
- continue: !def.abort
807
- });
808
- };
809
- });
810
- var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
811
- var _a, _b;
812
- $ZodCheck.init(inst, def);
813
- inst._zod.onattach.push((inst) => {
814
- const bag = inst._zod.bag;
815
- bag.format = def.format;
816
- if (def.pattern) {
817
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
818
- bag.patterns.add(def.pattern);
819
- }
820
- });
821
- if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
822
- def.pattern.lastIndex = 0;
823
- if (def.pattern.test(payload.value)) return;
824
- payload.issues.push({
825
- origin: "string",
826
- code: "invalid_format",
827
- format: def.format,
828
- input: payload.value,
829
- ...def.pattern ? { pattern: def.pattern.toString() } : {},
830
- inst,
831
- continue: !def.abort
832
- });
833
- });
834
- else (_b = inst._zod).check ?? (_b.check = () => {});
835
- });
836
- var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
837
- $ZodCheckStringFormat.init(inst, def);
838
- inst._zod.check = (payload) => {
839
- def.pattern.lastIndex = 0;
840
- if (def.pattern.test(payload.value)) return;
841
- payload.issues.push({
842
- origin: "string",
843
- code: "invalid_format",
844
- format: "regex",
845
- input: payload.value,
846
- pattern: def.pattern.toString(),
847
- inst,
848
- continue: !def.abort
849
- });
850
- };
851
- });
852
- var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
853
- def.pattern ?? (def.pattern = lowercase);
854
- $ZodCheckStringFormat.init(inst, def);
855
- });
856
- var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
857
- def.pattern ?? (def.pattern = uppercase);
858
- $ZodCheckStringFormat.init(inst, def);
859
- });
860
- var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
861
- $ZodCheck.init(inst, def);
862
- const escapedRegex = escapeRegex(def.includes);
863
- const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
864
- def.pattern = pattern;
865
- inst._zod.onattach.push((inst) => {
866
- const bag = inst._zod.bag;
867
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
868
- bag.patterns.add(pattern);
869
- });
870
- inst._zod.check = (payload) => {
871
- if (payload.value.includes(def.includes, def.position)) return;
872
- payload.issues.push({
873
- origin: "string",
874
- code: "invalid_format",
875
- format: "includes",
876
- includes: def.includes,
877
- input: payload.value,
878
- inst,
879
- continue: !def.abort
880
- });
881
- };
882
- });
883
- var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
884
- $ZodCheck.init(inst, def);
885
- const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
886
- def.pattern ?? (def.pattern = pattern);
887
- inst._zod.onattach.push((inst) => {
888
- const bag = inst._zod.bag;
889
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
890
- bag.patterns.add(pattern);
891
- });
892
- inst._zod.check = (payload) => {
893
- if (payload.value.startsWith(def.prefix)) return;
894
- payload.issues.push({
895
- origin: "string",
896
- code: "invalid_format",
897
- format: "starts_with",
898
- prefix: def.prefix,
899
- input: payload.value,
900
- inst,
901
- continue: !def.abort
902
- });
903
- };
904
- });
905
- var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
906
- $ZodCheck.init(inst, def);
907
- const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
908
- def.pattern ?? (def.pattern = pattern);
909
- inst._zod.onattach.push((inst) => {
910
- const bag = inst._zod.bag;
911
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
912
- bag.patterns.add(pattern);
913
- });
914
- inst._zod.check = (payload) => {
915
- if (payload.value.endsWith(def.suffix)) return;
916
- payload.issues.push({
917
- origin: "string",
918
- code: "invalid_format",
919
- format: "ends_with",
920
- suffix: def.suffix,
921
- input: payload.value,
922
- inst,
923
- continue: !def.abort
924
- });
925
- };
926
- });
927
- var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
928
- $ZodCheck.init(inst, def);
929
- inst._zod.check = (payload) => {
930
- payload.value = def.tx(payload.value);
931
- };
932
- });
933
- //#endregion
934
- //#region ../../node_modules/zod/v4/core/doc.js
935
- var Doc = class {
936
- constructor(args = []) {
937
- this.content = [];
938
- this.indent = 0;
939
- if (this) this.args = args;
940
- }
941
- indented(fn) {
942
- this.indent += 1;
943
- fn(this);
944
- this.indent -= 1;
945
- }
946
- write(arg) {
947
- if (typeof arg === "function") {
948
- arg(this, { execution: "sync" });
949
- arg(this, { execution: "async" });
950
- return;
951
- }
952
- const lines = arg.split("\n").filter((x) => x);
953
- const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
954
- const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
955
- for (const line of dedented) this.content.push(line);
956
- }
957
- compile() {
958
- const F = Function;
959
- const args = this?.args;
960
- const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
961
- return new F(...args, lines.join("\n"));
962
- }
963
- };
964
- //#endregion
965
- //#region ../../node_modules/zod/v4/core/versions.js
966
- var version = {
967
- major: 4,
968
- minor: 3,
969
- patch: 6
970
- };
971
- //#endregion
972
- //#region ../../node_modules/zod/v4/core/schemas.js
973
- var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
974
- var _a;
975
- inst ?? (inst = {});
976
- inst._zod.def = def;
977
- inst._zod.bag = inst._zod.bag || {};
978
- inst._zod.version = version;
979
- const checks = [...inst._zod.def.checks ?? []];
980
- if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
981
- for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
982
- if (checks.length === 0) {
983
- (_a = inst._zod).deferred ?? (_a.deferred = []);
984
- inst._zod.deferred?.push(() => {
985
- inst._zod.run = inst._zod.parse;
986
- });
987
- } else {
988
- const runChecks = (payload, checks, ctx) => {
989
- let isAborted = aborted(payload);
990
- let asyncResult;
991
- for (const ch of checks) {
992
- if (ch._zod.def.when) {
993
- if (!ch._zod.def.when(payload)) continue;
994
- } else if (isAborted) continue;
995
- const currLen = payload.issues.length;
996
- const _ = ch._zod.check(payload);
997
- if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
998
- if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
999
- await _;
1000
- if (payload.issues.length === currLen) return;
1001
- if (!isAborted) isAborted = aborted(payload, currLen);
1002
- });
1003
- else {
1004
- if (payload.issues.length === currLen) continue;
1005
- if (!isAborted) isAborted = aborted(payload, currLen);
1006
- }
1007
- }
1008
- if (asyncResult) return asyncResult.then(() => {
1009
- return payload;
1010
- });
1011
- return payload;
1012
- };
1013
- const handleCanaryResult = (canary, payload, ctx) => {
1014
- if (aborted(canary)) {
1015
- canary.aborted = true;
1016
- return canary;
1017
- }
1018
- const checkResult = runChecks(payload, checks, ctx);
1019
- if (checkResult instanceof Promise) {
1020
- if (ctx.async === false) throw new $ZodAsyncError();
1021
- return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
1022
- }
1023
- return inst._zod.parse(checkResult, ctx);
1024
- };
1025
- inst._zod.run = (payload, ctx) => {
1026
- if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
1027
- if (ctx.direction === "backward") {
1028
- const canary = inst._zod.parse({
1029
- value: payload.value,
1030
- issues: []
1031
- }, {
1032
- ...ctx,
1033
- skipChecks: true
1034
- });
1035
- if (canary instanceof Promise) return canary.then((canary) => {
1036
- return handleCanaryResult(canary, payload, ctx);
1037
- });
1038
- return handleCanaryResult(canary, payload, ctx);
1039
- }
1040
- const result = inst._zod.parse(payload, ctx);
1041
- if (result instanceof Promise) {
1042
- if (ctx.async === false) throw new $ZodAsyncError();
1043
- return result.then((result) => runChecks(result, checks, ctx));
1044
- }
1045
- return runChecks(result, checks, ctx);
1046
- };
1047
- }
1048
- defineLazy(inst, "~standard", () => ({
1049
- validate: (value) => {
1050
- try {
1051
- const r = safeParse$1(inst, value);
1052
- return r.success ? { value: r.data } : { issues: r.error?.issues };
1053
- } catch (_) {
1054
- return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1055
- }
1056
- },
1057
- vendor: "zod",
1058
- version: 1
1059
- }));
1060
- });
1061
- var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1062
- $ZodType.init(inst, def);
1063
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
1064
- inst._zod.parse = (payload, _) => {
1065
- if (def.coerce) try {
1066
- payload.value = String(payload.value);
1067
- } catch (_) {}
1068
- if (typeof payload.value === "string") return payload;
1069
- payload.issues.push({
1070
- expected: "string",
1071
- code: "invalid_type",
1072
- input: payload.value,
1073
- inst
1074
- });
1075
- return payload;
1076
- };
1077
- });
1078
- var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
1079
- $ZodCheckStringFormat.init(inst, def);
1080
- $ZodString.init(inst, def);
1081
- });
1082
- var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
1083
- def.pattern ?? (def.pattern = guid);
1084
- $ZodStringFormat.init(inst, def);
1085
- });
1086
- var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
1087
- if (def.version) {
1088
- const v = {
1089
- v1: 1,
1090
- v2: 2,
1091
- v3: 3,
1092
- v4: 4,
1093
- v5: 5,
1094
- v6: 6,
1095
- v7: 7,
1096
- v8: 8
1097
- }[def.version];
1098
- if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
1099
- def.pattern ?? (def.pattern = uuid(v));
1100
- } else def.pattern ?? (def.pattern = uuid());
1101
- $ZodStringFormat.init(inst, def);
1102
- });
1103
- var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
1104
- def.pattern ?? (def.pattern = email);
1105
- $ZodStringFormat.init(inst, def);
1106
- });
1107
- var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1108
- $ZodStringFormat.init(inst, def);
1109
- inst._zod.check = (payload) => {
1110
- try {
1111
- const trimmed = payload.value.trim();
1112
- const url = new URL(trimmed);
1113
- if (def.hostname) {
1114
- def.hostname.lastIndex = 0;
1115
- if (!def.hostname.test(url.hostname)) payload.issues.push({
1116
- code: "invalid_format",
1117
- format: "url",
1118
- note: "Invalid hostname",
1119
- pattern: def.hostname.source,
1120
- input: payload.value,
1121
- inst,
1122
- continue: !def.abort
1123
- });
1124
- }
1125
- if (def.protocol) {
1126
- def.protocol.lastIndex = 0;
1127
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1128
- code: "invalid_format",
1129
- format: "url",
1130
- note: "Invalid protocol",
1131
- pattern: def.protocol.source,
1132
- input: payload.value,
1133
- inst,
1134
- continue: !def.abort
1135
- });
1136
- }
1137
- if (def.normalize) payload.value = url.href;
1138
- else payload.value = trimmed;
1139
- return;
1140
- } catch (_) {
1141
- payload.issues.push({
1142
- code: "invalid_format",
1143
- format: "url",
1144
- input: payload.value,
1145
- inst,
1146
- continue: !def.abort
1147
- });
1148
- }
1149
- };
1150
- });
1151
- var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
1152
- def.pattern ?? (def.pattern = emoji());
1153
- $ZodStringFormat.init(inst, def);
1154
- });
1155
- var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
1156
- def.pattern ?? (def.pattern = nanoid);
1157
- $ZodStringFormat.init(inst, def);
1158
- });
1159
- var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
1160
- def.pattern ?? (def.pattern = cuid);
1161
- $ZodStringFormat.init(inst, def);
1162
- });
1163
- var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
1164
- def.pattern ?? (def.pattern = cuid2);
1165
- $ZodStringFormat.init(inst, def);
1166
- });
1167
- var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
1168
- def.pattern ?? (def.pattern = ulid);
1169
- $ZodStringFormat.init(inst, def);
1170
- });
1171
- var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
1172
- def.pattern ?? (def.pattern = xid);
1173
- $ZodStringFormat.init(inst, def);
1174
- });
1175
- var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
1176
- def.pattern ?? (def.pattern = ksuid);
1177
- $ZodStringFormat.init(inst, def);
1178
- });
1179
- var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
1180
- def.pattern ?? (def.pattern = datetime$1(def));
1181
- $ZodStringFormat.init(inst, def);
1182
- });
1183
- var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
1184
- def.pattern ?? (def.pattern = date$1);
1185
- $ZodStringFormat.init(inst, def);
1186
- });
1187
- var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
1188
- def.pattern ?? (def.pattern = time$1(def));
1189
- $ZodStringFormat.init(inst, def);
1190
- });
1191
- var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
1192
- def.pattern ?? (def.pattern = duration$1);
1193
- $ZodStringFormat.init(inst, def);
1194
- });
1195
- var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
1196
- def.pattern ?? (def.pattern = ipv4);
1197
- $ZodStringFormat.init(inst, def);
1198
- inst._zod.bag.format = `ipv4`;
1199
- });
1200
- var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
1201
- def.pattern ?? (def.pattern = ipv6);
1202
- $ZodStringFormat.init(inst, def);
1203
- inst._zod.bag.format = `ipv6`;
1204
- inst._zod.check = (payload) => {
1205
- try {
1206
- new URL(`http://[${payload.value}]`);
1207
- } catch {
1208
- payload.issues.push({
1209
- code: "invalid_format",
1210
- format: "ipv6",
1211
- input: payload.value,
1212
- inst,
1213
- continue: !def.abort
1214
- });
1215
- }
1216
- };
1217
- });
1218
- var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
1219
- def.pattern ?? (def.pattern = cidrv4);
1220
- $ZodStringFormat.init(inst, def);
1221
- });
1222
- var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
1223
- def.pattern ?? (def.pattern = cidrv6);
1224
- $ZodStringFormat.init(inst, def);
1225
- inst._zod.check = (payload) => {
1226
- const parts = payload.value.split("/");
1227
- try {
1228
- if (parts.length !== 2) throw new Error();
1229
- const [address, prefix] = parts;
1230
- if (!prefix) throw new Error();
1231
- const prefixNum = Number(prefix);
1232
- if (`${prefixNum}` !== prefix) throw new Error();
1233
- if (prefixNum < 0 || prefixNum > 128) throw new Error();
1234
- new URL(`http://[${address}]`);
1235
- } catch {
1236
- payload.issues.push({
1237
- code: "invalid_format",
1238
- format: "cidrv6",
1239
- input: payload.value,
1240
- inst,
1241
- continue: !def.abort
1242
- });
1243
- }
1244
- };
1245
- });
1246
- function isValidBase64(data) {
1247
- if (data === "") return true;
1248
- if (data.length % 4 !== 0) return false;
1249
- try {
1250
- atob(data);
1251
- return true;
1252
- } catch {
1253
- return false;
1254
- }
1255
- }
1256
- var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1257
- def.pattern ?? (def.pattern = base64);
1258
- $ZodStringFormat.init(inst, def);
1259
- inst._zod.bag.contentEncoding = "base64";
1260
- inst._zod.check = (payload) => {
1261
- if (isValidBase64(payload.value)) return;
1262
- payload.issues.push({
1263
- code: "invalid_format",
1264
- format: "base64",
1265
- input: payload.value,
1266
- inst,
1267
- continue: !def.abort
1268
- });
1269
- };
1270
- });
1271
- function isValidBase64URL(data) {
1272
- if (!base64url.test(data)) return false;
1273
- const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1274
- return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
1275
- }
1276
- var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1277
- def.pattern ?? (def.pattern = base64url);
1278
- $ZodStringFormat.init(inst, def);
1279
- inst._zod.bag.contentEncoding = "base64url";
1280
- inst._zod.check = (payload) => {
1281
- if (isValidBase64URL(payload.value)) return;
1282
- payload.issues.push({
1283
- code: "invalid_format",
1284
- format: "base64url",
1285
- input: payload.value,
1286
- inst,
1287
- continue: !def.abort
1288
- });
1289
- };
1290
- });
1291
- var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
1292
- def.pattern ?? (def.pattern = e164);
1293
- $ZodStringFormat.init(inst, def);
1294
- });
1295
- function isValidJWT(token, algorithm = null) {
1296
- try {
1297
- const tokensParts = token.split(".");
1298
- if (tokensParts.length !== 3) return false;
1299
- const [header] = tokensParts;
1300
- if (!header) return false;
1301
- const parsedHeader = JSON.parse(atob(header));
1302
- if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1303
- if (!parsedHeader.alg) return false;
1304
- if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
1305
- return true;
1306
- } catch {
1307
- return false;
1308
- }
1309
- }
1310
- var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1311
- $ZodStringFormat.init(inst, def);
1312
- inst._zod.check = (payload) => {
1313
- if (isValidJWT(payload.value, def.alg)) return;
1314
- payload.issues.push({
1315
- code: "invalid_format",
1316
- format: "jwt",
1317
- input: payload.value,
1318
- inst,
1319
- continue: !def.abort
1320
- });
1321
- };
1322
- });
1323
- var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1324
- $ZodType.init(inst, def);
1325
- inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1326
- inst._zod.parse = (payload, _ctx) => {
1327
- if (def.coerce) try {
1328
- payload.value = Number(payload.value);
1329
- } catch (_) {}
1330
- const input = payload.value;
1331
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1332
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1333
- payload.issues.push({
1334
- expected: "number",
1335
- code: "invalid_type",
1336
- input,
1337
- inst,
1338
- ...received ? { received } : {}
1339
- });
1340
- return payload;
1341
- };
1342
- });
1343
- var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
1344
- $ZodCheckNumberFormat.init(inst, def);
1345
- $ZodNumber.init(inst, def);
1346
- });
1347
- var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1348
- $ZodType.init(inst, def);
1349
- inst._zod.pattern = boolean$1;
1350
- inst._zod.parse = (payload, _ctx) => {
1351
- if (def.coerce) try {
1352
- payload.value = Boolean(payload.value);
1353
- } catch (_) {}
1354
- const input = payload.value;
1355
- if (typeof input === "boolean") return payload;
1356
- payload.issues.push({
1357
- expected: "boolean",
1358
- code: "invalid_type",
1359
- input,
1360
- inst
1361
- });
1362
- return payload;
1363
- };
1364
- });
1365
- var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1366
- $ZodType.init(inst, def);
1367
- inst._zod.parse = (payload) => payload;
1368
- });
1369
- var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1370
- $ZodType.init(inst, def);
1371
- inst._zod.parse = (payload, _ctx) => {
1372
- payload.issues.push({
1373
- expected: "never",
1374
- code: "invalid_type",
1375
- input: payload.value,
1376
- inst
1377
- });
1378
- return payload;
1379
- };
1380
- });
1381
- function handleArrayResult(result, final, index) {
1382
- if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1383
- final.value[index] = result.value;
1384
- }
1385
- var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1386
- $ZodType.init(inst, def);
1387
- inst._zod.parse = (payload, ctx) => {
1388
- const input = payload.value;
1389
- if (!Array.isArray(input)) {
1390
- payload.issues.push({
1391
- expected: "array",
1392
- code: "invalid_type",
1393
- input,
1394
- inst
1395
- });
1396
- return payload;
1397
- }
1398
- payload.value = Array(input.length);
1399
- const proms = [];
1400
- for (let i = 0; i < input.length; i++) {
1401
- const item = input[i];
1402
- const result = def.element._zod.run({
1403
- value: item,
1404
- issues: []
1405
- }, ctx);
1406
- if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
1407
- else handleArrayResult(result, payload, i);
1408
- }
1409
- if (proms.length) return Promise.all(proms).then(() => payload);
1410
- return payload;
1411
- };
1412
- });
1413
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
1414
- if (result.issues.length) {
1415
- if (isOptionalOut && !(key in input)) return;
1416
- final.issues.push(...prefixIssues(key, result.issues));
1417
- }
1418
- if (result.value === void 0) {
1419
- if (key in input) final.value[key] = void 0;
1420
- } else final.value[key] = result.value;
1421
- }
1422
- function normalizeDef(def) {
1423
- const keys = Object.keys(def.shape);
1424
- for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1425
- const okeys = optionalKeys(def.shape);
1426
- return {
1427
- ...def,
1428
- keys,
1429
- keySet: new Set(keys),
1430
- numKeys: keys.length,
1431
- optionalKeys: new Set(okeys)
1432
- };
1433
- }
1434
- function handleCatchall(proms, input, payload, ctx, def, inst) {
1435
- const unrecognized = [];
1436
- const keySet = def.keySet;
1437
- const _catchall = def.catchall._zod;
1438
- const t = _catchall.def.type;
1439
- const isOptionalOut = _catchall.optout === "optional";
1440
- for (const key in input) {
1441
- if (keySet.has(key)) continue;
1442
- if (t === "never") {
1443
- unrecognized.push(key);
1444
- continue;
1445
- }
1446
- const r = _catchall.run({
1447
- value: input[key],
1448
- issues: []
1449
- }, ctx);
1450
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1451
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1452
- }
1453
- if (unrecognized.length) payload.issues.push({
1454
- code: "unrecognized_keys",
1455
- keys: unrecognized,
1456
- input,
1457
- inst
1458
- });
1459
- if (!proms.length) return payload;
1460
- return Promise.all(proms).then(() => {
1461
- return payload;
1462
- });
1463
- }
1464
- var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1465
- $ZodType.init(inst, def);
1466
- if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1467
- const sh = def.shape;
1468
- Object.defineProperty(def, "shape", { get: () => {
1469
- const newSh = { ...sh };
1470
- Object.defineProperty(def, "shape", { value: newSh });
1471
- return newSh;
1472
- } });
1473
- }
1474
- const _normalized = cached(() => normalizeDef(def));
1475
- defineLazy(inst._zod, "propValues", () => {
1476
- const shape = def.shape;
1477
- const propValues = {};
1478
- for (const key in shape) {
1479
- const field = shape[key]._zod;
1480
- if (field.values) {
1481
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1482
- for (const v of field.values) propValues[key].add(v);
1483
- }
1484
- }
1485
- return propValues;
1486
- });
1487
- const isObject$2 = isObject;
1488
- const catchall = def.catchall;
1489
- let value;
1490
- inst._zod.parse = (payload, ctx) => {
1491
- value ?? (value = _normalized.value);
1492
- const input = payload.value;
1493
- if (!isObject$2(input)) {
1494
- payload.issues.push({
1495
- expected: "object",
1496
- code: "invalid_type",
1497
- input,
1498
- inst
1499
- });
1500
- return payload;
1501
- }
1502
- payload.value = {};
1503
- const proms = [];
1504
- const shape = value.shape;
1505
- for (const key of value.keys) {
1506
- const el = shape[key];
1507
- const isOptionalOut = el._zod.optout === "optional";
1508
- const r = el._zod.run({
1509
- value: input[key],
1510
- issues: []
1511
- }, ctx);
1512
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1513
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1514
- }
1515
- if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1516
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1517
- };
1518
- });
1519
- var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
1520
- $ZodObject.init(inst, def);
1521
- const superParse = inst._zod.parse;
1522
- const _normalized = cached(() => normalizeDef(def));
1523
- const generateFastpass = (shape) => {
1524
- const doc = new Doc([
1525
- "shape",
1526
- "payload",
1527
- "ctx"
1528
- ]);
1529
- const normalized = _normalized.value;
1530
- const parseStr = (key) => {
1531
- const k = esc(key);
1532
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1533
- };
1534
- doc.write(`const input = payload.value;`);
1535
- const ids = Object.create(null);
1536
- let counter = 0;
1537
- for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1538
- doc.write(`const newResult = {};`);
1539
- for (const key of normalized.keys) {
1540
- const id = ids[key];
1541
- const k = esc(key);
1542
- const isOptionalOut = shape[key]?._zod?.optout === "optional";
1543
- doc.write(`const ${id} = ${parseStr(key)};`);
1544
- if (isOptionalOut) doc.write(`
1545
- if (${id}.issues.length) {
1546
- if (${k} in input) {
1547
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1548
- ...iss,
1549
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1550
- })));
1551
- }
1552
- }
1553
-
1554
- if (${id}.value === undefined) {
1555
- if (${k} in input) {
1556
- newResult[${k}] = undefined;
1557
- }
1558
- } else {
1559
- newResult[${k}] = ${id}.value;
1560
- }
1561
-
1562
- `);
1563
- else doc.write(`
1564
- if (${id}.issues.length) {
1565
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1566
- ...iss,
1567
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1568
- })));
1569
- }
1570
-
1571
- if (${id}.value === undefined) {
1572
- if (${k} in input) {
1573
- newResult[${k}] = undefined;
1574
- }
1575
- } else {
1576
- newResult[${k}] = ${id}.value;
1577
- }
1578
-
1579
- `);
1580
- }
1581
- doc.write(`payload.value = newResult;`);
1582
- doc.write(`return payload;`);
1583
- const fn = doc.compile();
1584
- return (payload, ctx) => fn(shape, payload, ctx);
1585
- };
1586
- let fastpass;
1587
- const isObject$1 = isObject;
1588
- const jit = !globalConfig.jitless;
1589
- const fastEnabled = jit && allowsEval.value;
1590
- const catchall = def.catchall;
1591
- let value;
1592
- inst._zod.parse = (payload, ctx) => {
1593
- value ?? (value = _normalized.value);
1594
- const input = payload.value;
1595
- if (!isObject$1(input)) {
1596
- payload.issues.push({
1597
- expected: "object",
1598
- code: "invalid_type",
1599
- input,
1600
- inst
1601
- });
1602
- return payload;
1603
- }
1604
- if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1605
- if (!fastpass) fastpass = generateFastpass(def.shape);
1606
- payload = fastpass(payload, ctx);
1607
- if (!catchall) return payload;
1608
- return handleCatchall([], input, payload, ctx, value, inst);
1609
- }
1610
- return superParse(payload, ctx);
1611
- };
1612
- });
1613
- function handleUnionResults(results, final, inst, ctx) {
1614
- for (const result of results) if (result.issues.length === 0) {
1615
- final.value = result.value;
1616
- return final;
1617
- }
1618
- const nonaborted = results.filter((r) => !aborted(r));
1619
- if (nonaborted.length === 1) {
1620
- final.value = nonaborted[0].value;
1621
- return nonaborted[0];
1622
- }
1623
- final.issues.push({
1624
- code: "invalid_union",
1625
- input: final.value,
1626
- inst,
1627
- errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1628
- });
1629
- return final;
1630
- }
1631
- var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1632
- $ZodType.init(inst, def);
1633
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1634
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1635
- defineLazy(inst._zod, "values", () => {
1636
- if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1637
- });
1638
- defineLazy(inst._zod, "pattern", () => {
1639
- if (def.options.every((o) => o._zod.pattern)) {
1640
- const patterns = def.options.map((o) => o._zod.pattern);
1641
- return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1642
- }
1643
- });
1644
- const single = def.options.length === 1;
1645
- const first = def.options[0]._zod.run;
1646
- inst._zod.parse = (payload, ctx) => {
1647
- if (single) return first(payload, ctx);
1648
- let async = false;
1649
- const results = [];
1650
- for (const option of def.options) {
1651
- const result = option._zod.run({
1652
- value: payload.value,
1653
- issues: []
1654
- }, ctx);
1655
- if (result instanceof Promise) {
1656
- results.push(result);
1657
- async = true;
1658
- } else {
1659
- if (result.issues.length === 0) return result;
1660
- results.push(result);
1661
- }
1662
- }
1663
- if (!async) return handleUnionResults(results, payload, inst, ctx);
1664
- return Promise.all(results).then((results) => {
1665
- return handleUnionResults(results, payload, inst, ctx);
1666
- });
1667
- };
1668
- });
1669
- var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
1670
- $ZodType.init(inst, def);
1671
- inst._zod.parse = (payload, ctx) => {
1672
- const input = payload.value;
1673
- const left = def.left._zod.run({
1674
- value: input,
1675
- issues: []
1676
- }, ctx);
1677
- const right = def.right._zod.run({
1678
- value: input,
1679
- issues: []
1680
- }, ctx);
1681
- if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
1682
- return handleIntersectionResults(payload, left, right);
1683
- });
1684
- return handleIntersectionResults(payload, left, right);
1685
- };
1686
- });
1687
- function mergeValues(a, b) {
1688
- if (a === b) return {
1689
- valid: true,
1690
- data: a
1691
- };
1692
- if (a instanceof Date && b instanceof Date && +a === +b) return {
1693
- valid: true,
1694
- data: a
1695
- };
1696
- if (isPlainObject(a) && isPlainObject(b)) {
1697
- const bKeys = Object.keys(b);
1698
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1699
- const newObj = {
1700
- ...a,
1701
- ...b
1702
- };
1703
- for (const key of sharedKeys) {
1704
- const sharedValue = mergeValues(a[key], b[key]);
1705
- if (!sharedValue.valid) return {
1706
- valid: false,
1707
- mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
1708
- };
1709
- newObj[key] = sharedValue.data;
1710
- }
1711
- return {
1712
- valid: true,
1713
- data: newObj
1714
- };
1715
- }
1716
- if (Array.isArray(a) && Array.isArray(b)) {
1717
- if (a.length !== b.length) return {
1718
- valid: false,
1719
- mergeErrorPath: []
1720
- };
1721
- const newArray = [];
1722
- for (let index = 0; index < a.length; index++) {
1723
- const itemA = a[index];
1724
- const itemB = b[index];
1725
- const sharedValue = mergeValues(itemA, itemB);
1726
- if (!sharedValue.valid) return {
1727
- valid: false,
1728
- mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
1729
- };
1730
- newArray.push(sharedValue.data);
1731
- }
1732
- return {
1733
- valid: true,
1734
- data: newArray
1735
- };
1736
- }
1737
- return {
1738
- valid: false,
1739
- mergeErrorPath: []
1740
- };
1741
- }
1742
- function handleIntersectionResults(result, left, right) {
1743
- const unrecKeys = /* @__PURE__ */ new Map();
1744
- let unrecIssue;
1745
- for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1746
- unrecIssue ?? (unrecIssue = iss);
1747
- for (const k of iss.keys) {
1748
- if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1749
- unrecKeys.get(k).l = true;
1750
- }
1751
- } else result.issues.push(iss);
1752
- for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1753
- if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1754
- unrecKeys.get(k).r = true;
1755
- }
1756
- else result.issues.push(iss);
1757
- const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1758
- if (bothKeys.length && unrecIssue) result.issues.push({
1759
- ...unrecIssue,
1760
- keys: bothKeys
1761
- });
1762
- if (aborted(result)) return result;
1763
- const merged = mergeValues(left.value, right.value);
1764
- if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
1765
- result.value = merged.data;
1766
- return result;
1767
- }
1768
- var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1769
- $ZodType.init(inst, def);
1770
- inst._zod.parse = (payload, ctx) => {
1771
- const input = payload.value;
1772
- if (!isPlainObject(input)) {
1773
- payload.issues.push({
1774
- expected: "record",
1775
- code: "invalid_type",
1776
- input,
1777
- inst
1778
- });
1779
- return payload;
1780
- }
1781
- const proms = [];
1782
- const values = def.keyType._zod.values;
1783
- if (values) {
1784
- payload.value = {};
1785
- const recordKeys = /* @__PURE__ */ new Set();
1786
- for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1787
- recordKeys.add(typeof key === "number" ? key.toString() : key);
1788
- const result = def.valueType._zod.run({
1789
- value: input[key],
1790
- issues: []
1791
- }, ctx);
1792
- if (result instanceof Promise) proms.push(result.then((result) => {
1793
- if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1794
- payload.value[key] = result.value;
1795
- }));
1796
- else {
1797
- if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1798
- payload.value[key] = result.value;
1799
- }
1800
- }
1801
- let unrecognized;
1802
- for (const key in input) if (!recordKeys.has(key)) {
1803
- unrecognized = unrecognized ?? [];
1804
- unrecognized.push(key);
1805
- }
1806
- if (unrecognized && unrecognized.length > 0) payload.issues.push({
1807
- code: "unrecognized_keys",
1808
- input,
1809
- inst,
1810
- keys: unrecognized
1811
- });
1812
- } else {
1813
- payload.value = {};
1814
- for (const key of Reflect.ownKeys(input)) {
1815
- if (key === "__proto__") continue;
1816
- let keyResult = def.keyType._zod.run({
1817
- value: key,
1818
- issues: []
1819
- }, ctx);
1820
- if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1821
- if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
1822
- const retryResult = def.keyType._zod.run({
1823
- value: Number(key),
1824
- issues: []
1825
- }, ctx);
1826
- if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1827
- if (retryResult.issues.length === 0) keyResult = retryResult;
1828
- }
1829
- if (keyResult.issues.length) {
1830
- if (def.mode === "loose") payload.value[key] = input[key];
1831
- else payload.issues.push({
1832
- code: "invalid_key",
1833
- origin: "record",
1834
- issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
1835
- input: key,
1836
- path: [key],
1837
- inst
1838
- });
1839
- continue;
1840
- }
1841
- const result = def.valueType._zod.run({
1842
- value: input[key],
1843
- issues: []
1844
- }, ctx);
1845
- if (result instanceof Promise) proms.push(result.then((result) => {
1846
- if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1847
- payload.value[keyResult.value] = result.value;
1848
- }));
1849
- else {
1850
- if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1851
- payload.value[keyResult.value] = result.value;
1852
- }
1853
- }
1854
- }
1855
- if (proms.length) return Promise.all(proms).then(() => payload);
1856
- return payload;
1857
- };
1858
- });
1859
- var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
1860
- $ZodType.init(inst, def);
1861
- const values = getEnumValues(def.entries);
1862
- const valuesSet = new Set(values);
1863
- inst._zod.values = valuesSet;
1864
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
1865
- inst._zod.parse = (payload, _ctx) => {
1866
- const input = payload.value;
1867
- if (valuesSet.has(input)) return payload;
1868
- payload.issues.push({
1869
- code: "invalid_value",
1870
- values,
1871
- input,
1872
- inst
1873
- });
1874
- return payload;
1875
- };
1876
- });
1877
- var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
1878
- $ZodType.init(inst, def);
1879
- inst._zod.parse = (payload, ctx) => {
1880
- if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1881
- const _out = def.transform(payload.value, payload);
1882
- if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1883
- payload.value = output;
1884
- return payload;
1885
- });
1886
- if (_out instanceof Promise) throw new $ZodAsyncError();
1887
- payload.value = _out;
1888
- return payload;
1889
- };
1890
- });
1891
- function handleOptionalResult(result, input) {
1892
- if (result.issues.length && input === void 0) return {
1893
- issues: [],
1894
- value: void 0
1895
- };
1896
- return result;
1897
- }
1898
- var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
1899
- $ZodType.init(inst, def);
1900
- inst._zod.optin = "optional";
1901
- inst._zod.optout = "optional";
1902
- defineLazy(inst._zod, "values", () => {
1903
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
1904
- });
1905
- defineLazy(inst._zod, "pattern", () => {
1906
- const pattern = def.innerType._zod.pattern;
1907
- return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
1908
- });
1909
- inst._zod.parse = (payload, ctx) => {
1910
- if (def.innerType._zod.optin === "optional") {
1911
- const result = def.innerType._zod.run(payload, ctx);
1912
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
1913
- return handleOptionalResult(result, payload.value);
1914
- }
1915
- if (payload.value === void 0) return payload;
1916
- return def.innerType._zod.run(payload, ctx);
1917
- };
1918
- });
1919
- var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
1920
- $ZodOptional.init(inst, def);
1921
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1922
- defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
1923
- inst._zod.parse = (payload, ctx) => {
1924
- return def.innerType._zod.run(payload, ctx);
1925
- };
1926
- });
1927
- var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
1928
- $ZodType.init(inst, def);
1929
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1930
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1931
- defineLazy(inst._zod, "pattern", () => {
1932
- const pattern = def.innerType._zod.pattern;
1933
- return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
1934
- });
1935
- defineLazy(inst._zod, "values", () => {
1936
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
1937
- });
1938
- inst._zod.parse = (payload, ctx) => {
1939
- if (payload.value === null) return payload;
1940
- return def.innerType._zod.run(payload, ctx);
1941
- };
1942
- });
1943
- var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
1944
- $ZodType.init(inst, def);
1945
- inst._zod.optin = "optional";
1946
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1947
- inst._zod.parse = (payload, ctx) => {
1948
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1949
- if (payload.value === void 0) {
1950
- payload.value = def.defaultValue;
1951
- /**
1952
- * $ZodDefault returns the default value immediately in forward direction.
1953
- * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1954
- return payload;
1955
- }
1956
- const result = def.innerType._zod.run(payload, ctx);
1957
- if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
1958
- return handleDefaultResult(result, def);
1959
- };
1960
- });
1961
- function handleDefaultResult(payload, def) {
1962
- if (payload.value === void 0) payload.value = def.defaultValue;
1963
- return payload;
1964
- }
1965
- var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
1966
- $ZodType.init(inst, def);
1967
- inst._zod.optin = "optional";
1968
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1969
- inst._zod.parse = (payload, ctx) => {
1970
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1971
- if (payload.value === void 0) payload.value = def.defaultValue;
1972
- return def.innerType._zod.run(payload, ctx);
1973
- };
1974
- });
1975
- var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
1976
- $ZodType.init(inst, def);
1977
- defineLazy(inst._zod, "values", () => {
1978
- const v = def.innerType._zod.values;
1979
- return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
1980
- });
1981
- inst._zod.parse = (payload, ctx) => {
1982
- const result = def.innerType._zod.run(payload, ctx);
1983
- if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
1984
- return handleNonOptionalResult(result, inst);
1985
- };
1986
- });
1987
- function handleNonOptionalResult(payload, inst) {
1988
- if (!payload.issues.length && payload.value === void 0) payload.issues.push({
1989
- code: "invalid_type",
1990
- expected: "nonoptional",
1991
- input: payload.value,
1992
- inst
1993
- });
1994
- return payload;
1995
- }
1996
- var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
1997
- $ZodType.init(inst, def);
1998
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1999
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2000
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2001
- inst._zod.parse = (payload, ctx) => {
2002
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2003
- const result = def.innerType._zod.run(payload, ctx);
2004
- if (result instanceof Promise) return result.then((result) => {
2005
- payload.value = result.value;
2006
- if (result.issues.length) {
2007
- payload.value = def.catchValue({
2008
- ...payload,
2009
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2010
- input: payload.value
2011
- });
2012
- payload.issues = [];
2013
- }
2014
- return payload;
2015
- });
2016
- payload.value = result.value;
2017
- if (result.issues.length) {
2018
- payload.value = def.catchValue({
2019
- ...payload,
2020
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2021
- input: payload.value
2022
- });
2023
- payload.issues = [];
2024
- }
2025
- return payload;
2026
- };
2027
- });
2028
- var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2029
- $ZodType.init(inst, def);
2030
- defineLazy(inst._zod, "values", () => def.in._zod.values);
2031
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2032
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2033
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2034
- inst._zod.parse = (payload, ctx) => {
2035
- if (ctx.direction === "backward") {
2036
- const right = def.out._zod.run(payload, ctx);
2037
- if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
2038
- return handlePipeResult(right, def.in, ctx);
2039
- }
2040
- const left = def.in._zod.run(payload, ctx);
2041
- if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
2042
- return handlePipeResult(left, def.out, ctx);
2043
- };
2044
- });
2045
- function handlePipeResult(left, next, ctx) {
2046
- if (left.issues.length) {
2047
- left.aborted = true;
2048
- return left;
2049
- }
2050
- return next._zod.run({
2051
- value: left.value,
2052
- issues: left.issues
2053
- }, ctx);
2054
- }
2055
- var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2056
- $ZodType.init(inst, def);
2057
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2058
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2059
- defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2060
- defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2061
- inst._zod.parse = (payload, ctx) => {
2062
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2063
- const result = def.innerType._zod.run(payload, ctx);
2064
- if (result instanceof Promise) return result.then(handleReadonlyResult);
2065
- return handleReadonlyResult(result);
2066
- };
2067
- });
2068
- function handleReadonlyResult(payload) {
2069
- payload.value = Object.freeze(payload.value);
2070
- return payload;
2071
- }
2072
- var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2073
- $ZodCheck.init(inst, def);
2074
- $ZodType.init(inst, def);
2075
- inst._zod.parse = (payload, _) => {
2076
- return payload;
2077
- };
2078
- inst._zod.check = (payload) => {
2079
- const input = payload.value;
2080
- const r = def.fn(input);
2081
- if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
2082
- handleRefineResult(r, payload, input, inst);
2083
- };
2084
- });
2085
- function handleRefineResult(result, payload, input, inst) {
2086
- if (!result) {
2087
- const _iss = {
2088
- code: "custom",
2089
- input,
2090
- inst,
2091
- path: [...inst._zod.def.path ?? []],
2092
- continue: !inst._zod.def.abort
2093
- };
2094
- if (inst._zod.def.params) _iss.params = inst._zod.def.params;
2095
- payload.issues.push(issue(_iss));
2096
- }
2097
- }
2098
- //#endregion
2099
- //#region ../../node_modules/zod/v4/core/registries.js
2100
- var _a;
2101
- var $ZodRegistry = class {
2102
- constructor() {
2103
- this._map = /* @__PURE__ */ new WeakMap();
2104
- this._idmap = /* @__PURE__ */ new Map();
2105
- }
2106
- add(schema, ..._meta) {
2107
- const meta = _meta[0];
2108
- this._map.set(schema, meta);
2109
- if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
2110
- return this;
2111
- }
2112
- clear() {
2113
- this._map = /* @__PURE__ */ new WeakMap();
2114
- this._idmap = /* @__PURE__ */ new Map();
2115
- return this;
2116
- }
2117
- remove(schema) {
2118
- const meta = this._map.get(schema);
2119
- if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
2120
- this._map.delete(schema);
2121
- return this;
2122
- }
2123
- get(schema) {
2124
- const p = schema._zod.parent;
2125
- if (p) {
2126
- const pm = { ...this.get(p) ?? {} };
2127
- delete pm.id;
2128
- const f = {
2129
- ...pm,
2130
- ...this._map.get(schema)
2131
- };
2132
- return Object.keys(f).length ? f : void 0;
2133
- }
2134
- return this._map.get(schema);
2135
- }
2136
- has(schema) {
2137
- return this._map.has(schema);
2138
- }
2139
- };
2140
- function registry() {
2141
- return new $ZodRegistry();
2142
- }
2143
- (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2144
- var globalRegistry = globalThis.__zod_globalRegistry;
2145
- //#endregion
2146
- //#region ../../node_modules/zod/v4/core/api.js
2147
- /* @__NO_SIDE_EFFECTS__ */
2148
- function _string(Class, params) {
2149
- return new Class({
2150
- type: "string",
2151
- ...normalizeParams(params)
2152
- });
2153
- }
2154
- /* @__NO_SIDE_EFFECTS__ */
2155
- function _email(Class, params) {
2156
- return new Class({
2157
- type: "string",
2158
- format: "email",
2159
- check: "string_format",
2160
- abort: false,
2161
- ...normalizeParams(params)
2162
- });
2163
- }
2164
- /* @__NO_SIDE_EFFECTS__ */
2165
- function _guid(Class, params) {
2166
- return new Class({
2167
- type: "string",
2168
- format: "guid",
2169
- check: "string_format",
2170
- abort: false,
2171
- ...normalizeParams(params)
2172
- });
2173
- }
2174
- /* @__NO_SIDE_EFFECTS__ */
2175
- function _uuid(Class, params) {
2176
- return new Class({
2177
- type: "string",
2178
- format: "uuid",
2179
- check: "string_format",
2180
- abort: false,
2181
- ...normalizeParams(params)
2182
- });
2183
- }
2184
- /* @__NO_SIDE_EFFECTS__ */
2185
- function _uuidv4(Class, params) {
2186
- return new Class({
2187
- type: "string",
2188
- format: "uuid",
2189
- check: "string_format",
2190
- abort: false,
2191
- version: "v4",
2192
- ...normalizeParams(params)
2193
- });
2194
- }
2195
- /* @__NO_SIDE_EFFECTS__ */
2196
- function _uuidv6(Class, params) {
2197
- return new Class({
2198
- type: "string",
2199
- format: "uuid",
2200
- check: "string_format",
2201
- abort: false,
2202
- version: "v6",
2203
- ...normalizeParams(params)
2204
- });
2205
- }
2206
- /* @__NO_SIDE_EFFECTS__ */
2207
- function _uuidv7(Class, params) {
2208
- return new Class({
2209
- type: "string",
2210
- format: "uuid",
2211
- check: "string_format",
2212
- abort: false,
2213
- version: "v7",
2214
- ...normalizeParams(params)
2215
- });
2216
- }
2217
- /* @__NO_SIDE_EFFECTS__ */
2218
- function _url(Class, params) {
2219
- return new Class({
2220
- type: "string",
2221
- format: "url",
2222
- check: "string_format",
2223
- abort: false,
2224
- ...normalizeParams(params)
2225
- });
2226
- }
2227
- /* @__NO_SIDE_EFFECTS__ */
2228
- function _emoji(Class, params) {
2229
- return new Class({
2230
- type: "string",
2231
- format: "emoji",
2232
- check: "string_format",
2233
- abort: false,
2234
- ...normalizeParams(params)
2235
- });
2236
- }
2237
- /* @__NO_SIDE_EFFECTS__ */
2238
- function _nanoid(Class, params) {
2239
- return new Class({
2240
- type: "string",
2241
- format: "nanoid",
2242
- check: "string_format",
2243
- abort: false,
2244
- ...normalizeParams(params)
2245
- });
2246
- }
2247
- /* @__NO_SIDE_EFFECTS__ */
2248
- function _cuid(Class, params) {
2249
- return new Class({
2250
- type: "string",
2251
- format: "cuid",
2252
- check: "string_format",
2253
- abort: false,
2254
- ...normalizeParams(params)
2255
- });
2256
- }
2257
- /* @__NO_SIDE_EFFECTS__ */
2258
- function _cuid2(Class, params) {
2259
- return new Class({
2260
- type: "string",
2261
- format: "cuid2",
2262
- check: "string_format",
2263
- abort: false,
2264
- ...normalizeParams(params)
2265
- });
2266
- }
2267
- /* @__NO_SIDE_EFFECTS__ */
2268
- function _ulid(Class, params) {
2269
- return new Class({
2270
- type: "string",
2271
- format: "ulid",
2272
- check: "string_format",
2273
- abort: false,
2274
- ...normalizeParams(params)
2275
- });
2276
- }
2277
- /* @__NO_SIDE_EFFECTS__ */
2278
- function _xid(Class, params) {
2279
- return new Class({
2280
- type: "string",
2281
- format: "xid",
2282
- check: "string_format",
2283
- abort: false,
2284
- ...normalizeParams(params)
2285
- });
2286
- }
2287
- /* @__NO_SIDE_EFFECTS__ */
2288
- function _ksuid(Class, params) {
2289
- return new Class({
2290
- type: "string",
2291
- format: "ksuid",
2292
- check: "string_format",
2293
- abort: false,
2294
- ...normalizeParams(params)
2295
- });
2296
- }
2297
- /* @__NO_SIDE_EFFECTS__ */
2298
- function _ipv4(Class, params) {
2299
- return new Class({
2300
- type: "string",
2301
- format: "ipv4",
2302
- check: "string_format",
2303
- abort: false,
2304
- ...normalizeParams(params)
2305
- });
2306
- }
2307
- /* @__NO_SIDE_EFFECTS__ */
2308
- function _ipv6(Class, params) {
2309
- return new Class({
2310
- type: "string",
2311
- format: "ipv6",
2312
- check: "string_format",
2313
- abort: false,
2314
- ...normalizeParams(params)
2315
- });
2316
- }
2317
- /* @__NO_SIDE_EFFECTS__ */
2318
- function _cidrv4(Class, params) {
2319
- return new Class({
2320
- type: "string",
2321
- format: "cidrv4",
2322
- check: "string_format",
2323
- abort: false,
2324
- ...normalizeParams(params)
2325
- });
2326
- }
2327
- /* @__NO_SIDE_EFFECTS__ */
2328
- function _cidrv6(Class, params) {
2329
- return new Class({
2330
- type: "string",
2331
- format: "cidrv6",
2332
- check: "string_format",
2333
- abort: false,
2334
- ...normalizeParams(params)
2335
- });
2336
- }
2337
- /* @__NO_SIDE_EFFECTS__ */
2338
- function _base64(Class, params) {
2339
- return new Class({
2340
- type: "string",
2341
- format: "base64",
2342
- check: "string_format",
2343
- abort: false,
2344
- ...normalizeParams(params)
2345
- });
2346
- }
2347
- /* @__NO_SIDE_EFFECTS__ */
2348
- function _base64url(Class, params) {
2349
- return new Class({
2350
- type: "string",
2351
- format: "base64url",
2352
- check: "string_format",
2353
- abort: false,
2354
- ...normalizeParams(params)
2355
- });
2356
- }
2357
- /* @__NO_SIDE_EFFECTS__ */
2358
- function _e164(Class, params) {
2359
- return new Class({
2360
- type: "string",
2361
- format: "e164",
2362
- check: "string_format",
2363
- abort: false,
2364
- ...normalizeParams(params)
2365
- });
2366
- }
2367
- /* @__NO_SIDE_EFFECTS__ */
2368
- function _jwt(Class, params) {
2369
- return new Class({
2370
- type: "string",
2371
- format: "jwt",
2372
- check: "string_format",
2373
- abort: false,
2374
- ...normalizeParams(params)
2375
- });
2376
- }
2377
- /* @__NO_SIDE_EFFECTS__ */
2378
- function _isoDateTime(Class, params) {
2379
- return new Class({
2380
- type: "string",
2381
- format: "datetime",
2382
- check: "string_format",
2383
- offset: false,
2384
- local: false,
2385
- precision: null,
2386
- ...normalizeParams(params)
2387
- });
2388
- }
2389
- /* @__NO_SIDE_EFFECTS__ */
2390
- function _isoDate(Class, params) {
2391
- return new Class({
2392
- type: "string",
2393
- format: "date",
2394
- check: "string_format",
2395
- ...normalizeParams(params)
2396
- });
2397
- }
2398
- /* @__NO_SIDE_EFFECTS__ */
2399
- function _isoTime(Class, params) {
2400
- return new Class({
2401
- type: "string",
2402
- format: "time",
2403
- check: "string_format",
2404
- precision: null,
2405
- ...normalizeParams(params)
2406
- });
2407
- }
2408
- /* @__NO_SIDE_EFFECTS__ */
2409
- function _isoDuration(Class, params) {
2410
- return new Class({
2411
- type: "string",
2412
- format: "duration",
2413
- check: "string_format",
2414
- ...normalizeParams(params)
2415
- });
2416
- }
2417
- /* @__NO_SIDE_EFFECTS__ */
2418
- function _number(Class, params) {
2419
- return new Class({
2420
- type: "number",
2421
- checks: [],
2422
- ...normalizeParams(params)
2423
- });
2424
- }
2425
- /* @__NO_SIDE_EFFECTS__ */
2426
- function _int(Class, params) {
2427
- return new Class({
2428
- type: "number",
2429
- check: "number_format",
2430
- abort: false,
2431
- format: "safeint",
2432
- ...normalizeParams(params)
2433
- });
2434
- }
2435
- /* @__NO_SIDE_EFFECTS__ */
2436
- function _boolean(Class, params) {
2437
- return new Class({
2438
- type: "boolean",
2439
- ...normalizeParams(params)
2440
- });
2441
- }
2442
- /* @__NO_SIDE_EFFECTS__ */
2443
- function _unknown(Class) {
2444
- return new Class({ type: "unknown" });
2445
- }
2446
- /* @__NO_SIDE_EFFECTS__ */
2447
- function _never(Class, params) {
2448
- return new Class({
2449
- type: "never",
2450
- ...normalizeParams(params)
2451
- });
2452
- }
2453
- /* @__NO_SIDE_EFFECTS__ */
2454
- function _lt(value, params) {
2455
- return new $ZodCheckLessThan({
2456
- check: "less_than",
2457
- ...normalizeParams(params),
2458
- value,
2459
- inclusive: false
2460
- });
2461
- }
2462
- /* @__NO_SIDE_EFFECTS__ */
2463
- function _lte(value, params) {
2464
- return new $ZodCheckLessThan({
2465
- check: "less_than",
2466
- ...normalizeParams(params),
2467
- value,
2468
- inclusive: true
2469
- });
2470
- }
2471
- /* @__NO_SIDE_EFFECTS__ */
2472
- function _gt(value, params) {
2473
- return new $ZodCheckGreaterThan({
2474
- check: "greater_than",
2475
- ...normalizeParams(params),
2476
- value,
2477
- inclusive: false
2478
- });
2479
- }
2480
- /* @__NO_SIDE_EFFECTS__ */
2481
- function _gte(value, params) {
2482
- return new $ZodCheckGreaterThan({
2483
- check: "greater_than",
2484
- ...normalizeParams(params),
2485
- value,
2486
- inclusive: true
2487
- });
2488
- }
2489
- /* @__NO_SIDE_EFFECTS__ */
2490
- function _multipleOf(value, params) {
2491
- return new $ZodCheckMultipleOf({
2492
- check: "multiple_of",
2493
- ...normalizeParams(params),
2494
- value
2495
- });
2496
- }
2497
- /* @__NO_SIDE_EFFECTS__ */
2498
- function _maxLength(maximum, params) {
2499
- return new $ZodCheckMaxLength({
2500
- check: "max_length",
2501
- ...normalizeParams(params),
2502
- maximum
2503
- });
2504
- }
2505
- /* @__NO_SIDE_EFFECTS__ */
2506
- function _minLength(minimum, params) {
2507
- return new $ZodCheckMinLength({
2508
- check: "min_length",
2509
- ...normalizeParams(params),
2510
- minimum
2511
- });
2512
- }
2513
- /* @__NO_SIDE_EFFECTS__ */
2514
- function _length(length, params) {
2515
- return new $ZodCheckLengthEquals({
2516
- check: "length_equals",
2517
- ...normalizeParams(params),
2518
- length
2519
- });
2520
- }
2521
- /* @__NO_SIDE_EFFECTS__ */
2522
- function _regex(pattern, params) {
2523
- return new $ZodCheckRegex({
2524
- check: "string_format",
2525
- format: "regex",
2526
- ...normalizeParams(params),
2527
- pattern
2528
- });
2529
- }
2530
- /* @__NO_SIDE_EFFECTS__ */
2531
- function _lowercase(params) {
2532
- return new $ZodCheckLowerCase({
2533
- check: "string_format",
2534
- format: "lowercase",
2535
- ...normalizeParams(params)
2536
- });
2537
- }
2538
- /* @__NO_SIDE_EFFECTS__ */
2539
- function _uppercase(params) {
2540
- return new $ZodCheckUpperCase({
2541
- check: "string_format",
2542
- format: "uppercase",
2543
- ...normalizeParams(params)
2544
- });
2545
- }
2546
- /* @__NO_SIDE_EFFECTS__ */
2547
- function _includes(includes, params) {
2548
- return new $ZodCheckIncludes({
2549
- check: "string_format",
2550
- format: "includes",
2551
- ...normalizeParams(params),
2552
- includes
2553
- });
2554
- }
2555
- /* @__NO_SIDE_EFFECTS__ */
2556
- function _startsWith(prefix, params) {
2557
- return new $ZodCheckStartsWith({
2558
- check: "string_format",
2559
- format: "starts_with",
2560
- ...normalizeParams(params),
2561
- prefix
2562
- });
2563
- }
2564
- /* @__NO_SIDE_EFFECTS__ */
2565
- function _endsWith(suffix, params) {
2566
- return new $ZodCheckEndsWith({
2567
- check: "string_format",
2568
- format: "ends_with",
2569
- ...normalizeParams(params),
2570
- suffix
2571
- });
2572
- }
2573
- /* @__NO_SIDE_EFFECTS__ */
2574
- function _overwrite(tx) {
2575
- return new $ZodCheckOverwrite({
2576
- check: "overwrite",
2577
- tx
2578
- });
2579
- }
2580
- /* @__NO_SIDE_EFFECTS__ */
2581
- function _normalize(form) {
2582
- return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2583
- }
2584
- /* @__NO_SIDE_EFFECTS__ */
2585
- function _trim() {
2586
- return /* @__PURE__ */ _overwrite((input) => input.trim());
2587
- }
2588
- /* @__NO_SIDE_EFFECTS__ */
2589
- function _toLowerCase() {
2590
- return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2591
- }
2592
- /* @__NO_SIDE_EFFECTS__ */
2593
- function _toUpperCase() {
2594
- return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2595
- }
2596
- /* @__NO_SIDE_EFFECTS__ */
2597
- function _slugify() {
2598
- return /* @__PURE__ */ _overwrite((input) => slugify(input));
2599
- }
2600
- /* @__NO_SIDE_EFFECTS__ */
2601
- function _array(Class, element, params) {
2602
- return new Class({
2603
- type: "array",
2604
- element,
2605
- ...normalizeParams(params)
2606
- });
2607
- }
2608
- /* @__NO_SIDE_EFFECTS__ */
2609
- function _refine(Class, fn, _params) {
2610
- return new Class({
2611
- type: "custom",
2612
- check: "custom",
2613
- fn,
2614
- ...normalizeParams(_params)
2615
- });
2616
- }
2617
- /* @__NO_SIDE_EFFECTS__ */
2618
- function _superRefine(fn) {
2619
- const ch = /* @__PURE__ */ _check((payload) => {
2620
- payload.addIssue = (issue$2) => {
2621
- if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
2622
- else {
2623
- const _issue = issue$2;
2624
- if (_issue.fatal) _issue.continue = false;
2625
- _issue.code ?? (_issue.code = "custom");
2626
- _issue.input ?? (_issue.input = payload.value);
2627
- _issue.inst ?? (_issue.inst = ch);
2628
- _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2629
- payload.issues.push(issue(_issue));
2630
- }
2631
- };
2632
- return fn(payload.value, payload);
2633
- });
2634
- return ch;
2635
- }
2636
- /* @__NO_SIDE_EFFECTS__ */
2637
- function _check(fn, params) {
2638
- const ch = new $ZodCheck({
2639
- check: "custom",
2640
- ...normalizeParams(params)
2641
- });
2642
- ch._zod.check = fn;
2643
- return ch;
2644
- }
2645
- //#endregion
2646
- //#region ../../node_modules/zod/v4/core/to-json-schema.js
2647
- function initializeContext(params) {
2648
- let target = params?.target ?? "draft-2020-12";
2649
- if (target === "draft-4") target = "draft-04";
2650
- if (target === "draft-7") target = "draft-07";
2651
- return {
2652
- processors: params.processors ?? {},
2653
- metadataRegistry: params?.metadata ?? globalRegistry,
2654
- target,
2655
- unrepresentable: params?.unrepresentable ?? "throw",
2656
- override: params?.override ?? (() => {}),
2657
- io: params?.io ?? "output",
2658
- counter: 0,
2659
- seen: /* @__PURE__ */ new Map(),
2660
- cycles: params?.cycles ?? "ref",
2661
- reused: params?.reused ?? "inline",
2662
- external: params?.external ?? void 0
2663
- };
2664
- }
2665
- function process(schema, ctx, _params = {
2666
- path: [],
2667
- schemaPath: []
2668
- }) {
2669
- var _a;
2670
- const def = schema._zod.def;
2671
- const seen = ctx.seen.get(schema);
2672
- if (seen) {
2673
- seen.count++;
2674
- if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
2675
- return seen.schema;
2676
- }
2677
- const result = {
2678
- schema: {},
2679
- count: 1,
2680
- cycle: void 0,
2681
- path: _params.path
2682
- };
2683
- ctx.seen.set(schema, result);
2684
- const overrideSchema = schema._zod.toJSONSchema?.();
2685
- if (overrideSchema) result.schema = overrideSchema;
2686
- else {
2687
- const params = {
2688
- ..._params,
2689
- schemaPath: [..._params.schemaPath, schema],
2690
- path: _params.path
2691
- };
2692
- if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2693
- else {
2694
- const _json = result.schema;
2695
- const processor = ctx.processors[def.type];
2696
- if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2697
- processor(schema, ctx, _json, params);
2698
- }
2699
- const parent = schema._zod.parent;
2700
- if (parent) {
2701
- if (!result.ref) result.ref = parent;
2702
- process(parent, ctx, params);
2703
- ctx.seen.get(parent).isParent = true;
2704
- }
2705
- }
2706
- const meta = ctx.metadataRegistry.get(schema);
2707
- if (meta) Object.assign(result.schema, meta);
2708
- if (ctx.io === "input" && isTransforming(schema)) {
2709
- delete result.schema.examples;
2710
- delete result.schema.default;
2711
- }
2712
- if (ctx.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2713
- delete result.schema._prefault;
2714
- return ctx.seen.get(schema).schema;
2715
- }
2716
- function extractDefs(ctx, schema) {
2717
- const root = ctx.seen.get(schema);
2718
- if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2719
- const idToSchema = /* @__PURE__ */ new Map();
2720
- for (const entry of ctx.seen.entries()) {
2721
- const id = ctx.metadataRegistry.get(entry[0])?.id;
2722
- if (id) {
2723
- const existing = idToSchema.get(id);
2724
- if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2725
- idToSchema.set(id, entry[0]);
2726
- }
2727
- }
2728
- const makeURI = (entry) => {
2729
- const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2730
- if (ctx.external) {
2731
- const externalId = ctx.external.registry.get(entry[0])?.id;
2732
- const uriGenerator = ctx.external.uri ?? ((id) => id);
2733
- if (externalId) return { ref: uriGenerator(externalId) };
2734
- const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
2735
- entry[1].defId = id;
2736
- return {
2737
- defId: id,
2738
- ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
2739
- };
2740
- }
2741
- if (entry[1] === root) return { ref: "#" };
2742
- const defUriPrefix = `#/${defsSegment}/`;
2743
- const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2744
- return {
2745
- defId,
2746
- ref: defUriPrefix + defId
2747
- };
2748
- };
2749
- const extractToDef = (entry) => {
2750
- if (entry[1].schema.$ref) return;
2751
- const seen = entry[1];
2752
- const { ref, defId } = makeURI(entry);
2753
- seen.def = { ...seen.schema };
2754
- if (defId) seen.defId = defId;
2755
- const schema = seen.schema;
2756
- for (const key in schema) delete schema[key];
2757
- schema.$ref = ref;
2758
- };
2759
- if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
2760
- const seen = entry[1];
2761
- if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
2762
-
2763
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2764
- }
2765
- for (const entry of ctx.seen.entries()) {
2766
- const seen = entry[1];
2767
- if (schema === entry[0]) {
2768
- extractToDef(entry);
2769
- continue;
2770
- }
2771
- if (ctx.external) {
2772
- const ext = ctx.external.registry.get(entry[0])?.id;
2773
- if (schema !== entry[0] && ext) {
2774
- extractToDef(entry);
2775
- continue;
2776
- }
2777
- }
2778
- if (ctx.metadataRegistry.get(entry[0])?.id) {
2779
- extractToDef(entry);
2780
- continue;
2781
- }
2782
- if (seen.cycle) {
2783
- extractToDef(entry);
2784
- continue;
2785
- }
2786
- if (seen.count > 1) {
2787
- if (ctx.reused === "ref") {
2788
- extractToDef(entry);
2789
- continue;
2790
- }
2791
- }
2792
- }
2793
- }
2794
- function finalize(ctx, schema) {
2795
- const root = ctx.seen.get(schema);
2796
- if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2797
- const flattenRef = (zodSchema) => {
2798
- const seen = ctx.seen.get(zodSchema);
2799
- if (seen.ref === null) return;
2800
- const schema = seen.def ?? seen.schema;
2801
- const _cached = { ...schema };
2802
- const ref = seen.ref;
2803
- seen.ref = null;
2804
- if (ref) {
2805
- flattenRef(ref);
2806
- const refSeen = ctx.seen.get(ref);
2807
- const refSchema = refSeen.schema;
2808
- if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2809
- schema.allOf = schema.allOf ?? [];
2810
- schema.allOf.push(refSchema);
2811
- } else Object.assign(schema, refSchema);
2812
- Object.assign(schema, _cached);
2813
- if (zodSchema._zod.parent === ref) for (const key in schema) {
2814
- if (key === "$ref" || key === "allOf") continue;
2815
- if (!(key in _cached)) delete schema[key];
2816
- }
2817
- if (refSchema.$ref && refSeen.def) for (const key in schema) {
2818
- if (key === "$ref" || key === "allOf") continue;
2819
- if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
2820
- }
2821
- }
2822
- const parent = zodSchema._zod.parent;
2823
- if (parent && parent !== ref) {
2824
- flattenRef(parent);
2825
- const parentSeen = ctx.seen.get(parent);
2826
- if (parentSeen?.schema.$ref) {
2827
- schema.$ref = parentSeen.schema.$ref;
2828
- if (parentSeen.def) for (const key in schema) {
2829
- if (key === "$ref" || key === "allOf") continue;
2830
- if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
2831
- }
2832
- }
2833
- }
2834
- ctx.override({
2835
- zodSchema,
2836
- jsonSchema: schema,
2837
- path: seen.path ?? []
2838
- });
2839
- };
2840
- for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
2841
- const result = {};
2842
- if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2843
- else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
2844
- else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
2845
- else if (ctx.target === "openapi-3.0") {}
2846
- if (ctx.external?.uri) {
2847
- const id = ctx.external.registry.get(schema)?.id;
2848
- if (!id) throw new Error("Schema is missing an `id` property");
2849
- result.$id = ctx.external.uri(id);
2850
- }
2851
- Object.assign(result, root.def ?? root.schema);
2852
- const defs = ctx.external?.defs ?? {};
2853
- for (const entry of ctx.seen.entries()) {
2854
- const seen = entry[1];
2855
- if (seen.def && seen.defId) defs[seen.defId] = seen.def;
2856
- }
2857
- if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
2858
- else result.definitions = defs;
2859
- try {
2860
- const finalized = JSON.parse(JSON.stringify(result));
2861
- Object.defineProperty(finalized, "~standard", {
2862
- value: {
2863
- ...schema["~standard"],
2864
- jsonSchema: {
2865
- input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
2866
- output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
2867
- }
2868
- },
2869
- enumerable: false,
2870
- writable: false
2871
- });
2872
- return finalized;
2873
- } catch (_err) {
2874
- throw new Error("Error converting schema to JSON.");
2875
- }
2876
- }
2877
- function isTransforming(_schema, _ctx) {
2878
- const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
2879
- if (ctx.seen.has(_schema)) return false;
2880
- ctx.seen.add(_schema);
2881
- const def = _schema._zod.def;
2882
- if (def.type === "transform") return true;
2883
- if (def.type === "array") return isTransforming(def.element, ctx);
2884
- if (def.type === "set") return isTransforming(def.valueType, ctx);
2885
- if (def.type === "lazy") return isTransforming(def.getter(), ctx);
2886
- if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
2887
- if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2888
- if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2889
- if (def.type === "pipe") return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
2890
- if (def.type === "object") {
2891
- for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
2892
- return false;
2893
- }
2894
- if (def.type === "union") {
2895
- for (const option of def.options) if (isTransforming(option, ctx)) return true;
2896
- return false;
2897
- }
2898
- if (def.type === "tuple") {
2899
- for (const item of def.items) if (isTransforming(item, ctx)) return true;
2900
- if (def.rest && isTransforming(def.rest, ctx)) return true;
2901
- return false;
2902
- }
2903
- return false;
2904
- }
2905
- /**
2906
- * Creates a toJSONSchema method for a schema instance.
2907
- * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
2908
- */
2909
- var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
2910
- const ctx = initializeContext({
2911
- ...params,
2912
- processors
2913
- });
2914
- process(schema, ctx);
2915
- extractDefs(ctx, schema);
2916
- return finalize(ctx, schema);
2917
- };
2918
- var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
2919
- const { libraryOptions, target } = params ?? {};
2920
- const ctx = initializeContext({
2921
- ...libraryOptions ?? {},
2922
- target,
2923
- io,
2924
- processors
2925
- });
2926
- process(schema, ctx);
2927
- extractDefs(ctx, schema);
2928
- return finalize(ctx, schema);
2929
- };
2930
- //#endregion
2931
- //#region ../../node_modules/zod/v4/core/json-schema-processors.js
2932
- var formatMap = {
2933
- guid: "uuid",
2934
- url: "uri",
2935
- datetime: "date-time",
2936
- json_string: "json-string",
2937
- regex: ""
2938
- };
2939
- var stringProcessor = (schema, ctx, _json, _params) => {
2940
- const json = _json;
2941
- json.type = "string";
2942
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
2943
- if (typeof minimum === "number") json.minLength = minimum;
2944
- if (typeof maximum === "number") json.maxLength = maximum;
2945
- if (format) {
2946
- json.format = formatMap[format] ?? format;
2947
- if (json.format === "") delete json.format;
2948
- if (format === "time") delete json.format;
2949
- }
2950
- if (contentEncoding) json.contentEncoding = contentEncoding;
2951
- if (patterns && patterns.size > 0) {
2952
- const regexes = [...patterns];
2953
- if (regexes.length === 1) json.pattern = regexes[0].source;
2954
- else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
2955
- ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
2956
- pattern: regex.source
2957
- }))];
2958
- }
2959
- };
2960
- var numberProcessor = (schema, ctx, _json, _params) => {
2961
- const json = _json;
2962
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
2963
- if (typeof format === "string" && format.includes("int")) json.type = "integer";
2964
- else json.type = "number";
2965
- if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
2966
- json.minimum = exclusiveMinimum;
2967
- json.exclusiveMinimum = true;
2968
- } else json.exclusiveMinimum = exclusiveMinimum;
2969
- if (typeof minimum === "number") {
2970
- json.minimum = minimum;
2971
- if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json.minimum;
2972
- else delete json.exclusiveMinimum;
2973
- }
2974
- if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
2975
- json.maximum = exclusiveMaximum;
2976
- json.exclusiveMaximum = true;
2977
- } else json.exclusiveMaximum = exclusiveMaximum;
2978
- if (typeof maximum === "number") {
2979
- json.maximum = maximum;
2980
- if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json.maximum;
2981
- else delete json.exclusiveMaximum;
2982
- }
2983
- if (typeof multipleOf === "number") json.multipleOf = multipleOf;
2984
- };
2985
- var booleanProcessor = (_schema, _ctx, json, _params) => {
2986
- json.type = "boolean";
2987
- };
2988
- var neverProcessor = (_schema, _ctx, json, _params) => {
2989
- json.not = {};
2990
- };
2991
- var unknownProcessor = (_schema, _ctx, _json, _params) => {};
2992
- var enumProcessor = (schema, _ctx, json, _params) => {
2993
- const def = schema._zod.def;
2994
- const values = getEnumValues(def.entries);
2995
- if (values.every((v) => typeof v === "number")) json.type = "number";
2996
- if (values.every((v) => typeof v === "string")) json.type = "string";
2997
- json.enum = values;
2998
- };
2999
- var customProcessor = (_schema, ctx, _json, _params) => {
3000
- if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
3001
- };
3002
- var transformProcessor = (_schema, ctx, _json, _params) => {
3003
- if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
3004
- };
3005
- var arrayProcessor = (schema, ctx, _json, params) => {
3006
- const json = _json;
3007
- const def = schema._zod.def;
3008
- const { minimum, maximum } = schema._zod.bag;
3009
- if (typeof minimum === "number") json.minItems = minimum;
3010
- if (typeof maximum === "number") json.maxItems = maximum;
3011
- json.type = "array";
3012
- json.items = process(def.element, ctx, {
3013
- ...params,
3014
- path: [...params.path, "items"]
3015
- });
3016
- };
3017
- var objectProcessor = (schema, ctx, _json, params) => {
3018
- const json = _json;
3019
- const def = schema._zod.def;
3020
- json.type = "object";
3021
- json.properties = {};
3022
- const shape = def.shape;
3023
- for (const key in shape) json.properties[key] = process(shape[key], ctx, {
3024
- ...params,
3025
- path: [
3026
- ...params.path,
3027
- "properties",
3028
- key
3029
- ]
3030
- });
3031
- const allKeys = new Set(Object.keys(shape));
3032
- const requiredKeys = new Set([...allKeys].filter((key) => {
3033
- const v = def.shape[key]._zod;
3034
- if (ctx.io === "input") return v.optin === void 0;
3035
- else return v.optout === void 0;
3036
- }));
3037
- if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
3038
- if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3039
- else if (!def.catchall) {
3040
- if (ctx.io === "output") json.additionalProperties = false;
3041
- } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
3042
- ...params,
3043
- path: [...params.path, "additionalProperties"]
3044
- });
3045
- };
3046
- var unionProcessor = (schema, ctx, json, params) => {
3047
- const def = schema._zod.def;
3048
- const isExclusive = def.inclusive === false;
3049
- const options = def.options.map((x, i) => process(x, ctx, {
3050
- ...params,
3051
- path: [
3052
- ...params.path,
3053
- isExclusive ? "oneOf" : "anyOf",
3054
- i
3055
- ]
3056
- }));
3057
- if (isExclusive) json.oneOf = options;
3058
- else json.anyOf = options;
3059
- };
3060
- var intersectionProcessor = (schema, ctx, json, params) => {
3061
- const def = schema._zod.def;
3062
- const a = process(def.left, ctx, {
3063
- ...params,
3064
- path: [
3065
- ...params.path,
3066
- "allOf",
3067
- 0
3068
- ]
3069
- });
3070
- const b = process(def.right, ctx, {
3071
- ...params,
3072
- path: [
3073
- ...params.path,
3074
- "allOf",
3075
- 1
3076
- ]
3077
- });
3078
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3079
- json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3080
- };
3081
- var recordProcessor = (schema, ctx, _json, params) => {
3082
- const json = _json;
3083
- const def = schema._zod.def;
3084
- json.type = "object";
3085
- const keyType = def.keyType;
3086
- const patterns = keyType._zod.bag?.patterns;
3087
- if (def.mode === "loose" && patterns && patterns.size > 0) {
3088
- const valueSchema = process(def.valueType, ctx, {
3089
- ...params,
3090
- path: [
3091
- ...params.path,
3092
- "patternProperties",
3093
- "*"
3094
- ]
3095
- });
3096
- json.patternProperties = {};
3097
- for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
3098
- } else {
3099
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
3100
- ...params,
3101
- path: [...params.path, "propertyNames"]
3102
- });
3103
- json.additionalProperties = process(def.valueType, ctx, {
3104
- ...params,
3105
- path: [...params.path, "additionalProperties"]
3106
- });
3107
- }
3108
- const keyValues = keyType._zod.values;
3109
- if (keyValues) {
3110
- const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
3111
- if (validKeyValues.length > 0) json.required = validKeyValues;
3112
- }
3113
- };
3114
- var nullableProcessor = (schema, ctx, json, params) => {
3115
- const def = schema._zod.def;
3116
- const inner = process(def.innerType, ctx, params);
3117
- const seen = ctx.seen.get(schema);
3118
- if (ctx.target === "openapi-3.0") {
3119
- seen.ref = def.innerType;
3120
- json.nullable = true;
3121
- } else json.anyOf = [inner, { type: "null" }];
3122
- };
3123
- var nonoptionalProcessor = (schema, ctx, _json, params) => {
3124
- const def = schema._zod.def;
3125
- process(def.innerType, ctx, params);
3126
- const seen = ctx.seen.get(schema);
3127
- seen.ref = def.innerType;
3128
- };
3129
- var defaultProcessor = (schema, ctx, json, params) => {
3130
- const def = schema._zod.def;
3131
- process(def.innerType, ctx, params);
3132
- const seen = ctx.seen.get(schema);
3133
- seen.ref = def.innerType;
3134
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
3135
- };
3136
- var prefaultProcessor = (schema, ctx, json, params) => {
3137
- const def = schema._zod.def;
3138
- process(def.innerType, ctx, params);
3139
- const seen = ctx.seen.get(schema);
3140
- seen.ref = def.innerType;
3141
- if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3142
- };
3143
- var catchProcessor = (schema, ctx, json, params) => {
3144
- const def = schema._zod.def;
3145
- process(def.innerType, ctx, params);
3146
- const seen = ctx.seen.get(schema);
3147
- seen.ref = def.innerType;
3148
- let catchValue;
3149
- try {
3150
- catchValue = def.catchValue(void 0);
3151
- } catch {
3152
- throw new Error("Dynamic catch values are not supported in JSON Schema");
3153
- }
3154
- json.default = catchValue;
3155
- };
3156
- var pipeProcessor = (schema, ctx, _json, params) => {
3157
- const def = schema._zod.def;
3158
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
3159
- process(innerType, ctx, params);
3160
- const seen = ctx.seen.get(schema);
3161
- seen.ref = innerType;
3162
- };
3163
- var readonlyProcessor = (schema, ctx, json, params) => {
3164
- const def = schema._zod.def;
3165
- process(def.innerType, ctx, params);
3166
- const seen = ctx.seen.get(schema);
3167
- seen.ref = def.innerType;
3168
- json.readOnly = true;
3169
- };
3170
- var optionalProcessor = (schema, ctx, _json, params) => {
3171
- const def = schema._zod.def;
3172
- process(def.innerType, ctx, params);
3173
- const seen = ctx.seen.get(schema);
3174
- seen.ref = def.innerType;
3175
- };
3176
- //#endregion
3177
- //#region ../../node_modules/zod/v4/classic/iso.js
3178
- var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3179
- $ZodISODateTime.init(inst, def);
3180
- ZodStringFormat.init(inst, def);
3181
- });
3182
- function datetime(params) {
3183
- return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3184
- }
3185
- var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
3186
- $ZodISODate.init(inst, def);
3187
- ZodStringFormat.init(inst, def);
3188
- });
3189
- function date(params) {
3190
- return /* @__PURE__ */ _isoDate(ZodISODate, params);
3191
- }
3192
- var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
3193
- $ZodISOTime.init(inst, def);
3194
- ZodStringFormat.init(inst, def);
3195
- });
3196
- function time(params) {
3197
- return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3198
- }
3199
- var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
3200
- $ZodISODuration.init(inst, def);
3201
- ZodStringFormat.init(inst, def);
3202
- });
3203
- function duration(params) {
3204
- return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3205
- }
3206
- //#endregion
3207
- //#region ../../node_modules/zod/v4/classic/errors.js
3208
- var initializer = (inst, issues) => {
3209
- $ZodError.init(inst, issues);
3210
- inst.name = "ZodError";
3211
- Object.defineProperties(inst, {
3212
- format: { value: (mapper) => formatError(inst, mapper) },
3213
- flatten: { value: (mapper) => flattenError(inst, mapper) },
3214
- addIssue: { value: (issue) => {
3215
- inst.issues.push(issue);
3216
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3217
- } },
3218
- addIssues: { value: (issues) => {
3219
- inst.issues.push(...issues);
3220
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3221
- } },
3222
- isEmpty: { get() {
3223
- return inst.issues.length === 0;
3224
- } }
3225
- });
3226
- };
3227
- $constructor("ZodError", initializer);
3228
- var ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
3229
- //#endregion
3230
- //#region ../../node_modules/zod/v4/classic/parse.js
3231
- var parse = /* @__PURE__ */ _parse(ZodRealError);
3232
- var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3233
- var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
3234
- var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
3235
- var encode = /* @__PURE__ */ _encode(ZodRealError);
3236
- var decode = /* @__PURE__ */ _decode(ZodRealError);
3237
- var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
3238
- var decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
3239
- var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
3240
- var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
3241
- var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3242
- var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3243
- //#endregion
3244
- //#region ../../node_modules/zod/v4/classic/schemas.js
3245
- var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3246
- $ZodType.init(inst, def);
3247
- Object.assign(inst["~standard"], { jsonSchema: {
3248
- input: createStandardJSONSchemaMethod(inst, "input"),
3249
- output: createStandardJSONSchemaMethod(inst, "output")
3250
- } });
3251
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
3252
- inst.def = def;
3253
- inst.type = def.type;
3254
- Object.defineProperty(inst, "_def", { value: def });
3255
- inst.check = (...checks) => {
3256
- return inst.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
3257
- check: ch,
3258
- def: { check: "custom" },
3259
- onattach: []
3260
- } } : ch)] }), { parent: true });
3261
- };
3262
- inst.with = inst.check;
3263
- inst.clone = (def, params) => clone(inst, def, params);
3264
- inst.brand = () => inst;
3265
- inst.register = ((reg, meta) => {
3266
- reg.add(inst, meta);
3267
- return inst;
3268
- });
3269
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3270
- inst.safeParse = (data, params) => safeParse(inst, data, params);
3271
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3272
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
3273
- inst.spa = inst.safeParseAsync;
3274
- inst.encode = (data, params) => encode(inst, data, params);
3275
- inst.decode = (data, params) => decode(inst, data, params);
3276
- inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
3277
- inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
3278
- inst.safeEncode = (data, params) => safeEncode(inst, data, params);
3279
- inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3280
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3281
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3282
- inst.refine = (check, params) => inst.check(refine(check, params));
3283
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3284
- inst.overwrite = (fn) => inst.check(/* @__PURE__ */ _overwrite(fn));
3285
- inst.optional = () => optional(inst);
3286
- inst.exactOptional = () => exactOptional(inst);
3287
- inst.nullable = () => nullable(inst);
3288
- inst.nullish = () => optional(nullable(inst));
3289
- inst.nonoptional = (params) => nonoptional(inst, params);
3290
- inst.array = () => array(inst);
3291
- inst.or = (arg) => union([inst, arg]);
3292
- inst.and = (arg) => intersection(inst, arg);
3293
- inst.transform = (tx) => pipe(inst, transform(tx));
3294
- inst.default = (def) => _default(inst, def);
3295
- inst.prefault = (def) => prefault(inst, def);
3296
- inst.catch = (params) => _catch(inst, params);
3297
- inst.pipe = (target) => pipe(inst, target);
3298
- inst.readonly = () => readonly(inst);
3299
- inst.describe = (description) => {
3300
- const cl = inst.clone();
3301
- globalRegistry.add(cl, { description });
3302
- return cl;
3303
- };
3304
- Object.defineProperty(inst, "description", {
3305
- get() {
3306
- return globalRegistry.get(inst)?.description;
3307
- },
3308
- configurable: true
3309
- });
3310
- inst.meta = (...args) => {
3311
- if (args.length === 0) return globalRegistry.get(inst);
3312
- const cl = inst.clone();
3313
- globalRegistry.add(cl, args[0]);
3314
- return cl;
3315
- };
3316
- inst.isOptional = () => inst.safeParse(void 0).success;
3317
- inst.isNullable = () => inst.safeParse(null).success;
3318
- inst.apply = (fn) => fn(inst);
3319
- return inst;
3320
- });
3321
- /** @internal */
3322
- var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3323
- $ZodString.init(inst, def);
3324
- ZodType.init(inst, def);
3325
- inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
3326
- const bag = inst._zod.bag;
3327
- inst.format = bag.format ?? null;
3328
- inst.minLength = bag.minimum ?? null;
3329
- inst.maxLength = bag.maximum ?? null;
3330
- inst.regex = (...args) => inst.check(/* @__PURE__ */ _regex(...args));
3331
- inst.includes = (...args) => inst.check(/* @__PURE__ */ _includes(...args));
3332
- inst.startsWith = (...args) => inst.check(/* @__PURE__ */ _startsWith(...args));
3333
- inst.endsWith = (...args) => inst.check(/* @__PURE__ */ _endsWith(...args));
3334
- inst.min = (...args) => inst.check(/* @__PURE__ */ _minLength(...args));
3335
- inst.max = (...args) => inst.check(/* @__PURE__ */ _maxLength(...args));
3336
- inst.length = (...args) => inst.check(/* @__PURE__ */ _length(...args));
3337
- inst.nonempty = (...args) => inst.check(/* @__PURE__ */ _minLength(1, ...args));
3338
- inst.lowercase = (params) => inst.check(/* @__PURE__ */ _lowercase(params));
3339
- inst.uppercase = (params) => inst.check(/* @__PURE__ */ _uppercase(params));
3340
- inst.trim = () => inst.check(/* @__PURE__ */ _trim());
3341
- inst.normalize = (...args) => inst.check(/* @__PURE__ */ _normalize(...args));
3342
- inst.toLowerCase = () => inst.check(/* @__PURE__ */ _toLowerCase());
3343
- inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
3344
- inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
3345
- });
3346
- var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3347
- $ZodString.init(inst, def);
3348
- _ZodString.init(inst, def);
3349
- inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
3350
- inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
3351
- inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
3352
- inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
3353
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3354
- inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
3355
- inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
3356
- inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
3357
- inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
3358
- inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
3359
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3360
- inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
3361
- inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
3362
- inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
3363
- inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
3364
- inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
3365
- inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
3366
- inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
3367
- inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
3368
- inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
3369
- inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
3370
- inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
3371
- inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3372
- inst.datetime = (params) => inst.check(datetime(params));
3373
- inst.date = (params) => inst.check(date(params));
3374
- inst.time = (params) => inst.check(time(params));
3375
- inst.duration = (params) => inst.check(duration(params));
3376
- });
3377
- function string(params) {
3378
- return /* @__PURE__ */ _string(ZodString, params);
3379
- }
3380
- var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
3381
- $ZodStringFormat.init(inst, def);
3382
- _ZodString.init(inst, def);
3383
- });
3384
- var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
3385
- $ZodEmail.init(inst, def);
3386
- ZodStringFormat.init(inst, def);
3387
- });
3388
- var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
3389
- $ZodGUID.init(inst, def);
3390
- ZodStringFormat.init(inst, def);
3391
- });
3392
- var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
3393
- $ZodUUID.init(inst, def);
3394
- ZodStringFormat.init(inst, def);
3395
- });
3396
- var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
3397
- $ZodURL.init(inst, def);
3398
- ZodStringFormat.init(inst, def);
3399
- });
3400
- var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
3401
- $ZodEmoji.init(inst, def);
3402
- ZodStringFormat.init(inst, def);
3403
- });
3404
- var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
3405
- $ZodNanoID.init(inst, def);
3406
- ZodStringFormat.init(inst, def);
3407
- });
3408
- var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
3409
- $ZodCUID.init(inst, def);
3410
- ZodStringFormat.init(inst, def);
3411
- });
3412
- var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
3413
- $ZodCUID2.init(inst, def);
3414
- ZodStringFormat.init(inst, def);
3415
- });
3416
- var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
3417
- $ZodULID.init(inst, def);
3418
- ZodStringFormat.init(inst, def);
3419
- });
3420
- var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
3421
- $ZodXID.init(inst, def);
3422
- ZodStringFormat.init(inst, def);
3423
- });
3424
- var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
3425
- $ZodKSUID.init(inst, def);
3426
- ZodStringFormat.init(inst, def);
3427
- });
3428
- var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
3429
- $ZodIPv4.init(inst, def);
3430
- ZodStringFormat.init(inst, def);
3431
- });
3432
- var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
3433
- $ZodIPv6.init(inst, def);
3434
- ZodStringFormat.init(inst, def);
3435
- });
3436
- var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
3437
- $ZodCIDRv4.init(inst, def);
3438
- ZodStringFormat.init(inst, def);
3439
- });
3440
- var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
3441
- $ZodCIDRv6.init(inst, def);
3442
- ZodStringFormat.init(inst, def);
3443
- });
3444
- var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
3445
- $ZodBase64.init(inst, def);
3446
- ZodStringFormat.init(inst, def);
3447
- });
3448
- var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
3449
- $ZodBase64URL.init(inst, def);
3450
- ZodStringFormat.init(inst, def);
3451
- });
3452
- var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
3453
- $ZodE164.init(inst, def);
3454
- ZodStringFormat.init(inst, def);
3455
- });
3456
- var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
3457
- $ZodJWT.init(inst, def);
3458
- ZodStringFormat.init(inst, def);
3459
- });
3460
- var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3461
- $ZodNumber.init(inst, def);
3462
- ZodType.init(inst, def);
3463
- inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3464
- inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
3465
- inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
3466
- inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
3467
- inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
3468
- inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
3469
- inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
3470
- inst.int = (params) => inst.check(int(params));
3471
- inst.safe = (params) => inst.check(int(params));
3472
- inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(0, params));
3473
- inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(0, params));
3474
- inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(0, params));
3475
- inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(0, params));
3476
- inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
3477
- inst.step = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
3478
- inst.finite = () => inst;
3479
- const bag = inst._zod.bag;
3480
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3481
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3482
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3483
- inst.isFinite = true;
3484
- inst.format = bag.format ?? null;
3485
- });
3486
- function number(params) {
3487
- return /* @__PURE__ */ _number(ZodNumber, params);
3488
- }
3489
- var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
3490
- $ZodNumberFormat.init(inst, def);
3491
- ZodNumber.init(inst, def);
3492
- });
3493
- function int(params) {
3494
- return /* @__PURE__ */ _int(ZodNumberFormat, params);
3495
- }
3496
- var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
3497
- $ZodBoolean.init(inst, def);
3498
- ZodType.init(inst, def);
3499
- inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
3500
- });
3501
- function boolean(params) {
3502
- return /* @__PURE__ */ _boolean(ZodBoolean, params);
3503
- }
3504
- var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3505
- $ZodUnknown.init(inst, def);
3506
- ZodType.init(inst, def);
3507
- inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
3508
- });
3509
- function unknown() {
3510
- return /* @__PURE__ */ _unknown(ZodUnknown);
3511
- }
3512
- var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3513
- $ZodNever.init(inst, def);
3514
- ZodType.init(inst, def);
3515
- inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
3516
- });
3517
- function never(params) {
3518
- return /* @__PURE__ */ _never(ZodNever, params);
3519
- }
3520
- var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
3521
- $ZodArray.init(inst, def);
3522
- ZodType.init(inst, def);
3523
- inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3524
- inst.element = def.element;
3525
- inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
3526
- inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
3527
- inst.max = (maxLength, params) => inst.check(/* @__PURE__ */ _maxLength(maxLength, params));
3528
- inst.length = (len, params) => inst.check(/* @__PURE__ */ _length(len, params));
3529
- inst.unwrap = () => inst.element;
3530
- });
3531
- function array(element, params) {
3532
- return /* @__PURE__ */ _array(ZodArray, element, params);
3533
- }
3534
- var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
3535
- $ZodObjectJIT.init(inst, def);
3536
- ZodType.init(inst, def);
3537
- inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3538
- defineLazy(inst, "shape", () => {
3539
- return def.shape;
3540
- });
3541
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
3542
- inst.catchall = (catchall) => inst.clone({
3543
- ...inst._zod.def,
3544
- catchall
3545
- });
3546
- inst.passthrough = () => inst.clone({
3547
- ...inst._zod.def,
3548
- catchall: unknown()
3549
- });
3550
- inst.loose = () => inst.clone({
3551
- ...inst._zod.def,
3552
- catchall: unknown()
3553
- });
3554
- inst.strict = () => inst.clone({
3555
- ...inst._zod.def,
3556
- catchall: never()
3557
- });
3558
- inst.strip = () => inst.clone({
3559
- ...inst._zod.def,
3560
- catchall: void 0
3561
- });
3562
- inst.extend = (incoming) => {
3563
- return extend(inst, incoming);
3564
- };
3565
- inst.safeExtend = (incoming) => {
3566
- return safeExtend(inst, incoming);
3567
- };
3568
- inst.merge = (other) => merge(inst, other);
3569
- inst.pick = (mask) => pick(inst, mask);
3570
- inst.omit = (mask) => omit(inst, mask);
3571
- inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
3572
- inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
3573
- });
3574
- function object(shape, params) {
3575
- return new ZodObject({
3576
- type: "object",
3577
- shape: shape ?? {},
3578
- ...normalizeParams(params)
3579
- });
3580
- }
3581
- var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
3582
- $ZodUnion.init(inst, def);
3583
- ZodType.init(inst, def);
3584
- inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
3585
- inst.options = def.options;
3586
- });
3587
- function union(options, params) {
3588
- return new ZodUnion({
3589
- type: "union",
3590
- options,
3591
- ...normalizeParams(params)
3592
- });
3593
- }
3594
- var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
3595
- $ZodIntersection.init(inst, def);
3596
- ZodType.init(inst, def);
3597
- inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
3598
- });
3599
- function intersection(left, right) {
3600
- return new ZodIntersection({
3601
- type: "intersection",
3602
- left,
3603
- right
3604
- });
3605
- }
3606
- var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
3607
- $ZodRecord.init(inst, def);
3608
- ZodType.init(inst, def);
3609
- inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
3610
- inst.keyType = def.keyType;
3611
- inst.valueType = def.valueType;
3612
- });
3613
- function record(keyType, valueType, params) {
3614
- return new ZodRecord({
3615
- type: "record",
3616
- keyType,
3617
- valueType,
3618
- ...normalizeParams(params)
3619
- });
3620
- }
3621
- var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
3622
- $ZodEnum.init(inst, def);
3623
- ZodType.init(inst, def);
3624
- inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
3625
- inst.enum = def.entries;
3626
- inst.options = Object.values(def.entries);
3627
- const keys = new Set(Object.keys(def.entries));
3628
- inst.extract = (values, params) => {
3629
- const newEntries = {};
3630
- for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
3631
- else throw new Error(`Key ${value} not found in enum`);
3632
- return new ZodEnum({
3633
- ...def,
3634
- checks: [],
3635
- ...normalizeParams(params),
3636
- entries: newEntries
3637
- });
3638
- };
3639
- inst.exclude = (values, params) => {
3640
- const newEntries = { ...def.entries };
3641
- for (const value of values) if (keys.has(value)) delete newEntries[value];
3642
- else throw new Error(`Key ${value} not found in enum`);
3643
- return new ZodEnum({
3644
- ...def,
3645
- checks: [],
3646
- ...normalizeParams(params),
3647
- entries: newEntries
3648
- });
3649
- };
3650
- });
3651
- function _enum(values, params) {
3652
- return new ZodEnum({
3653
- type: "enum",
3654
- entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
3655
- ...normalizeParams(params)
3656
- });
3657
- }
3658
- var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
3659
- $ZodTransform.init(inst, def);
3660
- ZodType.init(inst, def);
3661
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
3662
- inst._zod.parse = (payload, _ctx) => {
3663
- if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
3664
- payload.addIssue = (issue$1) => {
3665
- if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
3666
- else {
3667
- const _issue = issue$1;
3668
- if (_issue.fatal) _issue.continue = false;
3669
- _issue.code ?? (_issue.code = "custom");
3670
- _issue.input ?? (_issue.input = payload.value);
3671
- _issue.inst ?? (_issue.inst = inst);
3672
- payload.issues.push(issue(_issue));
3673
- }
3674
- };
3675
- const output = def.transform(payload.value, payload);
3676
- if (output instanceof Promise) return output.then((output) => {
3677
- payload.value = output;
3678
- return payload;
3679
- });
3680
- payload.value = output;
3681
- return payload;
3682
- };
3683
- });
3684
- function transform(fn) {
3685
- return new ZodTransform({
3686
- type: "transform",
3687
- transform: fn
3688
- });
3689
- }
3690
- var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
3691
- $ZodOptional.init(inst, def);
3692
- ZodType.init(inst, def);
3693
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3694
- inst.unwrap = () => inst._zod.def.innerType;
3695
- });
3696
- function optional(innerType) {
3697
- return new ZodOptional({
3698
- type: "optional",
3699
- innerType
3700
- });
3701
- }
3702
- var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
3703
- $ZodExactOptional.init(inst, def);
3704
- ZodType.init(inst, def);
3705
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3706
- inst.unwrap = () => inst._zod.def.innerType;
3707
- });
3708
- function exactOptional(innerType) {
3709
- return new ZodExactOptional({
3710
- type: "optional",
3711
- innerType
3712
- });
3713
- }
3714
- var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
3715
- $ZodNullable.init(inst, def);
3716
- ZodType.init(inst, def);
3717
- inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
3718
- inst.unwrap = () => inst._zod.def.innerType;
3719
- });
3720
- function nullable(innerType) {
3721
- return new ZodNullable({
3722
- type: "nullable",
3723
- innerType
3724
- });
3725
- }
3726
- var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
3727
- $ZodDefault.init(inst, def);
3728
- ZodType.init(inst, def);
3729
- inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
3730
- inst.unwrap = () => inst._zod.def.innerType;
3731
- inst.removeDefault = inst.unwrap;
3732
- });
3733
- function _default(innerType, defaultValue) {
3734
- return new ZodDefault({
3735
- type: "default",
3736
- innerType,
3737
- get defaultValue() {
3738
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3739
- }
3740
- });
3741
- }
3742
- var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
3743
- $ZodPrefault.init(inst, def);
3744
- ZodType.init(inst, def);
3745
- inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
3746
- inst.unwrap = () => inst._zod.def.innerType;
3747
- });
3748
- function prefault(innerType, defaultValue) {
3749
- return new ZodPrefault({
3750
- type: "prefault",
3751
- innerType,
3752
- get defaultValue() {
3753
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3754
- }
3755
- });
3756
- }
3757
- var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
3758
- $ZodNonOptional.init(inst, def);
3759
- ZodType.init(inst, def);
3760
- inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
3761
- inst.unwrap = () => inst._zod.def.innerType;
3762
- });
3763
- function nonoptional(innerType, params) {
3764
- return new ZodNonOptional({
3765
- type: "nonoptional",
3766
- innerType,
3767
- ...normalizeParams(params)
3768
- });
3769
- }
3770
- var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
3771
- $ZodCatch.init(inst, def);
3772
- ZodType.init(inst, def);
3773
- inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
3774
- inst.unwrap = () => inst._zod.def.innerType;
3775
- inst.removeCatch = inst.unwrap;
3776
- });
3777
- function _catch(innerType, catchValue) {
3778
- return new ZodCatch({
3779
- type: "catch",
3780
- innerType,
3781
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
3782
- });
3783
- }
3784
- var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
3785
- $ZodPipe.init(inst, def);
3786
- ZodType.init(inst, def);
3787
- inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
3788
- inst.in = def.in;
3789
- inst.out = def.out;
3790
- });
3791
- function pipe(in_, out) {
3792
- return new ZodPipe({
3793
- type: "pipe",
3794
- in: in_,
3795
- out
3796
- });
3797
- }
3798
- var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
3799
- $ZodReadonly.init(inst, def);
3800
- ZodType.init(inst, def);
3801
- inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
3802
- inst.unwrap = () => inst._zod.def.innerType;
3803
- });
3804
- function readonly(innerType) {
3805
- return new ZodReadonly({
3806
- type: "readonly",
3807
- innerType
3808
- });
3809
- }
3810
- var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
3811
- $ZodCustom.init(inst, def);
3812
- ZodType.init(inst, def);
3813
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
3814
- });
3815
- function refine(fn, _params = {}) {
3816
- return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
3817
- }
3818
- function superRefine(fn) {
3819
- return /* @__PURE__ */ _superRefine(fn);
3820
- }
3821
- //#endregion
3822
- export { object as a, unknown as c, number as i, array as n, record as o, boolean as r, string as s, _enum as t };
3823
-
3824
- //# sourceMappingURL=schemas-BR3K5Luo.js.map