@hype-stack/cli 0.8.1 → 0.9.0

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