@hiai-gg/docsmint 0.3.0 → 0.3.2

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