@fluid-app/fluid-cli-theme-dev 0.1.534 → 0.1.535

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 (65) hide show
  1. package/dist/dist-cli-preview/.vite/manifest.json +276 -295
  2. package/dist/dist-cli-preview/account-screens.js +1 -1
  3. package/dist/dist-cli-preview/chunks/{Combobox-CJDvxjNn.js → Combobox-D4l7DbBy.js} +54 -53
  4. package/dist/dist-cli-preview/chunks/{ContactsScreen-DD3XWK3Q.js → ContactsScreen-CEtA3-1c.js} +903 -850
  5. package/dist/dist-cli-preview/chunks/MediaScreen-C2rOxuuv.js +8 -0
  6. package/dist/dist-cli-preview/chunks/{MemberManagementProviders-iVdfo0DH.js → MemberManagementProviders-B_YXVcDi.js} +13 -13
  7. package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-BulCAnNO.js → MemberShareablesScreen-UNjYr5R6.js} +4207 -3757
  8. package/dist/dist-cli-preview/chunks/{MessagingScreen-DlDsOy19.js → MessagingScreen-Btga_V0H.js} +24118 -21933
  9. package/dist/dist-cli-preview/chunks/MobileActionSheet-CrEH2vO7.js +1384 -0
  10. package/dist/dist-cli-preview/chunks/{MySiteScreen-BfPfyV4m.js → MySiteScreen-B1fGtPDj.js} +177 -163
  11. package/dist/dist-cli-preview/chunks/OrdersScreen-Bf9DtOCA.js +9 -0
  12. package/dist/dist-cli-preview/chunks/{OrdersScreen-C4yi3z2p.js → OrdersScreen-DyyL-P7j.js} +35 -34
  13. package/dist/dist-cli-preview/chunks/PlaylistsScreen-tws56I3H.js +8 -0
  14. package/dist/dist-cli-preview/chunks/{PortalTenantClientProvider-Clys_Bme.js → PortalTenantClientProvider-DUOOCXfW.js} +1 -1
  15. package/dist/dist-cli-preview/chunks/{ProfileScreen-e4QhExeS.js → ProfileScreen-wZO6QMrU.js} +259 -234
  16. package/dist/dist-cli-preview/chunks/ResponsiveDialog-DSDcOjhm.js +731 -0
  17. package/dist/dist-cli-preview/chunks/Select-DmRoXIkQ.js +2499 -0
  18. package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-DysTJ6w_.js → SubscriptionsScreen-BR2C0m7M.js} +3 -3
  19. package/dist/dist-cli-preview/chunks/Textarea-C59p5Cek.js +365 -0
  20. package/dist/dist-cli-preview/chunks/{account-screen-runtime-B3e0JV6I.js → account-screen-runtime-BqMndJcu.js} +1389 -1409
  21. package/dist/dist-cli-preview/chunks/{arrow-left-BOYuYcvT.js → arrow-left-CFy5J6Id.js} +1 -1
  22. package/dist/dist-cli-preview/chunks/{cli-preview-cY0EPyxC.js → cli-preview-DZOhxtLy.js} +10 -10
  23. package/dist/dist-cli-preview/chunks/{client.gen-jwIybX1j.js → client.gen-DTVKCFco.js} +12 -12
  24. package/dist/dist-cli-preview/chunks/{copy-Cm_EKxcg.js → copy-Da4VLOCZ.js} +1 -1
  25. package/dist/dist-cli-preview/chunks/{countries-api-adapter-BCS0247N.js → countries-api-adapter-Bh5QfCO1.js} +2 -2
  26. package/dist/dist-cli-preview/chunks/{create-card-entry-container-CZi7shLR.js → create-card-entry-container-ohrRYgww.js} +1939 -1929
  27. package/dist/dist-cli-preview/chunks/{hey-api-client-B6n5a7q-.js → hey-api-client-BIjWueui.js} +1 -1
  28. package/dist/dist-cli-preview/chunks/{index-CfLLmITa.js → index-BMWjXC9i.js} +405 -869
  29. package/dist/dist-cli-preview/chunks/{index-DFIsiT9r.js → index-BVehJyDQ.js} +2080 -2372
  30. package/dist/dist-cli-preview/chunks/index-_r1wSvno.js +427 -0
  31. package/dist/dist-cli-preview/chunks/{isAfter-D0zQuNEJ.js → isAfter-BR4uNpua.js} +145 -156
  32. package/dist/dist-cli-preview/chunks/{map-pin-Vt1smsNu.js → map-pin-C_cK_i_W.js} +1 -1
  33. package/dist/dist-cli-preview/chunks/messaging-B1UjYRdl.js +4 -0
  34. package/dist/dist-cli-preview/chunks/{mount-account-screen-BOVvR3Og.js → mount-account-screen-JJGALFRE.js} +8 -8
  35. package/dist/dist-cli-preview/chunks/{navigate-account-screen-D756rD78.js → navigate-account-screen-C0VoUNOi.js} +1 -1
  36. package/dist/dist-cli-preview/chunks/schemas-D0s3rDQw.js +4851 -0
  37. package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-HNXiCpo6.js → screen-route-slug-utils-n2BiDZmp.js} +205 -260
  38. package/dist/dist-cli-preview/chunks/search-zEnxG69C.js +14 -0
  39. package/dist/dist-cli-preview/chunks/sheet-haptics-context-p5ZPxslK.js +133 -0
  40. package/dist/dist-cli-preview/chunks/{sidebar-BDgHluGp.js → sidebar-CjPHl33n.js} +8 -8
  41. package/dist/dist-cli-preview/chunks/{sortable.esm-Cw91KlVU.js → sortable.esm-CrxUZkb-.js} +373 -362
  42. package/dist/dist-cli-preview/chunks/{store-api-context-BCaEZBlj.js → store-api-context-0k_ECvSE.js} +1 -1
  43. package/dist/dist-cli-preview/chunks/translation-api-context-factory-CP0LBb-M.js +74 -0
  44. package/dist/dist-cli-preview/chunks/{use-mobile-BztyG-mE.js → use-mobile-DIhDH3dI.js} +1 -1
  45. package/dist/dist-cli-preview/chunks/{use-optional-store-Dl6PSQur.js → use-optional-store-t4xzc2Rl.js} +2 -2
  46. package/dist/dist-cli-preview/chunks/use-store-YC0Ovzht.js +76 -0
  47. package/dist/dist-cli-preview/chunks/{useInfiniteQuery-fL_VYHHr.js → useInfiniteQuery-Bnzu0kZa.js} +9 -20
  48. package/dist/dist-cli-preview/chunks/{users-B3YJ3D1U.js → users-CabXl4EL.js} +1 -1
  49. package/package.json +1 -1
  50. package/dist/dist-cli-preview/chunks/Breadcrumb-ixf0cTR_.js +0 -91
  51. package/dist/dist-cli-preview/chunks/MediaScreen-D8WSOaze.js +0 -8
  52. package/dist/dist-cli-preview/chunks/MobileActionSheet-aGr-nGxu.js +0 -3884
  53. package/dist/dist-cli-preview/chunks/OrdersScreen-hidM-JR_.js +0 -9
  54. package/dist/dist-cli-preview/chunks/PlaylistsScreen-BIqSXZ5B.js +0 -8
  55. package/dist/dist-cli-preview/chunks/ellipsis-C1sJRT_T.js +0 -15
  56. package/dist/dist-cli-preview/chunks/eye-BHBOtWLw.js +0 -20
  57. package/dist/dist-cli-preview/chunks/index-COIiY5Im.js +0 -135
  58. package/dist/dist-cli-preview/chunks/log-out-segl_UhK.js +0 -30
  59. package/dist/dist-cli-preview/chunks/messaging-C_IkzF0O.js +0 -4
  60. package/dist/dist-cli-preview/chunks/pause-YWP8mWBs.js +0 -41
  61. package/dist/dist-cli-preview/chunks/schemas-BiM-ImW1.js +0 -5565
  62. package/dist/dist-cli-preview/chunks/sheet-haptics-context-d9udqor0.js +0 -116
  63. package/dist/dist-cli-preview/chunks/trash-2-CZEbdFT_.js +0 -17
  64. package/dist/dist-cli-preview/chunks/use-store-aahN8SDp.js +0 -400
  65. package/dist/dist-cli-preview/chunks/user-B4pULYRZ.js +0 -14
@@ -0,0 +1,4851 @@
1
+ var $t = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var xe = (e, t, n) => t.has(e) || $t("Cannot " + n);
5
+ var $ = (e, t, n) => (xe(e, t, "read from private field"), n ? n.call(e) : t.get(e)), ee = (e, t, n) => t.has(e) ? $t("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), te = (e, t, n, r) => (xe(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), ne = (e, t, n) => (xe(e, t, "access private method"), n);
6
+ import { be as qe, bf as Le, bg as _n, bh as zr, c as kr, S as $r, bi as Or, g as Ot, n as vn, _ as Sr, l as fe, b as Zr, bj as Pr } from "./account-screen-runtime-BqMndJcu.js";
7
+ import { g as Er } from "./use-mobile-DIhDH3dI.js";
8
+ const St = (e, t, n) => {
9
+ if (e && "reportValidity" in e) {
10
+ const r = qe(n, t);
11
+ e.setCustomValidity(r && r.message || ""), e.reportValidity();
12
+ }
13
+ }, Ye = (e, t) => {
14
+ for (const n in t.fields) {
15
+ const r = t.fields[n];
16
+ r && r.ref && "reportValidity" in r.ref ? St(r.ref, n, e) : r && r.refs && r.refs.forEach((o) => St(o, n, e));
17
+ }
18
+ }, Zt = (e, t) => {
19
+ t.shouldUseNativeValidation && Ye(e, t);
20
+ const n = {};
21
+ for (const r in e) {
22
+ const o = qe(t.fields, r), i = Object.assign(e[r] || {}, { ref: o && o.ref });
23
+ if (Ir(t.names || Object.keys(e), r)) {
24
+ const s = Object.assign({}, qe(n, r));
25
+ Le(s, "root", i), Le(n, r, s);
26
+ } else Le(n, r, i);
27
+ }
28
+ return n;
29
+ }, Ir = (e, t) => {
30
+ const n = Pt(t);
31
+ return e.some((r) => Pt(r).match(`^${n}\\.\\d+`));
32
+ };
33
+ function Pt(e) {
34
+ return e.replace(/\]|\[/g, "");
35
+ }
36
+ function Xe(e) {
37
+ const t = Object.values(e).filter((r) => typeof r == "number");
38
+ return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
39
+ }
40
+ function Et(e, t = "|") {
41
+ return e.map((n) => kn(n)).join(t);
42
+ }
43
+ function He(e, t) {
44
+ return typeof t == "bigint" ? t.toString() : t;
45
+ }
46
+ class Tr {
47
+ constructor(t) {
48
+ this._getter = t, this._value = void 0;
49
+ }
50
+ get value() {
51
+ const t = this._getter;
52
+ return t !== void 0 && (this._value = t(), this._getter = void 0), this._value;
53
+ }
54
+ }
55
+ function Ne(e) {
56
+ return new Tr(e);
57
+ }
58
+ function Ar(e) {
59
+ return e == null;
60
+ }
61
+ function ct(e) {
62
+ const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
63
+ return e.slice(t, n);
64
+ }
65
+ function Nr(e, t) {
66
+ const n = e / t, r = Math.round(n), o = 4 * Number.EPSILON * Math.max(Math.abs(n), 1);
67
+ return Math.abs(n - r) < o ? 0 : n - r;
68
+ }
69
+ const It = /* @__PURE__ */ Symbol("evaluating");
70
+ function jr(e, t, n) {
71
+ let r;
72
+ Object.defineProperty(e, t, {
73
+ get() {
74
+ if (r !== It)
75
+ return r === void 0 && (r = It, r = n()), r;
76
+ },
77
+ set(o) {
78
+ Object.defineProperty(e, t, {
79
+ value: o
80
+ // configurable: true,
81
+ });
82
+ },
83
+ configurable: !0
84
+ });
85
+ }
86
+ function K(e, t, n) {
87
+ Object.defineProperty(e, t, {
88
+ value: n,
89
+ writable: !0,
90
+ enumerable: !0,
91
+ configurable: !0
92
+ });
93
+ }
94
+ function at(e) {
95
+ const t = Object.getOwnPropertyDescriptor(e, "shape");
96
+ return t?.get ? t.get.raw : t?.value;
97
+ }
98
+ function J(e) {
99
+ return at(e._zod.def) ?? e._zod.def.shape;
100
+ }
101
+ function yn(e, t, n) {
102
+ Object.defineProperty(e, t, {
103
+ get() {
104
+ const r = n();
105
+ return K(this, t, r), r;
106
+ },
107
+ enumerable: !0,
108
+ configurable: !0
109
+ });
110
+ }
111
+ function bn(e, t, n) {
112
+ t in e ? K(e, t, n) : e[t] = n;
113
+ }
114
+ function Q(e, t, n, r) {
115
+ const o = J(t);
116
+ for (const i of n) {
117
+ const s = Object.getOwnPropertyDescriptor(o, i);
118
+ s.enumerable && (s.get ? yn(e, i, () => {
119
+ const u = t._zod.def.shape[i];
120
+ return r ? r(u, i) : u;
121
+ }) : bn(e, i, r ? r(s.value, i) : s.value));
122
+ }
123
+ }
124
+ function Rr(e, t) {
125
+ for (const n of Reflect.ownKeys(t)) {
126
+ const r = Object.getOwnPropertyDescriptor(t, n);
127
+ r.enumerable && (r.get ? yn(e, n, () => t[n]) : bn(e, n, r.value));
128
+ }
129
+ }
130
+ function N(...e) {
131
+ const t = {};
132
+ for (const n of e) {
133
+ const r = Object.getOwnPropertyDescriptors(n);
134
+ Object.assign(t, r);
135
+ }
136
+ return Object.defineProperties({}, t);
137
+ }
138
+ function Cr(e) {
139
+ return JSON.stringify(e);
140
+ }
141
+ function Dr(e) {
142
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
143
+ }
144
+ const wn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
145
+ };
146
+ function _e(e) {
147
+ return typeof e == "object" && e !== null && !Array.isArray(e);
148
+ }
149
+ const Ur = /* @__PURE__ */ Ne(() => {
150
+ if (R.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
151
+ return !1;
152
+ try {
153
+ const e = Function;
154
+ return new e(""), !0;
155
+ } catch {
156
+ return !1;
157
+ }
158
+ });
159
+ function re(e) {
160
+ if (_e(e) === !1)
161
+ return !1;
162
+ const t = e.constructor;
163
+ if (t === void 0 || typeof t != "function")
164
+ return !0;
165
+ const n = t.prototype;
166
+ return !(_e(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
167
+ }
168
+ function zn(e) {
169
+ return re(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
170
+ }
171
+ const Fr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
172
+ function oe(e) {
173
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
174
+ }
175
+ function X(e, t, n) {
176
+ const r = new e._zod.constr(t ?? e._zod.def);
177
+ return (!t || n?.parent) && (r._zod.parent = e), r;
178
+ }
179
+ function g(e) {
180
+ const t = e;
181
+ if (!t)
182
+ return {};
183
+ if (typeof t == "string")
184
+ return { error: () => t };
185
+ if (t?.message !== void 0) {
186
+ if (t?.error !== void 0)
187
+ throw new Error("Cannot specify both `message` and `error` params");
188
+ t.error = t.message;
189
+ }
190
+ return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
191
+ }
192
+ function kn(e) {
193
+ return typeof e == "bigint" ? e.toString() + "n" : typeof e == "string" ? `"${e}"` : `${e}`;
194
+ }
195
+ function Mr(e) {
196
+ return Object.keys(e).filter((t) => e[t]._zod.optin !== void 0 && e[t]._zod.optout === "optional");
197
+ }
198
+ const $n = {
199
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
200
+ int32: [-2147483648, 2147483647],
201
+ uint32: [0, 4294967295],
202
+ float32: [-34028234663852886e22, 34028234663852886e22],
203
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
204
+ }, xr = {
205
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
206
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
207
+ };
208
+ function Lr(e, t) {
209
+ const n = e._zod.def, r = n.checks;
210
+ if (r && r.length > 0)
211
+ throw new Error(".pick() cannot be used on object schemas containing refinements");
212
+ const i = {};
213
+ return Q(i, e, je(e, t)), X(e, N(n, { shape: i, checks: [] }));
214
+ }
215
+ function je(e, t) {
216
+ const n = J(e), r = [];
217
+ for (const o of Reflect.ownKeys(t)) {
218
+ if (!Object.getOwnPropertyDescriptor(n, o)?.enumerable)
219
+ throw new Error(`Unrecognized key: "${String(o)}"`);
220
+ t[o] && r.push(o);
221
+ }
222
+ return r;
223
+ }
224
+ function Jr(e, t) {
225
+ const n = e._zod.def, r = n.checks;
226
+ if (r && r.length > 0)
227
+ throw new Error(".omit() cannot be used on object schemas containing refinements");
228
+ const i = new Set(je(e, t)), s = {};
229
+ return Q(s, e, Reflect.ownKeys(J(e)).filter((u) => !i.has(u))), X(e, N(n, { shape: s, checks: [] }));
230
+ }
231
+ function Kr(e, t) {
232
+ if (!re(t))
233
+ throw new Error("Invalid input to extend: expected a plain object");
234
+ const n = e._zod.def.checks;
235
+ if (n && n.length > 0) {
236
+ const o = J(e);
237
+ for (const i of Reflect.ownKeys(t))
238
+ if (Object.getOwnPropertyDescriptor(o, i) !== void 0)
239
+ throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
240
+ }
241
+ return X(e, N(e._zod.def, { shape: On(e, t) }));
242
+ }
243
+ function On(e, t) {
244
+ const n = {};
245
+ return Q(n, e, Reflect.ownKeys(J(e))), Rr(n, t), n;
246
+ }
247
+ function Vr(e, t) {
248
+ if (!re(t))
249
+ throw new Error("Invalid input to safeExtend: expected a plain object");
250
+ return X(e, N(e._zod.def, { shape: On(e, t) }));
251
+ }
252
+ function Br(e, t) {
253
+ if (!t?._zod?.def)
254
+ throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
255
+ if (e._zod.def.checks?.length)
256
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
257
+ const n = {};
258
+ Q(n, e, Reflect.ownKeys(J(e))), Q(n, t, Reflect.ownKeys(J(t)));
259
+ const r = N(e._zod.def, {
260
+ shape: n,
261
+ get catchall() {
262
+ return t._zod.def.catchall;
263
+ },
264
+ checks: t._zod.def.checks ?? []
265
+ });
266
+ return X(e, r);
267
+ }
268
+ function Tt(e, t, n, r = "partial") {
269
+ const i = t._zod.def.checks;
270
+ if (i && i.length > 0)
271
+ throw new Error(`.${r}() cannot be used on object schemas containing refinements`);
272
+ const u = n ? new Set(je(t, n)) : void 0, c = {};
273
+ return Q(c, t, Reflect.ownKeys(J(t)), e && ((a, f) => u && !u.has(f) ? a : new e({ type: "optional", innerType: a }))), X(t, N(t._zod.def, { shape: c, checks: [] }));
274
+ }
275
+ function Wr(e, t, n) {
276
+ const r = n ? new Set(je(t, n)) : void 0, o = {};
277
+ return Q(o, t, Reflect.ownKeys(J(t)), (i, s) => (
278
+ // overwrite with non-optional
279
+ r && !r.has(s) ? i : new e({ type: "nonoptional", innerType: i })
280
+ )), X(t, N(t._zod.def, { shape: o }));
281
+ }
282
+ function D(e, t = 0) {
283
+ if (e.aborted === !0)
284
+ return !0;
285
+ for (let n = t; n < e.issues.length; n++)
286
+ if (e.issues[n]?.continue !== !0)
287
+ return !0;
288
+ return !1;
289
+ }
290
+ function Gr(e, t = 0) {
291
+ if (e.aborted === !0)
292
+ return !0;
293
+ for (let n = t; n < e.issues.length; n++)
294
+ if (e.issues[n]?.continue === !1)
295
+ return !0;
296
+ return !1;
297
+ }
298
+ function W(e, t) {
299
+ return t.map((n) => {
300
+ var r;
301
+ return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
302
+ });
303
+ }
304
+ function le(e) {
305
+ return typeof e == "string" ? e : e?.message;
306
+ }
307
+ function At(e, t, n) {
308
+ var r;
309
+ for (let o = t; o < e.length; o++)
310
+ (r = e[o]).schema ?? (r.schema = n);
311
+ }
312
+ function G(e, t, n) {
313
+ var r;
314
+ const o = e.inst?._zod?.traits;
315
+ o?.has("$ZodType") && (o.has("$ZodCheck") ? (r = e).schema ?? (r.schema = e.inst) : e.schema = e.inst);
316
+ const i = e.schema !== e.inst ? e.schema?._zod.def?.error : void 0, s = e.message ? e.message : le(e.inst?._zod.def?.error?.(e)) ?? le(i?.(e)) ?? le(t?.error?.(e)) ?? le(n.customError?.(e)) ?? le(n.localeError?.(e)) ?? "Invalid input", u = {};
317
+ for (const c of Object.keys(e))
318
+ c === "inst" || c === "schema" || c === "continue" || c === "input" || c === "__proto__" || (u[c] = e[c]);
319
+ return u.path ?? (u.path = []), u.message = s, t?.reportInput && (u.input = e.input), u;
320
+ }
321
+ const qr = /[\uD800-\uDBFF]/;
322
+ function ft(e) {
323
+ const t = e.length;
324
+ if (!qr.test(e))
325
+ return t;
326
+ let n = t;
327
+ for (let r = 0; r < t - 1; r++)
328
+ (e.charCodeAt(r) & 64512) === 55296 && (e.charCodeAt(r + 1) & 64512) === 56320 && (n--, r++);
329
+ return n;
330
+ }
331
+ function lt(e) {
332
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
333
+ }
334
+ function Yr(e) {
335
+ const t = typeof e;
336
+ switch (t) {
337
+ case "number":
338
+ return Number.isNaN(e) ? "nan" : "number";
339
+ case "object": {
340
+ if (e === null)
341
+ return "null";
342
+ if (Array.isArray(e))
343
+ return "array";
344
+ const n = e;
345
+ if (n && Object.getPrototypeOf(n) !== Object.prototype && "constructor" in n && n.constructor)
346
+ return n.constructor.name;
347
+ }
348
+ }
349
+ return t;
350
+ }
351
+ function ve(...e) {
352
+ const [t, n, r] = e;
353
+ return typeof t == "string" ? {
354
+ message: t,
355
+ code: "custom",
356
+ input: n,
357
+ inst: r
358
+ } : { ...t };
359
+ }
360
+ function Xr(e, t) {
361
+ for (const n in t) {
362
+ const r = Object.getOwnPropertyDescriptor(t, n);
363
+ r.get ? Object.defineProperty(e, n, { ...r, enumerable: !1 }) : Hr(e, n, r.value);
364
+ }
365
+ }
366
+ function q(e, t, n, r = !0) {
367
+ return Object.defineProperty(e, t, { configurable: !0, writable: !0, enumerable: r, value: n }), n;
368
+ }
369
+ function Sn(e, t, n) {
370
+ return q(e, t, n, !1);
371
+ }
372
+ function Zn(e, t) {
373
+ for (const n in e) {
374
+ const r = e[n];
375
+ Object.defineProperty(t, n, {
376
+ configurable: !0,
377
+ enumerable: !0,
378
+ get() {
379
+ return q(this, n, r(this));
380
+ },
381
+ set(o) {
382
+ q(this, n, o);
383
+ }
384
+ });
385
+ }
386
+ return t;
387
+ }
388
+ function Hr(e, t, n) {
389
+ Object.defineProperty(e, t, {
390
+ configurable: !0,
391
+ get() {
392
+ return this == null ? n : q(this, t, n.bind(this));
393
+ },
394
+ set(r) {
395
+ q(this, t, r);
396
+ }
397
+ });
398
+ }
399
+ function Qr(e, t) {
400
+ const n = Object.getPrototypeOf(e);
401
+ return t in n ? void 0 : n;
402
+ }
403
+ let Je, V = !1;
404
+ const eo = {
405
+ configurable: !0,
406
+ get() {
407
+ V = !0;
408
+ }
409
+ };
410
+ function y(e, t, n) {
411
+ const r = Object.getPrototypeOf(e._zod);
412
+ if (t in r && Je !== e._zod) {
413
+ Je = void 0;
414
+ return;
415
+ }
416
+ Je = e._zod, Object.defineProperty(r, t, {
417
+ configurable: !0,
418
+ get() {
419
+ Object.defineProperty(this, t, eo);
420
+ const o = V;
421
+ V = !1;
422
+ try {
423
+ const i = n(this);
424
+ return V ? delete this[t] : Object.defineProperty(this, t, { configurable: !0, writable: !0, value: i }), V = V || o, i;
425
+ } catch (i) {
426
+ throw delete this[t], V = V || o, i;
427
+ }
428
+ },
429
+ set(o) {
430
+ Object.defineProperty(this, t, { configurable: !0, writable: !0, value: o });
431
+ }
432
+ });
433
+ }
434
+ function to(e, t, n, r) {
435
+ const o = Qr(e, t);
436
+ o && Object.defineProperty(o, t, {
437
+ configurable: !0,
438
+ get() {
439
+ const i = { configurable: !0, writable: !0, enumerable: r, value: void 0 };
440
+ return Object.defineProperty(this, t, i), i.value = n(this), Object.defineProperty(this, t, i), i.value;
441
+ },
442
+ set(i) {
443
+ Object.defineProperty(this, t, { configurable: !0, writable: !0, enumerable: r, value: i });
444
+ }
445
+ });
446
+ }
447
+ const no = "~constantCatch";
448
+ function ro(e) {
449
+ const t = () => e;
450
+ return t[no] = !0, t;
451
+ }
452
+ var Nt;
453
+ const Ke = { value: void 0, enumerable: !1 };
454
+ let jt = "captureStackTrace" in Error ? Error : null;
455
+ function oo(e) {
456
+ const t = jt;
457
+ if (t) {
458
+ const n = t.stackTraceLimit;
459
+ if (typeof n == "number") {
460
+ try {
461
+ t.stackTraceLimit = 0;
462
+ } catch {
463
+ return jt = null, new e();
464
+ }
465
+ try {
466
+ return new e();
467
+ } finally {
468
+ t.stackTraceLimit = n;
469
+ }
470
+ }
471
+ }
472
+ return new e();
473
+ }
474
+ function l(e, t, n, r) {
475
+ const o = {};
476
+ function i(h) {
477
+ this.def = h, this.constr = d, this.traits = /* @__PURE__ */ new Set();
478
+ }
479
+ i.prototype = o;
480
+ const s = n, u = s && /* @__PURE__ */ new WeakSet();
481
+ function c(h, p) {
482
+ if (h._zod) {
483
+ if (h._zod.traits.has(e))
484
+ return;
485
+ } else {
486
+ Ke.value = new i(p);
487
+ try {
488
+ Object.defineProperty(h, "_zod", Ke);
489
+ } finally {
490
+ Ke.value = void 0;
491
+ }
492
+ }
493
+ if (h._zod.traits.add(e), t(h, p), u) {
494
+ const _ = Object.getPrototypeOf(h), v = h._zod.constr.prototype;
495
+ let b = _;
496
+ for (; b && b !== v; )
497
+ b = Object.getPrototypeOf(b);
498
+ const I = b ?? _;
499
+ u.has(I) || (u.add(I), Xr(I, s));
500
+ }
501
+ const m = d.prototype;
502
+ for (const _ in m)
503
+ Object.prototype.hasOwnProperty.call(m, _) && (_ in h || (h[_] = m[_].bind(h)));
504
+ }
505
+ const a = r?.Parent ?? Object;
506
+ class f extends a {
507
+ }
508
+ Object.defineProperty(f, "name", { value: e });
509
+ function d(h) {
510
+ const p = r?.Parent ? oo(f) : this;
511
+ c(p, h);
512
+ const m = p._zod.deferred;
513
+ if (m) {
514
+ for (const v of m)
515
+ v();
516
+ p._zod.deferred = void 0;
517
+ }
518
+ const _ = globalThis.__zod_globalConfig?.postProcessor;
519
+ return _ && _(p), p;
520
+ }
521
+ return Object.defineProperty(d, "init", { value: c }), Object.defineProperty(d, Symbol.hasInstance, {
522
+ value: (h) => r?.Parent && h instanceof r.Parent ? !0 : h?._zod?.traits?.has(e)
523
+ }), Object.defineProperty(d, "name", { value: e }), d;
524
+ }
525
+ class H extends Error {
526
+ constructor() {
527
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
528
+ }
529
+ }
530
+ class Pn extends Error {
531
+ constructor(t) {
532
+ super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
533
+ }
534
+ }
535
+ (Nt = globalThis).__zod_globalConfig ?? (Nt.__zod_globalConfig = {});
536
+ const R = globalThis.__zod_globalConfig;
537
+ function F(e) {
538
+ return e && Object.assign(R, e), R;
539
+ }
540
+ function io() {
541
+ const e = this._zod;
542
+ return e.message ?? (e.message = JSON.stringify(e.def, He, 2)), e.message;
543
+ }
544
+ function so(e) {
545
+ this._zod.message = e;
546
+ }
547
+ const uo = {
548
+ get: io,
549
+ set: so,
550
+ enumerable: !0,
551
+ configurable: !0
552
+ }, Ve = { value: void 0, enumerable: !1 }, Rt = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]), En = (e, t) => {
553
+ e.name = "$ZodError", Ve.value = t, Object.defineProperty(e, "issues", Ve), Ve.value = void 0, Object.defineProperty(e, "message", uo);
554
+ const n = Object.getPrototypeOf(e);
555
+ Rt.has(n) || (Rt.add(n), Object.defineProperty(n, "toString", {
556
+ configurable: !0,
557
+ enumerable: !1,
558
+ get() {
559
+ const r = () => this.message;
560
+ return Object.defineProperty(this, "toString", { value: r, configurable: !0, writable: !0 }), r;
561
+ },
562
+ set(r) {
563
+ Object.defineProperty(this, "toString", { value: r, configurable: !0, writable: !0 });
564
+ }
565
+ }));
566
+ }, In = l("$ZodError", En), Tn = l("$ZodError", En, void 0, {
567
+ Parent: Error
568
+ });
569
+ function co(e, t, n) {
570
+ return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, { value: n(), writable: !0, enumerable: !0, configurable: !0 }) : e[t] = n()), e[t];
571
+ }
572
+ function ao(e, t = (n) => n.message) {
573
+ const n = {}, r = [];
574
+ for (const o of e.issues)
575
+ o.path.length > 0 ? co(n, o.path[0], () => []).push(t(o)) : r.push(t(o));
576
+ return { formErrors: r, fieldErrors: n };
577
+ }
578
+ function fo(e, t = (n) => n.message) {
579
+ const n = { _errors: [] }, r = (o, i = []) => {
580
+ for (const s of o.issues)
581
+ if (s.code === "invalid_union" && s.errors.length)
582
+ s.errors.map((u) => r({ issues: u }, [...i, ...s.path]));
583
+ else if (s.code === "invalid_key")
584
+ r({ issues: s.issues }, [...i, ...s.path]);
585
+ else if (s.code === "invalid_element")
586
+ r({ issues: s.issues }, [...i, ...s.path]);
587
+ else {
588
+ const u = [...i, ...s.path];
589
+ if (u.length === 0)
590
+ n._errors.push(t(s));
591
+ else {
592
+ let c = n, a = 0;
593
+ for (; a < u.length; ) {
594
+ const f = u[a], d = a === u.length - 1;
595
+ if (f === "_errors") {
596
+ d && c._errors.push(t(s)), a++;
597
+ continue;
598
+ }
599
+ Object.prototype.hasOwnProperty.call(c, f) || Object.defineProperty(c, f, {
600
+ value: { _errors: [] },
601
+ enumerable: !0,
602
+ writable: !0,
603
+ configurable: !0
604
+ });
605
+ const h = c[f];
606
+ d && h._errors.push(t(s)), c = h, a++;
607
+ }
608
+ }
609
+ }
610
+ };
611
+ return r(e), n;
612
+ }
613
+ function Re(e, t) {
614
+ return { callee: t?.callee ?? e, Err: t?.Err };
615
+ }
616
+ const Ce = (e) => {
617
+ const t = (n, r, o, i) => {
618
+ const s = o ? { ...o, async: !1 } : { async: !1 }, u = n._zod.run({ value: r, issues: [] }, s);
619
+ if (u instanceof Promise)
620
+ throw new H();
621
+ if (u.issues.length) {
622
+ const c = new (i?.Err ?? e)(u.issues.map((a) => G(a, s, F())));
623
+ throw wn(c, i?.callee ?? t), c;
624
+ }
625
+ return u.value;
626
+ };
627
+ return t;
628
+ }, lo = /* @__PURE__ */ Ce(Tn), De = (e) => {
629
+ const t = async (n, r, o, i) => {
630
+ const s = o ? { ...o, async: !0 } : { async: !0 };
631
+ let u = n._zod.run({ value: r, issues: [] }, s);
632
+ if (u instanceof Promise && (u = await u), u.issues.length) {
633
+ const c = new (i?.Err ?? e)(u.issues.map((a) => G(a, s, F())));
634
+ throw wn(c, i?.callee ?? t), c;
635
+ }
636
+ return u.value;
637
+ };
638
+ return t;
639
+ }, po = /* @__PURE__ */ De(Tn), dt = (e) => (t, n, r) => {
640
+ const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
641
+ if (i instanceof Promise)
642
+ throw new H();
643
+ return i.issues.length ? An(e, i.issues, o) : { success: !0, data: i.value };
644
+ };
645
+ function An(e, t, n) {
646
+ let r;
647
+ return {
648
+ success: !1,
649
+ get error() {
650
+ return r || (r = new e(t.map((o) => G(o, n, F()))), t = void 0, n = void 0), r;
651
+ },
652
+ set error(o) {
653
+ r = o, t = void 0, n = void 0;
654
+ }
655
+ };
656
+ }
657
+ const pt = (e) => async (t, n, r) => {
658
+ const o = r ? { ...r, async: !0 } : { async: !0 };
659
+ let i = t._zod.run({ value: n, issues: [] }, o);
660
+ return i instanceof Promise && (i = await i), i.issues.length ? An(e, i.issues, o) : { success: !0, data: i.value };
661
+ }, ho = /* @__PURE__ */ Symbol.for("zod.compile.invalid"), mo = /* @__PURE__ */ Symbol.for("zod.compile.fallback"), go = ((e, t, n) => {
662
+ const r = e._zod.bag.validator;
663
+ if (r !== void 0) {
664
+ if (r(t) !== ho)
665
+ return !0;
666
+ if (r.definite === !0 && n === void 0)
667
+ return !1;
668
+ }
669
+ return _o(e, t, n);
670
+ });
671
+ function _o(e, t, n) {
672
+ const r = n ? { ...n, async: !1, abortEarly: !0 } : { async: !1, abortEarly: !0 }, o = e._zod.bag.fallbackRun;
673
+ let i;
674
+ if (o ? (r[mo] = !0, i = o({ value: t, issues: [] }, r)) : i = e._zod.run({ value: t, issues: [] }, r), i instanceof Promise)
675
+ throw new H();
676
+ return i.issues.length === 0;
677
+ }
678
+ const vo = async (e, t, n) => {
679
+ const r = n ? { ...n, async: !0, abortEarly: !0 } : { async: !0, abortEarly: !0 };
680
+ let o = e._zod.run({ value: t, issues: [] }, r);
681
+ return o instanceof Promise && (o = await o), o.issues.length === 0;
682
+ }, yo = (e) => {
683
+ const t = Ce(e), n = (r, o, i, s) => {
684
+ const u = i ? { ...i, direction: "backward" } : { direction: "backward" };
685
+ return t(r, o, u, Re(n, s));
686
+ };
687
+ return n;
688
+ }, bo = (e) => {
689
+ const t = Ce(e), n = (r, o, i, s) => t(r, o, i, Re(n, s));
690
+ return n;
691
+ }, wo = (e) => {
692
+ const t = De(e), n = async (r, o, i, s) => {
693
+ const u = i ? { ...i, direction: "backward" } : { direction: "backward" };
694
+ return await t(r, o, u, Re(n, s));
695
+ };
696
+ return n;
697
+ }, zo = (e) => {
698
+ const t = De(e), n = async (r, o, i, s) => await t(r, o, i, Re(n, s));
699
+ return n;
700
+ }, ko = (e) => (t, n, r) => {
701
+ const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
702
+ return dt(e)(t, n, o);
703
+ }, $o = (e) => (t, n, r) => dt(e)(t, n, r), Oo = (e) => async (t, n, r) => {
704
+ const o = r ? { ...r, direction: "backward" } : { direction: "backward" };
705
+ return pt(e)(t, n, o);
706
+ }, So = (e) => async (t, n, r) => pt(e)(t, n, r), Zo = /^[cC][0-9a-z]{6,}$/, Po = /^[0-9a-z]+$/, Eo = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/, Io = /^[0-9a-vA-V]{20}$/, To = /^[A-Za-z0-9]{27}$/, Ao = /^[a-zA-Z0-9_-]{21}$/;
707
+ function No(e) {
708
+ return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`);
709
+ }
710
+ const jo = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ro = /^([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})$/, Ct = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Co = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Do = "^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";
711
+ function Uo() {
712
+ return new RegExp(Do, "u");
713
+ }
714
+ const Fo = /^(?:(?: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])$/, Mo = /^(([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}|:))$/, xo = /^((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])$/, Lo = /^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Jo = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Ko = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/, Vo = /^https?$/, Bo = /^\+[1-9]\d{6,14}$/, Nn = "(?:(?:\\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])))";
715
+ function Wo(e) {
716
+ return new RegExp(`^${e}$`);
717
+ }
718
+ const Go = /* @__PURE__ */ Wo(Nn);
719
+ function Qe(e) {
720
+ const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
721
+ return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : e.seconds ? `${t}:[0-5]\\d(?:\\.\\d+)?` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
722
+ }
723
+ function qo(e) {
724
+ return new RegExp(`^${Qe(e)}$`);
725
+ }
726
+ function Yo(e) {
727
+ const t = ["Z"];
728
+ e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
729
+ const n = `${Qe({ precision: e.precision, seconds: !0 })}(?:${t.join("|")})`, r = e.local ? `${n}|${Qe({ precision: e.precision })}` : n;
730
+ return new RegExp(`^${Nn}T(?:${r})$`);
731
+ }
732
+ const Xo = /^[\s\S]{0,}$/, Ho = /^-?\d+$/, ht = /^-?\d+(?:\.\d+)?$/, Qo = /^(?:true|false)$/i, ei = /^null$/i, ti = /^[^A-Z]*$/, ni = /^[^a-z]*$/, A = /* @__PURE__ */ l("$ZodCheck", (e, t) => {
733
+ var n;
734
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
735
+ }), mt = (e) => {
736
+ const t = e.value;
737
+ return !Ar(t) && t.length !== void 0;
738
+ }, Pe = {
739
+ number: "number",
740
+ bigint: "bigint",
741
+ object: "date"
742
+ }, jn = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
743
+ A.init(e, t);
744
+ const n = Pe[typeof t.value];
745
+ e._zod.check = (r) => {
746
+ (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
747
+ origin: Pe[typeof r.value] ?? n,
748
+ code: "too_big",
749
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
750
+ input: r.value,
751
+ inclusive: t.inclusive,
752
+ inst: e,
753
+ continue: !t.abort
754
+ });
755
+ };
756
+ }), Rn = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
757
+ A.init(e, t);
758
+ const n = Pe[typeof t.value];
759
+ e._zod.check = (r) => {
760
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
761
+ origin: Pe[typeof r.value] ?? n,
762
+ code: "too_small",
763
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
764
+ input: r.value,
765
+ inclusive: t.inclusive,
766
+ inst: e,
767
+ continue: !t.abort
768
+ });
769
+ };
770
+ }), ri = /* @__PURE__ */ l("$ZodCheckMultipleOf", (e, t) => {
771
+ A.init(e, t), e._zod.check = (n) => {
772
+ if (typeof n.value != typeof t.value)
773
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
774
+ (typeof n.value == "bigint" ? (
775
+ // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN
776
+ t.value !== BigInt(0) && n.value % t.value === BigInt(0)
777
+ ) : Nr(n.value, t.value) === 0) || n.issues.push({
778
+ origin: typeof n.value,
779
+ code: "not_multiple_of",
780
+ divisor: t.value,
781
+ input: n.value,
782
+ inst: e,
783
+ continue: !t.abort
784
+ });
785
+ };
786
+ }), oi = /* @__PURE__ */ l("$ZodCheckNumberFormat", (e, t) => {
787
+ A.init(e, t), t.format = t.format || "float64";
788
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = $n[t.format];
789
+ e._zod.check = (s) => {
790
+ const u = s.value;
791
+ if (n) {
792
+ if (!Number.isInteger(u)) {
793
+ s.issues.push({
794
+ expected: r,
795
+ format: t.format,
796
+ code: "invalid_type",
797
+ continue: !1,
798
+ input: u,
799
+ inst: e
800
+ });
801
+ return;
802
+ }
803
+ if (!Number.isSafeInteger(u)) {
804
+ u > 0 ? s.issues.push({
805
+ input: u,
806
+ code: "too_big",
807
+ maximum: Number.MAX_SAFE_INTEGER,
808
+ note: "Integers must be within the safe integer range.",
809
+ inst: e,
810
+ origin: r,
811
+ inclusive: !0,
812
+ continue: !t.abort
813
+ }) : s.issues.push({
814
+ input: u,
815
+ code: "too_small",
816
+ minimum: Number.MIN_SAFE_INTEGER,
817
+ note: "Integers must be within the safe integer range.",
818
+ inst: e,
819
+ origin: r,
820
+ inclusive: !0,
821
+ continue: !t.abort
822
+ });
823
+ return;
824
+ }
825
+ }
826
+ u < o && s.issues.push({
827
+ origin: "number",
828
+ input: u,
829
+ code: "too_small",
830
+ minimum: o,
831
+ inclusive: !0,
832
+ inst: e,
833
+ continue: !t.abort
834
+ }), u > i && s.issues.push({
835
+ origin: "number",
836
+ input: u,
837
+ code: "too_big",
838
+ maximum: i,
839
+ inclusive: !0,
840
+ inst: e,
841
+ continue: !t.abort
842
+ });
843
+ };
844
+ }), ii = /* @__PURE__ */ l("$ZodCheckMaxLength", (e, t) => {
845
+ var n;
846
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = mt), e._zod.check = (r) => {
847
+ const o = r.value, i = o.length;
848
+ if ((typeof o == "string" && i > t.maximum ? ft(o) : i) <= t.maximum)
849
+ return;
850
+ const u = lt(o);
851
+ r.issues.push({
852
+ origin: u,
853
+ code: "too_big",
854
+ maximum: t.maximum,
855
+ inclusive: !0,
856
+ input: o,
857
+ inst: e,
858
+ continue: !t.abort
859
+ });
860
+ };
861
+ }), si = /* @__PURE__ */ l("$ZodCheckMinLength", (e, t) => {
862
+ var n;
863
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = mt), e._zod.check = (r) => {
864
+ const o = r.value, i = o.length;
865
+ if ((typeof o == "string" && i >= t.minimum && i < t.minimum * 2 ? ft(o) : i) >= t.minimum)
866
+ return;
867
+ const u = lt(o);
868
+ r.issues.push({
869
+ origin: u,
870
+ code: "too_small",
871
+ minimum: t.minimum,
872
+ inclusive: !0,
873
+ input: o,
874
+ inst: e,
875
+ continue: !t.abort
876
+ });
877
+ };
878
+ }), ui = /* @__PURE__ */ l("$ZodCheckLengthEquals", (e, t) => {
879
+ var n;
880
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = mt), e._zod.check = (r) => {
881
+ const o = r.value, i = o.length, s = typeof o == "string" && i >= t.length && i <= t.length * 2 ? ft(o) : i;
882
+ if (s === t.length)
883
+ return;
884
+ const u = lt(o), c = s > t.length;
885
+ r.issues.push({
886
+ origin: u,
887
+ ...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
888
+ inclusive: !0,
889
+ exact: !0,
890
+ input: r.value,
891
+ inst: e,
892
+ continue: !t.abort
893
+ });
894
+ };
895
+ }), Ue = /* @__PURE__ */ l("$ZodCheckStringFormat", (e, t) => {
896
+ var n, r;
897
+ A.init(e, t), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
898
+ t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
899
+ origin: "string",
900
+ code: "invalid_format",
901
+ format: t.format,
902
+ input: o.value,
903
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
904
+ inst: e,
905
+ continue: !t.abort
906
+ });
907
+ }) : (r = e._zod).check ?? (r.check = () => {
908
+ });
909
+ }), ci = /* @__PURE__ */ l("$ZodCheckRegex", (e, t) => {
910
+ Ue.init(e, t), e._zod.check = (n) => {
911
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
912
+ origin: "string",
913
+ code: "invalid_format",
914
+ format: "regex",
915
+ input: n.value,
916
+ pattern: t.pattern.toString(),
917
+ inst: e,
918
+ continue: !t.abort
919
+ });
920
+ };
921
+ }), ai = /* @__PURE__ */ l("$ZodCheckLowerCase", (e, t) => {
922
+ t.pattern ?? (t.pattern = ti), Ue.init(e, t);
923
+ }), fi = /* @__PURE__ */ l("$ZodCheckUpperCase", (e, t) => {
924
+ t.pattern ?? (t.pattern = ni), Ue.init(e, t);
925
+ }), li = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
926
+ A.init(e, t);
927
+ const n = oe(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
928
+ t.pattern = r, e._zod.check = (o) => {
929
+ o.value.includes(t.includes, t.position) || o.issues.push({
930
+ origin: "string",
931
+ code: "invalid_format",
932
+ format: "includes",
933
+ includes: t.includes,
934
+ input: o.value,
935
+ inst: e,
936
+ continue: !t.abort
937
+ });
938
+ };
939
+ }), di = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
940
+ A.init(e, t);
941
+ const n = new RegExp(`^${oe(t.prefix)}.*`);
942
+ t.pattern ?? (t.pattern = n), e._zod.check = (r) => {
943
+ r.value.startsWith(t.prefix) || r.issues.push({
944
+ origin: "string",
945
+ code: "invalid_format",
946
+ format: "starts_with",
947
+ prefix: t.prefix,
948
+ input: r.value,
949
+ inst: e,
950
+ continue: !t.abort
951
+ });
952
+ };
953
+ }), pi = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
954
+ A.init(e, t);
955
+ const n = new RegExp(`.*${oe(t.suffix)}$`);
956
+ t.pattern ?? (t.pattern = n), e._zod.check = (r) => {
957
+ r.value.endsWith(t.suffix) || r.issues.push({
958
+ origin: "string",
959
+ code: "invalid_format",
960
+ format: "ends_with",
961
+ suffix: t.suffix,
962
+ input: r.value,
963
+ inst: e,
964
+ continue: !t.abort
965
+ });
966
+ };
967
+ }), hi = /* @__PURE__ */ l("$ZodCheckOverwrite", (e, t) => {
968
+ A.init(e, t), e._zod.check = (n) => {
969
+ n.value = t.tx(n.value);
970
+ };
971
+ });
972
+ class mi {
973
+ constructor(t = [], n = {}) {
974
+ this.content = [], this.indent = 0, this.args = t, this.closed = n;
975
+ }
976
+ // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
977
+ indented(t) {
978
+ this.indent += 1;
979
+ try {
980
+ t(this);
981
+ } finally {
982
+ this.indent -= 1;
983
+ }
984
+ }
985
+ write(t) {
986
+ if (typeof t == "function") {
987
+ t(this, { execution: "sync" }), t(this, { execution: "async" });
988
+ return;
989
+ }
990
+ const r = t.split(`
991
+ `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
992
+ for (const s of i)
993
+ this.content.push(s);
994
+ }
995
+ compile() {
996
+ const t = Function, n = this?.content ?? [""];
997
+ return new t(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {
998
+ ${n.join(`
999
+ `)}
1000
+ };`)(...Object.values(this.closed));
1001
+ }
1002
+ }
1003
+ const gi = {
1004
+ major: 4,
1005
+ minor: 6,
1006
+ patch: 5
1007
+ }, w = /* @__PURE__ */ l("$ZodType", (e, t) => {
1008
+ var n;
1009
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = gi;
1010
+ const r = e._zod.def.checks, o = e._zod.traits.has("$ZodCheck") ? [e, ...r ?? []] : r?.length ? [...r] : [];
1011
+ for (const i of o)
1012
+ for (const s of i._zod.onattach)
1013
+ s(e);
1014
+ if (o.length === 0)
1015
+ (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
1016
+ e._zod.run = e._zod.parse;
1017
+ });
1018
+ else {
1019
+ const i = (u, c, a) => {
1020
+ if (u.memo)
1021
+ return u;
1022
+ let f = D(u), d;
1023
+ for (const h of c) {
1024
+ if (h._zod.def.when) {
1025
+ if (Gr(u) || !h._zod.def.when(u))
1026
+ continue;
1027
+ } else if (f)
1028
+ continue;
1029
+ const p = u.issues.length, m = h._zod.check(u);
1030
+ if (m instanceof Promise && a?.async === !1)
1031
+ throw new H();
1032
+ if (d || m instanceof Promise)
1033
+ d = (d ?? Promise.resolve()).then(async () => {
1034
+ await m, u.issues.length !== p && (At(u.issues, p, e), f || (f = D(u, p)));
1035
+ });
1036
+ else {
1037
+ if (u.issues.length === p)
1038
+ continue;
1039
+ At(u.issues, p, e), f || (f = D(u, p));
1040
+ }
1041
+ }
1042
+ return d ? d.then(() => u) : u;
1043
+ }, s = (u, c, a) => {
1044
+ if (D(u))
1045
+ return u.aborted = !0, u;
1046
+ const f = i(c, o, a);
1047
+ if (f instanceof Promise) {
1048
+ if (a.async === !1)
1049
+ throw new H();
1050
+ return f.then((d) => e._zod.parse(d, a));
1051
+ }
1052
+ return e._zod.parse(f, a);
1053
+ };
1054
+ e._zod.run = (u, c) => {
1055
+ if (c.skipChecks)
1056
+ return e._zod.parse(u, c);
1057
+ if (c.direction === "backward") {
1058
+ const f = e._zod.parse({ value: u.value, issues: [] }, { ...c, skipChecks: !0 });
1059
+ return f instanceof Promise ? f.then((d) => s(d, u, c)) : s(f, u, c);
1060
+ }
1061
+ const a = e._zod.parse(u, c);
1062
+ if (a instanceof Promise) {
1063
+ if (c.async === !1)
1064
+ throw new H();
1065
+ return a.then((f) => i(f, o, c));
1066
+ }
1067
+ return i(a, o, c);
1068
+ };
1069
+ }
1070
+ }, {
1071
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
1072
+ get "~standard"() {
1073
+ return Sn(this, "~standard", Dn(this));
1074
+ },
1075
+ set "~standard"(e) {
1076
+ q(this, "~standard", e);
1077
+ }
1078
+ }), Cn = (e, t) => e.issues.length ? { issues: e.issues.map((n) => G(n, t, F())) } : { value: e.value };
1079
+ async function _i(e, t) {
1080
+ const n = { async: !0 };
1081
+ return Cn(await e._zod.run({ value: t, issues: [] }, n), n);
1082
+ }
1083
+ function Dn(e) {
1084
+ return {
1085
+ validate: (t) => {
1086
+ const n = { async: !1 };
1087
+ try {
1088
+ const r = e._zod.run({ value: t, issues: [] }, n);
1089
+ if (!(r instanceof Promise))
1090
+ return Cn(r, n);
1091
+ } catch {
1092
+ }
1093
+ return _i(e, t);
1094
+ },
1095
+ vendor: "zod",
1096
+ version: 1
1097
+ };
1098
+ }
1099
+ const gt = /* @__PURE__ */ l("$ZodString", (e, t) => {
1100
+ w.init(e, t), e._zod.pattern = t.pattern ?? Xo, e._zod.parse = (n, r) => {
1101
+ if (t.coerce)
1102
+ try {
1103
+ n.value = String(n.value);
1104
+ } catch {
1105
+ }
1106
+ return typeof n.value == "string" || n.issues.push({
1107
+ expected: "string",
1108
+ code: "invalid_type",
1109
+ input: n.value,
1110
+ inst: e
1111
+ }), n;
1112
+ };
1113
+ }), O = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
1114
+ Ue.init(e, t), gt.init(e, t);
1115
+ }), vi = /* @__PURE__ */ l("$ZodGUID", (e, t) => {
1116
+ t.pattern ?? (t.pattern = Ro), O.init(e, t);
1117
+ }), yi = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
1118
+ if (t.version) {
1119
+ const r = {
1120
+ v1: 1,
1121
+ v2: 2,
1122
+ v3: 3,
1123
+ v4: 4,
1124
+ v5: 5,
1125
+ v6: 6,
1126
+ v7: 7,
1127
+ v8: 8
1128
+ }[t.version];
1129
+ if (r === void 0)
1130
+ throw new Error(`Invalid UUID version: "${t.version}"`);
1131
+ t.pattern ?? (t.pattern = Ct(r));
1132
+ } else
1133
+ t.pattern ?? (t.pattern = Ct());
1134
+ O.init(e, t);
1135
+ }), bi = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
1136
+ t.pattern ?? (t.pattern = Co), O.init(e, t);
1137
+ }), Un = 1, Ee = 2;
1138
+ function Fn(e) {
1139
+ try {
1140
+ return typeof URL < "u" && typeof URL.canParse == "function" ? URL.canParse(e) : (new URL(e), !0);
1141
+ } catch {
1142
+ return !1;
1143
+ }
1144
+ }
1145
+ function wi(e, t) {
1146
+ return !("normalize" in t) && !("hostname" in t) && !("protocol" in t) ? Fn(e) || Ee : zi(e, t);
1147
+ }
1148
+ function zi(e, t) {
1149
+ if (!t.normalize && t.protocol?.source === Vo.source && !/^https?:\/\//i.test(e))
1150
+ return Un;
1151
+ try {
1152
+ if (typeof URL < "u") {
1153
+ const n = URL;
1154
+ if (typeof n.parse == "function")
1155
+ return n.parse(e) ?? Ee;
1156
+ }
1157
+ return new URL(e);
1158
+ } catch {
1159
+ return Ee;
1160
+ }
1161
+ }
1162
+ const ki = /[\t\n\r]/g;
1163
+ function Dt(e) {
1164
+ return e.replace(ki, "");
1165
+ }
1166
+ function $i(e, t) {
1167
+ return t.lastIndex = 0, t.test(e.hostname);
1168
+ }
1169
+ function Oi(e, t) {
1170
+ return t.lastIndex = 0, t.test(e.protocol.endsWith(":") ? e.protocol.slice(0, -1) : e.protocol);
1171
+ }
1172
+ const Si = /* @__PURE__ */ l("$ZodURL", (e, t) => {
1173
+ O.init(e, t), e._zod.check = (n) => {
1174
+ try {
1175
+ const r = n.value.trim(), o = wi(r, t);
1176
+ if (o === Un) {
1177
+ n.issues.push({
1178
+ code: "invalid_format",
1179
+ format: "url",
1180
+ note: "Invalid URL format",
1181
+ input: n.value,
1182
+ inst: e,
1183
+ continue: !t.abort
1184
+ });
1185
+ return;
1186
+ }
1187
+ if (o === Ee) {
1188
+ n.issues.push({
1189
+ code: "invalid_format",
1190
+ format: "url",
1191
+ input: n.value,
1192
+ inst: e,
1193
+ continue: !t.abort
1194
+ });
1195
+ return;
1196
+ }
1197
+ if (o === !0) {
1198
+ n.value = Dt(r);
1199
+ return;
1200
+ }
1201
+ t.hostname && !$i(o, t.hostname) && n.issues.push({
1202
+ code: "invalid_format",
1203
+ format: "url",
1204
+ note: "Invalid hostname",
1205
+ pattern: t.hostname.source,
1206
+ input: n.value,
1207
+ inst: e,
1208
+ continue: !t.abort
1209
+ }), t.protocol && !Oi(o, t.protocol) && n.issues.push({
1210
+ code: "invalid_format",
1211
+ format: "url",
1212
+ note: "Invalid protocol",
1213
+ pattern: t.protocol.source,
1214
+ input: n.value,
1215
+ inst: e,
1216
+ continue: !t.abort
1217
+ }), n.value = t.normalize ? o.href : Dt(r);
1218
+ return;
1219
+ } catch {
1220
+ n.issues.push({
1221
+ code: "invalid_format",
1222
+ format: "url",
1223
+ input: n.value,
1224
+ inst: e,
1225
+ continue: !t.abort
1226
+ });
1227
+ }
1228
+ };
1229
+ }), Zi = /* @__PURE__ */ l("$ZodEmoji", (e, t) => {
1230
+ t.pattern ?? (t.pattern = Uo()), O.init(e, t);
1231
+ }), Pi = /* @__PURE__ */ l("$ZodNanoID", (e, t) => {
1232
+ if (t.length !== void 0 && (!Number.isInteger(t.length) || t.length < 1))
1233
+ throw new Error(`Invalid nanoid length: ${t.length}`);
1234
+ t.pattern ?? (t.pattern = t.length === void 0 ? Ao : No(t.length)), O.init(e, t);
1235
+ }), Ei = /* @__PURE__ */ l("$ZodCUID", (e, t) => {
1236
+ t.pattern ?? (t.pattern = Zo), O.init(e, t);
1237
+ }), Ii = /* @__PURE__ */ l("$ZodCUID2", (e, t) => {
1238
+ t.pattern ?? (t.pattern = Po), O.init(e, t);
1239
+ }), Ti = /* @__PURE__ */ l("$ZodULID", (e, t) => {
1240
+ t.pattern ?? (t.pattern = Eo), O.init(e, t);
1241
+ }), Ai = /* @__PURE__ */ l("$ZodXID", (e, t) => {
1242
+ t.pattern ?? (t.pattern = Io), O.init(e, t);
1243
+ }), Ni = /* @__PURE__ */ l("$ZodKSUID", (e, t) => {
1244
+ t.pattern ?? (t.pattern = To), O.init(e, t);
1245
+ }), ji = /* @__PURE__ */ l("$ZodISODateTime", (e, t) => {
1246
+ t.pattern ?? (t.pattern = Yo(t)), O.init(e, t);
1247
+ }), Ri = /* @__PURE__ */ l("$ZodISODate", (e, t) => {
1248
+ t.pattern ?? (t.pattern = Go), O.init(e, t);
1249
+ }), Ci = /* @__PURE__ */ l("$ZodISOTime", (e, t) => {
1250
+ t.pattern ?? (t.pattern = qo(t)), O.init(e, t);
1251
+ }), Di = /* @__PURE__ */ l("$ZodISODuration", (e, t) => {
1252
+ t.pattern ?? (t.pattern = jo), O.init(e, t);
1253
+ }), Ui = /* @__PURE__ */ l("$ZodIPv4", (e, t) => {
1254
+ t.pattern ?? (t.pattern = Fo), O.init(e, t);
1255
+ }), Fi = /^[0-9a-fA-F:.]+$/;
1256
+ function Mn(e) {
1257
+ return Fi.test(e) ? Fn(`http://[${e}]`) : !1;
1258
+ }
1259
+ const Mi = /* @__PURE__ */ l("$ZodIPv6", (e, t) => {
1260
+ t.pattern ?? (t.pattern = Mo), O.init(e, t), e._zod.check = (n) => {
1261
+ Mn(n.value) || n.issues.push({
1262
+ code: "invalid_format",
1263
+ format: "ipv6",
1264
+ input: n.value,
1265
+ inst: e,
1266
+ continue: !t.abort
1267
+ });
1268
+ };
1269
+ }), xi = /* @__PURE__ */ l("$ZodCIDRv4", (e, t) => {
1270
+ t.pattern ?? (t.pattern = xo), O.init(e, t);
1271
+ });
1272
+ function Li(e) {
1273
+ const t = e.split("/");
1274
+ if (t.length !== 2)
1275
+ return !1;
1276
+ const [n, r] = t;
1277
+ if (!r)
1278
+ return !1;
1279
+ const o = Number(r);
1280
+ return `${o}` !== r || o < 0 || o > 128 ? !1 : Mn(n);
1281
+ }
1282
+ const Ji = /* @__PURE__ */ l("$ZodCIDRv6", (e, t) => {
1283
+ t.pattern ?? (t.pattern = Lo), O.init(e, t), e._zod.check = (n) => {
1284
+ Li(n.value) || n.issues.push({
1285
+ code: "invalid_format",
1286
+ format: "cidrv6",
1287
+ input: n.value,
1288
+ inst: e,
1289
+ continue: !t.abort
1290
+ });
1291
+ };
1292
+ });
1293
+ function xn(e) {
1294
+ if (e === "")
1295
+ return !0;
1296
+ if (/\s/.test(e) || e.length % 4 !== 0)
1297
+ return !1;
1298
+ try {
1299
+ return atob(e), !0;
1300
+ } catch {
1301
+ return !1;
1302
+ }
1303
+ }
1304
+ const Ln = /^[0-9a-zA-Z+/]*={0,2}$/, Ki = /* @__PURE__ */ l("$ZodBase64", (e, t) => {
1305
+ t.pattern ?? (t.pattern = Ln), O.init(e, t), e._zod.check = (n) => {
1306
+ xn(n.value) || n.issues.push({
1307
+ code: "invalid_format",
1308
+ format: "base64",
1309
+ input: n.value,
1310
+ inst: e,
1311
+ continue: !t.abort
1312
+ });
1313
+ };
1314
+ }), _t = /^[A-Za-z0-9_-]*$/;
1315
+ function Vi(e) {
1316
+ if (!_t.test(e))
1317
+ return !1;
1318
+ const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1319
+ return xn(n);
1320
+ }
1321
+ const Bi = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
1322
+ t.pattern ?? (t.pattern = _t), O.init(e, t), e._zod.check = (n) => {
1323
+ Vi(n.value) || n.issues.push({
1324
+ code: "invalid_format",
1325
+ format: "base64url",
1326
+ input: n.value,
1327
+ inst: e,
1328
+ continue: !t.abort
1329
+ });
1330
+ };
1331
+ }), Wi = /* @__PURE__ */ l("$ZodE164", (e, t) => {
1332
+ t.pattern ?? (t.pattern = Bo), O.init(e, t);
1333
+ });
1334
+ function Gi(e, t = null) {
1335
+ try {
1336
+ const n = e.split(".");
1337
+ if (n.length !== 3)
1338
+ return !1;
1339
+ const [r] = n;
1340
+ if (!r)
1341
+ return !1;
1342
+ const o = JSON.parse(atob(r));
1343
+ return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
1344
+ } catch {
1345
+ return !1;
1346
+ }
1347
+ }
1348
+ const qi = /* @__PURE__ */ l("$ZodJWT", (e, t) => {
1349
+ O.init(e, t), e._zod.check = (n) => {
1350
+ Gi(n.value, t.alg) || n.issues.push({
1351
+ code: "invalid_format",
1352
+ format: "jwt",
1353
+ input: n.value,
1354
+ inst: e,
1355
+ continue: !t.abort
1356
+ });
1357
+ };
1358
+ }), Jn = /* @__PURE__ */ l("$ZodNumber", (e, t) => {
1359
+ w.init(e, t), e._zod.pattern = ht, e._zod.parse = (n, r) => {
1360
+ if (t.coerce)
1361
+ try {
1362
+ n.value = Number(n.value);
1363
+ } catch {
1364
+ }
1365
+ const o = n.value;
1366
+ if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
1367
+ return n;
1368
+ const i = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : String(o) : void 0;
1369
+ return n.issues.push({
1370
+ expected: "number",
1371
+ code: "invalid_type",
1372
+ input: o,
1373
+ inst: e,
1374
+ ...i ? { received: i } : {}
1375
+ }), n;
1376
+ };
1377
+ }), Yi = /* @__PURE__ */ l("$ZodNumberFormat", (e, t) => {
1378
+ oi.init(e, t), Jn.init(e, t);
1379
+ }), Xi = /* @__PURE__ */ l("$ZodBoolean", (e, t) => {
1380
+ w.init(e, t), e._zod.pattern = Qo, e._zod.parse = (n, r) => {
1381
+ if (t.coerce)
1382
+ try {
1383
+ n.value = !!n.value;
1384
+ } catch {
1385
+ }
1386
+ const o = n.value;
1387
+ return typeof o == "boolean" || n.issues.push({
1388
+ expected: "boolean",
1389
+ code: "invalid_type",
1390
+ input: o,
1391
+ inst: e
1392
+ }), n;
1393
+ };
1394
+ }), Hi = /* @__PURE__ */ l("$ZodNull", (e, t) => {
1395
+ w.init(e, t), e._zod.pattern = ei, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, r) => {
1396
+ const o = n.value;
1397
+ return o === null || n.issues.push({
1398
+ expected: "null",
1399
+ code: "invalid_type",
1400
+ input: o,
1401
+ inst: e
1402
+ }), n;
1403
+ };
1404
+ }), Qi = /* @__PURE__ */ l("$ZodAny", (e, t) => {
1405
+ w.init(e, t), e._zod.parse = (n) => n;
1406
+ }), es = /* @__PURE__ */ l("$ZodUnknown", (e, t) => {
1407
+ w.init(e, t), e._zod.parse = (n) => n;
1408
+ }), ts = /* @__PURE__ */ l("$ZodNever", (e, t) => {
1409
+ w.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1410
+ expected: "never",
1411
+ code: "invalid_type",
1412
+ input: n.value,
1413
+ inst: e
1414
+ }), n);
1415
+ });
1416
+ function Ut(e, t, n) {
1417
+ e.issues.length && t.issues.push(...W(n, e.issues)), t.value[n] = e.value;
1418
+ }
1419
+ const ns = /* @__PURE__ */ l("$ZodArray", (e, t) => {
1420
+ w.init(e, t);
1421
+ const n = R.memoizer;
1422
+ n?.attach(e), e._zod.parse = (r, o) => {
1423
+ const i = r.value;
1424
+ if (!Array.isArray(i))
1425
+ return r.issues.push({
1426
+ expected: "array",
1427
+ code: "invalid_type",
1428
+ input: i,
1429
+ inst: e
1430
+ }), r;
1431
+ r.value = n ? n.alloc(e, r, Array(i.length), o) : Array(i.length);
1432
+ const s = [], u = o?.abortEarly;
1433
+ for (let c = 0; c < i.length; c++) {
1434
+ const a = i[c], f = t.element._zod.run({
1435
+ value: a,
1436
+ issues: []
1437
+ }, o);
1438
+ if (f instanceof Promise)
1439
+ s.push(f.then((d) => Ut(d, r, c)));
1440
+ else if (Ut(f, r, c), u && f.issues.length !== 0 && D(f))
1441
+ break;
1442
+ }
1443
+ return s.length ? Promise.all(s).then(() => r) : r;
1444
+ };
1445
+ });
1446
+ function Ie(e, t, n, r, o, i) {
1447
+ const s = n in r, u = i === "optional";
1448
+ if (!(!s && u && o === "optional")) {
1449
+ if (e.issues.length) {
1450
+ if (o !== void 0 && u && !s)
1451
+ return;
1452
+ t.issues.push(...W(n, e.issues));
1453
+ }
1454
+ if (!s && o === void 0) {
1455
+ e.issues.length || t.issues.push({
1456
+ code: "invalid_type",
1457
+ expected: "nonoptional",
1458
+ input: void 0,
1459
+ path: [n]
1460
+ });
1461
+ return;
1462
+ }
1463
+ e.value === void 0 ? (s || o === "defaulted" && !u) && (t.value[n] = void 0) : t.value[n] = e.value;
1464
+ }
1465
+ }
1466
+ const rs = [];
1467
+ function Kn(e) {
1468
+ const t = Object.keys(e.shape), n = Object.getOwnPropertySymbols(e.shape), r = n.length ? n : rs, o = r.length ? [...t, ...r] : t;
1469
+ for (const s of o)
1470
+ if (!e.shape?.[s]?._zod?.traits?.has("$ZodType"))
1471
+ throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);
1472
+ const i = Mr(e.shape);
1473
+ return {
1474
+ ...e,
1475
+ allKeys: o,
1476
+ symbolKeys: r,
1477
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
1478
+ keySet: new Set(t),
1479
+ numKeys: t.length,
1480
+ optionalKeys: new Set(i)
1481
+ };
1482
+ }
1483
+ function Vn(e, t, n, r, o, i, s) {
1484
+ const u = [], c = o.keySet, a = o.catchall._zod, f = a.def.type, d = a.optin, h = a.optout;
1485
+ let p = 0;
1486
+ for (const m in t) {
1487
+ if (s && n.issues.length !== p) {
1488
+ if (D(n, p))
1489
+ break;
1490
+ p = n.issues.length;
1491
+ }
1492
+ if (c.has(m))
1493
+ continue;
1494
+ if (m === "__proto__") {
1495
+ f === "never" && u.push(m);
1496
+ continue;
1497
+ }
1498
+ if (f === "never") {
1499
+ u.push(m);
1500
+ continue;
1501
+ }
1502
+ const _ = a.run({ value: t[m], issues: [] }, r);
1503
+ _ instanceof Promise ? e.push(_.then((v) => Ie(v, n, m, t, d, h))) : Ie(_, n, m, t, d, h);
1504
+ }
1505
+ return u.length && n.issues.push({
1506
+ code: "unrecognized_keys",
1507
+ keys: u,
1508
+ input: t,
1509
+ inst: i,
1510
+ // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
1511
+ continue: !0
1512
+ }), e.length ? Promise.all(e).then(() => n) : n;
1513
+ }
1514
+ const os = /* @__PURE__ */ l("$ZodObject", (e, t) => {
1515
+ w.init(e, t);
1516
+ const n = Object.getOwnPropertyDescriptor(t, "shape"), r = n?.get ? n.get.raw : t.shape ?? {};
1517
+ if (r) {
1518
+ const a = () => {
1519
+ const f = { ...r };
1520
+ return Object.defineProperty(t, "shape", { value: f }), a.raw = f, f;
1521
+ };
1522
+ a.raw = r, Object.defineProperty(t, "shape", { get: a });
1523
+ }
1524
+ const o = Ne(() => Kn(t));
1525
+ y(e, "propValues", (a) => {
1526
+ const f = a.def.shape, d = {};
1527
+ for (const h in f) {
1528
+ const p = f[h]._zod;
1529
+ if (p.values) {
1530
+ Object.prototype.hasOwnProperty.call(d, h) || K(d, h, /* @__PURE__ */ new Set());
1531
+ for (const m of p.values)
1532
+ d[h].add(m);
1533
+ p.optin !== void 0 && d[h].add(void 0);
1534
+ }
1535
+ }
1536
+ return d;
1537
+ });
1538
+ const i = _e, s = t.catchall;
1539
+ let u;
1540
+ const c = R.memoizer;
1541
+ c?.attach(e), e._zod.parse = (a, f) => {
1542
+ u ?? (u = o.value);
1543
+ const d = a.value;
1544
+ if (!i(d))
1545
+ return a.issues.push({
1546
+ expected: "object",
1547
+ code: "invalid_type",
1548
+ input: d,
1549
+ inst: e
1550
+ }), a;
1551
+ a.value = c ? c.alloc(e, a, {}, f) : {};
1552
+ const h = [], p = u.shape, m = f?.abortEarly;
1553
+ let _ = a.issues.length;
1554
+ for (const v of u.allKeys) {
1555
+ if (m && a.issues.length !== _) {
1556
+ if (D(a, _))
1557
+ break;
1558
+ _ = a.issues.length;
1559
+ }
1560
+ if (v === "__proto__")
1561
+ continue;
1562
+ const b = p[v], I = b._zod.optin, ce = b._zod.optout, ae = b._zod.run({ value: d[v], issues: [] }, f);
1563
+ ae instanceof Promise ? h.push(ae.then((P) => Ie(P, a, v, d, I, ce))) : Ie(ae, a, v, d, I, ce);
1564
+ }
1565
+ return s ? Vn(h, d, a, f, o.value, e, m === !0) : h.length ? Promise.all(h).then(() => a) : a;
1566
+ };
1567
+ }), is = /* @__PURE__ */ l("$ZodObjectJIT", (e, t) => {
1568
+ os.init(e, t);
1569
+ const n = e._zod.parse, r = Ne(() => Kn(t)), o = R.memoizer, i = (p) => {
1570
+ const m = r.value, _ = m.symbolKeys, v = new mi(["payload", "ctx"], { shape: p, inst: e, memo: o, syms: _ }), b = (P) => `shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`, I = (P, k) => `
1571
+ let ${P}_ab = false;
1572
+ for (let i = 0; i < ${P}.issues.length; i++) {
1573
+ const iss = ${P}.issues[i];
1574
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
1575
+ payload.issues.push(iss);
1576
+ if (iss.continue !== true) ${P}_ab = true;
1577
+ }
1578
+ if (${P}_ab && ctx && ctx.abortEarly) {
1579
+ payload.value = newResult;
1580
+ return payload;
1581
+ }`;
1582
+ v.write("const input = payload.value;");
1583
+ const ce = /* @__PURE__ */ Object.create(null);
1584
+ let ae = 0;
1585
+ for (const P of m.allKeys)
1586
+ ce[P] = `key_${ae++}`;
1587
+ v.write(o ? "const newResult = memo.alloc(inst, payload, {}, ctx);" : "const newResult = {};");
1588
+ for (const P of m.allKeys) {
1589
+ if (P === "__proto__")
1590
+ continue;
1591
+ const k = ce[P], U = typeof P == "symbol" ? `syms[${_.indexOf(P)}]` : Cr(P), Fe = `${U} in input`, zt = p[P], Me = zt?._zod?.optin, kt = Me !== void 0, br = zt?._zod?.optout === "optional";
1592
+ if (v.write(`const ${k} = ${b(U)};`), kt && br) {
1593
+ const wr = Me === "optional" ? `${k}_present` : `${k}.value !== undefined || ${k}_present`;
1594
+ v.write(`
1595
+ const ${k}_present = ${Fe};
1596
+ if (!${k}.issues.length || ${k}_present) {
1597
+ if (${k}.issues.length) {${I(k, U)}
1598
+ }
1599
+
1600
+ if (${wr}) {
1601
+ newResult[${U}] = ${k}.value;
1602
+ }
1603
+ }
1604
+
1605
+ `);
1606
+ } else kt ? (v.write(`
1607
+ if (${k}.issues.length) {${I(k, U)}
1608
+ }
1609
+ `), Me === "defaulted" ? v.write(`newResult[${U}] = ${k}.value;`) : v.write(`
1610
+ if (${k}.value !== undefined || ${Fe}) {
1611
+ newResult[${U}] = ${k}.value;
1612
+ }
1613
+ `)) : v.write(`
1614
+ const ${k}_present = ${Fe};
1615
+ if (${k}.issues.length) {${I(k, U)}
1616
+ }
1617
+ if (!${k}_present && !${k}.issues.length) {
1618
+ payload.issues.push({
1619
+ code: "invalid_type",
1620
+ expected: "nonoptional",
1621
+ input: undefined,
1622
+ path: [${U}]
1623
+ });
1624
+ if (ctx && ctx.abortEarly) {
1625
+ payload.value = newResult;
1626
+ return payload;
1627
+ }
1628
+ }
1629
+
1630
+ if (${k}_present) {
1631
+ newResult[${U}] = ${k}.value;
1632
+ }
1633
+
1634
+ `);
1635
+ }
1636
+ return v.write("payload.value = newResult;"), v.write("return payload;"), v.compile();
1637
+ };
1638
+ let s;
1639
+ const u = _e, c = !R.jitless, f = c && Ur.value, d = t.catchall;
1640
+ let h;
1641
+ e._zod.parse = (p, m) => {
1642
+ h ?? (h = r.value);
1643
+ const _ = p.value;
1644
+ return u(_) ? c && f && m?.async === !1 && m.jitless !== !0 ? (s || (s = i(t.shape)), p = s(p, m), d ? Vn([], _, p, m, h, e, m?.abortEarly === !0) : p) : n(p, m) : (p.issues.push({
1645
+ expected: "object",
1646
+ code: "invalid_type",
1647
+ input: _,
1648
+ inst: e
1649
+ }), p);
1650
+ };
1651
+ });
1652
+ function Ft(e, t, n, r) {
1653
+ for (const i of e)
1654
+ if (i.issues.length === 0)
1655
+ return t.value = i.value, t;
1656
+ const o = e.filter((i) => !D(i));
1657
+ return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
1658
+ code: "invalid_union",
1659
+ input: t.value,
1660
+ inst: n,
1661
+ errors: e.map((i) => i.issues.map((s) => G(s, r, F())))
1662
+ }), t);
1663
+ }
1664
+ const Bn = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
1665
+ w.init(e, t), y(e, "optin", (r) => r.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : r.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0), y(e, "optout", (r) => r.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), y(e, "values", (r) => {
1666
+ if (r.def.options.every((o) => o._zod.values))
1667
+ return new Set(r.def.options.flatMap((o) => Array.from(o._zod.values)));
1668
+ }), y(e, "pattern", (r) => {
1669
+ if (r.def.options.every((o) => o._zod.pattern)) {
1670
+ const o = r.def.options.map((i) => i._zod.pattern);
1671
+ return new RegExp(`^(${o.map((i) => ct(i.source)).join("|")})$`);
1672
+ }
1673
+ });
1674
+ const n = t.options.length === 1 ? t.options[0]._zod.run : null;
1675
+ e._zod.parse = (r, o) => {
1676
+ if (n)
1677
+ return n(r, o);
1678
+ let i = !1;
1679
+ const s = [];
1680
+ for (const u of t.options) {
1681
+ const c = u._zod.run({
1682
+ value: r.value,
1683
+ issues: []
1684
+ }, o);
1685
+ if (c instanceof Promise)
1686
+ s.push(c), i = !0;
1687
+ else {
1688
+ if (c.issues.length === 0)
1689
+ return c;
1690
+ s.push(c);
1691
+ }
1692
+ }
1693
+ return i ? Promise.all(s).then((u) => Ft(u, r, e, o)) : Ft(s, r, e, o);
1694
+ };
1695
+ });
1696
+ function ss(e) {
1697
+ const t = /* @__PURE__ */ new Map();
1698
+ for (const n of e.options) {
1699
+ const r = n._zod.propValues?.[e.discriminator];
1700
+ if (!r || r.size === 0)
1701
+ throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);
1702
+ for (const o of r)
1703
+ if (t.has(o)) {
1704
+ if (o !== void 0)
1705
+ throw new Error(`Duplicate discriminator value "${String(o)}"`);
1706
+ t.set(o, null);
1707
+ } else
1708
+ t.set(o, n);
1709
+ }
1710
+ return t;
1711
+ }
1712
+ const us = /* @__PURE__ */ l("$ZodDiscriminatedUnion", (e, t) => {
1713
+ t.inclusive = !1, Bn.init(e, t);
1714
+ const n = e._zod.parse;
1715
+ y(e, "propValues", (o) => {
1716
+ const i = {};
1717
+ let s = 0;
1718
+ for (const u of o.def.options) {
1719
+ const c = u._zod.propValues;
1720
+ if (!c || Object.keys(c).length === 0)
1721
+ throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(u)}"`);
1722
+ c[o.def.discriminator]?.has(void 0) && s++;
1723
+ for (const [a, f] of Object.entries(c)) {
1724
+ Object.prototype.hasOwnProperty.call(i, a) || K(i, a, /* @__PURE__ */ new Set());
1725
+ for (const d of f)
1726
+ i[a].add(d);
1727
+ }
1728
+ }
1729
+ return !o.def.unionFallback && s > 1 && i[o.def.discriminator]?.delete(void 0), i;
1730
+ }), t.options.forEach((o, i) => {
1731
+ const s = at(o._zod.def);
1732
+ if (s && !Object.prototype.hasOwnProperty.call(s, t.discriminator))
1733
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
1734
+ });
1735
+ const r = Ne(() => ss(t));
1736
+ e._zod.parse = (o, i) => {
1737
+ const s = o.value;
1738
+ if (!_e(s))
1739
+ return o.issues.push({
1740
+ code: "invalid_type",
1741
+ expected: "object",
1742
+ input: s,
1743
+ inst: e
1744
+ }), o;
1745
+ const u = s?.[t.discriminator], c = r.value.get(u);
1746
+ return c && (u !== void 0 || i.direction !== "backward") ? c._zod.run(o, i) : t.unionFallback || i.direction === "backward" ? n(o, i) : (o.issues.push({
1747
+ code: "invalid_union",
1748
+ errors: [],
1749
+ note: "No matching discriminator",
1750
+ discriminator: t.discriminator,
1751
+ options: Array.from(r.value.keys()).filter((a) => r.value.get(a) !== null),
1752
+ input: s,
1753
+ path: [t.discriminator],
1754
+ inst: e
1755
+ }), o);
1756
+ };
1757
+ }), cs = /* @__PURE__ */ l("$ZodIntersection", (e, t) => {
1758
+ w.init(e, t), e._zod.parse = (n, r) => {
1759
+ const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
1760
+ return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([c, a]) => Mt(n, c, a)) : Mt(n, i, s);
1761
+ };
1762
+ });
1763
+ function et(e, t) {
1764
+ if (e === t)
1765
+ return { valid: !0, data: e };
1766
+ if (e instanceof Date && t instanceof Date && +e == +t)
1767
+ return { valid: !0, data: e };
1768
+ if (re(e) && re(t)) {
1769
+ const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
1770
+ Object.prototype.hasOwnProperty.call(o, "__proto__") && delete o.__proto__;
1771
+ for (const i of r) {
1772
+ if (i === "__proto__")
1773
+ continue;
1774
+ const s = et(e[i], t[i]);
1775
+ if (!s.valid)
1776
+ return {
1777
+ valid: !1,
1778
+ mergeErrorPath: [i, ...s.mergeErrorPath]
1779
+ };
1780
+ o[i] = s.data;
1781
+ }
1782
+ return { valid: !0, data: o };
1783
+ }
1784
+ if (Array.isArray(e) && Array.isArray(t)) {
1785
+ if (e.length !== t.length)
1786
+ return { valid: !1, mergeErrorPath: [] };
1787
+ const n = [];
1788
+ for (let r = 0; r < e.length; r++) {
1789
+ const o = e[r], i = t[r], s = et(o, i);
1790
+ if (!s.valid)
1791
+ return {
1792
+ valid: !1,
1793
+ mergeErrorPath: [r, ...s.mergeErrorPath]
1794
+ };
1795
+ n.push(s.data);
1796
+ }
1797
+ return { valid: !0, data: n };
1798
+ }
1799
+ return { valid: !1, mergeErrorPath: [] };
1800
+ }
1801
+ function Mt(e, t, n) {
1802
+ const r = /* @__PURE__ */ new Map();
1803
+ let o;
1804
+ const i = /* @__PURE__ */ new Map(), s = (a, f) => {
1805
+ let d;
1806
+ if (a.code === "unrecognized_keys" && !a.path?.length)
1807
+ o ?? (o = a), d = a.keys;
1808
+ else if (a.code === "invalid_key" && a.origin === "record" && a.path?.length === 1) {
1809
+ const h = String(a.path[0]);
1810
+ i.has(h) || i.set(h, a), d = [h];
1811
+ } else
1812
+ return !1;
1813
+ for (const h of d)
1814
+ r.has(h) || r.set(h, {}), r.get(h)[f] = !0;
1815
+ return !0;
1816
+ };
1817
+ for (const a of t.issues)
1818
+ s(a, "l") || e.issues.push(a);
1819
+ for (const a of n.issues)
1820
+ s(a, "r") || e.issues.push(a);
1821
+ const u = [...r].filter(([, a]) => a.l && a.r).map(([a]) => a);
1822
+ if (u.length) {
1823
+ const a = o ? u.filter((f) => o.keys.includes(f)) : [];
1824
+ a.length && e.issues.push({ ...o, keys: a });
1825
+ for (const f of u)
1826
+ !a.includes(f) && i.has(f) && e.issues.push(i.get(f));
1827
+ }
1828
+ const c = et(t.value, n.value);
1829
+ if (!c.valid) {
1830
+ if (D(e))
1831
+ return e;
1832
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
1833
+ }
1834
+ return e.value = c.data, e;
1835
+ }
1836
+ const as = /* @__PURE__ */ l("$ZodTuple", (e, t) => {
1837
+ w.init(e, t);
1838
+ const n = t.items, r = R.memoizer;
1839
+ r?.attach(e), e._zod.parse = (o, i) => {
1840
+ const s = o.value;
1841
+ if (!Array.isArray(s))
1842
+ return o.issues.push({
1843
+ input: s,
1844
+ inst: e,
1845
+ expected: "tuple",
1846
+ code: "invalid_type"
1847
+ }), o;
1848
+ o.value = r ? r.alloc(e, o, [], i) : [];
1849
+ const u = [], c = xt(n, "optin"), a = xt(n, "optout");
1850
+ if (!t.rest) {
1851
+ if (s.length < c)
1852
+ return o.issues.push({
1853
+ code: "too_small",
1854
+ minimum: c,
1855
+ inclusive: !0,
1856
+ input: s,
1857
+ inst: e,
1858
+ origin: "array"
1859
+ }), o;
1860
+ s.length > n.length && o.issues.push({
1861
+ code: "too_big",
1862
+ maximum: n.length,
1863
+ inclusive: !0,
1864
+ input: s,
1865
+ inst: e,
1866
+ origin: "array"
1867
+ });
1868
+ }
1869
+ const f = new Array(n.length), d = t.rest ? i?.abortEarly : void 0;
1870
+ let h = !1;
1871
+ for (let p = 0; p < n.length; p++) {
1872
+ const m = n[p]._zod.run({ value: s[p], issues: [] }, i);
1873
+ m instanceof Promise ? u.push(m.then((_) => {
1874
+ f[p] = _;
1875
+ })) : (f[p] = m, d && !h && m.issues.length && (h = D(m)));
1876
+ }
1877
+ if (t.rest && !h) {
1878
+ let p = n.length - 1;
1879
+ const m = s.slice(n.length);
1880
+ let _ = o.issues.length;
1881
+ for (const v of m) {
1882
+ if (d && o.issues.length !== _) {
1883
+ if (D(o, _))
1884
+ break;
1885
+ _ = o.issues.length;
1886
+ }
1887
+ p++;
1888
+ const b = t.rest._zod.run({ value: v, issues: [] }, i);
1889
+ b instanceof Promise ? u.push(b.then((I) => Lt(I, o, p))) : Lt(b, o, p);
1890
+ }
1891
+ }
1892
+ return u.length ? Promise.all(u).then(() => Jt(f, o, n, s, a)) : Jt(f, o, n, s, a);
1893
+ };
1894
+ });
1895
+ function xt(e, t) {
1896
+ for (let n = e.length - 1; n >= 0; n--)
1897
+ if (!(t === "optin" ? e[n]._zod.optin !== void 0 : e[n]._zod.optout === "optional"))
1898
+ return n + 1;
1899
+ return 0;
1900
+ }
1901
+ function Lt(e, t, n) {
1902
+ e.issues.length && t.issues.push(...W(n, e.issues)), t.value[n] = e.value;
1903
+ }
1904
+ function Jt(e, t, n, r, o) {
1905
+ for (let i = 0; i < n.length; i++) {
1906
+ const s = e[i], u = i < r.length;
1907
+ if (!u && i >= o && n[i]._zod.optin === "optional") {
1908
+ t.value.length = i;
1909
+ break;
1910
+ }
1911
+ if (s.issues.length) {
1912
+ if (!u && i >= o) {
1913
+ t.value.length = i;
1914
+ break;
1915
+ }
1916
+ t.issues.push(...W(i, s.issues));
1917
+ }
1918
+ t.value[i] = s.value;
1919
+ }
1920
+ for (let i = t.value.length - 1; i >= r.length && (n[i]._zod.optout === "optional" && t.value[i] === void 0); i--)
1921
+ t.value.length = i;
1922
+ return t;
1923
+ }
1924
+ const fs = /* @__PURE__ */ l("$ZodRecord", (e, t) => {
1925
+ w.init(e, t);
1926
+ const n = R.memoizer;
1927
+ n?.attach(e), e._zod.parse = (r, o) => {
1928
+ const i = r.value;
1929
+ if (!re(i))
1930
+ return r.issues.push({
1931
+ expected: "record",
1932
+ code: "invalid_type",
1933
+ input: i,
1934
+ inst: e
1935
+ }), r;
1936
+ const s = [], u = t.keyType._zod.values;
1937
+ if (u && !t.partial) {
1938
+ r.value = n ? n.alloc(e, r, {}, o) : {};
1939
+ const c = /* @__PURE__ */ new Set();
1940
+ for (const f of u)
1941
+ if (typeof f == "string" || typeof f == "number" || typeof f == "symbol") {
1942
+ if (c.add(typeof f == "number" ? f.toString() : f), f === "__proto__")
1943
+ continue;
1944
+ const d = t.keyType._zod.run({ value: f, issues: [] }, o);
1945
+ if (d instanceof Promise)
1946
+ throw new Error("Async schemas not supported in object keys currently");
1947
+ if (d.issues.length) {
1948
+ r.issues.push({
1949
+ code: "invalid_key",
1950
+ origin: "record",
1951
+ issues: d.issues.map((m) => G(m, o, F())),
1952
+ input: f,
1953
+ path: [f],
1954
+ inst: e
1955
+ });
1956
+ continue;
1957
+ }
1958
+ const h = d.value;
1959
+ if (h === "__proto__")
1960
+ continue;
1961
+ const p = t.valueType._zod.run({ value: i[f], issues: [] }, o);
1962
+ p instanceof Promise ? s.push(p.then((m) => {
1963
+ m.issues.length && r.issues.push(...W(f, m.issues)), r.value[h] = m.value;
1964
+ })) : (p.issues.length && r.issues.push(...W(f, p.issues)), r.value[h] = p.value);
1965
+ }
1966
+ let a;
1967
+ for (const f in i)
1968
+ if (!c.has(f))
1969
+ if (t.mode === "loose") {
1970
+ if (f === "__proto__")
1971
+ continue;
1972
+ r.value[f] = i[f];
1973
+ } else
1974
+ a = a ?? [], a.push(f);
1975
+ a && a.length > 0 && r.issues.push({
1976
+ code: "unrecognized_keys",
1977
+ input: i,
1978
+ inst: e,
1979
+ keys: a,
1980
+ continue: !0
1981
+ });
1982
+ } else {
1983
+ r.value = n ? n.alloc(e, r, {}, o) : {};
1984
+ let c;
1985
+ for (const a of Reflect.ownKeys(i)) {
1986
+ if (a === "__proto__" || !Object.prototype.propertyIsEnumerable.call(i, a))
1987
+ continue;
1988
+ let f = t.keyType._zod.run({ value: a, issues: [] }, o);
1989
+ if (f instanceof Promise)
1990
+ throw new Error("Async schemas not supported in object keys currently");
1991
+ if (typeof a == "string" && ht.test(a) && f.issues.length) {
1992
+ const m = t.keyType._zod.run({ value: Number(a), issues: [] }, o);
1993
+ if (m instanceof Promise)
1994
+ throw new Error("Async schemas not supported in object keys currently");
1995
+ m.issues.length === 0 && (f = m);
1996
+ }
1997
+ if (f.issues.length) {
1998
+ t.mode === "loose" ? r.value[a] = i[a] : u ? (c = c ?? [], c.push(a)) : r.issues.push({
1999
+ code: "invalid_key",
2000
+ origin: "record",
2001
+ issues: f.issues.map((m) => G(m, o, F())),
2002
+ input: a,
2003
+ path: [a],
2004
+ inst: e
2005
+ });
2006
+ continue;
2007
+ }
2008
+ const h = f.value;
2009
+ if (h === "__proto__")
2010
+ continue;
2011
+ const p = t.valueType._zod.run({ value: i[a], issues: [] }, o);
2012
+ p instanceof Promise ? s.push(p.then((m) => {
2013
+ m.issues.length && r.issues.push(...W(a, m.issues)), r.value[h] = m.value;
2014
+ })) : (p.issues.length && r.issues.push(...W(a, p.issues)), r.value[h] = p.value);
2015
+ }
2016
+ c && c.length > 0 && r.issues.push({
2017
+ code: "unrecognized_keys",
2018
+ input: i,
2019
+ inst: e,
2020
+ keys: c,
2021
+ continue: !0
2022
+ });
2023
+ }
2024
+ return s.length ? Promise.all(s).then(() => r) : r;
2025
+ };
2026
+ }), ls = /* @__PURE__ */ l("$ZodEnum", (e, t) => {
2027
+ w.init(e, t);
2028
+ const n = Xe(t.entries), r = new Set(n);
2029
+ e._zod.values = r, y(e, "pattern", (o) => {
2030
+ const i = Xe(o.def.entries).filter((s) => Fr.has(typeof s));
2031
+ return new RegExp(i.length ? `^(${i.map((s) => oe(s.toString())).join("|")})$` : "^[^\\s\\S]$");
2032
+ }), e._zod.parse = (o, i) => {
2033
+ const s = o.value;
2034
+ return r.has(s) || o.issues.push({
2035
+ code: "invalid_value",
2036
+ values: n,
2037
+ input: s,
2038
+ inst: e
2039
+ }), o;
2040
+ };
2041
+ }), ds = /* @__PURE__ */ l("$ZodLiteral", (e, t) => {
2042
+ w.init(e, t);
2043
+ const n = new Set(t.values);
2044
+ e._zod.values = n, y(e, "pattern", (r) => {
2045
+ const o = r.def.values;
2046
+ return new RegExp(o.length ? `^(${o.map((i) => typeof i == "string" ? oe(i) : i ? oe(i.toString()) : String(i)).join("|")})$` : "^[^\\s\\S]$");
2047
+ }), e._zod.parse = (r, o) => {
2048
+ const i = r.value;
2049
+ return n.has(i) || r.issues.push({
2050
+ code: "invalid_value",
2051
+ values: t.values,
2052
+ input: i,
2053
+ inst: e
2054
+ }), r;
2055
+ };
2056
+ }), ps = /* @__PURE__ */ l("$ZodTransform", (e, t) => {
2057
+ w.init(e, t), e._zod.optin = "optional", R.memoizer?.guard(e), e._zod.parse = (n, r) => {
2058
+ if (r.direction === "backward")
2059
+ throw new Pn(e.constructor.name);
2060
+ const o = t.transform(n.value, n);
2061
+ if (r.async)
2062
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
2063
+ if (o instanceof Promise)
2064
+ throw new H();
2065
+ return n.value = o, n;
2066
+ };
2067
+ });
2068
+ function Kt(e, t) {
2069
+ return e.value = t.issues.length ? void 0 : t.value, e;
2070
+ }
2071
+ const Wn = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
2072
+ w.init(e, t), y(e, "optin", (n) => n.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), e._zod.optout = "optional", y(e, "values", (n) => {
2073
+ const r = n.def.innerType._zod.values;
2074
+ return r ? /* @__PURE__ */ new Set([...r, void 0]) : void 0;
2075
+ }), y(e, "pattern", (n) => {
2076
+ const r = n.def.innerType._zod.pattern;
2077
+ return r ? new RegExp(`^(${ct(r.source)})?$`) : void 0;
2078
+ }), e._zod.parse = (n, r) => {
2079
+ if (n.value === void 0) {
2080
+ if (t.innerType._zod.optin !== "defaulted")
2081
+ return n;
2082
+ const o = t.innerType._zod.run({ value: n.value, issues: [] }, r);
2083
+ return o instanceof Promise ? o.then((i) => Kt(n, i)) : Kt(n, o);
2084
+ }
2085
+ return t.innerType._zod.run(n, r);
2086
+ };
2087
+ }), hs = /* @__PURE__ */ l("$ZodExactOptional", (e, t) => {
2088
+ Wn.init(e, t), y(e, "values", (n) => n.def.innerType._zod.values), y(e, "pattern", (n) => n.def.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
2089
+ }), ms = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
2090
+ w.init(e, t), y(e, "optin", (n) => n.def.innerType._zod.optin), y(e, "optout", (n) => n.def.innerType._zod.optout), y(e, "pattern", (n) => {
2091
+ const r = n.def.innerType._zod.pattern;
2092
+ return r ? new RegExp(`^(${ct(r.source)}|null)$`) : void 0;
2093
+ }), y(e, "values", (n) => n.def.innerType._zod.values ? /* @__PURE__ */ new Set([...n.def.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
2094
+ }), gs = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
2095
+ w.init(e, t), e._zod.optin = "defaulted", y(e, "values", (n) => n.def.innerType._zod.values), e._zod.parse = (n, r) => {
2096
+ if (r.direction === "backward")
2097
+ return t.innerType._zod.run(n, r);
2098
+ if (n.value === void 0)
2099
+ return n.value = t.defaultValue, n;
2100
+ const o = t.innerType._zod.run(n, r);
2101
+ return o instanceof Promise ? o.then((i) => Vt(i, t)) : Vt(o, t);
2102
+ };
2103
+ });
2104
+ function Vt(e, t) {
2105
+ return e.value === void 0 && (e.value = t.defaultValue), e;
2106
+ }
2107
+ const _s = /* @__PURE__ */ l("$ZodPrefault", (e, t) => {
2108
+ w.init(e, t), e._zod.optin = "defaulted", y(e, "values", (n) => n.def.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
2109
+ }), vs = /* @__PURE__ */ l("$ZodNonOptional", (e, t) => {
2110
+ w.init(e, t), y(e, "values", (n) => {
2111
+ const r = n.def.innerType._zod.values;
2112
+ return r ? new Set([...r].filter((o) => o !== void 0)) : void 0;
2113
+ }), e._zod.parse = (n, r) => {
2114
+ const o = t.innerType._zod.run(n, r);
2115
+ return o instanceof Promise ? o.then((i) => Bt(i, e)) : Bt(o, e);
2116
+ };
2117
+ });
2118
+ function Bt(e, t) {
2119
+ return !e.issues.length && e.value === void 0 && e.issues.push({
2120
+ code: "invalid_type",
2121
+ expected: "nonoptional",
2122
+ input: e.value,
2123
+ inst: t
2124
+ }), e;
2125
+ }
2126
+ function Wt(e, t, n, r) {
2127
+ return t.issues.length ? (e.value = n.catchValue({
2128
+ ...t,
2129
+ value: e.value,
2130
+ error: {
2131
+ issues: t.issues.map((o) => G(o, r, F()))
2132
+ },
2133
+ input: e.value
2134
+ }), e) : (e.value = t.value, t.memo && (e.memo = !0), e);
2135
+ }
2136
+ const ys = /* @__PURE__ */ l("$ZodCatch", (e, t) => {
2137
+ w.init(e, t), y(e, "optin", (n) => n.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), y(e, "optout", (n) => n.def.innerType._zod.optout), y(e, "values", (n) => n.def.innerType._zod.values), e._zod.parse = (n, r) => {
2138
+ if (r.direction === "backward")
2139
+ return t.innerType._zod.run(n, r);
2140
+ const o = t.innerType._zod.run({ value: n.value, issues: [] }, r);
2141
+ return o instanceof Promise ? o.then((i) => Wt(n, i, t, r)) : Wt(n, o, t, r);
2142
+ };
2143
+ }), bs = /* @__PURE__ */ l("$ZodPipe", (e, t) => {
2144
+ w.init(e, t), y(e, "values", (n) => n.def.in._zod.values), y(e, "optin", (n) => n.def.in._zod.optin), y(e, "optout", (n) => n.def.out._zod.optout), y(e, "propValues", (n) => n.def.in._zod.propValues), e._zod.parse = (n, r) => {
2145
+ if (r.direction === "backward") {
2146
+ const i = t.out._zod.run(n, r);
2147
+ return i instanceof Promise ? i.then((s) => we(s, t.in, r)) : we(i, t.in, r);
2148
+ }
2149
+ const o = t.in._zod.run(n, r);
2150
+ return o instanceof Promise ? o.then((i) => we(i, t.out, r)) : we(o, t.out, r);
2151
+ };
2152
+ });
2153
+ function we(e, t, n) {
2154
+ return e.issues.some((r) => r.code !== "unrecognized_keys") ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
2155
+ }
2156
+ const ws = /* @__PURE__ */ l("$ZodReadonly", (e, t) => {
2157
+ w.init(e, t), y(e, "propValues", (n) => n.def.innerType._zod.propValues), y(e, "values", (n) => n.def.innerType._zod.values), y(e, "optin", (n) => n.def.innerType?._zod?.optin), y(e, "optout", (n) => n.def.innerType?._zod?.optout), e._zod.parse = (n, r) => {
2158
+ if (r.direction === "backward")
2159
+ return t.innerType._zod.run(n, r);
2160
+ const o = t.innerType._zod.run(n, r);
2161
+ return o instanceof Promise ? o.then(Gt) : Gt(o);
2162
+ };
2163
+ });
2164
+ function Gt(e) {
2165
+ return e.memo || (e.value = Object.freeze(e.value)), e;
2166
+ }
2167
+ const zs = /* @__PURE__ */ l("$ZodLazy", (e, t) => {
2168
+ w.init(e, t), jr(e._zod, "innerType", () => {
2169
+ const n = t;
2170
+ return n._cachedInner || (n._cachedInner = t.getter()), n._cachedInner;
2171
+ }), y(e, "pattern", (n) => n.innerType?._zod?.pattern), y(e, "propValues", (n) => n.innerType?._zod?.propValues), y(e, "optin", (n) => n.innerType?._zod?.optin ?? void 0), y(e, "optout", (n) => n.innerType?._zod?.optout ?? void 0), e._zod.parse = (n, r) => e._zod.innerType._zod.run(n, r);
2172
+ }), ks = /* @__PURE__ */ l("$ZodCustom", (e, t) => {
2173
+ A.init(e, t), w.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
2174
+ const r = n.value, o = t.fn(r);
2175
+ if (o instanceof Promise)
2176
+ return o.then((i) => qt(i, n, r, e));
2177
+ qt(o, n, r, e);
2178
+ };
2179
+ });
2180
+ function qt(e, t, n, r) {
2181
+ if (!e) {
2182
+ const o = {
2183
+ code: "custom",
2184
+ input: n,
2185
+ inst: r,
2186
+ // incorporates params.error into issue reporting
2187
+ path: [...r._zod.def.path ?? []],
2188
+ // incorporates params.error into issue reporting
2189
+ continue: !r._zod.def.abort
2190
+ // params: inst._zod.def.params,
2191
+ };
2192
+ r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(ve(o));
2193
+ }
2194
+ }
2195
+ class $s extends Error {
2196
+ constructor() {
2197
+ super("Cannot parse a reference cycle that closes through a transform"), this.name = "ZodCyclicError";
2198
+ }
2199
+ }
2200
+ const tt = "~memo", Yt = [];
2201
+ function Gn(e) {
2202
+ return e !== null && typeof e == "object";
2203
+ }
2204
+ function Be(e) {
2205
+ return e.map((t) => t.path ? { ...t, path: t.path.slice() } : { ...t });
2206
+ }
2207
+ const qn = /* @__PURE__ */ new WeakMap(), de = 0, Oe = 1, me = 2;
2208
+ function Se(e, t, n) {
2209
+ const r = qn.get(e);
2210
+ if (r !== void 0)
2211
+ return r ? me : de;
2212
+ if (t.has(e))
2213
+ return me;
2214
+ t.add(e);
2215
+ let o = de;
2216
+ const i = (f) => {
2217
+ if (o !== me && f?._zod) {
2218
+ const d = Se(f, t);
2219
+ d > o && (o = d);
2220
+ }
2221
+ }, s = (f, d) => {
2222
+ let h = de;
2223
+ for (const p of Reflect.ownKeys(f)) {
2224
+ const m = Object.getOwnPropertyDescriptor(f, p);
2225
+ if (!m.enumerable)
2226
+ continue;
2227
+ const _ = m.get ? Oe : m.value?._zod ? Se(m.value, t) : de;
2228
+ _ > h && (h = _);
2229
+ }
2230
+ return h;
2231
+ }, u = (f) => {
2232
+ f > o && (o = f);
2233
+ }, c = e._zod.def;
2234
+ switch (c.type) {
2235
+ case "object": {
2236
+ const f = at(c);
2237
+ u(f ? s(f) : Oe), i(c.catchall);
2238
+ break;
2239
+ }
2240
+ case "array":
2241
+ i(c.element);
2242
+ break;
2243
+ case "tuple":
2244
+ for (const f of c.items)
2245
+ i(f);
2246
+ i(c.rest);
2247
+ break;
2248
+ case "record":
2249
+ case "map":
2250
+ i(c.keyType), i(c.valueType);
2251
+ break;
2252
+ case "set":
2253
+ i(c.valueType);
2254
+ break;
2255
+ case "union":
2256
+ for (const f of c.options)
2257
+ i(f);
2258
+ break;
2259
+ case "intersection":
2260
+ i(c.left), i(c.right);
2261
+ break;
2262
+ case "optional":
2263
+ case "nullable":
2264
+ case "default":
2265
+ case "prefault":
2266
+ case "catch":
2267
+ case "readonly":
2268
+ case "nonoptional":
2269
+ case "promise":
2270
+ case "success":
2271
+ i(c.innerType);
2272
+ break;
2273
+ case "pipe":
2274
+ i(c.in), i(c.out);
2275
+ break;
2276
+ case "function":
2277
+ i(c.input), i(c.output);
2278
+ break;
2279
+ // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
2280
+ case "lazy": {
2281
+ const f = c._cachedInner ?? void 0;
2282
+ u(f ? Se(f, t) : Oe);
2283
+ break;
2284
+ }
2285
+ // a leaf by choice: `parts` are regex fragments, not data positions
2286
+ case "template_literal":
2287
+ // leaves
2288
+ case "string":
2289
+ case "number":
2290
+ case "int":
2291
+ case "boolean":
2292
+ case "bigint":
2293
+ case "symbol":
2294
+ case "undefined":
2295
+ case "null":
2296
+ case "void":
2297
+ case "never":
2298
+ case "any":
2299
+ case "unknown":
2300
+ case "date":
2301
+ case "nan":
2302
+ case "enum":
2303
+ case "literal":
2304
+ case "file":
2305
+ case "transform":
2306
+ case "custom":
2307
+ break;
2308
+ default:
2309
+ for (const f in c) {
2310
+ const d = Object.getOwnPropertyDescriptor(c, f);
2311
+ if (!d || d.get)
2312
+ continue;
2313
+ const h = d.value;
2314
+ if (!(!h || typeof h != "object")) {
2315
+ if (h._zod)
2316
+ i(h);
2317
+ else if (Array.isArray(h))
2318
+ for (const p of h)
2319
+ i(p);
2320
+ }
2321
+ }
2322
+ }
2323
+ return t.delete(e), Os(e, o);
2324
+ }
2325
+ function Os(e, t) {
2326
+ return t !== Oe && qn.set(e, t === me), t;
2327
+ }
2328
+ function Ss(e, t) {
2329
+ let n = e.buckets.get(t);
2330
+ return n || (n = /* @__PURE__ */ new WeakMap(), e.buckets.set(t, n)), n;
2331
+ }
2332
+ let ze;
2333
+ const ke = [], Zs = {
2334
+ alloc(e, t, n) {
2335
+ const r = ze;
2336
+ if (!r)
2337
+ return n;
2338
+ ze = void 0;
2339
+ const o = { value: n, issues: null };
2340
+ return r.set(t.value, o), ke.push(o), n;
2341
+ },
2342
+ guard(e) {
2343
+ var t;
2344
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
2345
+ const n = e._zod.parse, r = (o, i) => {
2346
+ if (i.direction !== "backward" && Es(i, o.value))
2347
+ throw new $s();
2348
+ return n(o, i);
2349
+ };
2350
+ e._zod.parse = r, e._zod.run === n && (e._zod.run = r);
2351
+ });
2352
+ },
2353
+ attach(e) {
2354
+ var t;
2355
+ let n, r = !1, o, i;
2356
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
2357
+ const s = e._zod.parse, u = (c, a) => {
2358
+ if (n === void 0) {
2359
+ const b = Se(e, /* @__PURE__ */ new Set());
2360
+ if (b === de)
2361
+ return e._zod.parse = s, e._zod.run === u && (e._zod.run = s), s(c, a);
2362
+ b === me || r ? n = !0 : r = !0;
2363
+ }
2364
+ const f = c.value;
2365
+ if (!Gn(f))
2366
+ return s(c, a);
2367
+ let d = a[tt];
2368
+ d || (d = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 }, a[tt] = d);
2369
+ let h;
2370
+ o === a ? h = i : (h = Ss(d, e), o = a, i = h);
2371
+ const p = h.get(f);
2372
+ if (p)
2373
+ return c.value = p.value, p.issues ? p.issues.length && c.issues.push(...Be(p.issues)) : (c.memo = !0, d.backEdges ?? (d.backEdges = /* @__PURE__ */ new WeakSet()), d.backEdges.add(p.value)), c;
2374
+ ze = h;
2375
+ const m = ke.length, _ = s(c, a);
2376
+ ze = void 0;
2377
+ const v = ke.length > m ? ke.pop() : void 0;
2378
+ return _ instanceof Promise ? _.then((b) => (v && (v.issues = b.issues.length ? Be(b.issues) : Yt), b)) : (v && (v.issues = _.issues.length ? Be(_.issues) : Yt), _);
2379
+ };
2380
+ e._zod.parse = u, e._zod.run === s && (e._zod.run = u);
2381
+ });
2382
+ }
2383
+ };
2384
+ function Ps() {
2385
+ return Zs;
2386
+ }
2387
+ function Es(e, t) {
2388
+ const n = e[tt]?.backEdges;
2389
+ return n !== void 0 && Gn(t) && n.has(t);
2390
+ }
2391
+ const Is = () => {
2392
+ const e = {
2393
+ string: { unit: "characters", verb: "to have" },
2394
+ file: { unit: "bytes", verb: "to have" },
2395
+ array: { unit: "items", verb: "to have" },
2396
+ set: { unit: "items", verb: "to have" },
2397
+ map: { unit: "entries", verb: "to have" }
2398
+ };
2399
+ function t(i) {
2400
+ return e[i] ?? null;
2401
+ }
2402
+ const n = {
2403
+ regex: "input",
2404
+ email: "email address",
2405
+ url: "URL",
2406
+ emoji: "emoji",
2407
+ uuid: "UUID",
2408
+ uuidv4: "UUIDv4",
2409
+ uuidv6: "UUIDv6",
2410
+ nanoid: "nanoid",
2411
+ guid: "GUID",
2412
+ cuid: "cuid",
2413
+ cuid2: "cuid2",
2414
+ ulid: "ULID",
2415
+ xid: "XID",
2416
+ ksuid: "KSUID",
2417
+ datetime: "ISO datetime",
2418
+ date: "ISO date",
2419
+ time: "ISO time",
2420
+ duration: "ISO duration",
2421
+ ipv4: "IPv4 address",
2422
+ ipv6: "IPv6 address",
2423
+ mac: "MAC address",
2424
+ cidrv4: "IPv4 range",
2425
+ cidrv6: "IPv6 range",
2426
+ base64: "base64-encoded string",
2427
+ base64url: "base64url-encoded string",
2428
+ json_string: "JSON string",
2429
+ e164: "E.164 number",
2430
+ currency_code: "currency code",
2431
+ credit_card: "credit card number",
2432
+ iban: "IBAN",
2433
+ jwt: "JWT",
2434
+ template_literal: "input"
2435
+ }, r = {
2436
+ // Compatibility: "nan" -> "NaN" for display
2437
+ nan: "NaN"
2438
+ // All other type names omitted - they fall back to raw values via ?? operator
2439
+ };
2440
+ function o(i, s) {
2441
+ return i === "number" && typeof s == "number" && !Number.isFinite(s) ? String(s) : r[i] ?? i;
2442
+ }
2443
+ return (i) => {
2444
+ switch (i.code) {
2445
+ case "invalid_type": {
2446
+ const s = o(i.expected), u = Yr(i.input), c = o(u, i.input);
2447
+ return `Invalid input: expected ${s}, received ${c}`;
2448
+ }
2449
+ case "invalid_value":
2450
+ return i.values.length === 1 ? `Invalid input: expected ${kn(i.values[0])}` : `Invalid option: expected one of ${Et(i.values, "|")}`;
2451
+ case "too_big": {
2452
+ const s = i.exact ? "exactly " : i.inclusive ? "<=" : "<", u = t(i.origin);
2453
+ return u ? `Too big: expected ${i.origin ?? "value"} to have ${s}${i.maximum.toString()} ${u.unit ?? "elements"}` : `Too big: expected ${i.origin ?? "value"} to be ${s}${i.maximum.toString()}`;
2454
+ }
2455
+ case "too_small": {
2456
+ const s = i.exact ? "exactly " : i.inclusive ? ">=" : ">", u = t(i.origin);
2457
+ return u ? `Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${u.unit}` : `Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`;
2458
+ }
2459
+ case "invalid_format": {
2460
+ const s = i;
2461
+ return s.format === "starts_with" ? `Invalid string: must start with "${s.prefix}"` : s.format === "ends_with" ? `Invalid string: must end with "${s.suffix}"` : s.format === "includes" ? `Invalid string: must include "${s.includes}"` : s.format === "regex" ? `Invalid string: must match pattern ${s.pattern}` : `Invalid ${n[s.format] ?? i.format}`;
2462
+ }
2463
+ case "not_multiple_of":
2464
+ return `Invalid number: must be a multiple of ${i.divisor}`;
2465
+ case "unrecognized_keys":
2466
+ return `Unrecognized key${i.keys.length > 1 ? "s" : ""}: ${Et(i.keys, ", ")}`;
2467
+ case "invalid_key":
2468
+ return `Invalid key in ${i.origin}`;
2469
+ case "invalid_union":
2470
+ return i.options && Array.isArray(i.options) && i.options.length > 0 ? `Invalid discriminator value. Expected ${i.options.map((u) => `'${u}'`).join(" | ")}` : i.inclusive === !1 ? "Invalid input: more than one option matched" : "Invalid input";
2471
+ case "invalid_element":
2472
+ return `Invalid value in ${i.origin}`;
2473
+ default:
2474
+ return "Invalid input";
2475
+ }
2476
+ };
2477
+ };
2478
+ function Ts() {
2479
+ return {
2480
+ localeError: Is()
2481
+ };
2482
+ }
2483
+ var Xt;
2484
+ class As {
2485
+ constructor() {
2486
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
2487
+ }
2488
+ add(t, ...n) {
2489
+ const r = n[0];
2490
+ return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
2491
+ }
2492
+ clear() {
2493
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
2494
+ }
2495
+ remove(t) {
2496
+ const n = this._map.get(t);
2497
+ return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
2498
+ }
2499
+ get(t) {
2500
+ const n = t._zod.parent;
2501
+ if (n) {
2502
+ const r = { ...this.get(n) ?? {} };
2503
+ delete r.id;
2504
+ const o = { ...r, ...this._map.get(t) };
2505
+ return Object.keys(o).length ? o : void 0;
2506
+ }
2507
+ return this._map.get(t);
2508
+ }
2509
+ has(t) {
2510
+ return this._map.has(t);
2511
+ }
2512
+ }
2513
+ function Ns() {
2514
+ return new As();
2515
+ }
2516
+ (Xt = globalThis).__zod_globalRegistry ?? (Xt.__zod_globalRegistry = Ns());
2517
+ const pe = globalThis.__zod_globalRegistry;
2518
+ function vt(e) {
2519
+ return e.checks && (e.checks = [...e.checks]), e;
2520
+ }
2521
+ // @__NO_SIDE_EFFECTS__
2522
+ function js(e, t) {
2523
+ return new e(vt({ type: "string", ...g(t) }));
2524
+ }
2525
+ // @__NO_SIDE_EFFECTS__
2526
+ function Pa(e, t) {
2527
+ return new e(vt({ type: "string", coerce: !0, ...g(t) }));
2528
+ }
2529
+ // @__NO_SIDE_EFFECTS__
2530
+ function Yn(e, t) {
2531
+ return new e({
2532
+ type: "string",
2533
+ format: "email",
2534
+ check: "string_format",
2535
+ abort: !1,
2536
+ ...g(t)
2537
+ });
2538
+ }
2539
+ // @__NO_SIDE_EFFECTS__
2540
+ function Rs(e, t) {
2541
+ return new e({
2542
+ type: "string",
2543
+ format: "guid",
2544
+ check: "string_format",
2545
+ abort: !1,
2546
+ ...g(t)
2547
+ });
2548
+ }
2549
+ // @__NO_SIDE_EFFECTS__
2550
+ function Xn(e, t) {
2551
+ return new e({
2552
+ type: "string",
2553
+ format: "uuid",
2554
+ check: "string_format",
2555
+ abort: !1,
2556
+ ...g(t)
2557
+ });
2558
+ }
2559
+ // @__NO_SIDE_EFFECTS__
2560
+ function Cs(e, t) {
2561
+ return new e({
2562
+ type: "string",
2563
+ format: "uuid",
2564
+ check: "string_format",
2565
+ abort: !1,
2566
+ version: "v4",
2567
+ ...g(t)
2568
+ });
2569
+ }
2570
+ // @__NO_SIDE_EFFECTS__
2571
+ function Ds(e, t) {
2572
+ return new e({
2573
+ type: "string",
2574
+ format: "uuid",
2575
+ check: "string_format",
2576
+ abort: !1,
2577
+ version: "v6",
2578
+ ...g(t)
2579
+ });
2580
+ }
2581
+ // @__NO_SIDE_EFFECTS__
2582
+ function Us(e, t) {
2583
+ return new e({
2584
+ type: "string",
2585
+ format: "uuid",
2586
+ check: "string_format",
2587
+ abort: !1,
2588
+ version: "v7",
2589
+ ...g(t)
2590
+ });
2591
+ }
2592
+ // @__NO_SIDE_EFFECTS__
2593
+ function Fs(e, t) {
2594
+ return new e({
2595
+ type: "string",
2596
+ format: "url",
2597
+ check: "string_format",
2598
+ abort: !1,
2599
+ ...g(t)
2600
+ });
2601
+ }
2602
+ // @__NO_SIDE_EFFECTS__
2603
+ function Ms(e, t) {
2604
+ return new e({
2605
+ type: "string",
2606
+ format: "emoji",
2607
+ check: "string_format",
2608
+ abort: !1,
2609
+ ...g(t)
2610
+ });
2611
+ }
2612
+ // @__NO_SIDE_EFFECTS__
2613
+ function xs(e, t) {
2614
+ return new e({
2615
+ type: "string",
2616
+ format: "nanoid",
2617
+ check: "string_format",
2618
+ abort: !1,
2619
+ ...g(t)
2620
+ });
2621
+ }
2622
+ // @__NO_SIDE_EFFECTS__
2623
+ function Ls(e, t) {
2624
+ return new e({
2625
+ type: "string",
2626
+ format: "cuid",
2627
+ check: "string_format",
2628
+ abort: !1,
2629
+ ...g(t)
2630
+ });
2631
+ }
2632
+ // @__NO_SIDE_EFFECTS__
2633
+ function Js(e, t) {
2634
+ return new e({
2635
+ type: "string",
2636
+ format: "cuid2",
2637
+ check: "string_format",
2638
+ abort: !1,
2639
+ ...g(t)
2640
+ });
2641
+ }
2642
+ // @__NO_SIDE_EFFECTS__
2643
+ function Ks(e, t) {
2644
+ return new e({
2645
+ type: "string",
2646
+ format: "ulid",
2647
+ check: "string_format",
2648
+ abort: !1,
2649
+ ...g(t)
2650
+ });
2651
+ }
2652
+ // @__NO_SIDE_EFFECTS__
2653
+ function Vs(e, t) {
2654
+ return new e({
2655
+ type: "string",
2656
+ format: "xid",
2657
+ check: "string_format",
2658
+ abort: !1,
2659
+ ...g(t)
2660
+ });
2661
+ }
2662
+ // @__NO_SIDE_EFFECTS__
2663
+ function Bs(e, t) {
2664
+ return new e({
2665
+ type: "string",
2666
+ format: "ksuid",
2667
+ check: "string_format",
2668
+ abort: !1,
2669
+ ...g(t)
2670
+ });
2671
+ }
2672
+ // @__NO_SIDE_EFFECTS__
2673
+ function Ws(e, t) {
2674
+ return new e({
2675
+ type: "string",
2676
+ format: "ipv4",
2677
+ check: "string_format",
2678
+ abort: !1,
2679
+ ...g(t)
2680
+ });
2681
+ }
2682
+ // @__NO_SIDE_EFFECTS__
2683
+ function Gs(e, t) {
2684
+ return new e({
2685
+ type: "string",
2686
+ format: "ipv6",
2687
+ check: "string_format",
2688
+ abort: !1,
2689
+ ...g(t)
2690
+ });
2691
+ }
2692
+ // @__NO_SIDE_EFFECTS__
2693
+ function qs(e, t) {
2694
+ return new e({
2695
+ type: "string",
2696
+ format: "cidrv4",
2697
+ check: "string_format",
2698
+ abort: !1,
2699
+ ...g(t)
2700
+ });
2701
+ }
2702
+ // @__NO_SIDE_EFFECTS__
2703
+ function Ys(e, t) {
2704
+ return new e({
2705
+ type: "string",
2706
+ format: "cidrv6",
2707
+ check: "string_format",
2708
+ abort: !1,
2709
+ ...g(t)
2710
+ });
2711
+ }
2712
+ // @__NO_SIDE_EFFECTS__
2713
+ function Xs(e, t) {
2714
+ return new e({
2715
+ type: "string",
2716
+ format: "base64",
2717
+ check: "string_format",
2718
+ abort: !1,
2719
+ ...g(t)
2720
+ });
2721
+ }
2722
+ // @__NO_SIDE_EFFECTS__
2723
+ function Hs(e, t) {
2724
+ return new e({
2725
+ type: "string",
2726
+ format: "base64url",
2727
+ check: "string_format",
2728
+ abort: !1,
2729
+ ...g(t)
2730
+ });
2731
+ }
2732
+ // @__NO_SIDE_EFFECTS__
2733
+ function Qs(e, t) {
2734
+ return new e({
2735
+ type: "string",
2736
+ format: "e164",
2737
+ check: "string_format",
2738
+ abort: !1,
2739
+ ...g(t)
2740
+ });
2741
+ }
2742
+ // @__NO_SIDE_EFFECTS__
2743
+ function eu(e, t) {
2744
+ return new e({
2745
+ type: "string",
2746
+ format: "jwt",
2747
+ check: "string_format",
2748
+ abort: !1,
2749
+ ...g(t)
2750
+ });
2751
+ }
2752
+ // @__NO_SIDE_EFFECTS__
2753
+ function tu(e, t) {
2754
+ return new e({
2755
+ type: "string",
2756
+ format: "datetime",
2757
+ check: "string_format",
2758
+ offset: !1,
2759
+ local: !1,
2760
+ precision: null,
2761
+ ...g(t)
2762
+ });
2763
+ }
2764
+ // @__NO_SIDE_EFFECTS__
2765
+ function nu(e, t) {
2766
+ return new e({
2767
+ type: "string",
2768
+ format: "date",
2769
+ check: "string_format",
2770
+ ...g(t)
2771
+ });
2772
+ }
2773
+ // @__NO_SIDE_EFFECTS__
2774
+ function ru(e, t) {
2775
+ return new e({
2776
+ type: "string",
2777
+ format: "time",
2778
+ check: "string_format",
2779
+ precision: null,
2780
+ ...g(t)
2781
+ });
2782
+ }
2783
+ // @__NO_SIDE_EFFECTS__
2784
+ function ou(e, t) {
2785
+ return new e({
2786
+ type: "string",
2787
+ format: "duration",
2788
+ check: "string_format",
2789
+ ...g(t)
2790
+ });
2791
+ }
2792
+ // @__NO_SIDE_EFFECTS__
2793
+ function iu(e, t) {
2794
+ return new e(vt({ type: "number", checks: [], ...g(t) }));
2795
+ }
2796
+ // @__NO_SIDE_EFFECTS__
2797
+ function su(e, t) {
2798
+ return new e({
2799
+ type: "number",
2800
+ check: "number_format",
2801
+ abort: !1,
2802
+ format: "safeint",
2803
+ ...g(t)
2804
+ });
2805
+ }
2806
+ // @__NO_SIDE_EFFECTS__
2807
+ function uu(e, t) {
2808
+ return new e({
2809
+ type: "boolean",
2810
+ ...g(t)
2811
+ });
2812
+ }
2813
+ // @__NO_SIDE_EFFECTS__
2814
+ function cu(e, t) {
2815
+ return new e({
2816
+ type: "null",
2817
+ ...g(t)
2818
+ });
2819
+ }
2820
+ // @__NO_SIDE_EFFECTS__
2821
+ function au(e) {
2822
+ return new e({
2823
+ type: "any"
2824
+ });
2825
+ }
2826
+ // @__NO_SIDE_EFFECTS__
2827
+ function fu(e) {
2828
+ return new e({
2829
+ type: "unknown"
2830
+ });
2831
+ }
2832
+ // @__NO_SIDE_EFFECTS__
2833
+ function lu(e, t) {
2834
+ return new e({
2835
+ type: "never",
2836
+ ...g(t)
2837
+ });
2838
+ }
2839
+ // @__NO_SIDE_EFFECTS__
2840
+ function Ht(e, t) {
2841
+ return new jn({
2842
+ check: "less_than",
2843
+ ...g(t),
2844
+ value: e,
2845
+ inclusive: !1
2846
+ });
2847
+ }
2848
+ // @__NO_SIDE_EFFECTS__
2849
+ function We(e, t) {
2850
+ return new jn({
2851
+ check: "less_than",
2852
+ ...g(t),
2853
+ value: e,
2854
+ inclusive: !0
2855
+ });
2856
+ }
2857
+ // @__NO_SIDE_EFFECTS__
2858
+ function Qt(e, t) {
2859
+ return new Rn({
2860
+ check: "greater_than",
2861
+ ...g(t),
2862
+ value: e,
2863
+ inclusive: !1
2864
+ });
2865
+ }
2866
+ // @__NO_SIDE_EFFECTS__
2867
+ function Ge(e, t) {
2868
+ return new Rn({
2869
+ check: "greater_than",
2870
+ ...g(t),
2871
+ value: e,
2872
+ inclusive: !0
2873
+ });
2874
+ }
2875
+ // @__NO_SIDE_EFFECTS__
2876
+ function en(e, t) {
2877
+ return new ri({
2878
+ check: "multiple_of",
2879
+ ...g(t),
2880
+ value: e
2881
+ });
2882
+ }
2883
+ // @__NO_SIDE_EFFECTS__
2884
+ function Hn(e, t) {
2885
+ return new ii({
2886
+ check: "max_length",
2887
+ ...g(t),
2888
+ maximum: e
2889
+ });
2890
+ }
2891
+ // @__NO_SIDE_EFFECTS__
2892
+ function Te(e, t) {
2893
+ return new si({
2894
+ check: "min_length",
2895
+ ...g(t),
2896
+ minimum: e
2897
+ });
2898
+ }
2899
+ // @__NO_SIDE_EFFECTS__
2900
+ function Qn(e, t) {
2901
+ return new ui({
2902
+ check: "length_equals",
2903
+ ...g(t),
2904
+ length: e
2905
+ });
2906
+ }
2907
+ // @__NO_SIDE_EFFECTS__
2908
+ function du(e, t) {
2909
+ return new ci({
2910
+ check: "string_format",
2911
+ format: "regex",
2912
+ ...g(t),
2913
+ pattern: e
2914
+ });
2915
+ }
2916
+ // @__NO_SIDE_EFFECTS__
2917
+ function pu(e) {
2918
+ return new ai({
2919
+ check: "string_format",
2920
+ format: "lowercase",
2921
+ ...g(e)
2922
+ });
2923
+ }
2924
+ // @__NO_SIDE_EFFECTS__
2925
+ function hu(e) {
2926
+ return new fi({
2927
+ check: "string_format",
2928
+ format: "uppercase",
2929
+ ...g(e)
2930
+ });
2931
+ }
2932
+ // @__NO_SIDE_EFFECTS__
2933
+ function mu(e, t) {
2934
+ return new li({
2935
+ check: "string_format",
2936
+ format: "includes",
2937
+ ...g(t),
2938
+ includes: e
2939
+ });
2940
+ }
2941
+ // @__NO_SIDE_EFFECTS__
2942
+ function gu(e, t) {
2943
+ return new di({
2944
+ check: "string_format",
2945
+ format: "starts_with",
2946
+ ...g(t),
2947
+ prefix: e
2948
+ });
2949
+ }
2950
+ // @__NO_SIDE_EFFECTS__
2951
+ function _u(e, t) {
2952
+ return new pi({
2953
+ check: "string_format",
2954
+ format: "ends_with",
2955
+ ...g(t),
2956
+ suffix: e
2957
+ });
2958
+ }
2959
+ // @__NO_SIDE_EFFECTS__
2960
+ function ue(e) {
2961
+ return new hi({
2962
+ check: "overwrite",
2963
+ tx: e
2964
+ });
2965
+ }
2966
+ // @__NO_SIDE_EFFECTS__
2967
+ function vu(e) {
2968
+ return /* @__PURE__ */ ue((t) => t.normalize(e));
2969
+ }
2970
+ // @__NO_SIDE_EFFECTS__
2971
+ function yu() {
2972
+ return /* @__PURE__ */ ue((e) => e.trim());
2973
+ }
2974
+ // @__NO_SIDE_EFFECTS__
2975
+ function bu() {
2976
+ return /* @__PURE__ */ ue((e) => e.toLowerCase());
2977
+ }
2978
+ // @__NO_SIDE_EFFECTS__
2979
+ function wu() {
2980
+ return /* @__PURE__ */ ue((e) => e.toUpperCase());
2981
+ }
2982
+ // @__NO_SIDE_EFFECTS__
2983
+ function zu() {
2984
+ return /* @__PURE__ */ ue((e) => Dr(e));
2985
+ }
2986
+ // @__NO_SIDE_EFFECTS__
2987
+ function ku(e, t, n) {
2988
+ return new e({
2989
+ type: "array",
2990
+ element: t,
2991
+ // get element() {
2992
+ // return element;
2993
+ // },
2994
+ ...g(n)
2995
+ });
2996
+ }
2997
+ // @__NO_SIDE_EFFECTS__
2998
+ function $u(e, t, n) {
2999
+ const r = g(n);
3000
+ return r.abort ?? (r.abort = !0), new e({
3001
+ type: "custom",
3002
+ check: "custom",
3003
+ fn: t,
3004
+ ...r
3005
+ });
3006
+ }
3007
+ // @__NO_SIDE_EFFECTS__
3008
+ function Ou(e, t, n) {
3009
+ return new e({
3010
+ type: "custom",
3011
+ check: "custom",
3012
+ fn: t,
3013
+ ...g(n)
3014
+ });
3015
+ }
3016
+ // @__NO_SIDE_EFFECTS__
3017
+ function Su(e, t) {
3018
+ const n = /* @__PURE__ */ Zu((r) => (r.addIssue = (o) => {
3019
+ if (typeof o == "string")
3020
+ r.issues.push(ve(o, r.value, n._zod.def));
3021
+ else {
3022
+ const i = o;
3023
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), "input" in i || (i.input = r.value), i.inst ?? (i.inst = n), i.continue ?? (i.continue = !n._zod.def.abort), r.issues.push(ve(i));
3024
+ }
3025
+ }, e(r.value, r)), t);
3026
+ return n;
3027
+ }
3028
+ // @__NO_SIDE_EFFECTS__
3029
+ function Zu(e, t) {
3030
+ const n = new A({
3031
+ check: "custom",
3032
+ ...g(t)
3033
+ });
3034
+ return n._zod.check = e, n;
3035
+ }
3036
+ function ge(e, ...t) {
3037
+ for (const n of t)
3038
+ for (const r of Reflect.ownKeys(n))
3039
+ Object.prototype.propertyIsEnumerable.call(n, r) && K(e, r, n[r]);
3040
+ return e;
3041
+ }
3042
+ function er(e) {
3043
+ let t = e?.target ?? "draft-2020-12";
3044
+ return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
3045
+ processors: e.processors ?? {},
3046
+ metadataRegistry: e?.metadata ?? pe,
3047
+ target: t,
3048
+ unrepresentable: e?.unrepresentable ?? "throw",
3049
+ override: e?.override ?? (() => {
3050
+ }),
3051
+ io: e?.io ?? "output",
3052
+ counter: 0,
3053
+ seen: /* @__PURE__ */ new Map(),
3054
+ sharedDefsExtractedFor: void 0,
3055
+ sharedEmitDoneFor: void 0,
3056
+ cycles: e?.cycles ?? "ref",
3057
+ reused: e?.reused ?? "inline",
3058
+ intersections: [],
3059
+ deferred: [],
3060
+ external: e?.external ?? void 0
3061
+ };
3062
+ }
3063
+ function Y(e, t, n, r, o) {
3064
+ const i = typeof t.unrepresentable == "function" ? t.unrepresentable({ zodSchema: e, path: r.path, message: o }) : t.unrepresentable;
3065
+ if (i === "any")
3066
+ return !1;
3067
+ if (i === void 0 || i === "throw")
3068
+ throw new Error(o);
3069
+ return Object.assign(n, i), !0;
3070
+ }
3071
+ function S(e, t, n = { path: [], schemaPath: [] }) {
3072
+ var r;
3073
+ const o = e._zod.def, i = t.seen.get(e);
3074
+ if (i)
3075
+ return i.count++, n.schemaPath.includes(e) && (i.cycle = n.path), i.schema;
3076
+ const s = { schema: {}, count: 1, cycle: void 0, path: n.path };
3077
+ t.seen.set(e, s), t.sharedDefsExtractedFor = void 0, t.sharedEmitDoneFor = void 0;
3078
+ const u = e._zod.toJSONSchema?.();
3079
+ if (u)
3080
+ s.schema = u;
3081
+ else {
3082
+ const f = {
3083
+ ...n,
3084
+ schemaPath: [...n.schemaPath, e],
3085
+ path: n.path
3086
+ };
3087
+ if (e._zod.processJSONSchema)
3088
+ e._zod.processJSONSchema(t, s.schema, f);
3089
+ else {
3090
+ const h = s.schema, p = t.processors[o.type];
3091
+ if (!p)
3092
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);
3093
+ p(e, t, h, f);
3094
+ }
3095
+ const d = e._zod.parent;
3096
+ d && (s.ref || (s.ref = d), S(d, t, f), t.seen.get(d).isParent = !0);
3097
+ }
3098
+ const c = t.metadataRegistry.get(e);
3099
+ return c && ge(s.schema, c), t.io === "input" && E(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && "_prefault" in s.schema && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
3100
+ }
3101
+ function tn(e) {
3102
+ return e.replace(/~/g, "~0").replace(/\//g, "~1");
3103
+ }
3104
+ function tr(e, t) {
3105
+ const n = e.seen.get(t);
3106
+ if (!n)
3107
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
3108
+ if (e.external && e.sharedDefsExtractedFor === e.external)
3109
+ return;
3110
+ const r = /* @__PURE__ */ new Map();
3111
+ for (const s of e.seen.entries()) {
3112
+ const u = e.metadataRegistry.get(s[0])?.id;
3113
+ if (u) {
3114
+ const c = r.get(u);
3115
+ if (c && c !== s[0])
3116
+ throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
3117
+ r.set(u, s[0]);
3118
+ }
3119
+ }
3120
+ const o = (s) => {
3121
+ const u = e.target === "draft-2020-12" ? "$defs" : "definitions";
3122
+ if (e.external) {
3123
+ const d = e.external.registry.get(s[0])?.id, h = e.external.uri ?? ((m) => m);
3124
+ if (d)
3125
+ return { ref: h(d) };
3126
+ const p = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
3127
+ return s[1].defId = p, { defId: p, ref: `${h("__shared")}#/${u}/${tn(p)}` };
3128
+ }
3129
+ const c = "#", a = `${c}/${u}/`;
3130
+ if (s[1] === n && !s[1].schema.id)
3131
+ return { ref: c };
3132
+ const f = s[1].schema.id ?? `__schema${e.counter++}`;
3133
+ return { defId: f, ref: a + tn(f) };
3134
+ }, i = (s) => {
3135
+ if (s[1].schema.$ref)
3136
+ return;
3137
+ const u = s[1], { ref: c, defId: a } = o(s);
3138
+ u.def = { ...u.schema }, a && (u.defId = a);
3139
+ const f = u.schema;
3140
+ for (const d in f)
3141
+ delete f[d];
3142
+ f.$ref = c;
3143
+ };
3144
+ if (e.cycles === "throw")
3145
+ for (const s of e.seen.entries()) {
3146
+ const u = s[1];
3147
+ if (u.cycle)
3148
+ throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
3149
+
3150
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
3151
+ }
3152
+ for (const s of e.seen.entries()) {
3153
+ const u = s[1];
3154
+ if (t === s[0]) {
3155
+ i(s);
3156
+ continue;
3157
+ }
3158
+ if (e.external) {
3159
+ const a = e.external.registry.get(s[0])?.id;
3160
+ if (t !== s[0] && a) {
3161
+ i(s);
3162
+ continue;
3163
+ }
3164
+ }
3165
+ if (e.metadataRegistry.get(s[0])?.id) {
3166
+ i(s);
3167
+ continue;
3168
+ }
3169
+ if (u.cycle) {
3170
+ i(s);
3171
+ continue;
3172
+ }
3173
+ u.count > 1 && e.reused === "ref" && i(s);
3174
+ }
3175
+ e.external && (e.sharedDefsExtractedFor = e.external);
3176
+ }
3177
+ function nr(e) {
3178
+ const t = e.anyOf;
3179
+ if (!Array.isArray(t) || t.length === 0 || e.type !== void 0)
3180
+ return;
3181
+ const n = [];
3182
+ for (const r of t) {
3183
+ if (!r || typeof r != "object")
3184
+ return;
3185
+ nr(r);
3186
+ const o = Object.keys(r);
3187
+ if (o.length !== 1 || o[0] !== "type")
3188
+ return;
3189
+ const i = r.type;
3190
+ for (const s of Array.isArray(i) ? i : [i]) {
3191
+ if (typeof s != "string")
3192
+ return;
3193
+ n.includes(s) || n.push(s);
3194
+ }
3195
+ }
3196
+ delete e.anyOf, e.type = n.length === 1 ? n[0] : n;
3197
+ }
3198
+ const rr = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties"]), nn = ["oneOf", "anyOf"];
3199
+ function rn(e) {
3200
+ const t = e.additionalProperties;
3201
+ return t === void 0 || t === !1 || typeof t != "object" || t === null ? null : Object.keys(t).length ? t : null;
3202
+ }
3203
+ function nt(e) {
3204
+ const t = [];
3205
+ for (const i of e) {
3206
+ if (typeof i != "object" || i.type !== "object")
3207
+ return null;
3208
+ for (const s in i)
3209
+ if (!rr.has(s))
3210
+ return null;
3211
+ t.push(i);
3212
+ }
3213
+ const n = {}, r = /* @__PURE__ */ new Set();
3214
+ for (const i of t) {
3215
+ for (const s in i.properties) {
3216
+ if (Object.prototype.hasOwnProperty.call(n, s))
3217
+ continue;
3218
+ const u = [];
3219
+ for (const a of t) {
3220
+ const f = a.properties?.[s] ?? rn(a);
3221
+ f != null && (u.some((d) => JSON.stringify(d) === JSON.stringify(f)) || u.push(f));
3222
+ }
3223
+ const c = u.length === 1 ? u[0] : nt(u) ?? { allOf: u };
3224
+ K(n, s, c);
3225
+ }
3226
+ for (const s of i.required ?? [])
3227
+ r.add(s);
3228
+ }
3229
+ const o = { type: "object", properties: n };
3230
+ if (r.size && (o.required = [...r]), t.every((i) => i.additionalProperties === !1))
3231
+ o.additionalProperties = !1;
3232
+ else {
3233
+ const i = [];
3234
+ for (const s of t) {
3235
+ const u = rn(s);
3236
+ u && !i.some((c) => JSON.stringify(c) === JSON.stringify(u)) && i.push(u);
3237
+ }
3238
+ i.length === 1 ? o.additionalProperties = i[0] : i.length > 1 && (o.additionalProperties = { allOf: i });
3239
+ }
3240
+ return o;
3241
+ }
3242
+ function Pu(e) {
3243
+ const t = e.allOf;
3244
+ if (!Array.isArray(t) || t.length < 2)
3245
+ return;
3246
+ for (const o of rr)
3247
+ if (o in e)
3248
+ return;
3249
+ const n = t.filter((o) => nn.some((i) => Array.isArray(o[i])));
3250
+ let r = null;
3251
+ if (!n.length)
3252
+ r = nt(t);
3253
+ else {
3254
+ const o = n[0], i = nn.find((c) => Array.isArray(o[c]));
3255
+ if (Object.keys(o).length !== 1)
3256
+ return;
3257
+ const s = t.filter((c) => c !== o), u = o[i].map((c) => nt([...s, c]));
3258
+ if (u.some((c) => !c))
3259
+ return;
3260
+ r = { [i]: u };
3261
+ }
3262
+ r && (delete e.allOf, ge(e, r));
3263
+ }
3264
+ function or(e, t) {
3265
+ const n = e.seen.get(t);
3266
+ if (!n)
3267
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
3268
+ const r = (u) => {
3269
+ const c = e.seen.get(u);
3270
+ if (c.ref === null)
3271
+ return;
3272
+ const a = c.def ?? c.schema, f = { ...a }, d = c.ref;
3273
+ if (c.ref = null, d) {
3274
+ r(d);
3275
+ const p = e.seen.get(d), m = p.schema;
3276
+ if (m.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (a.allOf = a.allOf ?? [], a.allOf.push(m)) : ge(a, m), ge(a, f), u._zod.parent === d)
3277
+ for (const v in a)
3278
+ v === "$ref" || v === "allOf" || v in f || delete a[v];
3279
+ if (m.$ref && p.def)
3280
+ for (const v in a)
3281
+ v === "$ref" || v === "allOf" || v in p.def && JSON.stringify(a[v]) === JSON.stringify(p.def[v]) && delete a[v];
3282
+ }
3283
+ const h = u._zod.parent;
3284
+ if (h && h !== d) {
3285
+ r(h);
3286
+ const p = e.seen.get(h);
3287
+ if (p?.schema.$ref && (a.$ref = p.schema.$ref, p.def))
3288
+ for (const m in a)
3289
+ m === "$ref" || m === "allOf" || m in p.def && JSON.stringify(a[m]) === JSON.stringify(p.def[m]) && delete a[m];
3290
+ }
3291
+ e.override({
3292
+ zodSchema: u,
3293
+ jsonSchema: a,
3294
+ path: c.path ?? []
3295
+ });
3296
+ };
3297
+ if (!e.external || e.sharedEmitDoneFor !== e.external) {
3298
+ for (const u of [...e.seen.entries()].reverse())
3299
+ r(u[0]);
3300
+ if (e.target !== "openapi-3.0")
3301
+ for (const u of e.seen.entries())
3302
+ nr(u[1].def ?? u[1].schema);
3303
+ for (const u of e.deferred)
3304
+ u();
3305
+ if (e.intersections.length) {
3306
+ const u = /* @__PURE__ */ new Map();
3307
+ for (const c of e.seen.values())
3308
+ for (const a of [c.schema, c.def]) {
3309
+ const f = a?.allOf;
3310
+ if (!Array.isArray(f))
3311
+ continue;
3312
+ const d = u.get(f);
3313
+ d ? d.push(a) : u.set(f, [a]);
3314
+ }
3315
+ for (const c of e.intersections)
3316
+ for (const a of u.get(c) ?? [])
3317
+ Pu(a);
3318
+ }
3319
+ }
3320
+ const o = {};
3321
+ if (e.target === "draft-2020-12" ? o.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? o.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? o.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
3322
+ const u = e.external.registry.get(t)?.id;
3323
+ if (!u)
3324
+ throw new Error("Schema is missing an `id` property");
3325
+ o.$id = e.external.uri(u);
3326
+ }
3327
+ ge(o, n.defId ? n.schema : n.def ?? n.schema);
3328
+ const i = e.metadataRegistry.get(t)?.id;
3329
+ i !== void 0 && o.id === i && delete o.id;
3330
+ const s = e.external?.defs ?? {};
3331
+ if (!e.external || e.sharedEmitDoneFor !== e.external)
3332
+ for (const u of e.seen.entries()) {
3333
+ const c = u[1];
3334
+ c.def && c.defId && (c.def.id === c.defId && delete c.def.id, K(s, c.defId, c.def));
3335
+ }
3336
+ e.external && (e.sharedEmitDoneFor = e.external), e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? o.$defs = s : o.definitions = s);
3337
+ try {
3338
+ const u = JSON.parse(JSON.stringify(o));
3339
+ return Object.defineProperty(u, "~standard", {
3340
+ value: {
3341
+ ...t["~standard"],
3342
+ jsonSchema: {
3343
+ input: Ae(t, "input", e.processors),
3344
+ output: Ae(t, "output", e.processors)
3345
+ }
3346
+ },
3347
+ enumerable: !1,
3348
+ writable: !1
3349
+ }), u;
3350
+ } catch {
3351
+ throw new Error("Error converting schema to JSON.");
3352
+ }
3353
+ }
3354
+ function E(e, t) {
3355
+ const n = t ?? { seen: /* @__PURE__ */ new Set() };
3356
+ if (n.seen.has(e))
3357
+ return !1;
3358
+ n.seen.add(e);
3359
+ const r = e._zod.def;
3360
+ if (r.type === "transform")
3361
+ return !0;
3362
+ if (r.type === "array")
3363
+ return E(r.element, n);
3364
+ if (r.type === "set")
3365
+ return E(r.valueType, n);
3366
+ if (r.type === "lazy")
3367
+ return E(r.getter(), n);
3368
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch")
3369
+ return E(r.innerType, n);
3370
+ if (r.type === "intersection")
3371
+ return E(r.left, n) || E(r.right, n);
3372
+ if (r.type === "record" || r.type === "map")
3373
+ return E(r.keyType, n) || E(r.valueType, n);
3374
+ if (r.type === "pipe")
3375
+ return e._zod.traits.has("$ZodCodec") ? !0 : E(r.in, n) || E(r.out, n);
3376
+ if (r.type === "object") {
3377
+ for (const o in r.shape)
3378
+ if (E(r.shape[o], n))
3379
+ return !0;
3380
+ return !1;
3381
+ }
3382
+ if (r.type === "union") {
3383
+ for (const o of r.options)
3384
+ if (E(o, n))
3385
+ return !0;
3386
+ return !1;
3387
+ }
3388
+ if (r.type === "tuple") {
3389
+ for (const o of r.items)
3390
+ if (E(o, n))
3391
+ return !0;
3392
+ return !!(r.rest && E(r.rest, n));
3393
+ }
3394
+ return !1;
3395
+ }
3396
+ const Eu = (e, t = {}) => (n) => {
3397
+ const r = er({ ...n, processors: t });
3398
+ return S(e, r), tr(r, e), or(r, e);
3399
+ }, Ae = (e, t, n = {}) => (r) => {
3400
+ const { libraryOptions: o, target: i } = r ?? {}, s = er({ ...o ?? {}, target: i, io: t, processors: n });
3401
+ return S(e, s), tr(s, e), or(s, e);
3402
+ }, ie = (e, t, n) => {
3403
+ (e[t] === void 0 || n > e[t]) && (e[t] = n);
3404
+ }, se = (e, t, n) => {
3405
+ (e[t] === void 0 || n < e[t]) && (e[t] = n);
3406
+ }, on = (e, t) => {
3407
+ ie(e, "minimum", t), se(e, "maximum", t);
3408
+ }, ir = (e, t) => {
3409
+ e.multipleOf ?? (e.multipleOf = []), e.multipleOf.includes(t) || e.multipleOf.push(t);
3410
+ }, sr = (e, t) => {
3411
+ e.patterns ?? (e.patterns = /* @__PURE__ */ new Set()), e.patterns.add(t);
3412
+ }, ur = (e, t) => {
3413
+ e.mime = e.mime ? e.mime.filter((n) => t.includes(n)) : [...t];
3414
+ }, cr = (e, t) => {
3415
+ e.format = t, t.includes("int") && (e.isInt = !0);
3416
+ }, sn = (e, t) => ie(e, "minimum", t.minimum), un = (e, t) => se(e, "maximum", t.maximum), cn = (e) => (t, n) => {
3417
+ cr(t, n.format);
3418
+ const [r, o] = e[n.format];
3419
+ ie(t, "minimum", r), se(t, "maximum", o);
3420
+ }, Iu = {
3421
+ greater_than: (e, t) => ie(e, t.inclusive ? "minimum" : "exclusiveMinimum", t.value),
3422
+ less_than: (e, t) => se(e, t.inclusive ? "maximum" : "exclusiveMaximum", t.value),
3423
+ multiple_of: (e, t) => ir(e, t.value),
3424
+ number_format: cn($n),
3425
+ bigint_format: cn(xr),
3426
+ min_length: sn,
3427
+ max_length: un,
3428
+ length_equals: (e, t) => on(e, t.length),
3429
+ min_size: sn,
3430
+ max_size: un,
3431
+ size_equals: (e, t) => on(e, t.size),
3432
+ string_format: (e, t) => {
3433
+ cr(e, t.format), t.pattern && sr(e, t.pattern), (t.format === "base64" || t.format === "base64url") && (e.contentEncoding = t.format), (t.local || t.precision === -1) && (e.laxFormat = !0);
3434
+ },
3435
+ mime_type: (e, t) => ur(e, t.mime)
3436
+ };
3437
+ function j(e) {
3438
+ const t = {}, n = e._zod.def, r = e._zod.traits.has("$ZodCheck") ? [e, ...n.checks ?? []] : n.checks ?? [];
3439
+ for (const i of r)
3440
+ Iu[i._zod.def.check]?.(t, i._zod.def);
3441
+ const o = e._zod.bag;
3442
+ o.minimum !== void 0 && ie(t, "minimum", o.minimum), o.exclusiveMinimum !== void 0 && ie(t, "exclusiveMinimum", o.exclusiveMinimum), o.maximum !== void 0 && se(t, "maximum", o.maximum), o.exclusiveMaximum !== void 0 && se(t, "exclusiveMaximum", o.exclusiveMaximum), o.multipleOf !== void 0 && ir(t, o.multipleOf), o.format !== void 0 && (t.format ?? (t.format = o.format), o.format.includes("int") && (t.isInt = !0)), o.mime && ur(t, o.mime);
3443
+ for (const i of o.patterns ?? [])
3444
+ sr(t, i);
3445
+ return t;
3446
+ }
3447
+ const Tu = {
3448
+ guid: "uuid",
3449
+ url: "uri",
3450
+ datetime: "date-time",
3451
+ json_string: "json-string",
3452
+ regex: ""
3453
+ // do not set
3454
+ }, Au = /* @__PURE__ */ new Map([
3455
+ [Ln, Jo],
3456
+ [_t, Ko]
3457
+ ]), ar = (e) => Au.get(e) ?? e, Nu = (e, t, n, r) => {
3458
+ const o = n;
3459
+ o.type = "string";
3460
+ const { minimum: i, maximum: s, format: u, patterns: c, contentEncoding: a, laxFormat: f } = j(e);
3461
+ if (typeof i == "number" && (o.minLength = i), typeof s == "number" && (o.maxLength = s), u && (o.format = Tu[u] ?? u, o.format === "" && delete o.format, (u === "time" || f) && delete o.format), a && (o.contentEncoding = a), c && c.size > 0) {
3462
+ const d = [...c].map(ar);
3463
+ d.length === 1 ? o.pattern = d[0].source : d.length > 1 && (o.allOf = [
3464
+ ...d.map((h) => ({
3465
+ ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
3466
+ pattern: h.source
3467
+ }))
3468
+ ]);
3469
+ }
3470
+ }, ju = (e, t, n, r) => {
3471
+ const o = n, { minimum: i, maximum: s, multipleOf: u, exclusiveMaximum: c, exclusiveMinimum: a, isInt: f } = j(e);
3472
+ o.type = f ? "integer" : "number";
3473
+ const d = typeof a == "number" && a >= (i ?? Number.NEGATIVE_INFINITY), h = typeof c == "number" && c <= (s ?? Number.POSITIVE_INFINITY), p = t.target === "draft-04" || t.target === "openapi-3.0";
3474
+ if (d ? p ? (o.minimum = a, o.exclusiveMinimum = !0) : o.exclusiveMinimum = a : typeof i == "number" && (o.minimum = i), h ? p ? (o.maximum = c, o.exclusiveMaximum = !0) : o.exclusiveMaximum = c : typeof s == "number" && (o.maximum = s), u) {
3475
+ const m = /* @__PURE__ */ new Set();
3476
+ for (const b of u)
3477
+ Number.isFinite(b) && b !== 0 ? m.add(Math.abs(b)) : Y(e, t, o, r, `A multipleOf divisor of ${b} cannot be represented in JSON Schema`);
3478
+ const [_, ...v] = m;
3479
+ _ !== void 0 && (o.multipleOf = _), v.length && (o.allOf = [...o.allOf ?? [], ...v.map((b) => ({ multipleOf: b }))]);
3480
+ }
3481
+ }, Ru = (e, t, n, r) => {
3482
+ n.type = "boolean";
3483
+ }, Cu = (e, t, n, r) => {
3484
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
3485
+ }, Du = (e, t, n, r) => {
3486
+ n.not = {};
3487
+ }, Uu = (e, t, n, r) => {
3488
+ }, Fu = (e, t, n, r) => {
3489
+ }, Mu = (e, t, n, r) => {
3490
+ const o = e._zod.def, i = Xe(o.entries);
3491
+ if (i.length === 0) {
3492
+ n.not = {};
3493
+ return;
3494
+ }
3495
+ i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), n.enum = i;
3496
+ }, xu = (e, t, n, r) => {
3497
+ const o = e._zod.def;
3498
+ if (o.values.length === 0) {
3499
+ n.not = {};
3500
+ return;
3501
+ }
3502
+ const i = [];
3503
+ for (const s of o.values)
3504
+ if (s === void 0) {
3505
+ if (Y(e, t, n, r, "Literal `undefined` cannot be represented in JSON Schema"))
3506
+ return;
3507
+ } else if (typeof s == "bigint") {
3508
+ if (Y(e, t, n, r, "BigInt literals cannot be represented in JSON Schema"))
3509
+ return;
3510
+ i.push(Number(s));
3511
+ } else
3512
+ i.push(s);
3513
+ if (i.length !== 0) if (i.length === 1) {
3514
+ const s = i[0];
3515
+ n.type = s === null ? "null" : typeof s, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [s] : n.const = s;
3516
+ } else
3517
+ i.every((s) => typeof s == "number") && (n.type = "number"), i.every((s) => typeof s == "string") && (n.type = "string"), i.every((s) => typeof s == "boolean") && (n.type = "boolean"), i.every((s) => s === null) && (n.type = "null"), n.enum = i;
3518
+ }, Lu = (e, t, n, r) => {
3519
+ Y(e, t, n, r, "Custom types cannot be represented in JSON Schema");
3520
+ }, Ju = (e, t, n, r) => {
3521
+ Y(e, t, n, r, "Transforms cannot be represented in JSON Schema");
3522
+ }, Ku = (e, t, n, r) => {
3523
+ const o = n, i = e._zod.def, { minimum: s, maximum: u } = j(e);
3524
+ typeof s == "number" && (o.minItems = s), typeof u == "number" && (o.maxItems = u), o.type = "array", o.items = S(i.element, t, {
3525
+ ...r,
3526
+ path: [...r.path, "items"]
3527
+ });
3528
+ };
3529
+ function ye(e) {
3530
+ const t = e._zod.def;
3531
+ return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? ye(t.out) : t.type === "catch" ? ye(t.innerType) : e._zod.optin;
3532
+ }
3533
+ const Vu = (e, t, n, r) => {
3534
+ const o = n, i = e._zod.def, s = i.shape;
3535
+ if (Object.getOwnPropertySymbols(s).length && Y(e, t, o, r, "Symbol keys cannot be represented in JSON Schema"))
3536
+ return;
3537
+ o.type = "object", o.properties = {};
3538
+ for (const a in s)
3539
+ K(o.properties, a, S(s[a], t, {
3540
+ ...r,
3541
+ path: [...r.path, "properties", a]
3542
+ }));
3543
+ const c = [];
3544
+ for (const a of Object.keys(s)) {
3545
+ const f = i.shape[a];
3546
+ (t.io === "input" ? ye(f) === void 0 : f._zod.optout === void 0) && c.push(a);
3547
+ }
3548
+ c.length > 0 && (o.required = c), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = S(i.catchall, t, {
3549
+ ...r,
3550
+ path: [...r.path, "additionalProperties"]
3551
+ })) : t.io === "output" && (o.additionalProperties = !1);
3552
+ }, Bu = (e, t, n, r) => {
3553
+ const o = e._zod.def, i = o.inclusive === !1, s = o.options.map((u, c) => S(u, t, {
3554
+ ...r,
3555
+ path: [...r.path, i ? "oneOf" : "anyOf", c]
3556
+ }));
3557
+ i ? n.oneOf = s : n.anyOf = s;
3558
+ }, Wu = (e, t, n, r) => {
3559
+ const o = e._zod.def, i = S(o.left, t, {
3560
+ ...r,
3561
+ path: [...r.path, "allOf", 0]
3562
+ }), s = S(o.right, t, {
3563
+ ...r,
3564
+ path: [...r.path, "allOf", 1]
3565
+ }), u = (a) => "allOf" in a && Object.keys(a).length === 1, c = [
3566
+ ...u(i) ? i.allOf : [i],
3567
+ ...u(s) ? s.allOf : [s]
3568
+ ];
3569
+ n.allOf = c, t.intersections.push(c);
3570
+ }, Gu = (e, t, n, r) => {
3571
+ const o = n, i = e._zod.def;
3572
+ o.type = "array";
3573
+ const s = t.target === "draft-2020-12" ? "prefixItems" : "items", u = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = i.items.map((_, v) => S(_, t, {
3574
+ ...r,
3575
+ path: [...r.path, s, v]
3576
+ })), a = i.rest ? S(i.rest, t, {
3577
+ ...r,
3578
+ path: [...r.path, u, ...t.target === "openapi-3.0" ? [i.items.length] : []]
3579
+ }) : null;
3580
+ let f = i.items.length;
3581
+ for (; f > 0; ) {
3582
+ const _ = i.items[f - 1];
3583
+ if (!(t.io === "input" ? ye(_) !== void 0 : _._zod.optout === "optional"))
3584
+ break;
3585
+ f--;
3586
+ }
3587
+ const d = i.items.length, h = !i.rest;
3588
+ t.target === "draft-2020-12" ? (o.prefixItems = c, h ? o.items = !1 : a && (o.items = a), f > 0 && (o.minItems = f), h && (o.maxItems = d)) : t.target === "openapi-3.0" ? (o.items = {
3589
+ anyOf: c
3590
+ }, a && o.items.anyOf.push(a), f > 0 && (o.minItems = f), h && (o.maxItems = d)) : (o.items = c, h ? o.additionalItems = !1 : a && (o.additionalItems = a), f > 0 && (o.minItems = f), h && (o.maxItems = d));
3591
+ const { minimum: p, maximum: m } = j(e);
3592
+ typeof p == "number" && (o.minItems = p), typeof m == "number" && (o.maxItems = m);
3593
+ };
3594
+ function rt(e, t, n) {
3595
+ if (t.$ref) {
3596
+ if (n.has(t))
3597
+ return t;
3598
+ n.add(t);
3599
+ const m = e.get(t)?.def;
3600
+ if (!m)
3601
+ return t;
3602
+ const _ = rt(e, m, n);
3603
+ return _ === m ? t : _;
3604
+ }
3605
+ for (const m of ["anyOf", "oneOf"]) {
3606
+ const _ = t[m];
3607
+ if (!Array.isArray(_))
3608
+ continue;
3609
+ const v = _.map((b) => rt(e, b, n));
3610
+ v.some((b, I) => b !== _[I]) && (t = { ...t, [m]: v });
3611
+ }
3612
+ const r = Array.isArray(t.type) ? t.type : [t.type], o = !r.includes("string") && r.some((m) => m === "number" || m === "integer"), i = t.enum ?? (t.const !== void 0 ? [t.const] : void 0);
3613
+ if (!o && !i?.some((m) => typeof m == "number"))
3614
+ return t;
3615
+ const { minimum: s, maximum: u, exclusiveMinimum: c, exclusiveMaximum: a, multipleOf: f, format: d, id: h, ...p } = t;
3616
+ return p.enum ? p.enum = p.enum.map((m) => typeof m == "number" ? String(m) : m) : typeof p.const == "number" && (p.const = String(p.const)), o && (p.type = "string", i || (p.pattern = (r.includes("number") ? ht : Ho).source)), p;
3617
+ }
3618
+ const ot = /* @__PURE__ */ new WeakMap();
3619
+ function qu(e) {
3620
+ const t = /* @__PURE__ */ new Map();
3621
+ for (const r of e.seen.values())
3622
+ r.def && !t.has(r.schema) && t.set(r.schema, r);
3623
+ const n = /* @__PURE__ */ new Map();
3624
+ for (const r of ot.get(e) ?? []) {
3625
+ const o = e.seen.get(r), i = (o?.def ?? o?.schema)?.propertyNames;
3626
+ if (!i || i === !0 || n.has(i))
3627
+ continue;
3628
+ const s = rt(t, i, /* @__PURE__ */ new Set());
3629
+ s !== i && n.set(i, s);
3630
+ }
3631
+ if (n.size)
3632
+ for (const r of e.seen.values())
3633
+ for (const o of [r.schema, r.def]) {
3634
+ const i = o && n.get(o.propertyNames);
3635
+ i && (o.propertyNames = i);
3636
+ }
3637
+ }
3638
+ const Yu = (e, t, n, r) => {
3639
+ const o = n, i = e._zod.def;
3640
+ o.type = "object";
3641
+ const s = i.keyType, u = j(s).patterns;
3642
+ if (i.mode === "loose" && u && u.size > 0) {
3643
+ const f = S(i.valueType, t, {
3644
+ ...r,
3645
+ path: [...r.path, "patternProperties", "*"]
3646
+ });
3647
+ o.patternProperties = {};
3648
+ for (const d of u)
3649
+ K(o.patternProperties, ar(d).source, f);
3650
+ } else {
3651
+ if (t.target === "draft-07" || t.target === "draft-2020-12") {
3652
+ o.propertyNames = S(i.keyType, t, {
3653
+ ...r,
3654
+ path: [...r.path, "propertyNames"]
3655
+ });
3656
+ let f = ot.get(t);
3657
+ f || (f = [], ot.set(t, f), t.deferred.push(() => qu(t))), f.push(e);
3658
+ }
3659
+ o.additionalProperties = S(i.valueType, t, {
3660
+ ...r,
3661
+ path: [...r.path, "additionalProperties"]
3662
+ });
3663
+ }
3664
+ const c = s._zod.values, a = t.io === "input" && ye(i.valueType) !== void 0;
3665
+ if (c && !i.partial && !a) {
3666
+ const f = [...c].filter((d) => typeof d == "string" || typeof d == "number");
3667
+ f.length > 0 && (o.required = f.map(String));
3668
+ }
3669
+ }, Xu = (e, t, n, r) => {
3670
+ const o = e._zod.def, i = S(o.innerType, t, r), s = t.seen.get(e);
3671
+ t.target === "openapi-3.0" ? (s.ref = o.innerType, n.nullable = !0) : n.anyOf = [i, { type: "null" }];
3672
+ }, Hu = (e, t, n, r) => {
3673
+ const o = e._zod.def;
3674
+ S(o.innerType, t, r);
3675
+ const i = t.seen.get(e);
3676
+ i.ref = o.innerType;
3677
+ }, yt = Symbol();
3678
+ function fr(e, t, n, r, o) {
3679
+ let i = !1;
3680
+ const s = JSON.stringify(e, (u, c) => typeof c != "bigint" ? c : (i = !0, null));
3681
+ return i ? (Y(t, n, r, o, "BigInt defaults cannot be represented in JSON Schema"), yt) : JSON.parse(s);
3682
+ }
3683
+ const Qu = (e, t, n, r) => {
3684
+ const o = e._zod.def;
3685
+ S(o.innerType, t, r);
3686
+ const i = t.seen.get(e);
3687
+ i.ref = o.innerType;
3688
+ const s = fr(o.defaultValue, e, t, n, r);
3689
+ s !== yt && (n.default = s);
3690
+ }, ec = (e, t, n, r) => {
3691
+ const o = e._zod.def;
3692
+ S(o.innerType, t, r);
3693
+ const i = t.seen.get(e);
3694
+ if (i.ref = o.innerType, t.io !== "input")
3695
+ return;
3696
+ const s = fr(o.defaultValue, e, t, n, r);
3697
+ s !== yt && (n._prefault = s);
3698
+ }, tc = (e, t, n, r) => {
3699
+ const o = e._zod.def;
3700
+ S(o.innerType, t, r);
3701
+ const i = t.seen.get(e);
3702
+ i.ref = o.innerType;
3703
+ let s;
3704
+ try {
3705
+ s = o.catchValue(void 0);
3706
+ } catch {
3707
+ Y(e, t, n, r, "Dynamic catch values are not supported in JSON Schema");
3708
+ return;
3709
+ }
3710
+ n.default = s;
3711
+ }, nc = (e, t, n, r) => {
3712
+ const o = e._zod.def, i = o.in._zod.traits.has("$ZodTransform"), s = t.io === "input" ? i ? o.out : o.in : o.out;
3713
+ S(s, t, r);
3714
+ const u = t.seen.get(e);
3715
+ u.ref = s;
3716
+ }, rc = (e, t, n, r) => {
3717
+ const o = e._zod.def;
3718
+ S(o.innerType, t, r);
3719
+ const i = t.seen.get(e);
3720
+ i.ref = o.innerType, n.readOnly = !0;
3721
+ }, lr = (e, t, n, r) => {
3722
+ const o = e._zod.def;
3723
+ S(o.innerType, t, r);
3724
+ const i = t.seen.get(e);
3725
+ i.ref = o.innerType;
3726
+ }, oc = (e, t, n, r) => {
3727
+ const o = e._zod.innerType;
3728
+ S(o, t, r);
3729
+ const i = t.seen.get(e);
3730
+ i.ref = o;
3731
+ };
3732
+ function an(e, t) {
3733
+ try {
3734
+ var n = e();
3735
+ } catch (r) {
3736
+ return t(r);
3737
+ }
3738
+ return n && n.then ? n.then(void 0, t) : n;
3739
+ }
3740
+ function ic(e, t) {
3741
+ for (var n = {}; e.length; ) {
3742
+ var r = e[0], o = r.code, i = r.message, s = r.path.join(".");
3743
+ if (!n[s]) if ("unionErrors" in r) {
3744
+ var u = r.unionErrors[0].errors[0];
3745
+ n[s] = { message: u.message, type: u.code };
3746
+ } else n[s] = { message: i, type: o };
3747
+ if ("unionErrors" in r && r.unionErrors.forEach(function(f) {
3748
+ return f.errors.forEach(function(d) {
3749
+ return e.push(d);
3750
+ });
3751
+ }), t) {
3752
+ var c = n[s].types, a = c && c[r.code];
3753
+ n[s] = _n(s, t, n, o, a ? [].concat(a, r.message) : r.message);
3754
+ }
3755
+ e.shift();
3756
+ }
3757
+ return n;
3758
+ }
3759
+ function sc(e, t) {
3760
+ for (var n = {}; e.length; ) {
3761
+ var r = e[0], o = r.code, i = r.message, s = r.path.join(".");
3762
+ if (!n[s]) if (r.code === "invalid_union" && r.errors.length > 0) {
3763
+ var u = r.errors[0][0];
3764
+ n[s] = { message: u.message, type: u.code };
3765
+ } else n[s] = { message: i, type: o };
3766
+ if (r.code === "invalid_union" && r.errors.forEach(function(f) {
3767
+ return f.forEach(function(d) {
3768
+ return e.push(d);
3769
+ });
3770
+ }), t) {
3771
+ var c = n[s].types, a = c && c[r.code];
3772
+ n[s] = _n(s, t, n, o, a ? [].concat(a, r.message) : r.message);
3773
+ }
3774
+ e.shift();
3775
+ }
3776
+ return n;
3777
+ }
3778
+ function uc(e, t, n) {
3779
+ if (n === void 0 && (n = {}), (function(r) {
3780
+ return "_def" in r && typeof r._def == "object" && "typeName" in r._def;
3781
+ })(e)) return function(r, o, i) {
3782
+ try {
3783
+ return Promise.resolve(an(function() {
3784
+ return Promise.resolve(e[n.mode === "sync" ? "parse" : "parseAsync"](r, t)).then(function(s) {
3785
+ return i.shouldUseNativeValidation && Ye({}, i), { errors: {}, values: n.raw ? Object.assign({}, r) : s };
3786
+ });
3787
+ }, function(s) {
3788
+ if ((function(u) {
3789
+ return Array.isArray(u?.issues);
3790
+ })(s)) return { values: {}, errors: Zt(ic(s.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
3791
+ throw s;
3792
+ }));
3793
+ } catch (s) {
3794
+ return Promise.reject(s);
3795
+ }
3796
+ };
3797
+ if ((function(r) {
3798
+ return "_zod" in r && typeof r._zod == "object";
3799
+ })(e)) return function(r, o, i) {
3800
+ try {
3801
+ return Promise.resolve(an(function() {
3802
+ return Promise.resolve((n.mode === "sync" ? lo : po)(e, r, t)).then(function(s) {
3803
+ return i.shouldUseNativeValidation && Ye({}, i), { errors: {}, values: n.raw ? Object.assign({}, r) : s };
3804
+ });
3805
+ }, function(s) {
3806
+ if ((function(u) {
3807
+ return u instanceof In;
3808
+ })(s)) return { values: {}, errors: Zt(sc(s.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
3809
+ throw s;
3810
+ }));
3811
+ } catch (s) {
3812
+ return Promise.reject(s);
3813
+ }
3814
+ };
3815
+ throw new Error("Invalid input: not a Zod schema");
3816
+ }
3817
+ function Ea(e, t) {
3818
+ "use no memo";
3819
+ const r = uc(e);
3820
+ return zr({ ...t, resolver: r });
3821
+ }
3822
+ /**
3823
+ * @license lucide-react v0.575.0 - ISC
3824
+ *
3825
+ * This source code is licensed under the ISC license.
3826
+ * See the LICENSE file in the root directory of this source tree.
3827
+ */
3828
+ const cc = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Ia = kr("check", cc);
3829
+ var M, B, T, x, L, Ze, it, gn, ac = (gn = class extends $r {
3830
+ constructor(t, n) {
3831
+ super();
3832
+ ee(this, L);
3833
+ ee(this, M);
3834
+ ee(this, B);
3835
+ ee(this, T);
3836
+ ee(this, x);
3837
+ te(this, M, t), this.setOptions(n), this.bindMethods(), ne(this, L, Ze).call(this);
3838
+ }
3839
+ bindMethods() {
3840
+ this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
3841
+ }
3842
+ setOptions(t) {
3843
+ const n = this.options;
3844
+ this.options = $(this, M).defaultMutationOptions(t), Or(this.options, n) || $(this, M).getMutationCache().notify({
3845
+ type: "observerOptionsUpdated",
3846
+ mutation: $(this, T),
3847
+ observer: this
3848
+ }), n?.mutationKey && this.options.mutationKey && Ot(n.mutationKey) !== Ot(this.options.mutationKey) ? this.reset() : $(this, T)?.state.status === "pending" && $(this, T).setOptions(this.options);
3849
+ }
3850
+ onUnsubscribe() {
3851
+ this.hasListeners() || $(this, T)?.removeObserver(this);
3852
+ }
3853
+ onMutationUpdate(t) {
3854
+ ne(this, L, Ze).call(this), ne(this, L, it).call(this, t);
3855
+ }
3856
+ getCurrentResult() {
3857
+ return $(this, B);
3858
+ }
3859
+ reset() {
3860
+ $(this, T)?.removeObserver(this), te(this, T, void 0), ne(this, L, Ze).call(this), ne(this, L, it).call(this);
3861
+ }
3862
+ mutate(t, n) {
3863
+ return te(this, x, n), $(this, T)?.removeObserver(this), te(this, T, $(this, M).getMutationCache().build($(this, M), this.options)), $(this, T).addObserver(this), $(this, T).execute(t);
3864
+ }
3865
+ }, M = new WeakMap(), B = new WeakMap(), T = new WeakMap(), x = new WeakMap(), L = new WeakSet(), Ze = function() {
3866
+ const t = $(this, T)?.state ?? Er();
3867
+ te(this, B, {
3868
+ ...t,
3869
+ isPending: t.status === "pending",
3870
+ isSuccess: t.status === "success",
3871
+ isError: t.status === "error",
3872
+ isIdle: t.status === "idle",
3873
+ mutate: this.mutate,
3874
+ reset: this.reset
3875
+ });
3876
+ }, it = function(t) {
3877
+ vn.batch(() => {
3878
+ if ($(this, x) && this.hasListeners()) {
3879
+ const n = $(this, B).variables, r = $(this, B).context, o = {
3880
+ client: $(this, M),
3881
+ meta: this.options.meta,
3882
+ mutationKey: this.options.mutationKey
3883
+ };
3884
+ if (t?.type === "success") {
3885
+ try {
3886
+ $(this, x).onSuccess?.(
3887
+ t.data,
3888
+ n,
3889
+ r,
3890
+ o
3891
+ );
3892
+ } catch (i) {
3893
+ Promise.reject(i);
3894
+ }
3895
+ try {
3896
+ $(this, x).onSettled?.(
3897
+ t.data,
3898
+ null,
3899
+ n,
3900
+ r,
3901
+ o
3902
+ );
3903
+ } catch (i) {
3904
+ Promise.reject(i);
3905
+ }
3906
+ } else if (t?.type === "error") {
3907
+ try {
3908
+ $(this, x).onError?.(
3909
+ t.error,
3910
+ n,
3911
+ r,
3912
+ o
3913
+ );
3914
+ } catch (i) {
3915
+ Promise.reject(i);
3916
+ }
3917
+ try {
3918
+ $(this, x).onSettled?.(
3919
+ void 0,
3920
+ t.error,
3921
+ n,
3922
+ r,
3923
+ o
3924
+ );
3925
+ } catch (i) {
3926
+ Promise.reject(i);
3927
+ }
3928
+ }
3929
+ }
3930
+ this.listeners.forEach((n) => {
3931
+ n($(this, B));
3932
+ });
3933
+ });
3934
+ }, gn);
3935
+ function Ta(e, t) {
3936
+ const n = Sr(), [r] = fe.useState(
3937
+ () => new ac(
3938
+ n,
3939
+ e
3940
+ )
3941
+ );
3942
+ fe.useEffect(() => {
3943
+ r.setOptions(e);
3944
+ }, [r, e]);
3945
+ const o = fe.useSyncExternalStore(
3946
+ fe.useCallback(
3947
+ (s) => r.subscribe(vn.batchCalls(s)),
3948
+ [r]
3949
+ ),
3950
+ () => r.getCurrentResult(),
3951
+ () => r.getCurrentResult()
3952
+ ), i = fe.useCallback(
3953
+ (s, u) => {
3954
+ r.mutate(s, u).catch(Zr);
3955
+ },
3956
+ [r]
3957
+ );
3958
+ if (o.error && Pr(r.options.throwOnError, [o.error]))
3959
+ throw o.error;
3960
+ return { ...o, mutate: i, mutateAsync: o.mutate };
3961
+ }
3962
+ const fn = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
3963
+ function $e(e, t, n) {
3964
+ Object.defineProperty(e, t, {
3965
+ configurable: !0,
3966
+ enumerable: !1,
3967
+ get() {
3968
+ const r = n(this);
3969
+ return Object.defineProperty(this, t, { value: r, configurable: !0, writable: !0 }), r;
3970
+ },
3971
+ set(r) {
3972
+ Object.defineProperty(this, t, { value: r, configurable: !0, writable: !0 });
3973
+ }
3974
+ });
3975
+ }
3976
+ const fc = (e, t) => {
3977
+ In.init(e, t), e.name = "ZodError";
3978
+ const n = Object.getPrototypeOf(e);
3979
+ fn.has(n) || (fn.add(n), $e(n, "format", (r) => (o) => fo(r, o)), $e(n, "flatten", (r) => (o) => ao(r, o)), $e(n, "addIssue", (r) => (o) => {
3980
+ r.issues.push(o), r.message = JSON.stringify(r.issues, He, 2);
3981
+ }), $e(n, "addIssues", (r) => (o) => {
3982
+ r.issues.push(...o), r.message = JSON.stringify(r.issues, He, 2);
3983
+ }), Object.defineProperty(n, "isEmpty", {
3984
+ configurable: !0,
3985
+ enumerable: !1,
3986
+ get() {
3987
+ return this.issues.length === 0;
3988
+ }
3989
+ }));
3990
+ }, C = /* @__PURE__ */ l("ZodError", fc, void 0, {
3991
+ Parent: Error
3992
+ }), lc = /* @__PURE__ */ Ce(C), dc = /* @__PURE__ */ De(C), pc = /* @__PURE__ */ dt(C), hc = /* @__PURE__ */ pt(C), mc = /* @__PURE__ */ yo(C), gc = /* @__PURE__ */ bo(C), _c = /* @__PURE__ */ wo(C), vc = /* @__PURE__ */ zo(C), yc = /* @__PURE__ */ ko(C), bc = /* @__PURE__ */ $o(C), wc = /* @__PURE__ */ Oo(C), zc = /* @__PURE__ */ So(C);
3993
+ function kc() {
3994
+ R.localeError || F(Ts());
3995
+ }
3996
+ function be() {
3997
+ R.memoizer || F({ memoizer: Ps() });
3998
+ }
3999
+ const z = /* @__PURE__ */ l("ZodType", (e, t) => (kc(), w.init(e, t), e.def = t, e.type = t.type, e), {
4000
+ check(...e) {
4001
+ const t = this.def;
4002
+ return this.clone(N(t, {
4003
+ checks: [
4004
+ ...t.checks ?? [],
4005
+ ...e.map((n) => typeof n == "function" ? { _zod: { check: n, def: { check: "custom" }, onattach: [] } } : n)
4006
+ ]
4007
+ }), { parent: !0 });
4008
+ },
4009
+ with(...e) {
4010
+ return this.check(...e);
4011
+ },
4012
+ clone(e, t) {
4013
+ return X(this, e, t);
4014
+ },
4015
+ brand() {
4016
+ return this;
4017
+ },
4018
+ register(e, t) {
4019
+ return e.add(this, t), this;
4020
+ },
4021
+ refine(e, t) {
4022
+ return this.check(ka(e, t));
4023
+ },
4024
+ superRefine(e, t) {
4025
+ return this.check($a(e, t));
4026
+ },
4027
+ overwrite(e) {
4028
+ return this.check(/* @__PURE__ */ ue(e));
4029
+ },
4030
+ optional() {
4031
+ return pn(this);
4032
+ },
4033
+ exactOptional() {
4034
+ return fa(this);
4035
+ },
4036
+ nullable() {
4037
+ return hn(this);
4038
+ },
4039
+ nullish() {
4040
+ return pn(hn(this));
4041
+ },
4042
+ nonoptional(e) {
4043
+ return ga(this, e);
4044
+ },
4045
+ array() {
4046
+ return ea(this);
4047
+ },
4048
+ or(e) {
4049
+ return ta([this, e]);
4050
+ },
4051
+ and(e) {
4052
+ return oa(this, e);
4053
+ },
4054
+ transform(e) {
4055
+ return mn(this, aa(e));
4056
+ },
4057
+ default(e) {
4058
+ return pa(this, e);
4059
+ },
4060
+ prefault(e) {
4061
+ return ma(this, e);
4062
+ },
4063
+ catch(e) {
4064
+ return va(this, e);
4065
+ },
4066
+ pipe(e) {
4067
+ return mn(this, e);
4068
+ },
4069
+ readonly() {
4070
+ return wa(this);
4071
+ },
4072
+ describe(e) {
4073
+ const t = this.clone();
4074
+ return pe.add(t, { description: e }), t;
4075
+ },
4076
+ meta(...e) {
4077
+ if (e.length === 0)
4078
+ return pe.get(this);
4079
+ const t = this.clone();
4080
+ return pe.add(t, e[0]), t;
4081
+ },
4082
+ isOptional() {
4083
+ return this.safeParse(void 0).success;
4084
+ },
4085
+ isNullable() {
4086
+ return this.safeParse(null).success;
4087
+ },
4088
+ apply(e, ...t) {
4089
+ return t.length === 0 ? e(this) : e(this, ...t);
4090
+ },
4091
+ // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
4092
+ get "~standard"() {
4093
+ return Sn(this, "~standard", {
4094
+ ...Dn(this),
4095
+ jsonSchema: {
4096
+ input: Ae(this, "input"),
4097
+ output: Ae(this, "output")
4098
+ }
4099
+ });
4100
+ },
4101
+ set "~standard"(e) {
4102
+ q(this, "~standard", e);
4103
+ },
4104
+ parse: function e(t, n) {
4105
+ return lc(this, t, n, { callee: e });
4106
+ },
4107
+ parseAsync: async function e(t, n) {
4108
+ return await dc(this, t, n, { callee: e });
4109
+ },
4110
+ safeParse(e, t) {
4111
+ return pc(this, e, t);
4112
+ },
4113
+ async safeParseAsync(e, t) {
4114
+ return hc(this, e, t);
4115
+ },
4116
+ // `spa` is an alias: same function object as `safeParseAsync`, as before.
4117
+ get spa() {
4118
+ return this?.safeParseAsync;
4119
+ },
4120
+ set spa(e) {
4121
+ q(this, "spa", e);
4122
+ },
4123
+ validate(e, t) {
4124
+ return go(this, e, t);
4125
+ },
4126
+ validateAsync(e, t) {
4127
+ return vo(this, e, t);
4128
+ },
4129
+ encode: function e(t, n) {
4130
+ return mc(this, t, n, { callee: e });
4131
+ },
4132
+ decode: function e(t, n) {
4133
+ return gc(this, t, n, { callee: e });
4134
+ },
4135
+ encodeAsync: async function e(t, n) {
4136
+ return await _c(this, t, n, { callee: e });
4137
+ },
4138
+ decodeAsync: async function e(t, n) {
4139
+ return await vc(this, t, n, { callee: e });
4140
+ },
4141
+ safeEncode(e, t) {
4142
+ return yc(this, e, t);
4143
+ },
4144
+ safeDecode(e, t) {
4145
+ return bc(this, e, t);
4146
+ },
4147
+ async safeEncodeAsync(e, t) {
4148
+ return wc(this, e, t);
4149
+ },
4150
+ async safeDecodeAsync(e, t) {
4151
+ return zc(this, e, t);
4152
+ },
4153
+ toJSONSchema(e) {
4154
+ return Eu(this, {})(e);
4155
+ },
4156
+ // Reads through to the registry on every access, so it must not cache.
4157
+ get description() {
4158
+ return pe.get(this)?.description;
4159
+ },
4160
+ // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
4161
+ get _def() {
4162
+ return this._zod.def;
4163
+ }
4164
+ }), dr = /* @__PURE__ */ l(
4165
+ "_ZodString",
4166
+ (e, t) => {
4167
+ gt.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Nu(e, n, r);
4168
+ },
4169
+ /* @__PURE__ */ Zn({
4170
+ format: (e) => j(e).format ?? null,
4171
+ minLength: (e) => j(e).minimum ?? null,
4172
+ maxLength: (e) => j(e).maximum ?? null
4173
+ }, {
4174
+ regex(...e) {
4175
+ return this.check(/* @__PURE__ */ du(...e));
4176
+ },
4177
+ includes(...e) {
4178
+ return this.check(/* @__PURE__ */ mu(...e));
4179
+ },
4180
+ startsWith(...e) {
4181
+ return this.check(/* @__PURE__ */ gu(...e));
4182
+ },
4183
+ endsWith(...e) {
4184
+ return this.check(/* @__PURE__ */ _u(...e));
4185
+ },
4186
+ min(...e) {
4187
+ return this.check(/* @__PURE__ */ Te(...e));
4188
+ },
4189
+ max(...e) {
4190
+ return this.check(/* @__PURE__ */ Hn(...e));
4191
+ },
4192
+ length(...e) {
4193
+ return this.check(/* @__PURE__ */ Qn(...e));
4194
+ },
4195
+ nonempty(...e) {
4196
+ return this.check(/* @__PURE__ */ Te(1, ...e));
4197
+ },
4198
+ lowercase(e) {
4199
+ return this.check(/* @__PURE__ */ pu(e));
4200
+ },
4201
+ uppercase(e) {
4202
+ return this.check(/* @__PURE__ */ hu(e));
4203
+ },
4204
+ trim() {
4205
+ return this.check(/* @__PURE__ */ yu());
4206
+ },
4207
+ normalize(...e) {
4208
+ return this.check(/* @__PURE__ */ vu(...e));
4209
+ },
4210
+ toLowerCase() {
4211
+ return this.check(/* @__PURE__ */ bu());
4212
+ },
4213
+ toUpperCase() {
4214
+ return this.check(/* @__PURE__ */ wu());
4215
+ },
4216
+ slugify() {
4217
+ return this.check(/* @__PURE__ */ zu());
4218
+ }
4219
+ })
4220
+ ), $c = /* @__PURE__ */ l("ZodString", (e, t) => {
4221
+ gt.init(e, t), dr.init(e, t);
4222
+ }, {
4223
+ email(e) {
4224
+ return this.check(/* @__PURE__ */ Yn(pr, e));
4225
+ },
4226
+ url(e) {
4227
+ return this.check(/* @__PURE__ */ Fs(Tc, e));
4228
+ },
4229
+ jwt(e) {
4230
+ return this.check(/* @__PURE__ */ eu(Bc, e));
4231
+ },
4232
+ emoji(e) {
4233
+ return this.check(/* @__PURE__ */ Ms(Ac, e));
4234
+ },
4235
+ guid(e) {
4236
+ return this.check(/* @__PURE__ */ Rs(Ic, e));
4237
+ },
4238
+ uuid(e) {
4239
+ return this.check(/* @__PURE__ */ Xn(he, e));
4240
+ },
4241
+ uuidv4(e) {
4242
+ return this.check(/* @__PURE__ */ Cs(he, e));
4243
+ },
4244
+ uuidv6(e) {
4245
+ return this.check(/* @__PURE__ */ Ds(he, e));
4246
+ },
4247
+ uuidv7(e) {
4248
+ return this.check(/* @__PURE__ */ Us(he, e));
4249
+ },
4250
+ nanoid(e) {
4251
+ return this.check(/* @__PURE__ */ xs(Nc, e));
4252
+ },
4253
+ cuid(e) {
4254
+ return this.check(/* @__PURE__ */ Ls(jc, e));
4255
+ },
4256
+ cuid2(e) {
4257
+ return this.check(/* @__PURE__ */ Js(Rc, e));
4258
+ },
4259
+ ulid(e) {
4260
+ return this.check(/* @__PURE__ */ Ks(Cc, e));
4261
+ },
4262
+ base64(e) {
4263
+ return this.check(/* @__PURE__ */ Xs(Jc, e));
4264
+ },
4265
+ base64url(e) {
4266
+ return this.check(/* @__PURE__ */ Hs(Kc, e));
4267
+ },
4268
+ xid(e) {
4269
+ return this.check(/* @__PURE__ */ Vs(Dc, e));
4270
+ },
4271
+ ksuid(e) {
4272
+ return this.check(/* @__PURE__ */ Bs(Uc, e));
4273
+ },
4274
+ ipv4(e) {
4275
+ return this.check(/* @__PURE__ */ Ws(Fc, e));
4276
+ },
4277
+ ipv6(e) {
4278
+ return this.check(/* @__PURE__ */ Gs(Mc, e));
4279
+ },
4280
+ cidrv4(e) {
4281
+ return this.check(/* @__PURE__ */ qs(xc, e));
4282
+ },
4283
+ cidrv6(e) {
4284
+ return this.check(/* @__PURE__ */ Ys(Lc, e));
4285
+ },
4286
+ e164(e) {
4287
+ return this.check(/* @__PURE__ */ Qs(Vc, e));
4288
+ },
4289
+ datetime(e) {
4290
+ return this.check(/* @__PURE__ */ tu(Sc, e));
4291
+ },
4292
+ date(e) {
4293
+ return this.check(/* @__PURE__ */ nu(Zc, e));
4294
+ },
4295
+ time(e) {
4296
+ return this.check(/* @__PURE__ */ ru(Pc, e));
4297
+ },
4298
+ duration(e) {
4299
+ return this.check(/* @__PURE__ */ ou(Ec, e));
4300
+ }
4301
+ });
4302
+ function Oc(e) {
4303
+ return /* @__PURE__ */ js($c, e);
4304
+ }
4305
+ const Z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
4306
+ O.init(e, t), dr.init(e, t);
4307
+ }), Sc = /* @__PURE__ */ l("ZodISODateTime", (e, t) => {
4308
+ ji.init(e, t), Z.init(e, t);
4309
+ }), Zc = /* @__PURE__ */ l("ZodISODate", (e, t) => {
4310
+ Ri.init(e, t), Z.init(e, t);
4311
+ }), Pc = /* @__PURE__ */ l("ZodISOTime", (e, t) => {
4312
+ Ci.init(e, t), Z.init(e, t);
4313
+ }), Ec = /* @__PURE__ */ l("ZodISODuration", (e, t) => {
4314
+ Di.init(e, t), Z.init(e, t);
4315
+ }), pr = /* @__PURE__ */ l("ZodEmail", (e, t) => {
4316
+ bi.init(e, t), Z.init(e, t);
4317
+ });
4318
+ function Aa(e) {
4319
+ return /* @__PURE__ */ Yn(pr, e);
4320
+ }
4321
+ const Ic = /* @__PURE__ */ l("ZodGUID", (e, t) => {
4322
+ vi.init(e, t), Z.init(e, t);
4323
+ }), he = /* @__PURE__ */ l("ZodUUID", (e, t) => {
4324
+ yi.init(e, t), Z.init(e, t);
4325
+ });
4326
+ function Na(e) {
4327
+ return /* @__PURE__ */ Xn(he, e);
4328
+ }
4329
+ const Tc = /* @__PURE__ */ l("ZodURL", (e, t) => {
4330
+ Si.init(e, t), Z.init(e, t);
4331
+ }), Ac = /* @__PURE__ */ l("ZodEmoji", (e, t) => {
4332
+ Zi.init(e, t), Z.init(e, t);
4333
+ }), Nc = /* @__PURE__ */ l("ZodNanoID", (e, t) => {
4334
+ Pi.init(e, t), Z.init(e, t);
4335
+ }), jc = /* @__PURE__ */ l("ZodCUID", (e, t) => {
4336
+ Ei.init(e, t), Z.init(e, t);
4337
+ }), Rc = /* @__PURE__ */ l("ZodCUID2", (e, t) => {
4338
+ Ii.init(e, t), Z.init(e, t);
4339
+ }), Cc = /* @__PURE__ */ l("ZodULID", (e, t) => {
4340
+ Ti.init(e, t), Z.init(e, t);
4341
+ }), Dc = /* @__PURE__ */ l("ZodXID", (e, t) => {
4342
+ Ai.init(e, t), Z.init(e, t);
4343
+ }), Uc = /* @__PURE__ */ l("ZodKSUID", (e, t) => {
4344
+ Ni.init(e, t), Z.init(e, t);
4345
+ }), Fc = /* @__PURE__ */ l("ZodIPv4", (e, t) => {
4346
+ Ui.init(e, t), Z.init(e, t);
4347
+ }), Mc = /* @__PURE__ */ l("ZodIPv6", (e, t) => {
4348
+ Mi.init(e, t), Z.init(e, t);
4349
+ }), xc = /* @__PURE__ */ l("ZodCIDRv4", (e, t) => {
4350
+ xi.init(e, t), Z.init(e, t);
4351
+ }), Lc = /* @__PURE__ */ l("ZodCIDRv6", (e, t) => {
4352
+ Ji.init(e, t), Z.init(e, t);
4353
+ }), Jc = /* @__PURE__ */ l("ZodBase64", (e, t) => {
4354
+ Ki.init(e, t), Z.init(e, t);
4355
+ }), Kc = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
4356
+ Bi.init(e, t), Z.init(e, t);
4357
+ }), Vc = /* @__PURE__ */ l("ZodE164", (e, t) => {
4358
+ Wi.init(e, t), Z.init(e, t);
4359
+ }), Bc = /* @__PURE__ */ l("ZodJWT", (e, t) => {
4360
+ qi.init(e, t), Z.init(e, t);
4361
+ }), hr = /* @__PURE__ */ l(
4362
+ "ZodNumber",
4363
+ (e, t) => {
4364
+ Jn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ju(e, n, r, o), e.isFinite = !0;
4365
+ },
4366
+ /* @__PURE__ */ Zn({
4367
+ minValue: (e) => {
4368
+ const { minimum: t, exclusiveMinimum: n } = j(e);
4369
+ return Math.max(t ?? Number.NEGATIVE_INFINITY, n ?? Number.NEGATIVE_INFINITY);
4370
+ },
4371
+ maxValue: (e) => {
4372
+ const { maximum: t, exclusiveMaximum: n } = j(e);
4373
+ return Math.min(t ?? Number.POSITIVE_INFINITY, n ?? Number.POSITIVE_INFINITY);
4374
+ },
4375
+ isInt: (e) => {
4376
+ const { isInt: t, multipleOf: n } = j(e);
4377
+ return !!t || !!n?.some(Number.isSafeInteger);
4378
+ },
4379
+ format: (e) => j(e).format ?? null
4380
+ }, {
4381
+ gt(e, t) {
4382
+ return this.check(/* @__PURE__ */ Qt(e, t));
4383
+ },
4384
+ gte(e, t) {
4385
+ return this.check(/* @__PURE__ */ Ge(e, t));
4386
+ },
4387
+ min(e, t) {
4388
+ return this.check(/* @__PURE__ */ Ge(e, t));
4389
+ },
4390
+ lt(e, t) {
4391
+ return this.check(/* @__PURE__ */ Ht(e, t));
4392
+ },
4393
+ lte(e, t) {
4394
+ return this.check(/* @__PURE__ */ We(e, t));
4395
+ },
4396
+ max(e, t) {
4397
+ return this.check(/* @__PURE__ */ We(e, t));
4398
+ },
4399
+ int(e) {
4400
+ return this.check(ln(e));
4401
+ },
4402
+ safe(e) {
4403
+ return this.check(ln(e));
4404
+ },
4405
+ positive(e) {
4406
+ return this.check(/* @__PURE__ */ Qt(0, e));
4407
+ },
4408
+ nonnegative(e) {
4409
+ return this.check(/* @__PURE__ */ Ge(0, e));
4410
+ },
4411
+ negative(e) {
4412
+ return this.check(/* @__PURE__ */ Ht(0, e));
4413
+ },
4414
+ nonpositive(e) {
4415
+ return this.check(/* @__PURE__ */ We(0, e));
4416
+ },
4417
+ multipleOf(e, t) {
4418
+ return this.check(/* @__PURE__ */ en(e, t));
4419
+ },
4420
+ step(e, t) {
4421
+ return this.check(/* @__PURE__ */ en(e, t));
4422
+ },
4423
+ finite() {
4424
+ return this;
4425
+ }
4426
+ })
4427
+ );
4428
+ function ja(e) {
4429
+ return /* @__PURE__ */ iu(hr, e);
4430
+ }
4431
+ const Wc = /* @__PURE__ */ l("ZodNumberFormat", (e, t) => {
4432
+ Yi.init(e, t), hr.init(e, t);
4433
+ });
4434
+ function ln(e) {
4435
+ return /* @__PURE__ */ su(Wc, e);
4436
+ }
4437
+ const Gc = /* @__PURE__ */ l("ZodBoolean", (e, t) => {
4438
+ Xi.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ru(e, n, r);
4439
+ });
4440
+ function Ra(e) {
4441
+ return /* @__PURE__ */ uu(Gc, e);
4442
+ }
4443
+ const qc = /* @__PURE__ */ l("ZodNull", (e, t) => {
4444
+ Hi.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Cu(e, n, r);
4445
+ });
4446
+ function Ca(e) {
4447
+ return /* @__PURE__ */ cu(qc, e);
4448
+ }
4449
+ const Yc = /* @__PURE__ */ l("ZodAny", (e, t) => {
4450
+ Qi.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Uu();
4451
+ });
4452
+ function Da() {
4453
+ return /* @__PURE__ */ au(Yc);
4454
+ }
4455
+ const Xc = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
4456
+ es.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fu();
4457
+ });
4458
+ function st() {
4459
+ return /* @__PURE__ */ fu(Xc);
4460
+ }
4461
+ const Hc = /* @__PURE__ */ l("ZodNever", (e, t) => {
4462
+ ts.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Du(e, n, r);
4463
+ });
4464
+ function mr(e) {
4465
+ return /* @__PURE__ */ lu(Hc, e);
4466
+ }
4467
+ const Qc = /* @__PURE__ */ l("ZodArray", (e, t) => {
4468
+ be(), ns.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ku(e, n, r, o), e.element = t.element;
4469
+ }, {
4470
+ min(e, t) {
4471
+ return this.check(/* @__PURE__ */ Te(e, t));
4472
+ },
4473
+ nonempty(e) {
4474
+ return this.check(/* @__PURE__ */ Te(1, e));
4475
+ },
4476
+ max(e, t) {
4477
+ return this.check(/* @__PURE__ */ Hn(e, t));
4478
+ },
4479
+ length(e, t) {
4480
+ return this.check(/* @__PURE__ */ Qn(e, t));
4481
+ },
4482
+ unwrap() {
4483
+ return this.element;
4484
+ }
4485
+ });
4486
+ function ea(e, t) {
4487
+ return /* @__PURE__ */ ku(Qc, e, t);
4488
+ }
4489
+ const bt = /* @__PURE__ */ l("ZodObject", (e, t) => {
4490
+ be(), is.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Vu(e, n, r, o), to(e, "shape", (n) => n._zod.def.shape, !1);
4491
+ }, {
4492
+ keyof() {
4493
+ return sa(Object.keys(this._zod.def.shape));
4494
+ },
4495
+ catchall(e) {
4496
+ return this.clone(N(this._zod.def, { catchall: e }));
4497
+ },
4498
+ passthrough() {
4499
+ return this.clone(N(this._zod.def, { catchall: st() }));
4500
+ },
4501
+ loose() {
4502
+ return this.clone(N(this._zod.def, { catchall: st() }));
4503
+ },
4504
+ strict() {
4505
+ return this.clone(N(this._zod.def, { catchall: mr() }));
4506
+ },
4507
+ strip() {
4508
+ return this.clone(N(this._zod.def, { catchall: void 0 }));
4509
+ },
4510
+ extend(e) {
4511
+ return Kr(this, e);
4512
+ },
4513
+ safeExtend(e) {
4514
+ return Vr(this, e);
4515
+ },
4516
+ merge(e) {
4517
+ return Br(this, e);
4518
+ },
4519
+ pick(e) {
4520
+ return Lr(this, e);
4521
+ },
4522
+ omit(e) {
4523
+ return Jr(this, e);
4524
+ },
4525
+ partial(...e) {
4526
+ return Tt(wt, this, e[0]);
4527
+ },
4528
+ exactPartial(...e) {
4529
+ return Tt(_r, this, e[0], "exactPartial");
4530
+ },
4531
+ required(...e) {
4532
+ return Wr(vr, this, e[0]);
4533
+ }
4534
+ });
4535
+ function Ua(e, t) {
4536
+ const n = {
4537
+ type: "object",
4538
+ shape: e ?? {},
4539
+ ...g(t)
4540
+ };
4541
+ return new bt(n);
4542
+ }
4543
+ function Fa(e, t) {
4544
+ return new bt({
4545
+ type: "object",
4546
+ shape: e,
4547
+ catchall: mr(),
4548
+ ...g(t)
4549
+ });
4550
+ }
4551
+ function Ma(e, t) {
4552
+ return new bt({
4553
+ type: "object",
4554
+ shape: e,
4555
+ catchall: st(),
4556
+ ...g(t)
4557
+ });
4558
+ }
4559
+ const gr = /* @__PURE__ */ l("ZodUnion", (e, t) => {
4560
+ Bn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Bu(e, n, r, o), e.options = t.options;
4561
+ });
4562
+ function ta(e, t) {
4563
+ return new gr({
4564
+ type: "union",
4565
+ options: e,
4566
+ ...g(t)
4567
+ });
4568
+ }
4569
+ const na = /* @__PURE__ */ l("ZodDiscriminatedUnion", (e, t) => {
4570
+ gr.init(e, t), us.init(e, t);
4571
+ });
4572
+ function xa(e, t, n) {
4573
+ return new na({
4574
+ type: "union",
4575
+ options: t,
4576
+ discriminator: e,
4577
+ ...g(n)
4578
+ });
4579
+ }
4580
+ const ra = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
4581
+ cs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Wu(e, n, r, o);
4582
+ });
4583
+ function oa(e, t) {
4584
+ return new ra({
4585
+ type: "intersection",
4586
+ left: e,
4587
+ right: t
4588
+ });
4589
+ }
4590
+ const ia = /* @__PURE__ */ l("ZodTuple", (e, t) => {
4591
+ be(), as.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Gu(e, n, r, o);
4592
+ }, {
4593
+ rest(e) {
4594
+ return this.clone({
4595
+ ...this._zod.def,
4596
+ rest: e
4597
+ });
4598
+ },
4599
+ partial() {
4600
+ const e = this._zod.def;
4601
+ if (e.checks?.length)
4602
+ throw new Error(".partial() cannot be used on tuple schemas containing refinements");
4603
+ return this.clone({
4604
+ ...e,
4605
+ items: e.items.map((t) => new wt({ type: "optional", innerType: t }))
4606
+ });
4607
+ }
4608
+ });
4609
+ function La(e, t, n) {
4610
+ const r = t instanceof w, o = r ? n : t, i = r ? t : null;
4611
+ return new ia({
4612
+ type: "tuple",
4613
+ items: e,
4614
+ rest: i,
4615
+ ...g(o)
4616
+ });
4617
+ }
4618
+ const dn = /* @__PURE__ */ l("ZodRecord", (e, t) => {
4619
+ be(), fs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Yu(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
4620
+ });
4621
+ function Ja(e, t, n) {
4622
+ return !t || !t._zod ? new dn({
4623
+ type: "record",
4624
+ keyType: Oc(),
4625
+ valueType: e,
4626
+ ...g(t)
4627
+ }) : new dn({
4628
+ type: "record",
4629
+ keyType: e,
4630
+ valueType: t,
4631
+ ...g(n)
4632
+ });
4633
+ }
4634
+ const ut = /* @__PURE__ */ l("ZodEnum", (e, t) => {
4635
+ ls.init(e, t), z.init(e, t), e._zod.processJSONSchema = (r, o, i) => Mu(e, r, o), e.enum = t.entries, e.options = [...e._zod.values];
4636
+ const n = new Set(Object.keys(t.entries));
4637
+ e.extract = (r, o) => {
4638
+ const i = {};
4639
+ for (const s of r)
4640
+ if (n.has(s))
4641
+ i[s] = t.entries[s];
4642
+ else
4643
+ throw new Error(`Key ${s} not found in enum`);
4644
+ return new ut({
4645
+ ...t,
4646
+ checks: [],
4647
+ ...g(o),
4648
+ entries: i
4649
+ });
4650
+ }, e.exclude = (r, o) => {
4651
+ const i = { ...t.entries };
4652
+ for (const s of r)
4653
+ if (n.has(s))
4654
+ delete i[s];
4655
+ else
4656
+ throw new Error(`Key ${s} not found in enum`);
4657
+ return new ut({
4658
+ ...t,
4659
+ checks: [],
4660
+ ...g(o),
4661
+ entries: i
4662
+ });
4663
+ };
4664
+ });
4665
+ function sa(e, t) {
4666
+ const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
4667
+ return new ut({
4668
+ type: "enum",
4669
+ entries: n,
4670
+ ...g(t)
4671
+ });
4672
+ }
4673
+ const ua = /* @__PURE__ */ l("ZodLiteral", (e, t) => {
4674
+ ds.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => xu(e, n, r, o), e.values = new Set(t.values), Object.defineProperty(e, "value", {
4675
+ get() {
4676
+ if (t.values.length > 1)
4677
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
4678
+ return t.values[0];
4679
+ }
4680
+ });
4681
+ });
4682
+ function Ka(e, t) {
4683
+ return new ua({
4684
+ type: "literal",
4685
+ values: Array.isArray(e) ? e : [e],
4686
+ ...g(t)
4687
+ });
4688
+ }
4689
+ const ca = /* @__PURE__ */ l("ZodTransform", (e, t) => {
4690
+ be(), ps.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ju(e, n, r, o), e._zod.parse = (n, r) => {
4691
+ if (r.direction === "backward")
4692
+ throw new Pn(e.constructor.name);
4693
+ n.addIssue = (i) => {
4694
+ if (typeof i == "string")
4695
+ n.issues.push(ve(i, n.value, t));
4696
+ else {
4697
+ const s = i;
4698
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), "input" in s || (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(ve(s));
4699
+ }
4700
+ };
4701
+ const o = t.transform(n.value, n);
4702
+ return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
4703
+ };
4704
+ });
4705
+ function aa(e) {
4706
+ return new ca({
4707
+ type: "transform",
4708
+ transform: e
4709
+ });
4710
+ }
4711
+ const wt = /* @__PURE__ */ l("ZodOptional", (e, t) => {
4712
+ Wn.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => lr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4713
+ });
4714
+ function pn(e) {
4715
+ return new wt({
4716
+ type: "optional",
4717
+ innerType: e
4718
+ });
4719
+ }
4720
+ const _r = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
4721
+ hs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => lr(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4722
+ });
4723
+ function fa(e) {
4724
+ return new _r({
4725
+ type: "optional",
4726
+ innerType: e
4727
+ });
4728
+ }
4729
+ const la = /* @__PURE__ */ l("ZodNullable", (e, t) => {
4730
+ ms.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Xu(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4731
+ });
4732
+ function hn(e) {
4733
+ return new la({
4734
+ type: "nullable",
4735
+ innerType: e
4736
+ });
4737
+ }
4738
+ const da = /* @__PURE__ */ l("ZodDefault", (e, t) => {
4739
+ gs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Qu(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4740
+ });
4741
+ function pa(e, t) {
4742
+ return new da({
4743
+ type: "default",
4744
+ innerType: e,
4745
+ get defaultValue() {
4746
+ return typeof t == "function" ? t() : zn(t);
4747
+ }
4748
+ });
4749
+ }
4750
+ const ha = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
4751
+ _s.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => ec(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4752
+ });
4753
+ function ma(e, t) {
4754
+ return new ha({
4755
+ type: "prefault",
4756
+ innerType: e,
4757
+ get defaultValue() {
4758
+ return typeof t == "function" ? t() : zn(t);
4759
+ }
4760
+ });
4761
+ }
4762
+ const vr = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
4763
+ vs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Hu(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4764
+ });
4765
+ function ga(e, t) {
4766
+ return new vr({
4767
+ type: "nonoptional",
4768
+ innerType: e,
4769
+ ...g(t)
4770
+ });
4771
+ }
4772
+ const _a = /* @__PURE__ */ l("ZodCatch", (e, t) => {
4773
+ ys.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => tc(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
4774
+ });
4775
+ function va(e, t) {
4776
+ return new _a({
4777
+ type: "catch",
4778
+ innerType: e,
4779
+ catchValue: typeof t == "function" ? t : ro(t)
4780
+ });
4781
+ }
4782
+ const ya = /* @__PURE__ */ l("ZodPipe", (e, t) => {
4783
+ bs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => nc(e, n, r, o), e.in = t.in, e.out = t.out;
4784
+ });
4785
+ function mn(e, t) {
4786
+ return new ya({
4787
+ type: "pipe",
4788
+ in: e,
4789
+ out: t
4790
+ // ...util.normalizeParams(params),
4791
+ });
4792
+ }
4793
+ const ba = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
4794
+ ws.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => rc(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
4795
+ });
4796
+ function wa(e) {
4797
+ return new ba({
4798
+ type: "readonly",
4799
+ innerType: e
4800
+ });
4801
+ }
4802
+ const za = /* @__PURE__ */ l("ZodLazy", (e, t) => {
4803
+ zs.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => oc(e, n, r, o), e.unwrap = () => e._zod.def.getter();
4804
+ });
4805
+ function Va(e) {
4806
+ return new za({
4807
+ type: "lazy",
4808
+ getter: e
4809
+ });
4810
+ }
4811
+ const yr = /* @__PURE__ */ l("ZodCustom", (e, t) => {
4812
+ ks.init(e, t), z.init(e, t), e._zod.processJSONSchema = (n, r, o) => Lu(e, n, r, o);
4813
+ });
4814
+ function Ba(e, t) {
4815
+ return /* @__PURE__ */ $u(yr, e ?? (() => !0), t);
4816
+ }
4817
+ function ka(e, t = {}) {
4818
+ return /* @__PURE__ */ Ou(yr, e, t);
4819
+ }
4820
+ function $a(e, t) {
4821
+ return /* @__PURE__ */ Su(e, t);
4822
+ }
4823
+ export {
4824
+ Ia as C,
4825
+ $c as Z,
4826
+ sa as _,
4827
+ ta as a,
4828
+ ea as b,
4829
+ st as c,
4830
+ Ra as d,
4831
+ Da as e,
4832
+ Ea as f,
4833
+ Ka as g,
4834
+ Ba as h,
4835
+ Fa as i,
4836
+ Na as j,
4837
+ xa as k,
4838
+ Va as l,
4839
+ Aa as m,
4840
+ ja as n,
4841
+ Ua as o,
4842
+ wt as p,
4843
+ la as q,
4844
+ Ja as r,
4845
+ Oc as s,
4846
+ La as t,
4847
+ Ta as u,
4848
+ Ma as v,
4849
+ Ca as w,
4850
+ Pa as x
4851
+ };