@noxickon/onyx 0.0.1 → 0.0.3

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