@opencloud-eu/web-client 7.4.0 → 8.1.0

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