@majeanson/lac 3.0.3 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mcp.mjs CHANGED
@@ -11,7 +11,7 @@ import { execSync } from "node:child_process";
11
11
  //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/core.js
12
12
  /** A special constant with type `never` */
13
13
  const NEVER = Object.freeze({ status: "aborted" });
14
- function $constructor(name, initializer$2, params) {
14
+ function $constructor$1(name, initializer$4, params) {
15
15
  function init(inst, def) {
16
16
  if (!inst._zod) Object.defineProperty(inst, "_zod", {
17
17
  value: {
@@ -23,7 +23,7 @@ function $constructor(name, initializer$2, params) {
23
23
  });
24
24
  if (inst._zod.traits.has(name)) return;
25
25
  inst._zod.traits.add(name);
26
- initializer$2(inst, def);
26
+ initializer$4(inst, def);
27
27
  const proto = _.prototype;
28
28
  const keys = Object.keys(proto);
29
29
  for (let i = 0; i < keys.length; i++) {
@@ -35,10 +35,3777 @@ function $constructor(name, initializer$2, params) {
35
35
  class Definition extends Parent {}
36
36
  Object.defineProperty(Definition, "name", { value: name });
37
37
  function _(def) {
38
- var _a$1;
38
+ var _a$2;
39
39
  const inst = params?.Parent ? new Definition() : this;
40
40
  init(inst, def);
41
- (_a$1 = inst._zod).deferred ?? (_a$1.deferred = []);
41
+ (_a$2 = inst._zod).deferred ?? (_a$2.deferred = []);
42
+ for (const fn of inst._zod.deferred) fn();
43
+ return inst;
44
+ }
45
+ Object.defineProperty(_, "init", { value: init });
46
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
47
+ if (params?.Parent && inst instanceof params.Parent) return true;
48
+ return inst?._zod?.traits?.has(name);
49
+ } });
50
+ Object.defineProperty(_, "name", { value: name });
51
+ return _;
52
+ }
53
+ var $ZodAsyncError$1 = class extends Error {
54
+ constructor() {
55
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
56
+ }
57
+ };
58
+ var $ZodEncodeError$1 = class extends Error {
59
+ constructor(name) {
60
+ super(`Encountered unidirectional transform during encode: ${name}`);
61
+ this.name = "ZodEncodeError";
62
+ }
63
+ };
64
+ const globalConfig$1 = {};
65
+ function config$1(newConfig) {
66
+ if (newConfig) Object.assign(globalConfig$1, newConfig);
67
+ return globalConfig$1;
68
+ }
69
+
70
+ //#endregion
71
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/util.js
72
+ function getEnumValues$1(entries) {
73
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
74
+ return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
75
+ }
76
+ function jsonStringifyReplacer$1(_, value) {
77
+ if (typeof value === "bigint") return value.toString();
78
+ return value;
79
+ }
80
+ function cached$1(getter) {
81
+ return { get value() {
82
+ {
83
+ const value = getter();
84
+ Object.defineProperty(this, "value", { value });
85
+ return value;
86
+ }
87
+ throw new Error("cached value already set");
88
+ } };
89
+ }
90
+ function nullish$1(input) {
91
+ return input === null || input === void 0;
92
+ }
93
+ function cleanRegex$1(source) {
94
+ const start = source.startsWith("^") ? 1 : 0;
95
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
96
+ return source.slice(start, end);
97
+ }
98
+ function floatSafeRemainder$1(val, step) {
99
+ const valDecCount = (val.toString().split(".")[1] || "").length;
100
+ const stepString = step.toString();
101
+ let stepDecCount = (stepString.split(".")[1] || "").length;
102
+ if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
103
+ const match = stepString.match(/\d?e-(\d?)/);
104
+ if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
105
+ }
106
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
107
+ return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
108
+ }
109
+ const EVALUATING$1 = Symbol("evaluating");
110
+ function defineLazy$1(object$2, key, getter) {
111
+ let value = void 0;
112
+ Object.defineProperty(object$2, key, {
113
+ get() {
114
+ if (value === EVALUATING$1) return;
115
+ if (value === void 0) {
116
+ value = EVALUATING$1;
117
+ value = getter();
118
+ }
119
+ return value;
120
+ },
121
+ set(v) {
122
+ Object.defineProperty(object$2, key, { value: v });
123
+ },
124
+ configurable: true
125
+ });
126
+ }
127
+ function assignProp$1(target, prop, value) {
128
+ Object.defineProperty(target, prop, {
129
+ value,
130
+ writable: true,
131
+ enumerable: true,
132
+ configurable: true
133
+ });
134
+ }
135
+ function mergeDefs$1(...defs) {
136
+ const mergedDescriptors = {};
137
+ for (const def of defs) {
138
+ const descriptors = Object.getOwnPropertyDescriptors(def);
139
+ Object.assign(mergedDescriptors, descriptors);
140
+ }
141
+ return Object.defineProperties({}, mergedDescriptors);
142
+ }
143
+ function esc$1(str) {
144
+ return JSON.stringify(str);
145
+ }
146
+ function slugify$1(input) {
147
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
148
+ }
149
+ const captureStackTrace$1 = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
150
+ function isObject$1(data) {
151
+ return typeof data === "object" && data !== null && !Array.isArray(data);
152
+ }
153
+ const allowsEval$1 = cached$1(() => {
154
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
155
+ try {
156
+ new Function("");
157
+ return true;
158
+ } catch (_) {
159
+ return false;
160
+ }
161
+ });
162
+ function isPlainObject$1(o) {
163
+ if (isObject$1(o) === false) return false;
164
+ const ctor = o.constructor;
165
+ if (ctor === void 0) return true;
166
+ if (typeof ctor !== "function") return true;
167
+ const prot = ctor.prototype;
168
+ if (isObject$1(prot) === false) return false;
169
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
170
+ return true;
171
+ }
172
+ function shallowClone$1(o) {
173
+ if (isPlainObject$1(o)) return { ...o };
174
+ if (Array.isArray(o)) return [...o];
175
+ return o;
176
+ }
177
+ const propertyKeyTypes$1 = new Set([
178
+ "string",
179
+ "number",
180
+ "symbol"
181
+ ]);
182
+ function escapeRegex$1(str) {
183
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
184
+ }
185
+ function clone$1(inst, def, params) {
186
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
187
+ if (!def || params?.parent) cl._zod.parent = inst;
188
+ return cl;
189
+ }
190
+ function normalizeParams$1(_params) {
191
+ const params = _params;
192
+ if (!params) return {};
193
+ if (typeof params === "string") return { error: () => params };
194
+ if (params?.message !== void 0) {
195
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
196
+ params.error = params.message;
197
+ }
198
+ delete params.message;
199
+ if (typeof params.error === "string") return {
200
+ ...params,
201
+ error: () => params.error
202
+ };
203
+ return params;
204
+ }
205
+ function optionalKeys$1(shape) {
206
+ return Object.keys(shape).filter((k) => {
207
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
208
+ });
209
+ }
210
+ const NUMBER_FORMAT_RANGES$1 = {
211
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
212
+ int32: [-2147483648, 2147483647],
213
+ uint32: [0, 4294967295],
214
+ float32: [-34028234663852886e22, 34028234663852886e22],
215
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
216
+ };
217
+ function pick$1(schema, mask) {
218
+ const currDef = schema._zod.def;
219
+ const checks = currDef.checks;
220
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
221
+ return clone$1(schema, mergeDefs$1(schema._zod.def, {
222
+ get shape() {
223
+ const newShape = {};
224
+ for (const key in mask) {
225
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
226
+ if (!mask[key]) continue;
227
+ newShape[key] = currDef.shape[key];
228
+ }
229
+ assignProp$1(this, "shape", newShape);
230
+ return newShape;
231
+ },
232
+ checks: []
233
+ }));
234
+ }
235
+ function omit$1(schema, mask) {
236
+ const currDef = schema._zod.def;
237
+ const checks = currDef.checks;
238
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
239
+ return clone$1(schema, mergeDefs$1(schema._zod.def, {
240
+ get shape() {
241
+ const newShape = { ...schema._zod.def.shape };
242
+ for (const key in mask) {
243
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
244
+ if (!mask[key]) continue;
245
+ delete newShape[key];
246
+ }
247
+ assignProp$1(this, "shape", newShape);
248
+ return newShape;
249
+ },
250
+ checks: []
251
+ }));
252
+ }
253
+ function extend$1(schema, shape) {
254
+ if (!isPlainObject$1(shape)) throw new Error("Invalid input to extend: expected a plain object");
255
+ const checks = schema._zod.def.checks;
256
+ if (checks && checks.length > 0) {
257
+ const existingShape = schema._zod.def.shape;
258
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
259
+ }
260
+ return clone$1(schema, mergeDefs$1(schema._zod.def, { get shape() {
261
+ const _shape = {
262
+ ...schema._zod.def.shape,
263
+ ...shape
264
+ };
265
+ assignProp$1(this, "shape", _shape);
266
+ return _shape;
267
+ } }));
268
+ }
269
+ function safeExtend$1(schema, shape) {
270
+ if (!isPlainObject$1(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
271
+ return clone$1(schema, mergeDefs$1(schema._zod.def, { get shape() {
272
+ const _shape = {
273
+ ...schema._zod.def.shape,
274
+ ...shape
275
+ };
276
+ assignProp$1(this, "shape", _shape);
277
+ return _shape;
278
+ } }));
279
+ }
280
+ function merge$1(a, b) {
281
+ return clone$1(a, mergeDefs$1(a._zod.def, {
282
+ get shape() {
283
+ const _shape = {
284
+ ...a._zod.def.shape,
285
+ ...b._zod.def.shape
286
+ };
287
+ assignProp$1(this, "shape", _shape);
288
+ return _shape;
289
+ },
290
+ get catchall() {
291
+ return b._zod.def.catchall;
292
+ },
293
+ checks: []
294
+ }));
295
+ }
296
+ function partial$1(Class, schema, mask) {
297
+ const checks = schema._zod.def.checks;
298
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
299
+ return clone$1(schema, mergeDefs$1(schema._zod.def, {
300
+ get shape() {
301
+ const oldShape = schema._zod.def.shape;
302
+ const shape = { ...oldShape };
303
+ if (mask) for (const key in mask) {
304
+ if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
305
+ if (!mask[key]) continue;
306
+ shape[key] = Class ? new Class({
307
+ type: "optional",
308
+ innerType: oldShape[key]
309
+ }) : oldShape[key];
310
+ }
311
+ else for (const key in oldShape) shape[key] = Class ? new Class({
312
+ type: "optional",
313
+ innerType: oldShape[key]
314
+ }) : oldShape[key];
315
+ assignProp$1(this, "shape", shape);
316
+ return shape;
317
+ },
318
+ checks: []
319
+ }));
320
+ }
321
+ function required$1(Class, schema, mask) {
322
+ return clone$1(schema, mergeDefs$1(schema._zod.def, { get shape() {
323
+ const oldShape = schema._zod.def.shape;
324
+ const shape = { ...oldShape };
325
+ if (mask) for (const key in mask) {
326
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
327
+ if (!mask[key]) continue;
328
+ shape[key] = new Class({
329
+ type: "nonoptional",
330
+ innerType: oldShape[key]
331
+ });
332
+ }
333
+ else for (const key in oldShape) shape[key] = new Class({
334
+ type: "nonoptional",
335
+ innerType: oldShape[key]
336
+ });
337
+ assignProp$1(this, "shape", shape);
338
+ return shape;
339
+ } }));
340
+ }
341
+ function aborted$1(x, startIndex = 0) {
342
+ if (x.aborted === true) return true;
343
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
344
+ return false;
345
+ }
346
+ function prefixIssues$1(path$1, issues) {
347
+ return issues.map((iss) => {
348
+ var _a$2;
349
+ (_a$2 = iss).path ?? (_a$2.path = []);
350
+ iss.path.unshift(path$1);
351
+ return iss;
352
+ });
353
+ }
354
+ function unwrapMessage$1(message) {
355
+ return typeof message === "string" ? message : message?.message;
356
+ }
357
+ function finalizeIssue$1(iss, ctx, config$2) {
358
+ const full = {
359
+ ...iss,
360
+ path: iss.path ?? []
361
+ };
362
+ if (!iss.message) full.message = unwrapMessage$1(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage$1(ctx?.error?.(iss)) ?? unwrapMessage$1(config$2.customError?.(iss)) ?? unwrapMessage$1(config$2.localeError?.(iss)) ?? "Invalid input";
363
+ delete full.inst;
364
+ delete full.continue;
365
+ if (!ctx?.reportInput) delete full.input;
366
+ return full;
367
+ }
368
+ function getLengthableOrigin$1(input) {
369
+ if (Array.isArray(input)) return "array";
370
+ if (typeof input === "string") return "string";
371
+ return "unknown";
372
+ }
373
+ function issue$1(...args) {
374
+ const [iss, input, inst] = args;
375
+ if (typeof iss === "string") return {
376
+ message: iss,
377
+ code: "custom",
378
+ input,
379
+ inst
380
+ };
381
+ return { ...iss };
382
+ }
383
+
384
+ //#endregion
385
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/errors.js
386
+ const initializer$3 = (inst, def) => {
387
+ inst.name = "$ZodError";
388
+ Object.defineProperty(inst, "_zod", {
389
+ value: inst._zod,
390
+ enumerable: false
391
+ });
392
+ Object.defineProperty(inst, "issues", {
393
+ value: def,
394
+ enumerable: false
395
+ });
396
+ inst.message = JSON.stringify(def, jsonStringifyReplacer$1, 2);
397
+ Object.defineProperty(inst, "toString", {
398
+ value: () => inst.message,
399
+ enumerable: false
400
+ });
401
+ };
402
+ const $ZodError$1 = $constructor$1("$ZodError", initializer$3);
403
+ const $ZodRealError$1 = $constructor$1("$ZodError", initializer$3, { Parent: Error });
404
+ function flattenError$1(error, mapper = (issue$2) => issue$2.message) {
405
+ const fieldErrors = {};
406
+ const formErrors = [];
407
+ for (const sub of error.issues) if (sub.path.length > 0) {
408
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
409
+ fieldErrors[sub.path[0]].push(mapper(sub));
410
+ } else formErrors.push(mapper(sub));
411
+ return {
412
+ formErrors,
413
+ fieldErrors
414
+ };
415
+ }
416
+ function formatError$1(error, mapper = (issue$2) => issue$2.message) {
417
+ const fieldErrors = { _errors: [] };
418
+ const processError = (error$1) => {
419
+ for (const issue$2 of error$1.issues) if (issue$2.code === "invalid_union" && issue$2.errors.length) issue$2.errors.map((issues) => processError({ issues }));
420
+ else if (issue$2.code === "invalid_key") processError({ issues: issue$2.issues });
421
+ else if (issue$2.code === "invalid_element") processError({ issues: issue$2.issues });
422
+ else if (issue$2.path.length === 0) fieldErrors._errors.push(mapper(issue$2));
423
+ else {
424
+ let curr = fieldErrors;
425
+ let i = 0;
426
+ while (i < issue$2.path.length) {
427
+ const el = issue$2.path[i];
428
+ if (!(i === issue$2.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
429
+ else {
430
+ curr[el] = curr[el] || { _errors: [] };
431
+ curr[el]._errors.push(mapper(issue$2));
432
+ }
433
+ curr = curr[el];
434
+ i++;
435
+ }
436
+ }
437
+ };
438
+ processError(error);
439
+ return fieldErrors;
440
+ }
441
+
442
+ //#endregion
443
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/parse.js
444
+ const _parse$1 = (_Err) => (schema, value, _ctx, _params) => {
445
+ const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
446
+ const result = schema._zod.run({
447
+ value,
448
+ issues: []
449
+ }, ctx);
450
+ if (result instanceof Promise) throw new $ZodAsyncError$1();
451
+ if (result.issues.length) {
452
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())));
453
+ captureStackTrace$1(e, _params?.callee);
454
+ throw e;
455
+ }
456
+ return result.value;
457
+ };
458
+ const parse$2 = /* @__PURE__ */ _parse$1($ZodRealError$1);
459
+ const _parseAsync$1 = (_Err) => async (schema, value, _ctx, params) => {
460
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
461
+ let result = schema._zod.run({
462
+ value,
463
+ issues: []
464
+ }, ctx);
465
+ if (result instanceof Promise) result = await result;
466
+ if (result.issues.length) {
467
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())));
468
+ captureStackTrace$1(e, params?.callee);
469
+ throw e;
470
+ }
471
+ return result.value;
472
+ };
473
+ const parseAsync$2 = /* @__PURE__ */ _parseAsync$1($ZodRealError$1);
474
+ const _safeParse$1 = (_Err) => (schema, value, _ctx) => {
475
+ const ctx = _ctx ? {
476
+ ..._ctx,
477
+ async: false
478
+ } : { async: false };
479
+ const result = schema._zod.run({
480
+ value,
481
+ issues: []
482
+ }, ctx);
483
+ if (result instanceof Promise) throw new $ZodAsyncError$1();
484
+ return result.issues.length ? {
485
+ success: false,
486
+ error: new (_Err ?? $ZodError$1)(result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())))
487
+ } : {
488
+ success: true,
489
+ data: result.value
490
+ };
491
+ };
492
+ const safeParse$3 = /* @__PURE__ */ _safeParse$1($ZodRealError$1);
493
+ const _safeParseAsync$1 = (_Err) => async (schema, value, _ctx) => {
494
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
495
+ let result = schema._zod.run({
496
+ value,
497
+ issues: []
498
+ }, ctx);
499
+ if (result instanceof Promise) result = await result;
500
+ return result.issues.length ? {
501
+ success: false,
502
+ error: new _Err(result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())))
503
+ } : {
504
+ success: true,
505
+ data: result.value
506
+ };
507
+ };
508
+ const safeParseAsync$3 = /* @__PURE__ */ _safeParseAsync$1($ZodRealError$1);
509
+ const _encode$1 = (_Err) => (schema, value, _ctx) => {
510
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
511
+ return _parse$1(_Err)(schema, value, ctx);
512
+ };
513
+ const encode$2 = /* @__PURE__ */ _encode$1($ZodRealError$1);
514
+ const _decode$1 = (_Err) => (schema, value, _ctx) => {
515
+ return _parse$1(_Err)(schema, value, _ctx);
516
+ };
517
+ const decode$2 = /* @__PURE__ */ _decode$1($ZodRealError$1);
518
+ const _encodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
519
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
520
+ return _parseAsync$1(_Err)(schema, value, ctx);
521
+ };
522
+ const encodeAsync$2 = /* @__PURE__ */ _encodeAsync$1($ZodRealError$1);
523
+ const _decodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
524
+ return _parseAsync$1(_Err)(schema, value, _ctx);
525
+ };
526
+ const decodeAsync$2 = /* @__PURE__ */ _decodeAsync$1($ZodRealError$1);
527
+ const _safeEncode$1 = (_Err) => (schema, value, _ctx) => {
528
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
529
+ return _safeParse$1(_Err)(schema, value, ctx);
530
+ };
531
+ const safeEncode$2 = /* @__PURE__ */ _safeEncode$1($ZodRealError$1);
532
+ const _safeDecode$1 = (_Err) => (schema, value, _ctx) => {
533
+ return _safeParse$1(_Err)(schema, value, _ctx);
534
+ };
535
+ const safeDecode$2 = /* @__PURE__ */ _safeDecode$1($ZodRealError$1);
536
+ const _safeEncodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
537
+ const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
538
+ return _safeParseAsync$1(_Err)(schema, value, ctx);
539
+ };
540
+ const safeEncodeAsync$2 = /* @__PURE__ */ _safeEncodeAsync$1($ZodRealError$1);
541
+ const _safeDecodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
542
+ return _safeParseAsync$1(_Err)(schema, value, _ctx);
543
+ };
544
+ const safeDecodeAsync$2 = /* @__PURE__ */ _safeDecodeAsync$1($ZodRealError$1);
545
+
546
+ //#endregion
547
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/regexes.js
548
+ const cuid$1 = /^[cC][^\s-]{8,}$/;
549
+ const cuid2$1 = /^[0-9a-z]+$/;
550
+ const ulid$1 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
551
+ const xid$1 = /^[0-9a-vA-V]{20}$/;
552
+ const ksuid$1 = /^[A-Za-z0-9]{27}$/;
553
+ const nanoid$1 = /^[a-zA-Z0-9_-]{21}$/;
554
+ /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
555
+ const duration$3 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
556
+ /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
557
+ const guid$1 = /^([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})$/;
558
+ /** Returns a regex for validating an RFC 9562/4122 UUID.
559
+ *
560
+ * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
561
+ const uuid$1 = (version$2) => {
562
+ if (!version$2) return /^([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)$/;
563
+ return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
564
+ };
565
+ /** Practical email validation */
566
+ const email$1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
567
+ const _emoji$3 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
568
+ function emoji$1() {
569
+ return new RegExp(_emoji$3, "u");
570
+ }
571
+ const ipv4$1 = /^(?:(?: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])$/;
572
+ const ipv6$1 = /^(([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}|:))$/;
573
+ const cidrv4$1 = /^((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])$/;
574
+ const cidrv6$1 = /^(([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])$/;
575
+ const base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
576
+ const base64url$1 = /^[A-Za-z0-9_-]*$/;
577
+ const e164$1 = /^\+[1-9]\d{6,14}$/;
578
+ const dateSource$1 = `(?:(?:\\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])))`;
579
+ const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource$1}$`);
580
+ function timeSource$1(args) {
581
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
582
+ return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
583
+ }
584
+ function time$3(args) {
585
+ return /* @__PURE__ */ new RegExp(`^${timeSource$1(args)}$`);
586
+ }
587
+ function datetime$3(args) {
588
+ const time$4 = timeSource$1({ precision: args.precision });
589
+ const opts = ["Z"];
590
+ if (args.local) opts.push("");
591
+ if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
592
+ const timeRegex = `${time$4}(?:${opts.join("|")})`;
593
+ return /* @__PURE__ */ new RegExp(`^${dateSource$1}T(?:${timeRegex})$`);
594
+ }
595
+ const string$3 = (params) => {
596
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
597
+ return /* @__PURE__ */ new RegExp(`^${regex}$`);
598
+ };
599
+ const integer$1 = /^-?\d+$/;
600
+ const number$3 = /^-?\d+(?:\.\d+)?$/;
601
+ const lowercase$1 = /^[^A-Z]*$/;
602
+ const uppercase$1 = /^[^a-z]*$/;
603
+
604
+ //#endregion
605
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/checks.js
606
+ const $ZodCheck$1 = /* @__PURE__ */ $constructor$1("$ZodCheck", (inst, def) => {
607
+ var _a$2;
608
+ inst._zod ?? (inst._zod = {});
609
+ inst._zod.def = def;
610
+ (_a$2 = inst._zod).onattach ?? (_a$2.onattach = []);
611
+ });
612
+ const numericOriginMap$1 = {
613
+ number: "number",
614
+ bigint: "bigint",
615
+ object: "date"
616
+ };
617
+ const $ZodCheckLessThan$1 = /* @__PURE__ */ $constructor$1("$ZodCheckLessThan", (inst, def) => {
618
+ $ZodCheck$1.init(inst, def);
619
+ const origin = numericOriginMap$1[typeof def.value];
620
+ inst._zod.onattach.push((inst$1) => {
621
+ const bag = inst$1._zod.bag;
622
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
623
+ if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
624
+ else bag.exclusiveMaximum = def.value;
625
+ });
626
+ inst._zod.check = (payload) => {
627
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
628
+ payload.issues.push({
629
+ origin,
630
+ code: "too_big",
631
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
632
+ input: payload.value,
633
+ inclusive: def.inclusive,
634
+ inst,
635
+ continue: !def.abort
636
+ });
637
+ };
638
+ });
639
+ const $ZodCheckGreaterThan$1 = /* @__PURE__ */ $constructor$1("$ZodCheckGreaterThan", (inst, def) => {
640
+ $ZodCheck$1.init(inst, def);
641
+ const origin = numericOriginMap$1[typeof def.value];
642
+ inst._zod.onattach.push((inst$1) => {
643
+ const bag = inst$1._zod.bag;
644
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
645
+ if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
646
+ else bag.exclusiveMinimum = def.value;
647
+ });
648
+ inst._zod.check = (payload) => {
649
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
650
+ payload.issues.push({
651
+ origin,
652
+ code: "too_small",
653
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
654
+ input: payload.value,
655
+ inclusive: def.inclusive,
656
+ inst,
657
+ continue: !def.abort
658
+ });
659
+ };
660
+ });
661
+ const $ZodCheckMultipleOf$1 = /* @__PURE__ */ $constructor$1("$ZodCheckMultipleOf", (inst, def) => {
662
+ $ZodCheck$1.init(inst, def);
663
+ inst._zod.onattach.push((inst$1) => {
664
+ var _a$2;
665
+ (_a$2 = inst$1._zod.bag).multipleOf ?? (_a$2.multipleOf = def.value);
666
+ });
667
+ inst._zod.check = (payload) => {
668
+ if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
669
+ if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder$1(payload.value, def.value) === 0) return;
670
+ payload.issues.push({
671
+ origin: typeof payload.value,
672
+ code: "not_multiple_of",
673
+ divisor: def.value,
674
+ input: payload.value,
675
+ inst,
676
+ continue: !def.abort
677
+ });
678
+ };
679
+ });
680
+ const $ZodCheckNumberFormat$1 = /* @__PURE__ */ $constructor$1("$ZodCheckNumberFormat", (inst, def) => {
681
+ $ZodCheck$1.init(inst, def);
682
+ def.format = def.format || "float64";
683
+ const isInt = def.format?.includes("int");
684
+ const origin = isInt ? "int" : "number";
685
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES$1[def.format];
686
+ inst._zod.onattach.push((inst$1) => {
687
+ const bag = inst$1._zod.bag;
688
+ bag.format = def.format;
689
+ bag.minimum = minimum;
690
+ bag.maximum = maximum;
691
+ if (isInt) bag.pattern = integer$1;
692
+ });
693
+ inst._zod.check = (payload) => {
694
+ const input = payload.value;
695
+ if (isInt) {
696
+ if (!Number.isInteger(input)) {
697
+ payload.issues.push({
698
+ expected: origin,
699
+ format: def.format,
700
+ code: "invalid_type",
701
+ continue: false,
702
+ input,
703
+ inst
704
+ });
705
+ return;
706
+ }
707
+ if (!Number.isSafeInteger(input)) {
708
+ if (input > 0) payload.issues.push({
709
+ input,
710
+ code: "too_big",
711
+ maximum: Number.MAX_SAFE_INTEGER,
712
+ note: "Integers must be within the safe integer range.",
713
+ inst,
714
+ origin,
715
+ inclusive: true,
716
+ continue: !def.abort
717
+ });
718
+ else payload.issues.push({
719
+ input,
720
+ code: "too_small",
721
+ minimum: Number.MIN_SAFE_INTEGER,
722
+ note: "Integers must be within the safe integer range.",
723
+ inst,
724
+ origin,
725
+ inclusive: true,
726
+ continue: !def.abort
727
+ });
728
+ return;
729
+ }
730
+ }
731
+ if (input < minimum) payload.issues.push({
732
+ origin: "number",
733
+ input,
734
+ code: "too_small",
735
+ minimum,
736
+ inclusive: true,
737
+ inst,
738
+ continue: !def.abort
739
+ });
740
+ if (input > maximum) payload.issues.push({
741
+ origin: "number",
742
+ input,
743
+ code: "too_big",
744
+ maximum,
745
+ inclusive: true,
746
+ inst,
747
+ continue: !def.abort
748
+ });
749
+ };
750
+ });
751
+ const $ZodCheckMaxLength$1 = /* @__PURE__ */ $constructor$1("$ZodCheckMaxLength", (inst, def) => {
752
+ var _a$2;
753
+ $ZodCheck$1.init(inst, def);
754
+ (_a$2 = inst._zod.def).when ?? (_a$2.when = (payload) => {
755
+ const val = payload.value;
756
+ return !nullish$1(val) && val.length !== void 0;
757
+ });
758
+ inst._zod.onattach.push((inst$1) => {
759
+ const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
760
+ if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
761
+ });
762
+ inst._zod.check = (payload) => {
763
+ const input = payload.value;
764
+ if (input.length <= def.maximum) return;
765
+ const origin = getLengthableOrigin$1(input);
766
+ payload.issues.push({
767
+ origin,
768
+ code: "too_big",
769
+ maximum: def.maximum,
770
+ inclusive: true,
771
+ input,
772
+ inst,
773
+ continue: !def.abort
774
+ });
775
+ };
776
+ });
777
+ const $ZodCheckMinLength$1 = /* @__PURE__ */ $constructor$1("$ZodCheckMinLength", (inst, def) => {
778
+ var _a$2;
779
+ $ZodCheck$1.init(inst, def);
780
+ (_a$2 = inst._zod.def).when ?? (_a$2.when = (payload) => {
781
+ const val = payload.value;
782
+ return !nullish$1(val) && val.length !== void 0;
783
+ });
784
+ inst._zod.onattach.push((inst$1) => {
785
+ const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
786
+ if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
787
+ });
788
+ inst._zod.check = (payload) => {
789
+ const input = payload.value;
790
+ if (input.length >= def.minimum) return;
791
+ const origin = getLengthableOrigin$1(input);
792
+ payload.issues.push({
793
+ origin,
794
+ code: "too_small",
795
+ minimum: def.minimum,
796
+ inclusive: true,
797
+ input,
798
+ inst,
799
+ continue: !def.abort
800
+ });
801
+ };
802
+ });
803
+ const $ZodCheckLengthEquals$1 = /* @__PURE__ */ $constructor$1("$ZodCheckLengthEquals", (inst, def) => {
804
+ var _a$2;
805
+ $ZodCheck$1.init(inst, def);
806
+ (_a$2 = inst._zod.def).when ?? (_a$2.when = (payload) => {
807
+ const val = payload.value;
808
+ return !nullish$1(val) && val.length !== void 0;
809
+ });
810
+ inst._zod.onattach.push((inst$1) => {
811
+ const bag = inst$1._zod.bag;
812
+ bag.minimum = def.length;
813
+ bag.maximum = def.length;
814
+ bag.length = def.length;
815
+ });
816
+ inst._zod.check = (payload) => {
817
+ const input = payload.value;
818
+ const length = input.length;
819
+ if (length === def.length) return;
820
+ const origin = getLengthableOrigin$1(input);
821
+ const tooBig = length > def.length;
822
+ payload.issues.push({
823
+ origin,
824
+ ...tooBig ? {
825
+ code: "too_big",
826
+ maximum: def.length
827
+ } : {
828
+ code: "too_small",
829
+ minimum: def.length
830
+ },
831
+ inclusive: true,
832
+ exact: true,
833
+ input: payload.value,
834
+ inst,
835
+ continue: !def.abort
836
+ });
837
+ };
838
+ });
839
+ const $ZodCheckStringFormat$1 = /* @__PURE__ */ $constructor$1("$ZodCheckStringFormat", (inst, def) => {
840
+ var _a$2, _b;
841
+ $ZodCheck$1.init(inst, def);
842
+ inst._zod.onattach.push((inst$1) => {
843
+ const bag = inst$1._zod.bag;
844
+ bag.format = def.format;
845
+ if (def.pattern) {
846
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
847
+ bag.patterns.add(def.pattern);
848
+ }
849
+ });
850
+ if (def.pattern) (_a$2 = inst._zod).check ?? (_a$2.check = (payload) => {
851
+ def.pattern.lastIndex = 0;
852
+ if (def.pattern.test(payload.value)) return;
853
+ payload.issues.push({
854
+ origin: "string",
855
+ code: "invalid_format",
856
+ format: def.format,
857
+ input: payload.value,
858
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
859
+ inst,
860
+ continue: !def.abort
861
+ });
862
+ });
863
+ else (_b = inst._zod).check ?? (_b.check = () => {});
864
+ });
865
+ const $ZodCheckRegex$1 = /* @__PURE__ */ $constructor$1("$ZodCheckRegex", (inst, def) => {
866
+ $ZodCheckStringFormat$1.init(inst, def);
867
+ inst._zod.check = (payload) => {
868
+ def.pattern.lastIndex = 0;
869
+ if (def.pattern.test(payload.value)) return;
870
+ payload.issues.push({
871
+ origin: "string",
872
+ code: "invalid_format",
873
+ format: "regex",
874
+ input: payload.value,
875
+ pattern: def.pattern.toString(),
876
+ inst,
877
+ continue: !def.abort
878
+ });
879
+ };
880
+ });
881
+ const $ZodCheckLowerCase$1 = /* @__PURE__ */ $constructor$1("$ZodCheckLowerCase", (inst, def) => {
882
+ def.pattern ?? (def.pattern = lowercase$1);
883
+ $ZodCheckStringFormat$1.init(inst, def);
884
+ });
885
+ const $ZodCheckUpperCase$1 = /* @__PURE__ */ $constructor$1("$ZodCheckUpperCase", (inst, def) => {
886
+ def.pattern ?? (def.pattern = uppercase$1);
887
+ $ZodCheckStringFormat$1.init(inst, def);
888
+ });
889
+ const $ZodCheckIncludes$1 = /* @__PURE__ */ $constructor$1("$ZodCheckIncludes", (inst, def) => {
890
+ $ZodCheck$1.init(inst, def);
891
+ const escapedRegex = escapeRegex$1(def.includes);
892
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
893
+ def.pattern = pattern;
894
+ inst._zod.onattach.push((inst$1) => {
895
+ const bag = inst$1._zod.bag;
896
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
897
+ bag.patterns.add(pattern);
898
+ });
899
+ inst._zod.check = (payload) => {
900
+ if (payload.value.includes(def.includes, def.position)) return;
901
+ payload.issues.push({
902
+ origin: "string",
903
+ code: "invalid_format",
904
+ format: "includes",
905
+ includes: def.includes,
906
+ input: payload.value,
907
+ inst,
908
+ continue: !def.abort
909
+ });
910
+ };
911
+ });
912
+ const $ZodCheckStartsWith$1 = /* @__PURE__ */ $constructor$1("$ZodCheckStartsWith", (inst, def) => {
913
+ $ZodCheck$1.init(inst, def);
914
+ const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex$1(def.prefix)}.*`);
915
+ def.pattern ?? (def.pattern = pattern);
916
+ inst._zod.onattach.push((inst$1) => {
917
+ const bag = inst$1._zod.bag;
918
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
919
+ bag.patterns.add(pattern);
920
+ });
921
+ inst._zod.check = (payload) => {
922
+ if (payload.value.startsWith(def.prefix)) return;
923
+ payload.issues.push({
924
+ origin: "string",
925
+ code: "invalid_format",
926
+ format: "starts_with",
927
+ prefix: def.prefix,
928
+ input: payload.value,
929
+ inst,
930
+ continue: !def.abort
931
+ });
932
+ };
933
+ });
934
+ const $ZodCheckEndsWith$1 = /* @__PURE__ */ $constructor$1("$ZodCheckEndsWith", (inst, def) => {
935
+ $ZodCheck$1.init(inst, def);
936
+ const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex$1(def.suffix)}$`);
937
+ def.pattern ?? (def.pattern = pattern);
938
+ inst._zod.onattach.push((inst$1) => {
939
+ const bag = inst$1._zod.bag;
940
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
941
+ bag.patterns.add(pattern);
942
+ });
943
+ inst._zod.check = (payload) => {
944
+ if (payload.value.endsWith(def.suffix)) return;
945
+ payload.issues.push({
946
+ origin: "string",
947
+ code: "invalid_format",
948
+ format: "ends_with",
949
+ suffix: def.suffix,
950
+ input: payload.value,
951
+ inst,
952
+ continue: !def.abort
953
+ });
954
+ };
955
+ });
956
+ const $ZodCheckOverwrite$1 = /* @__PURE__ */ $constructor$1("$ZodCheckOverwrite", (inst, def) => {
957
+ $ZodCheck$1.init(inst, def);
958
+ inst._zod.check = (payload) => {
959
+ payload.value = def.tx(payload.value);
960
+ };
961
+ });
962
+
963
+ //#endregion
964
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/doc.js
965
+ var Doc$1 = class {
966
+ constructor(args = []) {
967
+ this.content = [];
968
+ this.indent = 0;
969
+ if (this) this.args = args;
970
+ }
971
+ indented(fn) {
972
+ this.indent += 1;
973
+ fn(this);
974
+ this.indent -= 1;
975
+ }
976
+ write(arg) {
977
+ if (typeof arg === "function") {
978
+ arg(this, { execution: "sync" });
979
+ arg(this, { execution: "async" });
980
+ return;
981
+ }
982
+ const lines = arg.split("\n").filter((x) => x);
983
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
984
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
985
+ for (const line of dedented) this.content.push(line);
986
+ }
987
+ compile() {
988
+ const F = Function;
989
+ const args = this?.args;
990
+ const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
991
+ return new F(...args, lines.join("\n"));
992
+ }
993
+ };
994
+
995
+ //#endregion
996
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/versions.js
997
+ const version$1 = {
998
+ major: 4,
999
+ minor: 3,
1000
+ patch: 6
1001
+ };
1002
+
1003
+ //#endregion
1004
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/schemas.js
1005
+ const $ZodType$1 = /* @__PURE__ */ $constructor$1("$ZodType", (inst, def) => {
1006
+ var _a$2;
1007
+ inst ?? (inst = {});
1008
+ inst._zod.def = def;
1009
+ inst._zod.bag = inst._zod.bag || {};
1010
+ inst._zod.version = version$1;
1011
+ const checks = [...inst._zod.def.checks ?? []];
1012
+ if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1013
+ for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1014
+ if (checks.length === 0) {
1015
+ (_a$2 = inst._zod).deferred ?? (_a$2.deferred = []);
1016
+ inst._zod.deferred?.push(() => {
1017
+ inst._zod.run = inst._zod.parse;
1018
+ });
1019
+ } else {
1020
+ const runChecks = (payload, checks$1, ctx) => {
1021
+ let isAborted = aborted$1(payload);
1022
+ let asyncResult;
1023
+ for (const ch of checks$1) {
1024
+ if (ch._zod.def.when) {
1025
+ if (!ch._zod.def.when(payload)) continue;
1026
+ } else if (isAborted) continue;
1027
+ const currLen = payload.issues.length;
1028
+ const _ = ch._zod.check(payload);
1029
+ if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError$1();
1030
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1031
+ await _;
1032
+ if (payload.issues.length === currLen) return;
1033
+ if (!isAborted) isAborted = aborted$1(payload, currLen);
1034
+ });
1035
+ else {
1036
+ if (payload.issues.length === currLen) continue;
1037
+ if (!isAborted) isAborted = aborted$1(payload, currLen);
1038
+ }
1039
+ }
1040
+ if (asyncResult) return asyncResult.then(() => {
1041
+ return payload;
1042
+ });
1043
+ return payload;
1044
+ };
1045
+ const handleCanaryResult = (canary, payload, ctx) => {
1046
+ if (aborted$1(canary)) {
1047
+ canary.aborted = true;
1048
+ return canary;
1049
+ }
1050
+ const checkResult = runChecks(payload, checks, ctx);
1051
+ if (checkResult instanceof Promise) {
1052
+ if (ctx.async === false) throw new $ZodAsyncError$1();
1053
+ return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx));
1054
+ }
1055
+ return inst._zod.parse(checkResult, ctx);
1056
+ };
1057
+ inst._zod.run = (payload, ctx) => {
1058
+ if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
1059
+ if (ctx.direction === "backward") {
1060
+ const canary = inst._zod.parse({
1061
+ value: payload.value,
1062
+ issues: []
1063
+ }, {
1064
+ ...ctx,
1065
+ skipChecks: true
1066
+ });
1067
+ if (canary instanceof Promise) return canary.then((canary$1) => {
1068
+ return handleCanaryResult(canary$1, payload, ctx);
1069
+ });
1070
+ return handleCanaryResult(canary, payload, ctx);
1071
+ }
1072
+ const result = inst._zod.parse(payload, ctx);
1073
+ if (result instanceof Promise) {
1074
+ if (ctx.async === false) throw new $ZodAsyncError$1();
1075
+ return result.then((result$1) => runChecks(result$1, checks, ctx));
1076
+ }
1077
+ return runChecks(result, checks, ctx);
1078
+ };
1079
+ }
1080
+ defineLazy$1(inst, "~standard", () => ({
1081
+ validate: (value) => {
1082
+ try {
1083
+ const r = safeParse$3(inst, value);
1084
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1085
+ } catch (_) {
1086
+ return safeParseAsync$3(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1087
+ }
1088
+ },
1089
+ vendor: "zod",
1090
+ version: 1
1091
+ }));
1092
+ });
1093
+ const $ZodString$1 = /* @__PURE__ */ $constructor$1("$ZodString", (inst, def) => {
1094
+ $ZodType$1.init(inst, def);
1095
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$3(inst._zod.bag);
1096
+ inst._zod.parse = (payload, _) => {
1097
+ if (def.coerce) try {
1098
+ payload.value = String(payload.value);
1099
+ } catch (_$1) {}
1100
+ if (typeof payload.value === "string") return payload;
1101
+ payload.issues.push({
1102
+ expected: "string",
1103
+ code: "invalid_type",
1104
+ input: payload.value,
1105
+ inst
1106
+ });
1107
+ return payload;
1108
+ };
1109
+ });
1110
+ const $ZodStringFormat$1 = /* @__PURE__ */ $constructor$1("$ZodStringFormat", (inst, def) => {
1111
+ $ZodCheckStringFormat$1.init(inst, def);
1112
+ $ZodString$1.init(inst, def);
1113
+ });
1114
+ const $ZodGUID$1 = /* @__PURE__ */ $constructor$1("$ZodGUID", (inst, def) => {
1115
+ def.pattern ?? (def.pattern = guid$1);
1116
+ $ZodStringFormat$1.init(inst, def);
1117
+ });
1118
+ const $ZodUUID$1 = /* @__PURE__ */ $constructor$1("$ZodUUID", (inst, def) => {
1119
+ if (def.version) {
1120
+ const v = {
1121
+ v1: 1,
1122
+ v2: 2,
1123
+ v3: 3,
1124
+ v4: 4,
1125
+ v5: 5,
1126
+ v6: 6,
1127
+ v7: 7,
1128
+ v8: 8
1129
+ }[def.version];
1130
+ if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
1131
+ def.pattern ?? (def.pattern = uuid$1(v));
1132
+ } else def.pattern ?? (def.pattern = uuid$1());
1133
+ $ZodStringFormat$1.init(inst, def);
1134
+ });
1135
+ const $ZodEmail$1 = /* @__PURE__ */ $constructor$1("$ZodEmail", (inst, def) => {
1136
+ def.pattern ?? (def.pattern = email$1);
1137
+ $ZodStringFormat$1.init(inst, def);
1138
+ });
1139
+ const $ZodURL$1 = /* @__PURE__ */ $constructor$1("$ZodURL", (inst, def) => {
1140
+ $ZodStringFormat$1.init(inst, def);
1141
+ inst._zod.check = (payload) => {
1142
+ try {
1143
+ const trimmed = payload.value.trim();
1144
+ const url = new URL(trimmed);
1145
+ if (def.hostname) {
1146
+ def.hostname.lastIndex = 0;
1147
+ if (!def.hostname.test(url.hostname)) payload.issues.push({
1148
+ code: "invalid_format",
1149
+ format: "url",
1150
+ note: "Invalid hostname",
1151
+ pattern: def.hostname.source,
1152
+ input: payload.value,
1153
+ inst,
1154
+ continue: !def.abort
1155
+ });
1156
+ }
1157
+ if (def.protocol) {
1158
+ def.protocol.lastIndex = 0;
1159
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1160
+ code: "invalid_format",
1161
+ format: "url",
1162
+ note: "Invalid protocol",
1163
+ pattern: def.protocol.source,
1164
+ input: payload.value,
1165
+ inst,
1166
+ continue: !def.abort
1167
+ });
1168
+ }
1169
+ if (def.normalize) payload.value = url.href;
1170
+ else payload.value = trimmed;
1171
+ return;
1172
+ } catch (_) {
1173
+ payload.issues.push({
1174
+ code: "invalid_format",
1175
+ format: "url",
1176
+ input: payload.value,
1177
+ inst,
1178
+ continue: !def.abort
1179
+ });
1180
+ }
1181
+ };
1182
+ });
1183
+ const $ZodEmoji$1 = /* @__PURE__ */ $constructor$1("$ZodEmoji", (inst, def) => {
1184
+ def.pattern ?? (def.pattern = emoji$1());
1185
+ $ZodStringFormat$1.init(inst, def);
1186
+ });
1187
+ const $ZodNanoID$1 = /* @__PURE__ */ $constructor$1("$ZodNanoID", (inst, def) => {
1188
+ def.pattern ?? (def.pattern = nanoid$1);
1189
+ $ZodStringFormat$1.init(inst, def);
1190
+ });
1191
+ const $ZodCUID$1 = /* @__PURE__ */ $constructor$1("$ZodCUID", (inst, def) => {
1192
+ def.pattern ?? (def.pattern = cuid$1);
1193
+ $ZodStringFormat$1.init(inst, def);
1194
+ });
1195
+ const $ZodCUID2$1 = /* @__PURE__ */ $constructor$1("$ZodCUID2", (inst, def) => {
1196
+ def.pattern ?? (def.pattern = cuid2$1);
1197
+ $ZodStringFormat$1.init(inst, def);
1198
+ });
1199
+ const $ZodULID$1 = /* @__PURE__ */ $constructor$1("$ZodULID", (inst, def) => {
1200
+ def.pattern ?? (def.pattern = ulid$1);
1201
+ $ZodStringFormat$1.init(inst, def);
1202
+ });
1203
+ const $ZodXID$1 = /* @__PURE__ */ $constructor$1("$ZodXID", (inst, def) => {
1204
+ def.pattern ?? (def.pattern = xid$1);
1205
+ $ZodStringFormat$1.init(inst, def);
1206
+ });
1207
+ const $ZodKSUID$1 = /* @__PURE__ */ $constructor$1("$ZodKSUID", (inst, def) => {
1208
+ def.pattern ?? (def.pattern = ksuid$1);
1209
+ $ZodStringFormat$1.init(inst, def);
1210
+ });
1211
+ const $ZodISODateTime$1 = /* @__PURE__ */ $constructor$1("$ZodISODateTime", (inst, def) => {
1212
+ def.pattern ?? (def.pattern = datetime$3(def));
1213
+ $ZodStringFormat$1.init(inst, def);
1214
+ });
1215
+ const $ZodISODate$1 = /* @__PURE__ */ $constructor$1("$ZodISODate", (inst, def) => {
1216
+ def.pattern ?? (def.pattern = date$3);
1217
+ $ZodStringFormat$1.init(inst, def);
1218
+ });
1219
+ const $ZodISOTime$1 = /* @__PURE__ */ $constructor$1("$ZodISOTime", (inst, def) => {
1220
+ def.pattern ?? (def.pattern = time$3(def));
1221
+ $ZodStringFormat$1.init(inst, def);
1222
+ });
1223
+ const $ZodISODuration$1 = /* @__PURE__ */ $constructor$1("$ZodISODuration", (inst, def) => {
1224
+ def.pattern ?? (def.pattern = duration$3);
1225
+ $ZodStringFormat$1.init(inst, def);
1226
+ });
1227
+ const $ZodIPv4$1 = /* @__PURE__ */ $constructor$1("$ZodIPv4", (inst, def) => {
1228
+ def.pattern ?? (def.pattern = ipv4$1);
1229
+ $ZodStringFormat$1.init(inst, def);
1230
+ inst._zod.bag.format = `ipv4`;
1231
+ });
1232
+ const $ZodIPv6$1 = /* @__PURE__ */ $constructor$1("$ZodIPv6", (inst, def) => {
1233
+ def.pattern ?? (def.pattern = ipv6$1);
1234
+ $ZodStringFormat$1.init(inst, def);
1235
+ inst._zod.bag.format = `ipv6`;
1236
+ inst._zod.check = (payload) => {
1237
+ try {
1238
+ new URL(`http://[${payload.value}]`);
1239
+ } catch {
1240
+ payload.issues.push({
1241
+ code: "invalid_format",
1242
+ format: "ipv6",
1243
+ input: payload.value,
1244
+ inst,
1245
+ continue: !def.abort
1246
+ });
1247
+ }
1248
+ };
1249
+ });
1250
+ const $ZodCIDRv4$1 = /* @__PURE__ */ $constructor$1("$ZodCIDRv4", (inst, def) => {
1251
+ def.pattern ?? (def.pattern = cidrv4$1);
1252
+ $ZodStringFormat$1.init(inst, def);
1253
+ });
1254
+ const $ZodCIDRv6$1 = /* @__PURE__ */ $constructor$1("$ZodCIDRv6", (inst, def) => {
1255
+ def.pattern ?? (def.pattern = cidrv6$1);
1256
+ $ZodStringFormat$1.init(inst, def);
1257
+ inst._zod.check = (payload) => {
1258
+ const parts = payload.value.split("/");
1259
+ try {
1260
+ if (parts.length !== 2) throw new Error();
1261
+ const [address, prefix] = parts;
1262
+ if (!prefix) throw new Error();
1263
+ const prefixNum = Number(prefix);
1264
+ if (`${prefixNum}` !== prefix) throw new Error();
1265
+ if (prefixNum < 0 || prefixNum > 128) throw new Error();
1266
+ new URL(`http://[${address}]`);
1267
+ } catch {
1268
+ payload.issues.push({
1269
+ code: "invalid_format",
1270
+ format: "cidrv6",
1271
+ input: payload.value,
1272
+ inst,
1273
+ continue: !def.abort
1274
+ });
1275
+ }
1276
+ };
1277
+ });
1278
+ function isValidBase64$1(data) {
1279
+ if (data === "") return true;
1280
+ if (data.length % 4 !== 0) return false;
1281
+ try {
1282
+ atob(data);
1283
+ return true;
1284
+ } catch {
1285
+ return false;
1286
+ }
1287
+ }
1288
+ const $ZodBase64$1 = /* @__PURE__ */ $constructor$1("$ZodBase64", (inst, def) => {
1289
+ def.pattern ?? (def.pattern = base64$1);
1290
+ $ZodStringFormat$1.init(inst, def);
1291
+ inst._zod.bag.contentEncoding = "base64";
1292
+ inst._zod.check = (payload) => {
1293
+ if (isValidBase64$1(payload.value)) return;
1294
+ payload.issues.push({
1295
+ code: "invalid_format",
1296
+ format: "base64",
1297
+ input: payload.value,
1298
+ inst,
1299
+ continue: !def.abort
1300
+ });
1301
+ };
1302
+ });
1303
+ function isValidBase64URL$1(data) {
1304
+ if (!base64url$1.test(data)) return false;
1305
+ const base64$2 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1306
+ return isValidBase64$1(base64$2.padEnd(Math.ceil(base64$2.length / 4) * 4, "="));
1307
+ }
1308
+ const $ZodBase64URL$1 = /* @__PURE__ */ $constructor$1("$ZodBase64URL", (inst, def) => {
1309
+ def.pattern ?? (def.pattern = base64url$1);
1310
+ $ZodStringFormat$1.init(inst, def);
1311
+ inst._zod.bag.contentEncoding = "base64url";
1312
+ inst._zod.check = (payload) => {
1313
+ if (isValidBase64URL$1(payload.value)) return;
1314
+ payload.issues.push({
1315
+ code: "invalid_format",
1316
+ format: "base64url",
1317
+ input: payload.value,
1318
+ inst,
1319
+ continue: !def.abort
1320
+ });
1321
+ };
1322
+ });
1323
+ const $ZodE164$1 = /* @__PURE__ */ $constructor$1("$ZodE164", (inst, def) => {
1324
+ def.pattern ?? (def.pattern = e164$1);
1325
+ $ZodStringFormat$1.init(inst, def);
1326
+ });
1327
+ function isValidJWT$1(token, algorithm = null) {
1328
+ try {
1329
+ const tokensParts = token.split(".");
1330
+ if (tokensParts.length !== 3) return false;
1331
+ const [header] = tokensParts;
1332
+ if (!header) return false;
1333
+ const parsedHeader = JSON.parse(atob(header));
1334
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1335
+ if (!parsedHeader.alg) return false;
1336
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
1337
+ return true;
1338
+ } catch {
1339
+ return false;
1340
+ }
1341
+ }
1342
+ const $ZodJWT$1 = /* @__PURE__ */ $constructor$1("$ZodJWT", (inst, def) => {
1343
+ $ZodStringFormat$1.init(inst, def);
1344
+ inst._zod.check = (payload) => {
1345
+ if (isValidJWT$1(payload.value, def.alg)) return;
1346
+ payload.issues.push({
1347
+ code: "invalid_format",
1348
+ format: "jwt",
1349
+ input: payload.value,
1350
+ inst,
1351
+ continue: !def.abort
1352
+ });
1353
+ };
1354
+ });
1355
+ const $ZodNumber$1 = /* @__PURE__ */ $constructor$1("$ZodNumber", (inst, def) => {
1356
+ $ZodType$1.init(inst, def);
1357
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$3;
1358
+ inst._zod.parse = (payload, _ctx) => {
1359
+ if (def.coerce) try {
1360
+ payload.value = Number(payload.value);
1361
+ } catch (_) {}
1362
+ const input = payload.value;
1363
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1364
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1365
+ payload.issues.push({
1366
+ expected: "number",
1367
+ code: "invalid_type",
1368
+ input,
1369
+ inst,
1370
+ ...received ? { received } : {}
1371
+ });
1372
+ return payload;
1373
+ };
1374
+ });
1375
+ const $ZodNumberFormat$1 = /* @__PURE__ */ $constructor$1("$ZodNumberFormat", (inst, def) => {
1376
+ $ZodCheckNumberFormat$1.init(inst, def);
1377
+ $ZodNumber$1.init(inst, def);
1378
+ });
1379
+ const $ZodUnknown$1 = /* @__PURE__ */ $constructor$1("$ZodUnknown", (inst, def) => {
1380
+ $ZodType$1.init(inst, def);
1381
+ inst._zod.parse = (payload) => payload;
1382
+ });
1383
+ const $ZodNever$1 = /* @__PURE__ */ $constructor$1("$ZodNever", (inst, def) => {
1384
+ $ZodType$1.init(inst, def);
1385
+ inst._zod.parse = (payload, _ctx) => {
1386
+ payload.issues.push({
1387
+ expected: "never",
1388
+ code: "invalid_type",
1389
+ input: payload.value,
1390
+ inst
1391
+ });
1392
+ return payload;
1393
+ };
1394
+ });
1395
+ function handleArrayResult$1(result, final, index) {
1396
+ if (result.issues.length) final.issues.push(...prefixIssues$1(index, result.issues));
1397
+ final.value[index] = result.value;
1398
+ }
1399
+ const $ZodArray$1 = /* @__PURE__ */ $constructor$1("$ZodArray", (inst, def) => {
1400
+ $ZodType$1.init(inst, def);
1401
+ inst._zod.parse = (payload, ctx) => {
1402
+ const input = payload.value;
1403
+ if (!Array.isArray(input)) {
1404
+ payload.issues.push({
1405
+ expected: "array",
1406
+ code: "invalid_type",
1407
+ input,
1408
+ inst
1409
+ });
1410
+ return payload;
1411
+ }
1412
+ payload.value = Array(input.length);
1413
+ const proms = [];
1414
+ for (let i = 0; i < input.length; i++) {
1415
+ const item = input[i];
1416
+ const result = def.element._zod.run({
1417
+ value: item,
1418
+ issues: []
1419
+ }, ctx);
1420
+ if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult$1(result$1, payload, i)));
1421
+ else handleArrayResult$1(result, payload, i);
1422
+ }
1423
+ if (proms.length) return Promise.all(proms).then(() => payload);
1424
+ return payload;
1425
+ };
1426
+ });
1427
+ function handlePropertyResult$1(result, final, key, input, isOptionalOut) {
1428
+ if (result.issues.length) {
1429
+ if (isOptionalOut && !(key in input)) return;
1430
+ final.issues.push(...prefixIssues$1(key, result.issues));
1431
+ }
1432
+ if (result.value === void 0) {
1433
+ if (key in input) final.value[key] = void 0;
1434
+ } else final.value[key] = result.value;
1435
+ }
1436
+ function normalizeDef$1(def) {
1437
+ const keys = Object.keys(def.shape);
1438
+ for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1439
+ const okeys = optionalKeys$1(def.shape);
1440
+ return {
1441
+ ...def,
1442
+ keys,
1443
+ keySet: new Set(keys),
1444
+ numKeys: keys.length,
1445
+ optionalKeys: new Set(okeys)
1446
+ };
1447
+ }
1448
+ function handleCatchall$1(proms, input, payload, ctx, def, inst) {
1449
+ const unrecognized = [];
1450
+ const keySet = def.keySet;
1451
+ const _catchall = def.catchall._zod;
1452
+ const t = _catchall.def.type;
1453
+ const isOptionalOut = _catchall.optout === "optional";
1454
+ for (const key in input) {
1455
+ if (keySet.has(key)) continue;
1456
+ if (t === "never") {
1457
+ unrecognized.push(key);
1458
+ continue;
1459
+ }
1460
+ const r = _catchall.run({
1461
+ value: input[key],
1462
+ issues: []
1463
+ }, ctx);
1464
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult$1(r$1, payload, key, input, isOptionalOut)));
1465
+ else handlePropertyResult$1(r, payload, key, input, isOptionalOut);
1466
+ }
1467
+ if (unrecognized.length) payload.issues.push({
1468
+ code: "unrecognized_keys",
1469
+ keys: unrecognized,
1470
+ input,
1471
+ inst
1472
+ });
1473
+ if (!proms.length) return payload;
1474
+ return Promise.all(proms).then(() => {
1475
+ return payload;
1476
+ });
1477
+ }
1478
+ const $ZodObject$1 = /* @__PURE__ */ $constructor$1("$ZodObject", (inst, def) => {
1479
+ $ZodType$1.init(inst, def);
1480
+ if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1481
+ const sh = def.shape;
1482
+ Object.defineProperty(def, "shape", { get: () => {
1483
+ const newSh = { ...sh };
1484
+ Object.defineProperty(def, "shape", { value: newSh });
1485
+ return newSh;
1486
+ } });
1487
+ }
1488
+ const _normalized = cached$1(() => normalizeDef$1(def));
1489
+ defineLazy$1(inst._zod, "propValues", () => {
1490
+ const shape = def.shape;
1491
+ const propValues = {};
1492
+ for (const key in shape) {
1493
+ const field = shape[key]._zod;
1494
+ if (field.values) {
1495
+ propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1496
+ for (const v of field.values) propValues[key].add(v);
1497
+ }
1498
+ }
1499
+ return propValues;
1500
+ });
1501
+ const isObject$2 = isObject$1;
1502
+ const catchall = def.catchall;
1503
+ let value;
1504
+ inst._zod.parse = (payload, ctx) => {
1505
+ value ?? (value = _normalized.value);
1506
+ const input = payload.value;
1507
+ if (!isObject$2(input)) {
1508
+ payload.issues.push({
1509
+ expected: "object",
1510
+ code: "invalid_type",
1511
+ input,
1512
+ inst
1513
+ });
1514
+ return payload;
1515
+ }
1516
+ payload.value = {};
1517
+ const proms = [];
1518
+ const shape = value.shape;
1519
+ for (const key of value.keys) {
1520
+ const el = shape[key];
1521
+ const isOptionalOut = el._zod.optout === "optional";
1522
+ const r = el._zod.run({
1523
+ value: input[key],
1524
+ issues: []
1525
+ }, ctx);
1526
+ if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult$1(r$1, payload, key, input, isOptionalOut)));
1527
+ else handlePropertyResult$1(r, payload, key, input, isOptionalOut);
1528
+ }
1529
+ if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1530
+ return handleCatchall$1(proms, input, payload, ctx, _normalized.value, inst);
1531
+ };
1532
+ });
1533
+ const $ZodObjectJIT$1 = /* @__PURE__ */ $constructor$1("$ZodObjectJIT", (inst, def) => {
1534
+ $ZodObject$1.init(inst, def);
1535
+ const superParse = inst._zod.parse;
1536
+ const _normalized = cached$1(() => normalizeDef$1(def));
1537
+ const generateFastpass = (shape) => {
1538
+ const doc = new Doc$1([
1539
+ "shape",
1540
+ "payload",
1541
+ "ctx"
1542
+ ]);
1543
+ const normalized = _normalized.value;
1544
+ const parseStr = (key) => {
1545
+ const k = esc$1(key);
1546
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1547
+ };
1548
+ doc.write(`const input = payload.value;`);
1549
+ const ids = Object.create(null);
1550
+ let counter = 0;
1551
+ for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1552
+ doc.write(`const newResult = {};`);
1553
+ for (const key of normalized.keys) {
1554
+ const id = ids[key];
1555
+ const k = esc$1(key);
1556
+ const isOptionalOut = shape[key]?._zod?.optout === "optional";
1557
+ doc.write(`const ${id} = ${parseStr(key)};`);
1558
+ if (isOptionalOut) doc.write(`
1559
+ if (${id}.issues.length) {
1560
+ if (${k} in input) {
1561
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1562
+ ...iss,
1563
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1564
+ })));
1565
+ }
1566
+ }
1567
+
1568
+ if (${id}.value === undefined) {
1569
+ if (${k} in input) {
1570
+ newResult[${k}] = undefined;
1571
+ }
1572
+ } else {
1573
+ newResult[${k}] = ${id}.value;
1574
+ }
1575
+
1576
+ `);
1577
+ else doc.write(`
1578
+ if (${id}.issues.length) {
1579
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1580
+ ...iss,
1581
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1582
+ })));
1583
+ }
1584
+
1585
+ if (${id}.value === undefined) {
1586
+ if (${k} in input) {
1587
+ newResult[${k}] = undefined;
1588
+ }
1589
+ } else {
1590
+ newResult[${k}] = ${id}.value;
1591
+ }
1592
+
1593
+ `);
1594
+ }
1595
+ doc.write(`payload.value = newResult;`);
1596
+ doc.write(`return payload;`);
1597
+ const fn = doc.compile();
1598
+ return (payload, ctx) => fn(shape, payload, ctx);
1599
+ };
1600
+ let fastpass;
1601
+ const isObject$2 = isObject$1;
1602
+ const jit = !globalConfig$1.jitless;
1603
+ const allowsEval$2 = allowsEval$1;
1604
+ const fastEnabled = jit && allowsEval$2.value;
1605
+ const catchall = def.catchall;
1606
+ let value;
1607
+ inst._zod.parse = (payload, ctx) => {
1608
+ value ?? (value = _normalized.value);
1609
+ const input = payload.value;
1610
+ if (!isObject$2(input)) {
1611
+ payload.issues.push({
1612
+ expected: "object",
1613
+ code: "invalid_type",
1614
+ input,
1615
+ inst
1616
+ });
1617
+ return payload;
1618
+ }
1619
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1620
+ if (!fastpass) fastpass = generateFastpass(def.shape);
1621
+ payload = fastpass(payload, ctx);
1622
+ if (!catchall) return payload;
1623
+ return handleCatchall$1([], input, payload, ctx, value, inst);
1624
+ }
1625
+ return superParse(payload, ctx);
1626
+ };
1627
+ });
1628
+ function handleUnionResults$1(results, final, inst, ctx) {
1629
+ for (const result of results) if (result.issues.length === 0) {
1630
+ final.value = result.value;
1631
+ return final;
1632
+ }
1633
+ const nonaborted = results.filter((r) => !aborted$1(r));
1634
+ if (nonaborted.length === 1) {
1635
+ final.value = nonaborted[0].value;
1636
+ return nonaborted[0];
1637
+ }
1638
+ final.issues.push({
1639
+ code: "invalid_union",
1640
+ input: final.value,
1641
+ inst,
1642
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())))
1643
+ });
1644
+ return final;
1645
+ }
1646
+ const $ZodUnion$1 = /* @__PURE__ */ $constructor$1("$ZodUnion", (inst, def) => {
1647
+ $ZodType$1.init(inst, def);
1648
+ defineLazy$1(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1649
+ defineLazy$1(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1650
+ defineLazy$1(inst._zod, "values", () => {
1651
+ if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1652
+ });
1653
+ defineLazy$1(inst._zod, "pattern", () => {
1654
+ if (def.options.every((o) => o._zod.pattern)) {
1655
+ const patterns = def.options.map((o) => o._zod.pattern);
1656
+ return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex$1(p.source)).join("|")})$`);
1657
+ }
1658
+ });
1659
+ const single = def.options.length === 1;
1660
+ const first = def.options[0]._zod.run;
1661
+ inst._zod.parse = (payload, ctx) => {
1662
+ if (single) return first(payload, ctx);
1663
+ let async = false;
1664
+ const results = [];
1665
+ for (const option of def.options) {
1666
+ const result = option._zod.run({
1667
+ value: payload.value,
1668
+ issues: []
1669
+ }, ctx);
1670
+ if (result instanceof Promise) {
1671
+ results.push(result);
1672
+ async = true;
1673
+ } else {
1674
+ if (result.issues.length === 0) return result;
1675
+ results.push(result);
1676
+ }
1677
+ }
1678
+ if (!async) return handleUnionResults$1(results, payload, inst, ctx);
1679
+ return Promise.all(results).then((results$1) => {
1680
+ return handleUnionResults$1(results$1, payload, inst, ctx);
1681
+ });
1682
+ };
1683
+ });
1684
+ const $ZodIntersection$1 = /* @__PURE__ */ $constructor$1("$ZodIntersection", (inst, def) => {
1685
+ $ZodType$1.init(inst, def);
1686
+ inst._zod.parse = (payload, ctx) => {
1687
+ const input = payload.value;
1688
+ const left = def.left._zod.run({
1689
+ value: input,
1690
+ issues: []
1691
+ }, ctx);
1692
+ const right = def.right._zod.run({
1693
+ value: input,
1694
+ issues: []
1695
+ }, ctx);
1696
+ if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left$1, right$1]) => {
1697
+ return handleIntersectionResults$1(payload, left$1, right$1);
1698
+ });
1699
+ return handleIntersectionResults$1(payload, left, right);
1700
+ };
1701
+ });
1702
+ function mergeValues$1(a, b) {
1703
+ if (a === b) return {
1704
+ valid: true,
1705
+ data: a
1706
+ };
1707
+ if (a instanceof Date && b instanceof Date && +a === +b) return {
1708
+ valid: true,
1709
+ data: a
1710
+ };
1711
+ if (isPlainObject$1(a) && isPlainObject$1(b)) {
1712
+ const bKeys = Object.keys(b);
1713
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1714
+ const newObj = {
1715
+ ...a,
1716
+ ...b
1717
+ };
1718
+ for (const key of sharedKeys) {
1719
+ const sharedValue = mergeValues$1(a[key], b[key]);
1720
+ if (!sharedValue.valid) return {
1721
+ valid: false,
1722
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
1723
+ };
1724
+ newObj[key] = sharedValue.data;
1725
+ }
1726
+ return {
1727
+ valid: true,
1728
+ data: newObj
1729
+ };
1730
+ }
1731
+ if (Array.isArray(a) && Array.isArray(b)) {
1732
+ if (a.length !== b.length) return {
1733
+ valid: false,
1734
+ mergeErrorPath: []
1735
+ };
1736
+ const newArray = [];
1737
+ for (let index = 0; index < a.length; index++) {
1738
+ const itemA = a[index];
1739
+ const itemB = b[index];
1740
+ const sharedValue = mergeValues$1(itemA, itemB);
1741
+ if (!sharedValue.valid) return {
1742
+ valid: false,
1743
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
1744
+ };
1745
+ newArray.push(sharedValue.data);
1746
+ }
1747
+ return {
1748
+ valid: true,
1749
+ data: newArray
1750
+ };
1751
+ }
1752
+ return {
1753
+ valid: false,
1754
+ mergeErrorPath: []
1755
+ };
1756
+ }
1757
+ function handleIntersectionResults$1(result, left, right) {
1758
+ const unrecKeys = /* @__PURE__ */ new Map();
1759
+ let unrecIssue;
1760
+ for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1761
+ unrecIssue ?? (unrecIssue = iss);
1762
+ for (const k of iss.keys) {
1763
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1764
+ unrecKeys.get(k).l = true;
1765
+ }
1766
+ } else result.issues.push(iss);
1767
+ for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1768
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1769
+ unrecKeys.get(k).r = true;
1770
+ }
1771
+ else result.issues.push(iss);
1772
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1773
+ if (bothKeys.length && unrecIssue) result.issues.push({
1774
+ ...unrecIssue,
1775
+ keys: bothKeys
1776
+ });
1777
+ if (aborted$1(result)) return result;
1778
+ const merged = mergeValues$1(left.value, right.value);
1779
+ if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
1780
+ result.value = merged.data;
1781
+ return result;
1782
+ }
1783
+ const $ZodEnum$1 = /* @__PURE__ */ $constructor$1("$ZodEnum", (inst, def) => {
1784
+ $ZodType$1.init(inst, def);
1785
+ const values = getEnumValues$1(def.entries);
1786
+ const valuesSet = new Set(values);
1787
+ inst._zod.values = valuesSet;
1788
+ inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${values.filter((k) => propertyKeyTypes$1.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex$1(o) : o.toString()).join("|")})$`);
1789
+ inst._zod.parse = (payload, _ctx) => {
1790
+ const input = payload.value;
1791
+ if (valuesSet.has(input)) return payload;
1792
+ payload.issues.push({
1793
+ code: "invalid_value",
1794
+ values,
1795
+ input,
1796
+ inst
1797
+ });
1798
+ return payload;
1799
+ };
1800
+ });
1801
+ const $ZodTransform$1 = /* @__PURE__ */ $constructor$1("$ZodTransform", (inst, def) => {
1802
+ $ZodType$1.init(inst, def);
1803
+ inst._zod.parse = (payload, ctx) => {
1804
+ if (ctx.direction === "backward") throw new $ZodEncodeError$1(inst.constructor.name);
1805
+ const _out = def.transform(payload.value, payload);
1806
+ if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1807
+ payload.value = output;
1808
+ return payload;
1809
+ });
1810
+ if (_out instanceof Promise) throw new $ZodAsyncError$1();
1811
+ payload.value = _out;
1812
+ return payload;
1813
+ };
1814
+ });
1815
+ function handleOptionalResult$1(result, input) {
1816
+ if (result.issues.length && input === void 0) return {
1817
+ issues: [],
1818
+ value: void 0
1819
+ };
1820
+ return result;
1821
+ }
1822
+ const $ZodOptional$1 = /* @__PURE__ */ $constructor$1("$ZodOptional", (inst, def) => {
1823
+ $ZodType$1.init(inst, def);
1824
+ inst._zod.optin = "optional";
1825
+ inst._zod.optout = "optional";
1826
+ defineLazy$1(inst._zod, "values", () => {
1827
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
1828
+ });
1829
+ defineLazy$1(inst._zod, "pattern", () => {
1830
+ const pattern = def.innerType._zod.pattern;
1831
+ return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex$1(pattern.source)})?$`) : void 0;
1832
+ });
1833
+ inst._zod.parse = (payload, ctx) => {
1834
+ if (def.innerType._zod.optin === "optional") {
1835
+ const result = def.innerType._zod.run(payload, ctx);
1836
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult$1(r, payload.value));
1837
+ return handleOptionalResult$1(result, payload.value);
1838
+ }
1839
+ if (payload.value === void 0) return payload;
1840
+ return def.innerType._zod.run(payload, ctx);
1841
+ };
1842
+ });
1843
+ const $ZodExactOptional$1 = /* @__PURE__ */ $constructor$1("$ZodExactOptional", (inst, def) => {
1844
+ $ZodOptional$1.init(inst, def);
1845
+ defineLazy$1(inst._zod, "values", () => def.innerType._zod.values);
1846
+ defineLazy$1(inst._zod, "pattern", () => def.innerType._zod.pattern);
1847
+ inst._zod.parse = (payload, ctx) => {
1848
+ return def.innerType._zod.run(payload, ctx);
1849
+ };
1850
+ });
1851
+ const $ZodNullable$1 = /* @__PURE__ */ $constructor$1("$ZodNullable", (inst, def) => {
1852
+ $ZodType$1.init(inst, def);
1853
+ defineLazy$1(inst._zod, "optin", () => def.innerType._zod.optin);
1854
+ defineLazy$1(inst._zod, "optout", () => def.innerType._zod.optout);
1855
+ defineLazy$1(inst._zod, "pattern", () => {
1856
+ const pattern = def.innerType._zod.pattern;
1857
+ return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex$1(pattern.source)}|null)$`) : void 0;
1858
+ });
1859
+ defineLazy$1(inst._zod, "values", () => {
1860
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
1861
+ });
1862
+ inst._zod.parse = (payload, ctx) => {
1863
+ if (payload.value === null) return payload;
1864
+ return def.innerType._zod.run(payload, ctx);
1865
+ };
1866
+ });
1867
+ const $ZodDefault$1 = /* @__PURE__ */ $constructor$1("$ZodDefault", (inst, def) => {
1868
+ $ZodType$1.init(inst, def);
1869
+ inst._zod.optin = "optional";
1870
+ defineLazy$1(inst._zod, "values", () => def.innerType._zod.values);
1871
+ inst._zod.parse = (payload, ctx) => {
1872
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1873
+ if (payload.value === void 0) {
1874
+ payload.value = def.defaultValue;
1875
+ /**
1876
+ * $ZodDefault returns the default value immediately in forward direction.
1877
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1878
+ return payload;
1879
+ }
1880
+ const result = def.innerType._zod.run(payload, ctx);
1881
+ if (result instanceof Promise) return result.then((result$1) => handleDefaultResult$1(result$1, def));
1882
+ return handleDefaultResult$1(result, def);
1883
+ };
1884
+ });
1885
+ function handleDefaultResult$1(payload, def) {
1886
+ if (payload.value === void 0) payload.value = def.defaultValue;
1887
+ return payload;
1888
+ }
1889
+ const $ZodPrefault$1 = /* @__PURE__ */ $constructor$1("$ZodPrefault", (inst, def) => {
1890
+ $ZodType$1.init(inst, def);
1891
+ inst._zod.optin = "optional";
1892
+ defineLazy$1(inst._zod, "values", () => def.innerType._zod.values);
1893
+ inst._zod.parse = (payload, ctx) => {
1894
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1895
+ if (payload.value === void 0) payload.value = def.defaultValue;
1896
+ return def.innerType._zod.run(payload, ctx);
1897
+ };
1898
+ });
1899
+ const $ZodNonOptional$1 = /* @__PURE__ */ $constructor$1("$ZodNonOptional", (inst, def) => {
1900
+ $ZodType$1.init(inst, def);
1901
+ defineLazy$1(inst._zod, "values", () => {
1902
+ const v = def.innerType._zod.values;
1903
+ return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
1904
+ });
1905
+ inst._zod.parse = (payload, ctx) => {
1906
+ const result = def.innerType._zod.run(payload, ctx);
1907
+ if (result instanceof Promise) return result.then((result$1) => handleNonOptionalResult$1(result$1, inst));
1908
+ return handleNonOptionalResult$1(result, inst);
1909
+ };
1910
+ });
1911
+ function handleNonOptionalResult$1(payload, inst) {
1912
+ if (!payload.issues.length && payload.value === void 0) payload.issues.push({
1913
+ code: "invalid_type",
1914
+ expected: "nonoptional",
1915
+ input: payload.value,
1916
+ inst
1917
+ });
1918
+ return payload;
1919
+ }
1920
+ const $ZodCatch$1 = /* @__PURE__ */ $constructor$1("$ZodCatch", (inst, def) => {
1921
+ $ZodType$1.init(inst, def);
1922
+ defineLazy$1(inst._zod, "optin", () => def.innerType._zod.optin);
1923
+ defineLazy$1(inst._zod, "optout", () => def.innerType._zod.optout);
1924
+ defineLazy$1(inst._zod, "values", () => def.innerType._zod.values);
1925
+ inst._zod.parse = (payload, ctx) => {
1926
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1927
+ const result = def.innerType._zod.run(payload, ctx);
1928
+ if (result instanceof Promise) return result.then((result$1) => {
1929
+ payload.value = result$1.value;
1930
+ if (result$1.issues.length) {
1931
+ payload.value = def.catchValue({
1932
+ ...payload,
1933
+ error: { issues: result$1.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())) },
1934
+ input: payload.value
1935
+ });
1936
+ payload.issues = [];
1937
+ }
1938
+ return payload;
1939
+ });
1940
+ payload.value = result.value;
1941
+ if (result.issues.length) {
1942
+ payload.value = def.catchValue({
1943
+ ...payload,
1944
+ error: { issues: result.issues.map((iss) => finalizeIssue$1(iss, ctx, config$1())) },
1945
+ input: payload.value
1946
+ });
1947
+ payload.issues = [];
1948
+ }
1949
+ return payload;
1950
+ };
1951
+ });
1952
+ const $ZodPipe$1 = /* @__PURE__ */ $constructor$1("$ZodPipe", (inst, def) => {
1953
+ $ZodType$1.init(inst, def);
1954
+ defineLazy$1(inst._zod, "values", () => def.in._zod.values);
1955
+ defineLazy$1(inst._zod, "optin", () => def.in._zod.optin);
1956
+ defineLazy$1(inst._zod, "optout", () => def.out._zod.optout);
1957
+ defineLazy$1(inst._zod, "propValues", () => def.in._zod.propValues);
1958
+ inst._zod.parse = (payload, ctx) => {
1959
+ if (ctx.direction === "backward") {
1960
+ const right = def.out._zod.run(payload, ctx);
1961
+ if (right instanceof Promise) return right.then((right$1) => handlePipeResult$1(right$1, def.in, ctx));
1962
+ return handlePipeResult$1(right, def.in, ctx);
1963
+ }
1964
+ const left = def.in._zod.run(payload, ctx);
1965
+ if (left instanceof Promise) return left.then((left$1) => handlePipeResult$1(left$1, def.out, ctx));
1966
+ return handlePipeResult$1(left, def.out, ctx);
1967
+ };
1968
+ });
1969
+ function handlePipeResult$1(left, next, ctx) {
1970
+ if (left.issues.length) {
1971
+ left.aborted = true;
1972
+ return left;
1973
+ }
1974
+ return next._zod.run({
1975
+ value: left.value,
1976
+ issues: left.issues
1977
+ }, ctx);
1978
+ }
1979
+ const $ZodReadonly$1 = /* @__PURE__ */ $constructor$1("$ZodReadonly", (inst, def) => {
1980
+ $ZodType$1.init(inst, def);
1981
+ defineLazy$1(inst._zod, "propValues", () => def.innerType._zod.propValues);
1982
+ defineLazy$1(inst._zod, "values", () => def.innerType._zod.values);
1983
+ defineLazy$1(inst._zod, "optin", () => def.innerType?._zod?.optin);
1984
+ defineLazy$1(inst._zod, "optout", () => def.innerType?._zod?.optout);
1985
+ inst._zod.parse = (payload, ctx) => {
1986
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1987
+ const result = def.innerType._zod.run(payload, ctx);
1988
+ if (result instanceof Promise) return result.then(handleReadonlyResult$1);
1989
+ return handleReadonlyResult$1(result);
1990
+ };
1991
+ });
1992
+ function handleReadonlyResult$1(payload) {
1993
+ payload.value = Object.freeze(payload.value);
1994
+ return payload;
1995
+ }
1996
+ const $ZodCustom$1 = /* @__PURE__ */ $constructor$1("$ZodCustom", (inst, def) => {
1997
+ $ZodCheck$1.init(inst, def);
1998
+ $ZodType$1.init(inst, def);
1999
+ inst._zod.parse = (payload, _) => {
2000
+ return payload;
2001
+ };
2002
+ inst._zod.check = (payload) => {
2003
+ const input = payload.value;
2004
+ const r = def.fn(input);
2005
+ if (r instanceof Promise) return r.then((r$1) => handleRefineResult$1(r$1, payload, input, inst));
2006
+ handleRefineResult$1(r, payload, input, inst);
2007
+ };
2008
+ });
2009
+ function handleRefineResult$1(result, payload, input, inst) {
2010
+ if (!result) {
2011
+ const _iss = {
2012
+ code: "custom",
2013
+ input,
2014
+ inst,
2015
+ path: [...inst._zod.def.path ?? []],
2016
+ continue: !inst._zod.def.abort
2017
+ };
2018
+ if (inst._zod.def.params) _iss.params = inst._zod.def.params;
2019
+ payload.issues.push(issue$1(_iss));
2020
+ }
2021
+ }
2022
+
2023
+ //#endregion
2024
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/registries.js
2025
+ var _a$1;
2026
+ var $ZodRegistry$1 = class {
2027
+ constructor() {
2028
+ this._map = /* @__PURE__ */ new WeakMap();
2029
+ this._idmap = /* @__PURE__ */ new Map();
2030
+ }
2031
+ add(schema, ..._meta) {
2032
+ const meta$2 = _meta[0];
2033
+ this._map.set(schema, meta$2);
2034
+ if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema);
2035
+ return this;
2036
+ }
2037
+ clear() {
2038
+ this._map = /* @__PURE__ */ new WeakMap();
2039
+ this._idmap = /* @__PURE__ */ new Map();
2040
+ return this;
2041
+ }
2042
+ remove(schema) {
2043
+ const meta$2 = this._map.get(schema);
2044
+ if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.delete(meta$2.id);
2045
+ this._map.delete(schema);
2046
+ return this;
2047
+ }
2048
+ get(schema) {
2049
+ const p = schema._zod.parent;
2050
+ if (p) {
2051
+ const pm = { ...this.get(p) ?? {} };
2052
+ delete pm.id;
2053
+ const f = {
2054
+ ...pm,
2055
+ ...this._map.get(schema)
2056
+ };
2057
+ return Object.keys(f).length ? f : void 0;
2058
+ }
2059
+ return this._map.get(schema);
2060
+ }
2061
+ has(schema) {
2062
+ return this._map.has(schema);
2063
+ }
2064
+ };
2065
+ function registry$1() {
2066
+ return new $ZodRegistry$1();
2067
+ }
2068
+ (_a$1 = globalThis).__zod_globalRegistry ?? (_a$1.__zod_globalRegistry = registry$1());
2069
+ const globalRegistry$1 = globalThis.__zod_globalRegistry;
2070
+
2071
+ //#endregion
2072
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/api.js
2073
+ /* @__NO_SIDE_EFFECTS__ */
2074
+ function _string$1(Class, params) {
2075
+ return new Class({
2076
+ type: "string",
2077
+ ...normalizeParams$1(params)
2078
+ });
2079
+ }
2080
+ /* @__NO_SIDE_EFFECTS__ */
2081
+ function _email$1(Class, params) {
2082
+ return new Class({
2083
+ type: "string",
2084
+ format: "email",
2085
+ check: "string_format",
2086
+ abort: false,
2087
+ ...normalizeParams$1(params)
2088
+ });
2089
+ }
2090
+ /* @__NO_SIDE_EFFECTS__ */
2091
+ function _guid$1(Class, params) {
2092
+ return new Class({
2093
+ type: "string",
2094
+ format: "guid",
2095
+ check: "string_format",
2096
+ abort: false,
2097
+ ...normalizeParams$1(params)
2098
+ });
2099
+ }
2100
+ /* @__NO_SIDE_EFFECTS__ */
2101
+ function _uuid$1(Class, params) {
2102
+ return new Class({
2103
+ type: "string",
2104
+ format: "uuid",
2105
+ check: "string_format",
2106
+ abort: false,
2107
+ ...normalizeParams$1(params)
2108
+ });
2109
+ }
2110
+ /* @__NO_SIDE_EFFECTS__ */
2111
+ function _uuidv4$1(Class, params) {
2112
+ return new Class({
2113
+ type: "string",
2114
+ format: "uuid",
2115
+ check: "string_format",
2116
+ abort: false,
2117
+ version: "v4",
2118
+ ...normalizeParams$1(params)
2119
+ });
2120
+ }
2121
+ /* @__NO_SIDE_EFFECTS__ */
2122
+ function _uuidv6$1(Class, params) {
2123
+ return new Class({
2124
+ type: "string",
2125
+ format: "uuid",
2126
+ check: "string_format",
2127
+ abort: false,
2128
+ version: "v6",
2129
+ ...normalizeParams$1(params)
2130
+ });
2131
+ }
2132
+ /* @__NO_SIDE_EFFECTS__ */
2133
+ function _uuidv7$1(Class, params) {
2134
+ return new Class({
2135
+ type: "string",
2136
+ format: "uuid",
2137
+ check: "string_format",
2138
+ abort: false,
2139
+ version: "v7",
2140
+ ...normalizeParams$1(params)
2141
+ });
2142
+ }
2143
+ /* @__NO_SIDE_EFFECTS__ */
2144
+ function _url$1(Class, params) {
2145
+ return new Class({
2146
+ type: "string",
2147
+ format: "url",
2148
+ check: "string_format",
2149
+ abort: false,
2150
+ ...normalizeParams$1(params)
2151
+ });
2152
+ }
2153
+ /* @__NO_SIDE_EFFECTS__ */
2154
+ function _emoji$2(Class, params) {
2155
+ return new Class({
2156
+ type: "string",
2157
+ format: "emoji",
2158
+ check: "string_format",
2159
+ abort: false,
2160
+ ...normalizeParams$1(params)
2161
+ });
2162
+ }
2163
+ /* @__NO_SIDE_EFFECTS__ */
2164
+ function _nanoid$1(Class, params) {
2165
+ return new Class({
2166
+ type: "string",
2167
+ format: "nanoid",
2168
+ check: "string_format",
2169
+ abort: false,
2170
+ ...normalizeParams$1(params)
2171
+ });
2172
+ }
2173
+ /* @__NO_SIDE_EFFECTS__ */
2174
+ function _cuid$1(Class, params) {
2175
+ return new Class({
2176
+ type: "string",
2177
+ format: "cuid",
2178
+ check: "string_format",
2179
+ abort: false,
2180
+ ...normalizeParams$1(params)
2181
+ });
2182
+ }
2183
+ /* @__NO_SIDE_EFFECTS__ */
2184
+ function _cuid2$1(Class, params) {
2185
+ return new Class({
2186
+ type: "string",
2187
+ format: "cuid2",
2188
+ check: "string_format",
2189
+ abort: false,
2190
+ ...normalizeParams$1(params)
2191
+ });
2192
+ }
2193
+ /* @__NO_SIDE_EFFECTS__ */
2194
+ function _ulid$1(Class, params) {
2195
+ return new Class({
2196
+ type: "string",
2197
+ format: "ulid",
2198
+ check: "string_format",
2199
+ abort: false,
2200
+ ...normalizeParams$1(params)
2201
+ });
2202
+ }
2203
+ /* @__NO_SIDE_EFFECTS__ */
2204
+ function _xid$1(Class, params) {
2205
+ return new Class({
2206
+ type: "string",
2207
+ format: "xid",
2208
+ check: "string_format",
2209
+ abort: false,
2210
+ ...normalizeParams$1(params)
2211
+ });
2212
+ }
2213
+ /* @__NO_SIDE_EFFECTS__ */
2214
+ function _ksuid$1(Class, params) {
2215
+ return new Class({
2216
+ type: "string",
2217
+ format: "ksuid",
2218
+ check: "string_format",
2219
+ abort: false,
2220
+ ...normalizeParams$1(params)
2221
+ });
2222
+ }
2223
+ /* @__NO_SIDE_EFFECTS__ */
2224
+ function _ipv4$1(Class, params) {
2225
+ return new Class({
2226
+ type: "string",
2227
+ format: "ipv4",
2228
+ check: "string_format",
2229
+ abort: false,
2230
+ ...normalizeParams$1(params)
2231
+ });
2232
+ }
2233
+ /* @__NO_SIDE_EFFECTS__ */
2234
+ function _ipv6$1(Class, params) {
2235
+ return new Class({
2236
+ type: "string",
2237
+ format: "ipv6",
2238
+ check: "string_format",
2239
+ abort: false,
2240
+ ...normalizeParams$1(params)
2241
+ });
2242
+ }
2243
+ /* @__NO_SIDE_EFFECTS__ */
2244
+ function _cidrv4$1(Class, params) {
2245
+ return new Class({
2246
+ type: "string",
2247
+ format: "cidrv4",
2248
+ check: "string_format",
2249
+ abort: false,
2250
+ ...normalizeParams$1(params)
2251
+ });
2252
+ }
2253
+ /* @__NO_SIDE_EFFECTS__ */
2254
+ function _cidrv6$1(Class, params) {
2255
+ return new Class({
2256
+ type: "string",
2257
+ format: "cidrv6",
2258
+ check: "string_format",
2259
+ abort: false,
2260
+ ...normalizeParams$1(params)
2261
+ });
2262
+ }
2263
+ /* @__NO_SIDE_EFFECTS__ */
2264
+ function _base64$1(Class, params) {
2265
+ return new Class({
2266
+ type: "string",
2267
+ format: "base64",
2268
+ check: "string_format",
2269
+ abort: false,
2270
+ ...normalizeParams$1(params)
2271
+ });
2272
+ }
2273
+ /* @__NO_SIDE_EFFECTS__ */
2274
+ function _base64url$1(Class, params) {
2275
+ return new Class({
2276
+ type: "string",
2277
+ format: "base64url",
2278
+ check: "string_format",
2279
+ abort: false,
2280
+ ...normalizeParams$1(params)
2281
+ });
2282
+ }
2283
+ /* @__NO_SIDE_EFFECTS__ */
2284
+ function _e164$1(Class, params) {
2285
+ return new Class({
2286
+ type: "string",
2287
+ format: "e164",
2288
+ check: "string_format",
2289
+ abort: false,
2290
+ ...normalizeParams$1(params)
2291
+ });
2292
+ }
2293
+ /* @__NO_SIDE_EFFECTS__ */
2294
+ function _jwt$1(Class, params) {
2295
+ return new Class({
2296
+ type: "string",
2297
+ format: "jwt",
2298
+ check: "string_format",
2299
+ abort: false,
2300
+ ...normalizeParams$1(params)
2301
+ });
2302
+ }
2303
+ /* @__NO_SIDE_EFFECTS__ */
2304
+ function _isoDateTime$1(Class, params) {
2305
+ return new Class({
2306
+ type: "string",
2307
+ format: "datetime",
2308
+ check: "string_format",
2309
+ offset: false,
2310
+ local: false,
2311
+ precision: null,
2312
+ ...normalizeParams$1(params)
2313
+ });
2314
+ }
2315
+ /* @__NO_SIDE_EFFECTS__ */
2316
+ function _isoDate$1(Class, params) {
2317
+ return new Class({
2318
+ type: "string",
2319
+ format: "date",
2320
+ check: "string_format",
2321
+ ...normalizeParams$1(params)
2322
+ });
2323
+ }
2324
+ /* @__NO_SIDE_EFFECTS__ */
2325
+ function _isoTime$1(Class, params) {
2326
+ return new Class({
2327
+ type: "string",
2328
+ format: "time",
2329
+ check: "string_format",
2330
+ precision: null,
2331
+ ...normalizeParams$1(params)
2332
+ });
2333
+ }
2334
+ /* @__NO_SIDE_EFFECTS__ */
2335
+ function _isoDuration$1(Class, params) {
2336
+ return new Class({
2337
+ type: "string",
2338
+ format: "duration",
2339
+ check: "string_format",
2340
+ ...normalizeParams$1(params)
2341
+ });
2342
+ }
2343
+ /* @__NO_SIDE_EFFECTS__ */
2344
+ function _number$1(Class, params) {
2345
+ return new Class({
2346
+ type: "number",
2347
+ checks: [],
2348
+ ...normalizeParams$1(params)
2349
+ });
2350
+ }
2351
+ /* @__NO_SIDE_EFFECTS__ */
2352
+ function _int$1(Class, params) {
2353
+ return new Class({
2354
+ type: "number",
2355
+ check: "number_format",
2356
+ abort: false,
2357
+ format: "safeint",
2358
+ ...normalizeParams$1(params)
2359
+ });
2360
+ }
2361
+ /* @__NO_SIDE_EFFECTS__ */
2362
+ function _unknown$1(Class) {
2363
+ return new Class({ type: "unknown" });
2364
+ }
2365
+ /* @__NO_SIDE_EFFECTS__ */
2366
+ function _never$1(Class, params) {
2367
+ return new Class({
2368
+ type: "never",
2369
+ ...normalizeParams$1(params)
2370
+ });
2371
+ }
2372
+ /* @__NO_SIDE_EFFECTS__ */
2373
+ function _lt$1(value, params) {
2374
+ return new $ZodCheckLessThan$1({
2375
+ check: "less_than",
2376
+ ...normalizeParams$1(params),
2377
+ value,
2378
+ inclusive: false
2379
+ });
2380
+ }
2381
+ /* @__NO_SIDE_EFFECTS__ */
2382
+ function _lte$1(value, params) {
2383
+ return new $ZodCheckLessThan$1({
2384
+ check: "less_than",
2385
+ ...normalizeParams$1(params),
2386
+ value,
2387
+ inclusive: true
2388
+ });
2389
+ }
2390
+ /* @__NO_SIDE_EFFECTS__ */
2391
+ function _gt$1(value, params) {
2392
+ return new $ZodCheckGreaterThan$1({
2393
+ check: "greater_than",
2394
+ ...normalizeParams$1(params),
2395
+ value,
2396
+ inclusive: false
2397
+ });
2398
+ }
2399
+ /* @__NO_SIDE_EFFECTS__ */
2400
+ function _gte$1(value, params) {
2401
+ return new $ZodCheckGreaterThan$1({
2402
+ check: "greater_than",
2403
+ ...normalizeParams$1(params),
2404
+ value,
2405
+ inclusive: true
2406
+ });
2407
+ }
2408
+ /* @__NO_SIDE_EFFECTS__ */
2409
+ function _multipleOf$1(value, params) {
2410
+ return new $ZodCheckMultipleOf$1({
2411
+ check: "multiple_of",
2412
+ ...normalizeParams$1(params),
2413
+ value
2414
+ });
2415
+ }
2416
+ /* @__NO_SIDE_EFFECTS__ */
2417
+ function _maxLength$1(maximum, params) {
2418
+ return new $ZodCheckMaxLength$1({
2419
+ check: "max_length",
2420
+ ...normalizeParams$1(params),
2421
+ maximum
2422
+ });
2423
+ }
2424
+ /* @__NO_SIDE_EFFECTS__ */
2425
+ function _minLength$1(minimum, params) {
2426
+ return new $ZodCheckMinLength$1({
2427
+ check: "min_length",
2428
+ ...normalizeParams$1(params),
2429
+ minimum
2430
+ });
2431
+ }
2432
+ /* @__NO_SIDE_EFFECTS__ */
2433
+ function _length$1(length, params) {
2434
+ return new $ZodCheckLengthEquals$1({
2435
+ check: "length_equals",
2436
+ ...normalizeParams$1(params),
2437
+ length
2438
+ });
2439
+ }
2440
+ /* @__NO_SIDE_EFFECTS__ */
2441
+ function _regex$1(pattern, params) {
2442
+ return new $ZodCheckRegex$1({
2443
+ check: "string_format",
2444
+ format: "regex",
2445
+ ...normalizeParams$1(params),
2446
+ pattern
2447
+ });
2448
+ }
2449
+ /* @__NO_SIDE_EFFECTS__ */
2450
+ function _lowercase$1(params) {
2451
+ return new $ZodCheckLowerCase$1({
2452
+ check: "string_format",
2453
+ format: "lowercase",
2454
+ ...normalizeParams$1(params)
2455
+ });
2456
+ }
2457
+ /* @__NO_SIDE_EFFECTS__ */
2458
+ function _uppercase$1(params) {
2459
+ return new $ZodCheckUpperCase$1({
2460
+ check: "string_format",
2461
+ format: "uppercase",
2462
+ ...normalizeParams$1(params)
2463
+ });
2464
+ }
2465
+ /* @__NO_SIDE_EFFECTS__ */
2466
+ function _includes$1(includes, params) {
2467
+ return new $ZodCheckIncludes$1({
2468
+ check: "string_format",
2469
+ format: "includes",
2470
+ ...normalizeParams$1(params),
2471
+ includes
2472
+ });
2473
+ }
2474
+ /* @__NO_SIDE_EFFECTS__ */
2475
+ function _startsWith$1(prefix, params) {
2476
+ return new $ZodCheckStartsWith$1({
2477
+ check: "string_format",
2478
+ format: "starts_with",
2479
+ ...normalizeParams$1(params),
2480
+ prefix
2481
+ });
2482
+ }
2483
+ /* @__NO_SIDE_EFFECTS__ */
2484
+ function _endsWith$1(suffix, params) {
2485
+ return new $ZodCheckEndsWith$1({
2486
+ check: "string_format",
2487
+ format: "ends_with",
2488
+ ...normalizeParams$1(params),
2489
+ suffix
2490
+ });
2491
+ }
2492
+ /* @__NO_SIDE_EFFECTS__ */
2493
+ function _overwrite$1(tx) {
2494
+ return new $ZodCheckOverwrite$1({
2495
+ check: "overwrite",
2496
+ tx
2497
+ });
2498
+ }
2499
+ /* @__NO_SIDE_EFFECTS__ */
2500
+ function _normalize$1(form) {
2501
+ return /* @__PURE__ */ _overwrite$1((input) => input.normalize(form));
2502
+ }
2503
+ /* @__NO_SIDE_EFFECTS__ */
2504
+ function _trim$1() {
2505
+ return /* @__PURE__ */ _overwrite$1((input) => input.trim());
2506
+ }
2507
+ /* @__NO_SIDE_EFFECTS__ */
2508
+ function _toLowerCase$1() {
2509
+ return /* @__PURE__ */ _overwrite$1((input) => input.toLowerCase());
2510
+ }
2511
+ /* @__NO_SIDE_EFFECTS__ */
2512
+ function _toUpperCase$1() {
2513
+ return /* @__PURE__ */ _overwrite$1((input) => input.toUpperCase());
2514
+ }
2515
+ /* @__NO_SIDE_EFFECTS__ */
2516
+ function _slugify$1() {
2517
+ return /* @__PURE__ */ _overwrite$1((input) => slugify$1(input));
2518
+ }
2519
+ /* @__NO_SIDE_EFFECTS__ */
2520
+ function _array$1(Class, element, params) {
2521
+ return new Class({
2522
+ type: "array",
2523
+ element,
2524
+ ...normalizeParams$1(params)
2525
+ });
2526
+ }
2527
+ /* @__NO_SIDE_EFFECTS__ */
2528
+ function _refine$1(Class, fn, _params) {
2529
+ return new Class({
2530
+ type: "custom",
2531
+ check: "custom",
2532
+ fn,
2533
+ ...normalizeParams$1(_params)
2534
+ });
2535
+ }
2536
+ /* @__NO_SIDE_EFFECTS__ */
2537
+ function _superRefine$1(fn) {
2538
+ const ch = /* @__PURE__ */ _check$1((payload) => {
2539
+ payload.addIssue = (issue$2) => {
2540
+ if (typeof issue$2 === "string") payload.issues.push(issue$1(issue$2, payload.value, ch._zod.def));
2541
+ else {
2542
+ const _issue = issue$2;
2543
+ if (_issue.fatal) _issue.continue = false;
2544
+ _issue.code ?? (_issue.code = "custom");
2545
+ _issue.input ?? (_issue.input = payload.value);
2546
+ _issue.inst ?? (_issue.inst = ch);
2547
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2548
+ payload.issues.push(issue$1(_issue));
2549
+ }
2550
+ };
2551
+ return fn(payload.value, payload);
2552
+ });
2553
+ return ch;
2554
+ }
2555
+ /* @__NO_SIDE_EFFECTS__ */
2556
+ function _check$1(fn, params) {
2557
+ const ch = new $ZodCheck$1({
2558
+ check: "custom",
2559
+ ...normalizeParams$1(params)
2560
+ });
2561
+ ch._zod.check = fn;
2562
+ return ch;
2563
+ }
2564
+ /* @__NO_SIDE_EFFECTS__ */
2565
+ function describe$1(description) {
2566
+ const ch = new $ZodCheck$1({ check: "describe" });
2567
+ ch._zod.onattach = [(inst) => {
2568
+ const existing = globalRegistry$1.get(inst) ?? {};
2569
+ globalRegistry$1.add(inst, {
2570
+ ...existing,
2571
+ description
2572
+ });
2573
+ }];
2574
+ ch._zod.check = () => {};
2575
+ return ch;
2576
+ }
2577
+ /* @__NO_SIDE_EFFECTS__ */
2578
+ function meta$1(metadata) {
2579
+ const ch = new $ZodCheck$1({ check: "meta" });
2580
+ ch._zod.onattach = [(inst) => {
2581
+ const existing = globalRegistry$1.get(inst) ?? {};
2582
+ globalRegistry$1.add(inst, {
2583
+ ...existing,
2584
+ ...metadata
2585
+ });
2586
+ }];
2587
+ ch._zod.check = () => {};
2588
+ return ch;
2589
+ }
2590
+
2591
+ //#endregion
2592
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
2593
+ function initializeContext$1(params) {
2594
+ let target = params?.target ?? "draft-2020-12";
2595
+ if (target === "draft-4") target = "draft-04";
2596
+ if (target === "draft-7") target = "draft-07";
2597
+ return {
2598
+ processors: params.processors ?? {},
2599
+ metadataRegistry: params?.metadata ?? globalRegistry$1,
2600
+ target,
2601
+ unrepresentable: params?.unrepresentable ?? "throw",
2602
+ override: params?.override ?? (() => {}),
2603
+ io: params?.io ?? "output",
2604
+ counter: 0,
2605
+ seen: /* @__PURE__ */ new Map(),
2606
+ cycles: params?.cycles ?? "ref",
2607
+ reused: params?.reused ?? "inline",
2608
+ external: params?.external ?? void 0
2609
+ };
2610
+ }
2611
+ function process$3(schema, ctx, _params = {
2612
+ path: [],
2613
+ schemaPath: []
2614
+ }) {
2615
+ var _a$2;
2616
+ const def = schema._zod.def;
2617
+ const seen = ctx.seen.get(schema);
2618
+ if (seen) {
2619
+ seen.count++;
2620
+ if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
2621
+ return seen.schema;
2622
+ }
2623
+ const result = {
2624
+ schema: {},
2625
+ count: 1,
2626
+ cycle: void 0,
2627
+ path: _params.path
2628
+ };
2629
+ ctx.seen.set(schema, result);
2630
+ const overrideSchema = schema._zod.toJSONSchema?.();
2631
+ if (overrideSchema) result.schema = overrideSchema;
2632
+ else {
2633
+ const params = {
2634
+ ..._params,
2635
+ schemaPath: [..._params.schemaPath, schema],
2636
+ path: _params.path
2637
+ };
2638
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2639
+ else {
2640
+ const _json = result.schema;
2641
+ const processor = ctx.processors[def.type];
2642
+ if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2643
+ processor(schema, ctx, _json, params);
2644
+ }
2645
+ const parent = schema._zod.parent;
2646
+ if (parent) {
2647
+ if (!result.ref) result.ref = parent;
2648
+ process$3(parent, ctx, params);
2649
+ ctx.seen.get(parent).isParent = true;
2650
+ }
2651
+ }
2652
+ const meta$2 = ctx.metadataRegistry.get(schema);
2653
+ if (meta$2) Object.assign(result.schema, meta$2);
2654
+ if (ctx.io === "input" && isTransforming$1(schema)) {
2655
+ delete result.schema.examples;
2656
+ delete result.schema.default;
2657
+ }
2658
+ if (ctx.io === "input" && result.schema._prefault) (_a$2 = result.schema).default ?? (_a$2.default = result.schema._prefault);
2659
+ delete result.schema._prefault;
2660
+ return ctx.seen.get(schema).schema;
2661
+ }
2662
+ function extractDefs$1(ctx, schema) {
2663
+ const root = ctx.seen.get(schema);
2664
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2665
+ const idToSchema = /* @__PURE__ */ new Map();
2666
+ for (const entry of ctx.seen.entries()) {
2667
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
2668
+ if (id) {
2669
+ const existing = idToSchema.get(id);
2670
+ if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2671
+ idToSchema.set(id, entry[0]);
2672
+ }
2673
+ }
2674
+ const makeURI = (entry) => {
2675
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2676
+ if (ctx.external) {
2677
+ const externalId = ctx.external.registry.get(entry[0])?.id;
2678
+ const uriGenerator = ctx.external.uri ?? ((id$1) => id$1);
2679
+ if (externalId) return { ref: uriGenerator(externalId) };
2680
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
2681
+ entry[1].defId = id;
2682
+ return {
2683
+ defId: id,
2684
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
2685
+ };
2686
+ }
2687
+ if (entry[1] === root) return { ref: "#" };
2688
+ const defUriPrefix = `#/${defsSegment}/`;
2689
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2690
+ return {
2691
+ defId,
2692
+ ref: defUriPrefix + defId
2693
+ };
2694
+ };
2695
+ const extractToDef = (entry) => {
2696
+ if (entry[1].schema.$ref) return;
2697
+ const seen = entry[1];
2698
+ const { ref, defId } = makeURI(entry);
2699
+ seen.def = { ...seen.schema };
2700
+ if (defId) seen.defId = defId;
2701
+ const schema$1 = seen.schema;
2702
+ for (const key in schema$1) delete schema$1[key];
2703
+ schema$1.$ref = ref;
2704
+ };
2705
+ if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
2706
+ const seen = entry[1];
2707
+ if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
2708
+
2709
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2710
+ }
2711
+ for (const entry of ctx.seen.entries()) {
2712
+ const seen = entry[1];
2713
+ if (schema === entry[0]) {
2714
+ extractToDef(entry);
2715
+ continue;
2716
+ }
2717
+ if (ctx.external) {
2718
+ const ext = ctx.external.registry.get(entry[0])?.id;
2719
+ if (schema !== entry[0] && ext) {
2720
+ extractToDef(entry);
2721
+ continue;
2722
+ }
2723
+ }
2724
+ if (ctx.metadataRegistry.get(entry[0])?.id) {
2725
+ extractToDef(entry);
2726
+ continue;
2727
+ }
2728
+ if (seen.cycle) {
2729
+ extractToDef(entry);
2730
+ continue;
2731
+ }
2732
+ if (seen.count > 1) {
2733
+ if (ctx.reused === "ref") {
2734
+ extractToDef(entry);
2735
+ continue;
2736
+ }
2737
+ }
2738
+ }
2739
+ }
2740
+ function finalize$1(ctx, schema) {
2741
+ const root = ctx.seen.get(schema);
2742
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2743
+ const flattenRef = (zodSchema) => {
2744
+ const seen = ctx.seen.get(zodSchema);
2745
+ if (seen.ref === null) return;
2746
+ const schema$1 = seen.def ?? seen.schema;
2747
+ const _cached = { ...schema$1 };
2748
+ const ref = seen.ref;
2749
+ seen.ref = null;
2750
+ if (ref) {
2751
+ flattenRef(ref);
2752
+ const refSeen = ctx.seen.get(ref);
2753
+ const refSchema = refSeen.schema;
2754
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2755
+ schema$1.allOf = schema$1.allOf ?? [];
2756
+ schema$1.allOf.push(refSchema);
2757
+ } else Object.assign(schema$1, refSchema);
2758
+ Object.assign(schema$1, _cached);
2759
+ if (zodSchema._zod.parent === ref) for (const key in schema$1) {
2760
+ if (key === "$ref" || key === "allOf") continue;
2761
+ if (!(key in _cached)) delete schema$1[key];
2762
+ }
2763
+ if (refSchema.$ref && refSeen.def) for (const key in schema$1) {
2764
+ if (key === "$ref" || key === "allOf") continue;
2765
+ if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key];
2766
+ }
2767
+ }
2768
+ const parent = zodSchema._zod.parent;
2769
+ if (parent && parent !== ref) {
2770
+ flattenRef(parent);
2771
+ const parentSeen = ctx.seen.get(parent);
2772
+ if (parentSeen?.schema.$ref) {
2773
+ schema$1.$ref = parentSeen.schema.$ref;
2774
+ if (parentSeen.def) for (const key in schema$1) {
2775
+ if (key === "$ref" || key === "allOf") continue;
2776
+ if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key];
2777
+ }
2778
+ }
2779
+ }
2780
+ ctx.override({
2781
+ zodSchema,
2782
+ jsonSchema: schema$1,
2783
+ path: seen.path ?? []
2784
+ });
2785
+ };
2786
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
2787
+ const result = {};
2788
+ if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2789
+ else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
2790
+ else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
2791
+ else if (ctx.target === "openapi-3.0") {}
2792
+ if (ctx.external?.uri) {
2793
+ const id = ctx.external.registry.get(schema)?.id;
2794
+ if (!id) throw new Error("Schema is missing an `id` property");
2795
+ result.$id = ctx.external.uri(id);
2796
+ }
2797
+ Object.assign(result, root.def ?? root.schema);
2798
+ const defs = ctx.external?.defs ?? {};
2799
+ for (const entry of ctx.seen.entries()) {
2800
+ const seen = entry[1];
2801
+ if (seen.def && seen.defId) defs[seen.defId] = seen.def;
2802
+ }
2803
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
2804
+ else result.definitions = defs;
2805
+ try {
2806
+ const finalized = JSON.parse(JSON.stringify(result));
2807
+ Object.defineProperty(finalized, "~standard", {
2808
+ value: {
2809
+ ...schema["~standard"],
2810
+ jsonSchema: {
2811
+ input: createStandardJSONSchemaMethod$1(schema, "input", ctx.processors),
2812
+ output: createStandardJSONSchemaMethod$1(schema, "output", ctx.processors)
2813
+ }
2814
+ },
2815
+ enumerable: false,
2816
+ writable: false
2817
+ });
2818
+ return finalized;
2819
+ } catch (_err) {
2820
+ throw new Error("Error converting schema to JSON.");
2821
+ }
2822
+ }
2823
+ function isTransforming$1(_schema, _ctx) {
2824
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
2825
+ if (ctx.seen.has(_schema)) return false;
2826
+ ctx.seen.add(_schema);
2827
+ const def = _schema._zod.def;
2828
+ if (def.type === "transform") return true;
2829
+ if (def.type === "array") return isTransforming$1(def.element, ctx);
2830
+ if (def.type === "set") return isTransforming$1(def.valueType, ctx);
2831
+ if (def.type === "lazy") return isTransforming$1(def.getter(), ctx);
2832
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming$1(def.innerType, ctx);
2833
+ if (def.type === "intersection") return isTransforming$1(def.left, ctx) || isTransforming$1(def.right, ctx);
2834
+ if (def.type === "record" || def.type === "map") return isTransforming$1(def.keyType, ctx) || isTransforming$1(def.valueType, ctx);
2835
+ if (def.type === "pipe") return isTransforming$1(def.in, ctx) || isTransforming$1(def.out, ctx);
2836
+ if (def.type === "object") {
2837
+ for (const key in def.shape) if (isTransforming$1(def.shape[key], ctx)) return true;
2838
+ return false;
2839
+ }
2840
+ if (def.type === "union") {
2841
+ for (const option of def.options) if (isTransforming$1(option, ctx)) return true;
2842
+ return false;
2843
+ }
2844
+ if (def.type === "tuple") {
2845
+ for (const item of def.items) if (isTransforming$1(item, ctx)) return true;
2846
+ if (def.rest && isTransforming$1(def.rest, ctx)) return true;
2847
+ return false;
2848
+ }
2849
+ return false;
2850
+ }
2851
+ /**
2852
+ * Creates a toJSONSchema method for a schema instance.
2853
+ * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
2854
+ */
2855
+ const createToJSONSchemaMethod$1 = (schema, processors = {}) => (params) => {
2856
+ const ctx = initializeContext$1({
2857
+ ...params,
2858
+ processors
2859
+ });
2860
+ process$3(schema, ctx);
2861
+ extractDefs$1(ctx, schema);
2862
+ return finalize$1(ctx, schema);
2863
+ };
2864
+ const createStandardJSONSchemaMethod$1 = (schema, io, processors = {}) => (params) => {
2865
+ const { libraryOptions, target } = params ?? {};
2866
+ const ctx = initializeContext$1({
2867
+ ...libraryOptions ?? {},
2868
+ target,
2869
+ io,
2870
+ processors
2871
+ });
2872
+ process$3(schema, ctx);
2873
+ extractDefs$1(ctx, schema);
2874
+ return finalize$1(ctx, schema);
2875
+ };
2876
+
2877
+ //#endregion
2878
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
2879
+ const formatMap$1 = {
2880
+ guid: "uuid",
2881
+ url: "uri",
2882
+ datetime: "date-time",
2883
+ json_string: "json-string",
2884
+ regex: ""
2885
+ };
2886
+ const stringProcessor$1 = (schema, ctx, _json, _params) => {
2887
+ const json = _json;
2888
+ json.type = "string";
2889
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
2890
+ if (typeof minimum === "number") json.minLength = minimum;
2891
+ if (typeof maximum === "number") json.maxLength = maximum;
2892
+ if (format) {
2893
+ json.format = formatMap$1[format] ?? format;
2894
+ if (json.format === "") delete json.format;
2895
+ if (format === "time") delete json.format;
2896
+ }
2897
+ if (contentEncoding) json.contentEncoding = contentEncoding;
2898
+ if (patterns && patterns.size > 0) {
2899
+ const regexes = [...patterns];
2900
+ if (regexes.length === 1) json.pattern = regexes[0].source;
2901
+ else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
2902
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
2903
+ pattern: regex.source
2904
+ }))];
2905
+ }
2906
+ };
2907
+ const numberProcessor$1 = (schema, ctx, _json, _params) => {
2908
+ const json = _json;
2909
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
2910
+ if (typeof format === "string" && format.includes("int")) json.type = "integer";
2911
+ else json.type = "number";
2912
+ if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
2913
+ json.minimum = exclusiveMinimum;
2914
+ json.exclusiveMinimum = true;
2915
+ } else json.exclusiveMinimum = exclusiveMinimum;
2916
+ if (typeof minimum === "number") {
2917
+ json.minimum = minimum;
2918
+ if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json.minimum;
2919
+ else delete json.exclusiveMinimum;
2920
+ }
2921
+ if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
2922
+ json.maximum = exclusiveMaximum;
2923
+ json.exclusiveMaximum = true;
2924
+ } else json.exclusiveMaximum = exclusiveMaximum;
2925
+ if (typeof maximum === "number") {
2926
+ json.maximum = maximum;
2927
+ if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json.maximum;
2928
+ else delete json.exclusiveMaximum;
2929
+ }
2930
+ if (typeof multipleOf === "number") json.multipleOf = multipleOf;
2931
+ };
2932
+ const neverProcessor$1 = (_schema, _ctx, json, _params) => {
2933
+ json.not = {};
2934
+ };
2935
+ const unknownProcessor$1 = (_schema, _ctx, _json, _params) => {};
2936
+ const enumProcessor$1 = (schema, _ctx, json, _params) => {
2937
+ const def = schema._zod.def;
2938
+ const values = getEnumValues$1(def.entries);
2939
+ if (values.every((v) => typeof v === "number")) json.type = "number";
2940
+ if (values.every((v) => typeof v === "string")) json.type = "string";
2941
+ json.enum = values;
2942
+ };
2943
+ const customProcessor$1 = (_schema, ctx, _json, _params) => {
2944
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
2945
+ };
2946
+ const transformProcessor$1 = (_schema, ctx, _json, _params) => {
2947
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
2948
+ };
2949
+ const arrayProcessor$1 = (schema, ctx, _json, params) => {
2950
+ const json = _json;
2951
+ const def = schema._zod.def;
2952
+ const { minimum, maximum } = schema._zod.bag;
2953
+ if (typeof minimum === "number") json.minItems = minimum;
2954
+ if (typeof maximum === "number") json.maxItems = maximum;
2955
+ json.type = "array";
2956
+ json.items = process$3(def.element, ctx, {
2957
+ ...params,
2958
+ path: [...params.path, "items"]
2959
+ });
2960
+ };
2961
+ const objectProcessor$1 = (schema, ctx, _json, params) => {
2962
+ const json = _json;
2963
+ const def = schema._zod.def;
2964
+ json.type = "object";
2965
+ json.properties = {};
2966
+ const shape = def.shape;
2967
+ for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
2968
+ ...params,
2969
+ path: [
2970
+ ...params.path,
2971
+ "properties",
2972
+ key
2973
+ ]
2974
+ });
2975
+ const allKeys = new Set(Object.keys(shape));
2976
+ const requiredKeys = new Set([...allKeys].filter((key) => {
2977
+ const v = def.shape[key]._zod;
2978
+ if (ctx.io === "input") return v.optin === void 0;
2979
+ else return v.optout === void 0;
2980
+ }));
2981
+ if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
2982
+ if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
2983
+ else if (!def.catchall) {
2984
+ if (ctx.io === "output") json.additionalProperties = false;
2985
+ } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
2986
+ ...params,
2987
+ path: [...params.path, "additionalProperties"]
2988
+ });
2989
+ };
2990
+ const unionProcessor$1 = (schema, ctx, json, params) => {
2991
+ const def = schema._zod.def;
2992
+ const isExclusive = def.inclusive === false;
2993
+ const options = def.options.map((x, i) => process$3(x, ctx, {
2994
+ ...params,
2995
+ path: [
2996
+ ...params.path,
2997
+ isExclusive ? "oneOf" : "anyOf",
2998
+ i
2999
+ ]
3000
+ }));
3001
+ if (isExclusive) json.oneOf = options;
3002
+ else json.anyOf = options;
3003
+ };
3004
+ const intersectionProcessor$1 = (schema, ctx, json, params) => {
3005
+ const def = schema._zod.def;
3006
+ const a = process$3(def.left, ctx, {
3007
+ ...params,
3008
+ path: [
3009
+ ...params.path,
3010
+ "allOf",
3011
+ 0
3012
+ ]
3013
+ });
3014
+ const b = process$3(def.right, ctx, {
3015
+ ...params,
3016
+ path: [
3017
+ ...params.path,
3018
+ "allOf",
3019
+ 1
3020
+ ]
3021
+ });
3022
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3023
+ json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3024
+ };
3025
+ const nullableProcessor$1 = (schema, ctx, json, params) => {
3026
+ const def = schema._zod.def;
3027
+ const inner = process$3(def.innerType, ctx, params);
3028
+ const seen = ctx.seen.get(schema);
3029
+ if (ctx.target === "openapi-3.0") {
3030
+ seen.ref = def.innerType;
3031
+ json.nullable = true;
3032
+ } else json.anyOf = [inner, { type: "null" }];
3033
+ };
3034
+ const nonoptionalProcessor$1 = (schema, ctx, _json, params) => {
3035
+ const def = schema._zod.def;
3036
+ process$3(def.innerType, ctx, params);
3037
+ const seen = ctx.seen.get(schema);
3038
+ seen.ref = def.innerType;
3039
+ };
3040
+ const defaultProcessor$1 = (schema, ctx, json, params) => {
3041
+ const def = schema._zod.def;
3042
+ process$3(def.innerType, ctx, params);
3043
+ const seen = ctx.seen.get(schema);
3044
+ seen.ref = def.innerType;
3045
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
3046
+ };
3047
+ const prefaultProcessor$1 = (schema, ctx, json, params) => {
3048
+ const def = schema._zod.def;
3049
+ process$3(def.innerType, ctx, params);
3050
+ const seen = ctx.seen.get(schema);
3051
+ seen.ref = def.innerType;
3052
+ if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3053
+ };
3054
+ const catchProcessor$1 = (schema, ctx, json, params) => {
3055
+ const def = schema._zod.def;
3056
+ process$3(def.innerType, ctx, params);
3057
+ const seen = ctx.seen.get(schema);
3058
+ seen.ref = def.innerType;
3059
+ let catchValue;
3060
+ try {
3061
+ catchValue = def.catchValue(void 0);
3062
+ } catch {
3063
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
3064
+ }
3065
+ json.default = catchValue;
3066
+ };
3067
+ const pipeProcessor$1 = (schema, ctx, _json, params) => {
3068
+ const def = schema._zod.def;
3069
+ const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
3070
+ process$3(innerType, ctx, params);
3071
+ const seen = ctx.seen.get(schema);
3072
+ seen.ref = innerType;
3073
+ };
3074
+ const readonlyProcessor$1 = (schema, ctx, json, params) => {
3075
+ const def = schema._zod.def;
3076
+ process$3(def.innerType, ctx, params);
3077
+ const seen = ctx.seen.get(schema);
3078
+ seen.ref = def.innerType;
3079
+ json.readOnly = true;
3080
+ };
3081
+ const optionalProcessor$1 = (schema, ctx, _json, params) => {
3082
+ const def = schema._zod.def;
3083
+ process$3(def.innerType, ctx, params);
3084
+ const seen = ctx.seen.get(schema);
3085
+ seen.ref = def.innerType;
3086
+ };
3087
+
3088
+ //#endregion
3089
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/iso.js
3090
+ const ZodISODateTime$1 = /* @__PURE__ */ $constructor$1("ZodISODateTime", (inst, def) => {
3091
+ $ZodISODateTime$1.init(inst, def);
3092
+ ZodStringFormat$1.init(inst, def);
3093
+ });
3094
+ function datetime$2(params) {
3095
+ return _isoDateTime$1(ZodISODateTime$1, params);
3096
+ }
3097
+ const ZodISODate$1 = /* @__PURE__ */ $constructor$1("ZodISODate", (inst, def) => {
3098
+ $ZodISODate$1.init(inst, def);
3099
+ ZodStringFormat$1.init(inst, def);
3100
+ });
3101
+ function date$2(params) {
3102
+ return _isoDate$1(ZodISODate$1, params);
3103
+ }
3104
+ const ZodISOTime$1 = /* @__PURE__ */ $constructor$1("ZodISOTime", (inst, def) => {
3105
+ $ZodISOTime$1.init(inst, def);
3106
+ ZodStringFormat$1.init(inst, def);
3107
+ });
3108
+ function time$2(params) {
3109
+ return _isoTime$1(ZodISOTime$1, params);
3110
+ }
3111
+ const ZodISODuration$1 = /* @__PURE__ */ $constructor$1("ZodISODuration", (inst, def) => {
3112
+ $ZodISODuration$1.init(inst, def);
3113
+ ZodStringFormat$1.init(inst, def);
3114
+ });
3115
+ function duration$2(params) {
3116
+ return _isoDuration$1(ZodISODuration$1, params);
3117
+ }
3118
+
3119
+ //#endregion
3120
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/errors.js
3121
+ const initializer$2 = (inst, issues) => {
3122
+ $ZodError$1.init(inst, issues);
3123
+ inst.name = "ZodError";
3124
+ Object.defineProperties(inst, {
3125
+ format: { value: (mapper) => formatError$1(inst, mapper) },
3126
+ flatten: { value: (mapper) => flattenError$1(inst, mapper) },
3127
+ addIssue: { value: (issue$2) => {
3128
+ inst.issues.push(issue$2);
3129
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer$1, 2);
3130
+ } },
3131
+ addIssues: { value: (issues$1) => {
3132
+ inst.issues.push(...issues$1);
3133
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer$1, 2);
3134
+ } },
3135
+ isEmpty: { get() {
3136
+ return inst.issues.length === 0;
3137
+ } }
3138
+ });
3139
+ };
3140
+ const ZodError = $constructor$1("ZodError", initializer$2);
3141
+ const ZodRealError$1 = $constructor$1("ZodError", initializer$2, { Parent: Error });
3142
+
3143
+ //#endregion
3144
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/parse.js
3145
+ const parse$1 = /* @__PURE__ */ _parse$1(ZodRealError$1);
3146
+ const parseAsync$1 = /* @__PURE__ */ _parseAsync$1(ZodRealError$1);
3147
+ const safeParse$2 = /* @__PURE__ */ _safeParse$1(ZodRealError$1);
3148
+ const safeParseAsync$2 = /* @__PURE__ */ _safeParseAsync$1(ZodRealError$1);
3149
+ const encode$1 = /* @__PURE__ */ _encode$1(ZodRealError$1);
3150
+ const decode$1 = /* @__PURE__ */ _decode$1(ZodRealError$1);
3151
+ const encodeAsync$1 = /* @__PURE__ */ _encodeAsync$1(ZodRealError$1);
3152
+ const decodeAsync$1 = /* @__PURE__ */ _decodeAsync$1(ZodRealError$1);
3153
+ const safeEncode$1 = /* @__PURE__ */ _safeEncode$1(ZodRealError$1);
3154
+ const safeDecode$1 = /* @__PURE__ */ _safeDecode$1(ZodRealError$1);
3155
+ const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync$1(ZodRealError$1);
3156
+ const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync$1(ZodRealError$1);
3157
+
3158
+ //#endregion
3159
+ //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
3160
+ const ZodType$1 = /* @__PURE__ */ $constructor$1("ZodType", (inst, def) => {
3161
+ $ZodType$1.init(inst, def);
3162
+ Object.assign(inst["~standard"], { jsonSchema: {
3163
+ input: createStandardJSONSchemaMethod$1(inst, "input"),
3164
+ output: createStandardJSONSchemaMethod$1(inst, "output")
3165
+ } });
3166
+ inst.toJSONSchema = createToJSONSchemaMethod$1(inst, {});
3167
+ inst.def = def;
3168
+ inst.type = def.type;
3169
+ Object.defineProperty(inst, "_def", { value: def });
3170
+ inst.check = (...checks) => {
3171
+ return inst.clone(mergeDefs$1(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
3172
+ check: ch,
3173
+ def: { check: "custom" },
3174
+ onattach: []
3175
+ } } : ch)] }), { parent: true });
3176
+ };
3177
+ inst.with = inst.check;
3178
+ inst.clone = (def$1, params) => clone$1(inst, def$1, params);
3179
+ inst.brand = () => inst;
3180
+ inst.register = ((reg, meta$2) => {
3181
+ reg.add(inst, meta$2);
3182
+ return inst;
3183
+ });
3184
+ inst.parse = (data, params) => parse$1(inst, data, params, { callee: inst.parse });
3185
+ inst.safeParse = (data, params) => safeParse$2(inst, data, params);
3186
+ inst.parseAsync = async (data, params) => parseAsync$1(inst, data, params, { callee: inst.parseAsync });
3187
+ inst.safeParseAsync = async (data, params) => safeParseAsync$2(inst, data, params);
3188
+ inst.spa = inst.safeParseAsync;
3189
+ inst.encode = (data, params) => encode$1(inst, data, params);
3190
+ inst.decode = (data, params) => decode$1(inst, data, params);
3191
+ inst.encodeAsync = async (data, params) => encodeAsync$1(inst, data, params);
3192
+ inst.decodeAsync = async (data, params) => decodeAsync$1(inst, data, params);
3193
+ inst.safeEncode = (data, params) => safeEncode$1(inst, data, params);
3194
+ inst.safeDecode = (data, params) => safeDecode$1(inst, data, params);
3195
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync$1(inst, data, params);
3196
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync$1(inst, data, params);
3197
+ inst.refine = (check, params) => inst.check(refine$1(check, params));
3198
+ inst.superRefine = (refinement) => inst.check(superRefine$1(refinement));
3199
+ inst.overwrite = (fn) => inst.check(_overwrite$1(fn));
3200
+ inst.optional = () => optional$1(inst);
3201
+ inst.exactOptional = () => exactOptional$1(inst);
3202
+ inst.nullable = () => nullable$1(inst);
3203
+ inst.nullish = () => optional$1(nullable$1(inst));
3204
+ inst.nonoptional = (params) => nonoptional$1(inst, params);
3205
+ inst.array = () => array$1(inst);
3206
+ inst.or = (arg) => union$1([inst, arg]);
3207
+ inst.and = (arg) => intersection$1(inst, arg);
3208
+ inst.transform = (tx) => pipe$1(inst, transform$1(tx));
3209
+ inst.default = (def$1) => _default$1(inst, def$1);
3210
+ inst.prefault = (def$1) => prefault$1(inst, def$1);
3211
+ inst.catch = (params) => _catch$1(inst, params);
3212
+ inst.pipe = (target) => pipe$1(inst, target);
3213
+ inst.readonly = () => readonly$1(inst);
3214
+ inst.describe = (description) => {
3215
+ const cl = inst.clone();
3216
+ globalRegistry$1.add(cl, { description });
3217
+ return cl;
3218
+ };
3219
+ Object.defineProperty(inst, "description", {
3220
+ get() {
3221
+ return globalRegistry$1.get(inst)?.description;
3222
+ },
3223
+ configurable: true
3224
+ });
3225
+ inst.meta = (...args) => {
3226
+ if (args.length === 0) return globalRegistry$1.get(inst);
3227
+ const cl = inst.clone();
3228
+ globalRegistry$1.add(cl, args[0]);
3229
+ return cl;
3230
+ };
3231
+ inst.isOptional = () => inst.safeParse(void 0).success;
3232
+ inst.isNullable = () => inst.safeParse(null).success;
3233
+ inst.apply = (fn) => fn(inst);
3234
+ return inst;
3235
+ });
3236
+ /** @internal */
3237
+ const _ZodString$1 = /* @__PURE__ */ $constructor$1("_ZodString", (inst, def) => {
3238
+ $ZodString$1.init(inst, def);
3239
+ ZodType$1.init(inst, def);
3240
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor$1(inst, ctx, json, params);
3241
+ const bag = inst._zod.bag;
3242
+ inst.format = bag.format ?? null;
3243
+ inst.minLength = bag.minimum ?? null;
3244
+ inst.maxLength = bag.maximum ?? null;
3245
+ inst.regex = (...args) => inst.check(_regex$1(...args));
3246
+ inst.includes = (...args) => inst.check(_includes$1(...args));
3247
+ inst.startsWith = (...args) => inst.check(_startsWith$1(...args));
3248
+ inst.endsWith = (...args) => inst.check(_endsWith$1(...args));
3249
+ inst.min = (...args) => inst.check(_minLength$1(...args));
3250
+ inst.max = (...args) => inst.check(_maxLength$1(...args));
3251
+ inst.length = (...args) => inst.check(_length$1(...args));
3252
+ inst.nonempty = (...args) => inst.check(_minLength$1(1, ...args));
3253
+ inst.lowercase = (params) => inst.check(_lowercase$1(params));
3254
+ inst.uppercase = (params) => inst.check(_uppercase$1(params));
3255
+ inst.trim = () => inst.check(_trim$1());
3256
+ inst.normalize = (...args) => inst.check(_normalize$1(...args));
3257
+ inst.toLowerCase = () => inst.check(_toLowerCase$1());
3258
+ inst.toUpperCase = () => inst.check(_toUpperCase$1());
3259
+ inst.slugify = () => inst.check(_slugify$1());
3260
+ });
3261
+ const ZodString$1 = /* @__PURE__ */ $constructor$1("ZodString", (inst, def) => {
3262
+ $ZodString$1.init(inst, def);
3263
+ _ZodString$1.init(inst, def);
3264
+ inst.email = (params) => inst.check(_email$1(ZodEmail$1, params));
3265
+ inst.url = (params) => inst.check(_url$1(ZodURL$1, params));
3266
+ inst.jwt = (params) => inst.check(_jwt$1(ZodJWT$1, params));
3267
+ inst.emoji = (params) => inst.check(_emoji$2(ZodEmoji$1, params));
3268
+ inst.guid = (params) => inst.check(_guid$1(ZodGUID$1, params));
3269
+ inst.uuid = (params) => inst.check(_uuid$1(ZodUUID$1, params));
3270
+ inst.uuidv4 = (params) => inst.check(_uuidv4$1(ZodUUID$1, params));
3271
+ inst.uuidv6 = (params) => inst.check(_uuidv6$1(ZodUUID$1, params));
3272
+ inst.uuidv7 = (params) => inst.check(_uuidv7$1(ZodUUID$1, params));
3273
+ inst.nanoid = (params) => inst.check(_nanoid$1(ZodNanoID$1, params));
3274
+ inst.guid = (params) => inst.check(_guid$1(ZodGUID$1, params));
3275
+ inst.cuid = (params) => inst.check(_cuid$1(ZodCUID$1, params));
3276
+ inst.cuid2 = (params) => inst.check(_cuid2$1(ZodCUID2$1, params));
3277
+ inst.ulid = (params) => inst.check(_ulid$1(ZodULID$1, params));
3278
+ inst.base64 = (params) => inst.check(_base64$1(ZodBase64$1, params));
3279
+ inst.base64url = (params) => inst.check(_base64url$1(ZodBase64URL$1, params));
3280
+ inst.xid = (params) => inst.check(_xid$1(ZodXID$1, params));
3281
+ inst.ksuid = (params) => inst.check(_ksuid$1(ZodKSUID$1, params));
3282
+ inst.ipv4 = (params) => inst.check(_ipv4$1(ZodIPv4$1, params));
3283
+ inst.ipv6 = (params) => inst.check(_ipv6$1(ZodIPv6$1, params));
3284
+ inst.cidrv4 = (params) => inst.check(_cidrv4$1(ZodCIDRv4$1, params));
3285
+ inst.cidrv6 = (params) => inst.check(_cidrv6$1(ZodCIDRv6$1, params));
3286
+ inst.e164 = (params) => inst.check(_e164$1(ZodE164$1, params));
3287
+ inst.datetime = (params) => inst.check(datetime$2(params));
3288
+ inst.date = (params) => inst.check(date$2(params));
3289
+ inst.time = (params) => inst.check(time$2(params));
3290
+ inst.duration = (params) => inst.check(duration$2(params));
3291
+ });
3292
+ function string$2(params) {
3293
+ return _string$1(ZodString$1, params);
3294
+ }
3295
+ const ZodStringFormat$1 = /* @__PURE__ */ $constructor$1("ZodStringFormat", (inst, def) => {
3296
+ $ZodStringFormat$1.init(inst, def);
3297
+ _ZodString$1.init(inst, def);
3298
+ });
3299
+ const ZodEmail$1 = /* @__PURE__ */ $constructor$1("ZodEmail", (inst, def) => {
3300
+ $ZodEmail$1.init(inst, def);
3301
+ ZodStringFormat$1.init(inst, def);
3302
+ });
3303
+ const ZodGUID$1 = /* @__PURE__ */ $constructor$1("ZodGUID", (inst, def) => {
3304
+ $ZodGUID$1.init(inst, def);
3305
+ ZodStringFormat$1.init(inst, def);
3306
+ });
3307
+ const ZodUUID$1 = /* @__PURE__ */ $constructor$1("ZodUUID", (inst, def) => {
3308
+ $ZodUUID$1.init(inst, def);
3309
+ ZodStringFormat$1.init(inst, def);
3310
+ });
3311
+ const ZodURL$1 = /* @__PURE__ */ $constructor$1("ZodURL", (inst, def) => {
3312
+ $ZodURL$1.init(inst, def);
3313
+ ZodStringFormat$1.init(inst, def);
3314
+ });
3315
+ const ZodEmoji$1 = /* @__PURE__ */ $constructor$1("ZodEmoji", (inst, def) => {
3316
+ $ZodEmoji$1.init(inst, def);
3317
+ ZodStringFormat$1.init(inst, def);
3318
+ });
3319
+ const ZodNanoID$1 = /* @__PURE__ */ $constructor$1("ZodNanoID", (inst, def) => {
3320
+ $ZodNanoID$1.init(inst, def);
3321
+ ZodStringFormat$1.init(inst, def);
3322
+ });
3323
+ const ZodCUID$1 = /* @__PURE__ */ $constructor$1("ZodCUID", (inst, def) => {
3324
+ $ZodCUID$1.init(inst, def);
3325
+ ZodStringFormat$1.init(inst, def);
3326
+ });
3327
+ const ZodCUID2$1 = /* @__PURE__ */ $constructor$1("ZodCUID2", (inst, def) => {
3328
+ $ZodCUID2$1.init(inst, def);
3329
+ ZodStringFormat$1.init(inst, def);
3330
+ });
3331
+ const ZodULID$1 = /* @__PURE__ */ $constructor$1("ZodULID", (inst, def) => {
3332
+ $ZodULID$1.init(inst, def);
3333
+ ZodStringFormat$1.init(inst, def);
3334
+ });
3335
+ const ZodXID$1 = /* @__PURE__ */ $constructor$1("ZodXID", (inst, def) => {
3336
+ $ZodXID$1.init(inst, def);
3337
+ ZodStringFormat$1.init(inst, def);
3338
+ });
3339
+ const ZodKSUID$1 = /* @__PURE__ */ $constructor$1("ZodKSUID", (inst, def) => {
3340
+ $ZodKSUID$1.init(inst, def);
3341
+ ZodStringFormat$1.init(inst, def);
3342
+ });
3343
+ const ZodIPv4$1 = /* @__PURE__ */ $constructor$1("ZodIPv4", (inst, def) => {
3344
+ $ZodIPv4$1.init(inst, def);
3345
+ ZodStringFormat$1.init(inst, def);
3346
+ });
3347
+ const ZodIPv6$1 = /* @__PURE__ */ $constructor$1("ZodIPv6", (inst, def) => {
3348
+ $ZodIPv6$1.init(inst, def);
3349
+ ZodStringFormat$1.init(inst, def);
3350
+ });
3351
+ const ZodCIDRv4$1 = /* @__PURE__ */ $constructor$1("ZodCIDRv4", (inst, def) => {
3352
+ $ZodCIDRv4$1.init(inst, def);
3353
+ ZodStringFormat$1.init(inst, def);
3354
+ });
3355
+ const ZodCIDRv6$1 = /* @__PURE__ */ $constructor$1("ZodCIDRv6", (inst, def) => {
3356
+ $ZodCIDRv6$1.init(inst, def);
3357
+ ZodStringFormat$1.init(inst, def);
3358
+ });
3359
+ const ZodBase64$1 = /* @__PURE__ */ $constructor$1("ZodBase64", (inst, def) => {
3360
+ $ZodBase64$1.init(inst, def);
3361
+ ZodStringFormat$1.init(inst, def);
3362
+ });
3363
+ const ZodBase64URL$1 = /* @__PURE__ */ $constructor$1("ZodBase64URL", (inst, def) => {
3364
+ $ZodBase64URL$1.init(inst, def);
3365
+ ZodStringFormat$1.init(inst, def);
3366
+ });
3367
+ const ZodE164$1 = /* @__PURE__ */ $constructor$1("ZodE164", (inst, def) => {
3368
+ $ZodE164$1.init(inst, def);
3369
+ ZodStringFormat$1.init(inst, def);
3370
+ });
3371
+ const ZodJWT$1 = /* @__PURE__ */ $constructor$1("ZodJWT", (inst, def) => {
3372
+ $ZodJWT$1.init(inst, def);
3373
+ ZodStringFormat$1.init(inst, def);
3374
+ });
3375
+ const ZodNumber$1 = /* @__PURE__ */ $constructor$1("ZodNumber", (inst, def) => {
3376
+ $ZodNumber$1.init(inst, def);
3377
+ ZodType$1.init(inst, def);
3378
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor$1(inst, ctx, json, params);
3379
+ inst.gt = (value, params) => inst.check(_gt$1(value, params));
3380
+ inst.gte = (value, params) => inst.check(_gte$1(value, params));
3381
+ inst.min = (value, params) => inst.check(_gte$1(value, params));
3382
+ inst.lt = (value, params) => inst.check(_lt$1(value, params));
3383
+ inst.lte = (value, params) => inst.check(_lte$1(value, params));
3384
+ inst.max = (value, params) => inst.check(_lte$1(value, params));
3385
+ inst.int = (params) => inst.check(int$1(params));
3386
+ inst.safe = (params) => inst.check(int$1(params));
3387
+ inst.positive = (params) => inst.check(_gt$1(0, params));
3388
+ inst.nonnegative = (params) => inst.check(_gte$1(0, params));
3389
+ inst.negative = (params) => inst.check(_lt$1(0, params));
3390
+ inst.nonpositive = (params) => inst.check(_lte$1(0, params));
3391
+ inst.multipleOf = (value, params) => inst.check(_multipleOf$1(value, params));
3392
+ inst.step = (value, params) => inst.check(_multipleOf$1(value, params));
3393
+ inst.finite = () => inst;
3394
+ const bag = inst._zod.bag;
3395
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3396
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3397
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3398
+ inst.isFinite = true;
3399
+ inst.format = bag.format ?? null;
3400
+ });
3401
+ function number$2(params) {
3402
+ return _number$1(ZodNumber$1, params);
3403
+ }
3404
+ const ZodNumberFormat$1 = /* @__PURE__ */ $constructor$1("ZodNumberFormat", (inst, def) => {
3405
+ $ZodNumberFormat$1.init(inst, def);
3406
+ ZodNumber$1.init(inst, def);
3407
+ });
3408
+ function int$1(params) {
3409
+ return _int$1(ZodNumberFormat$1, params);
3410
+ }
3411
+ const ZodUnknown$1 = /* @__PURE__ */ $constructor$1("ZodUnknown", (inst, def) => {
3412
+ $ZodUnknown$1.init(inst, def);
3413
+ ZodType$1.init(inst, def);
3414
+ inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor$1(inst, ctx, json, params);
3415
+ });
3416
+ function unknown$1() {
3417
+ return _unknown$1(ZodUnknown$1);
3418
+ }
3419
+ const ZodNever$1 = /* @__PURE__ */ $constructor$1("ZodNever", (inst, def) => {
3420
+ $ZodNever$1.init(inst, def);
3421
+ ZodType$1.init(inst, def);
3422
+ inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor$1(inst, ctx, json, params);
3423
+ });
3424
+ function never$1(params) {
3425
+ return _never$1(ZodNever$1, params);
3426
+ }
3427
+ const ZodArray$1 = /* @__PURE__ */ $constructor$1("ZodArray", (inst, def) => {
3428
+ $ZodArray$1.init(inst, def);
3429
+ ZodType$1.init(inst, def);
3430
+ inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor$1(inst, ctx, json, params);
3431
+ inst.element = def.element;
3432
+ inst.min = (minLength, params) => inst.check(_minLength$1(minLength, params));
3433
+ inst.nonempty = (params) => inst.check(_minLength$1(1, params));
3434
+ inst.max = (maxLength, params) => inst.check(_maxLength$1(maxLength, params));
3435
+ inst.length = (len, params) => inst.check(_length$1(len, params));
3436
+ inst.unwrap = () => inst.element;
3437
+ });
3438
+ function array$1(element, params) {
3439
+ return _array$1(ZodArray$1, element, params);
3440
+ }
3441
+ const ZodObject$1 = /* @__PURE__ */ $constructor$1("ZodObject", (inst, def) => {
3442
+ $ZodObjectJIT$1.init(inst, def);
3443
+ ZodType$1.init(inst, def);
3444
+ inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor$1(inst, ctx, json, params);
3445
+ defineLazy$1(inst, "shape", () => {
3446
+ return def.shape;
3447
+ });
3448
+ inst.keyof = () => _enum$1(Object.keys(inst._zod.def.shape));
3449
+ inst.catchall = (catchall) => inst.clone({
3450
+ ...inst._zod.def,
3451
+ catchall
3452
+ });
3453
+ inst.passthrough = () => inst.clone({
3454
+ ...inst._zod.def,
3455
+ catchall: unknown$1()
3456
+ });
3457
+ inst.loose = () => inst.clone({
3458
+ ...inst._zod.def,
3459
+ catchall: unknown$1()
3460
+ });
3461
+ inst.strict = () => inst.clone({
3462
+ ...inst._zod.def,
3463
+ catchall: never$1()
3464
+ });
3465
+ inst.strip = () => inst.clone({
3466
+ ...inst._zod.def,
3467
+ catchall: void 0
3468
+ });
3469
+ inst.extend = (incoming) => {
3470
+ return extend$1(inst, incoming);
3471
+ };
3472
+ inst.safeExtend = (incoming) => {
3473
+ return safeExtend$1(inst, incoming);
3474
+ };
3475
+ inst.merge = (other) => merge$1(inst, other);
3476
+ inst.pick = (mask) => pick$1(inst, mask);
3477
+ inst.omit = (mask) => omit$1(inst, mask);
3478
+ inst.partial = (...args) => partial$1(ZodOptional$1, inst, args[0]);
3479
+ inst.required = (...args) => required$1(ZodNonOptional$1, inst, args[0]);
3480
+ });
3481
+ function object$1(shape, params) {
3482
+ return new ZodObject$1({
3483
+ type: "object",
3484
+ shape: shape ?? {},
3485
+ ...normalizeParams$1(params)
3486
+ });
3487
+ }
3488
+ const ZodUnion$1 = /* @__PURE__ */ $constructor$1("ZodUnion", (inst, def) => {
3489
+ $ZodUnion$1.init(inst, def);
3490
+ ZodType$1.init(inst, def);
3491
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor$1(inst, ctx, json, params);
3492
+ inst.options = def.options;
3493
+ });
3494
+ function union$1(options, params) {
3495
+ return new ZodUnion$1({
3496
+ type: "union",
3497
+ options,
3498
+ ...normalizeParams$1(params)
3499
+ });
3500
+ }
3501
+ const ZodIntersection$1 = /* @__PURE__ */ $constructor$1("ZodIntersection", (inst, def) => {
3502
+ $ZodIntersection$1.init(inst, def);
3503
+ ZodType$1.init(inst, def);
3504
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor$1(inst, ctx, json, params);
3505
+ });
3506
+ function intersection$1(left, right) {
3507
+ return new ZodIntersection$1({
3508
+ type: "intersection",
3509
+ left,
3510
+ right
3511
+ });
3512
+ }
3513
+ const ZodEnum$1 = /* @__PURE__ */ $constructor$1("ZodEnum", (inst, def) => {
3514
+ $ZodEnum$1.init(inst, def);
3515
+ ZodType$1.init(inst, def);
3516
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor$1(inst, ctx, json, params);
3517
+ inst.enum = def.entries;
3518
+ inst.options = Object.values(def.entries);
3519
+ const keys = new Set(Object.keys(def.entries));
3520
+ inst.extract = (values, params) => {
3521
+ const newEntries = {};
3522
+ for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
3523
+ else throw new Error(`Key ${value} not found in enum`);
3524
+ return new ZodEnum$1({
3525
+ ...def,
3526
+ checks: [],
3527
+ ...normalizeParams$1(params),
3528
+ entries: newEntries
3529
+ });
3530
+ };
3531
+ inst.exclude = (values, params) => {
3532
+ const newEntries = { ...def.entries };
3533
+ for (const value of values) if (keys.has(value)) delete newEntries[value];
3534
+ else throw new Error(`Key ${value} not found in enum`);
3535
+ return new ZodEnum$1({
3536
+ ...def,
3537
+ checks: [],
3538
+ ...normalizeParams$1(params),
3539
+ entries: newEntries
3540
+ });
3541
+ };
3542
+ });
3543
+ function _enum$1(values, params) {
3544
+ return new ZodEnum$1({
3545
+ type: "enum",
3546
+ entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
3547
+ ...normalizeParams$1(params)
3548
+ });
3549
+ }
3550
+ const ZodTransform$1 = /* @__PURE__ */ $constructor$1("ZodTransform", (inst, def) => {
3551
+ $ZodTransform$1.init(inst, def);
3552
+ ZodType$1.init(inst, def);
3553
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor$1(inst, ctx, json, params);
3554
+ inst._zod.parse = (payload, _ctx) => {
3555
+ if (_ctx.direction === "backward") throw new $ZodEncodeError$1(inst.constructor.name);
3556
+ payload.addIssue = (issue$2) => {
3557
+ if (typeof issue$2 === "string") payload.issues.push(issue$1(issue$2, payload.value, def));
3558
+ else {
3559
+ const _issue = issue$2;
3560
+ if (_issue.fatal) _issue.continue = false;
3561
+ _issue.code ?? (_issue.code = "custom");
3562
+ _issue.input ?? (_issue.input = payload.value);
3563
+ _issue.inst ?? (_issue.inst = inst);
3564
+ payload.issues.push(issue$1(_issue));
3565
+ }
3566
+ };
3567
+ const output = def.transform(payload.value, payload);
3568
+ if (output instanceof Promise) return output.then((output$1) => {
3569
+ payload.value = output$1;
3570
+ return payload;
3571
+ });
3572
+ payload.value = output;
3573
+ return payload;
3574
+ };
3575
+ });
3576
+ function transform$1(fn) {
3577
+ return new ZodTransform$1({
3578
+ type: "transform",
3579
+ transform: fn
3580
+ });
3581
+ }
3582
+ const ZodOptional$1 = /* @__PURE__ */ $constructor$1("ZodOptional", (inst, def) => {
3583
+ $ZodOptional$1.init(inst, def);
3584
+ ZodType$1.init(inst, def);
3585
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor$1(inst, ctx, json, params);
3586
+ inst.unwrap = () => inst._zod.def.innerType;
3587
+ });
3588
+ function optional$1(innerType) {
3589
+ return new ZodOptional$1({
3590
+ type: "optional",
3591
+ innerType
3592
+ });
3593
+ }
3594
+ const ZodExactOptional$1 = /* @__PURE__ */ $constructor$1("ZodExactOptional", (inst, def) => {
3595
+ $ZodExactOptional$1.init(inst, def);
3596
+ ZodType$1.init(inst, def);
3597
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor$1(inst, ctx, json, params);
3598
+ inst.unwrap = () => inst._zod.def.innerType;
3599
+ });
3600
+ function exactOptional$1(innerType) {
3601
+ return new ZodExactOptional$1({
3602
+ type: "optional",
3603
+ innerType
3604
+ });
3605
+ }
3606
+ const ZodNullable$1 = /* @__PURE__ */ $constructor$1("ZodNullable", (inst, def) => {
3607
+ $ZodNullable$1.init(inst, def);
3608
+ ZodType$1.init(inst, def);
3609
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor$1(inst, ctx, json, params);
3610
+ inst.unwrap = () => inst._zod.def.innerType;
3611
+ });
3612
+ function nullable$1(innerType) {
3613
+ return new ZodNullable$1({
3614
+ type: "nullable",
3615
+ innerType
3616
+ });
3617
+ }
3618
+ const ZodDefault$1 = /* @__PURE__ */ $constructor$1("ZodDefault", (inst, def) => {
3619
+ $ZodDefault$1.init(inst, def);
3620
+ ZodType$1.init(inst, def);
3621
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor$1(inst, ctx, json, params);
3622
+ inst.unwrap = () => inst._zod.def.innerType;
3623
+ inst.removeDefault = inst.unwrap;
3624
+ });
3625
+ function _default$1(innerType, defaultValue) {
3626
+ return new ZodDefault$1({
3627
+ type: "default",
3628
+ innerType,
3629
+ get defaultValue() {
3630
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone$1(defaultValue);
3631
+ }
3632
+ });
3633
+ }
3634
+ const ZodPrefault$1 = /* @__PURE__ */ $constructor$1("ZodPrefault", (inst, def) => {
3635
+ $ZodPrefault$1.init(inst, def);
3636
+ ZodType$1.init(inst, def);
3637
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor$1(inst, ctx, json, params);
3638
+ inst.unwrap = () => inst._zod.def.innerType;
3639
+ });
3640
+ function prefault$1(innerType, defaultValue) {
3641
+ return new ZodPrefault$1({
3642
+ type: "prefault",
3643
+ innerType,
3644
+ get defaultValue() {
3645
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone$1(defaultValue);
3646
+ }
3647
+ });
3648
+ }
3649
+ const ZodNonOptional$1 = /* @__PURE__ */ $constructor$1("ZodNonOptional", (inst, def) => {
3650
+ $ZodNonOptional$1.init(inst, def);
3651
+ ZodType$1.init(inst, def);
3652
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor$1(inst, ctx, json, params);
3653
+ inst.unwrap = () => inst._zod.def.innerType;
3654
+ });
3655
+ function nonoptional$1(innerType, params) {
3656
+ return new ZodNonOptional$1({
3657
+ type: "nonoptional",
3658
+ innerType,
3659
+ ...normalizeParams$1(params)
3660
+ });
3661
+ }
3662
+ const ZodCatch$1 = /* @__PURE__ */ $constructor$1("ZodCatch", (inst, def) => {
3663
+ $ZodCatch$1.init(inst, def);
3664
+ ZodType$1.init(inst, def);
3665
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor$1(inst, ctx, json, params);
3666
+ inst.unwrap = () => inst._zod.def.innerType;
3667
+ inst.removeCatch = inst.unwrap;
3668
+ });
3669
+ function _catch$1(innerType, catchValue) {
3670
+ return new ZodCatch$1({
3671
+ type: "catch",
3672
+ innerType,
3673
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
3674
+ });
3675
+ }
3676
+ const ZodPipe$1 = /* @__PURE__ */ $constructor$1("ZodPipe", (inst, def) => {
3677
+ $ZodPipe$1.init(inst, def);
3678
+ ZodType$1.init(inst, def);
3679
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor$1(inst, ctx, json, params);
3680
+ inst.in = def.in;
3681
+ inst.out = def.out;
3682
+ });
3683
+ function pipe$1(in_, out) {
3684
+ return new ZodPipe$1({
3685
+ type: "pipe",
3686
+ in: in_,
3687
+ out
3688
+ });
3689
+ }
3690
+ const ZodReadonly$1 = /* @__PURE__ */ $constructor$1("ZodReadonly", (inst, def) => {
3691
+ $ZodReadonly$1.init(inst, def);
3692
+ ZodType$1.init(inst, def);
3693
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor$1(inst, ctx, json, params);
3694
+ inst.unwrap = () => inst._zod.def.innerType;
3695
+ });
3696
+ function readonly$1(innerType) {
3697
+ return new ZodReadonly$1({
3698
+ type: "readonly",
3699
+ innerType
3700
+ });
3701
+ }
3702
+ const ZodCustom$1 = /* @__PURE__ */ $constructor$1("ZodCustom", (inst, def) => {
3703
+ $ZodCustom$1.init(inst, def);
3704
+ ZodType$1.init(inst, def);
3705
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor$1(inst, ctx, json, params);
3706
+ });
3707
+ function refine$1(fn, _params = {}) {
3708
+ return _refine$1(ZodCustom$1, fn, _params);
3709
+ }
3710
+ function superRefine$1(fn) {
3711
+ return _superRefine$1(fn);
3712
+ }
3713
+ const describe = describe$1;
3714
+ const meta = meta$1;
3715
+
3716
+ //#endregion
3717
+ //#region ../feature-schema/dist/schema.mjs
3718
+ /** Matches any domain prefix: feat-2026-001, proc-2026-001, goal-2026-001, etc. */
3719
+ const FEATURE_KEY_PATTERN$1 = /^[a-z][a-z0-9]*-\d{4}-\d{3}$/;
3720
+ const FeatureStatusSchema$1 = _enum$1([
3721
+ "draft",
3722
+ "active",
3723
+ "frozen",
3724
+ "deprecated"
3725
+ ]);
3726
+ const DecisionSchema$1 = object$1({
3727
+ decision: string$2().min(1),
3728
+ rationale: string$2().min(1),
3729
+ alternativesConsidered: array$1(string$2()).optional(),
3730
+ date: string$2().regex(/^\d{4}-\d{2}-\d{2}$/, "date must be YYYY-MM-DD").optional()
3731
+ });
3732
+ const AnnotationSchema$1 = object$1({
3733
+ id: string$2().min(1),
3734
+ author: string$2().min(1),
3735
+ date: string$2().min(1),
3736
+ type: string$2().min(1),
3737
+ body: string$2().min(1)
3738
+ });
3739
+ const LineageSchema$1 = object$1({
3740
+ parent: string$2().nullable().optional(),
3741
+ children: array$1(string$2()).optional(),
3742
+ spawnReason: string$2().nullable().optional()
3743
+ });
3744
+ const FeatureSchema$1 = object$1({
3745
+ featureKey: string$2().regex(FEATURE_KEY_PATTERN$1, "featureKey must match pattern <domain>-YYYY-NNN (e.g. feat-2026-001, proc-2026-001)"),
3746
+ title: string$2().min(1),
3747
+ status: FeatureStatusSchema$1,
3748
+ problem: string$2().min(1),
3749
+ schemaVersion: number$2().int().positive().optional(),
3750
+ owner: string$2().optional(),
3751
+ analysis: string$2().optional(),
3752
+ decisions: array$1(DecisionSchema$1).optional(),
3753
+ implementation: string$2().optional(),
3754
+ knownLimitations: array$1(string$2()).optional(),
3755
+ tags: array$1(string$2()).optional(),
3756
+ annotations: array$1(AnnotationSchema$1).optional(),
3757
+ lineage: LineageSchema$1.optional(),
3758
+ successCriteria: string$2().optional(),
3759
+ domain: string$2().optional()
3760
+ });
3761
+
3762
+ //#endregion
3763
+ //#region ../feature-schema/dist/validate.mjs
3764
+ function validateFeature$1(data) {
3765
+ const result = FeatureSchema$1.safeParse(data);
3766
+ if (result.success) return {
3767
+ success: true,
3768
+ data: result.data
3769
+ };
3770
+ return {
3771
+ success: false,
3772
+ errors: result.error.issues.map((issue$2) => {
3773
+ return `${issue$2.path.length > 0 ? `${issue$2.path.join(".")}: ` : ""}${issue$2.message}`;
3774
+ })
3775
+ };
3776
+ }
3777
+
3778
+ //#endregion
3779
+ //#region ../lac-claude/dist/index.mjs
3780
+ Object.freeze({ status: "aborted" });
3781
+ function $constructor(name, initializer$2$1, params) {
3782
+ function init(inst, def) {
3783
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
3784
+ value: {
3785
+ def,
3786
+ constr: _,
3787
+ traits: /* @__PURE__ */ new Set()
3788
+ },
3789
+ enumerable: false
3790
+ });
3791
+ if (inst._zod.traits.has(name)) return;
3792
+ inst._zod.traits.add(name);
3793
+ initializer$2$1(inst, def);
3794
+ const proto = _.prototype;
3795
+ const keys = Object.keys(proto);
3796
+ for (let i = 0; i < keys.length; i++) {
3797
+ const k = keys[i];
3798
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
3799
+ }
3800
+ }
3801
+ const Parent = params?.Parent ?? Object;
3802
+ class Definition extends Parent {}
3803
+ Object.defineProperty(Definition, "name", { value: name });
3804
+ function _(def) {
3805
+ var _a$1$1;
3806
+ const inst = params?.Parent ? new Definition() : this;
3807
+ init(inst, def);
3808
+ (_a$1$1 = inst._zod).deferred ?? (_a$1$1.deferred = []);
42
3809
  for (const fn of inst._zod.deferred) fn();
43
3810
  return inst;
44
3811
  }
@@ -66,9 +3833,6 @@ function config(newConfig) {
66
3833
  if (newConfig) Object.assign(globalConfig, newConfig);
67
3834
  return globalConfig;
68
3835
  }
69
-
70
- //#endregion
71
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/util.js
72
3836
  function getEnumValues(entries) {
73
3837
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
74
3838
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -107,9 +3871,9 @@ function floatSafeRemainder(val, step) {
107
3871
  return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
108
3872
  }
109
3873
  const EVALUATING = Symbol("evaluating");
110
- function defineLazy(object$1, key, getter) {
3874
+ function defineLazy(object$1$1, key, getter) {
111
3875
  let value = void 0;
112
- Object.defineProperty(object$1, key, {
3876
+ Object.defineProperty(object$1$1, key, {
113
3877
  get() {
114
3878
  if (value === EVALUATING) return;
115
3879
  if (value === void 0) {
@@ -119,7 +3883,7 @@ function defineLazy(object$1, key, getter) {
119
3883
  return value;
120
3884
  },
121
3885
  set(v) {
122
- Object.defineProperty(object$1, key, { value: v });
3886
+ Object.defineProperty(object$1$1, key, { value: v });
123
3887
  },
124
3888
  configurable: true
125
3889
  });
@@ -345,8 +4109,8 @@ function aborted(x, startIndex = 0) {
345
4109
  }
346
4110
  function prefixIssues(path$1, issues) {
347
4111
  return issues.map((iss) => {
348
- var _a$1;
349
- (_a$1 = iss).path ?? (_a$1.path = []);
4112
+ var _a$1$1;
4113
+ (_a$1$1 = iss).path ?? (_a$1$1.path = []);
350
4114
  iss.path.unshift(path$1);
351
4115
  return iss;
352
4116
  });
@@ -354,12 +4118,12 @@ function prefixIssues(path$1, issues) {
354
4118
  function unwrapMessage(message) {
355
4119
  return typeof message === "string" ? message : message?.message;
356
4120
  }
357
- function finalizeIssue(iss, ctx, config$1) {
4121
+ function finalizeIssue(iss, ctx, config$1$1) {
358
4122
  const full = {
359
4123
  ...iss,
360
4124
  path: iss.path ?? []
361
4125
  };
362
- if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1.customError?.(iss)) ?? unwrapMessage(config$1.localeError?.(iss)) ?? "Invalid input";
4126
+ if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1$1.customError?.(iss)) ?? unwrapMessage(config$1$1.localeError?.(iss)) ?? "Invalid input";
363
4127
  delete full.inst;
364
4128
  delete full.continue;
365
4129
  if (!ctx?.reportInput) delete full.input;
@@ -380,9 +4144,6 @@ function issue(...args) {
380
4144
  };
381
4145
  return { ...iss };
382
4146
  }
383
-
384
- //#endregion
385
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/errors.js
386
4147
  const initializer$1 = (inst, def) => {
387
4148
  inst.name = "$ZodError";
388
4149
  Object.defineProperty(inst, "_zod", {
@@ -401,7 +4162,7 @@ const initializer$1 = (inst, def) => {
401
4162
  };
402
4163
  const $ZodError = $constructor("$ZodError", initializer$1);
403
4164
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
404
- function flattenError(error, mapper = (issue$1) => issue$1.message) {
4165
+ function flattenError(error, mapper = (issue$1$1) => issue$1$1.message) {
405
4166
  const fieldErrors = {};
406
4167
  const formErrors = [];
407
4168
  for (const sub of error.issues) if (sub.path.length > 0) {
@@ -413,22 +4174,22 @@ function flattenError(error, mapper = (issue$1) => issue$1.message) {
413
4174
  fieldErrors
414
4175
  };
415
4176
  }
416
- function formatError(error, mapper = (issue$1) => issue$1.message) {
4177
+ function formatError(error, mapper = (issue$1$1) => issue$1$1.message) {
417
4178
  const fieldErrors = { _errors: [] };
418
4179
  const processError = (error$1) => {
419
- for (const issue$1 of error$1.issues) if (issue$1.code === "invalid_union" && issue$1.errors.length) issue$1.errors.map((issues) => processError({ issues }));
420
- else if (issue$1.code === "invalid_key") processError({ issues: issue$1.issues });
421
- else if (issue$1.code === "invalid_element") processError({ issues: issue$1.issues });
422
- else if (issue$1.path.length === 0) fieldErrors._errors.push(mapper(issue$1));
4180
+ for (const issue$1$1 of error$1.issues) if (issue$1$1.code === "invalid_union" && issue$1$1.errors.length) issue$1$1.errors.map((issues) => processError({ issues }));
4181
+ else if (issue$1$1.code === "invalid_key") processError({ issues: issue$1$1.issues });
4182
+ else if (issue$1$1.code === "invalid_element") processError({ issues: issue$1$1.issues });
4183
+ else if (issue$1$1.path.length === 0) fieldErrors._errors.push(mapper(issue$1$1));
423
4184
  else {
424
4185
  let curr = fieldErrors;
425
4186
  let i = 0;
426
- while (i < issue$1.path.length) {
427
- const el = issue$1.path[i];
428
- if (!(i === issue$1.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
4187
+ while (i < issue$1$1.path.length) {
4188
+ const el = issue$1$1.path[i];
4189
+ if (!(i === issue$1$1.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
429
4190
  else {
430
4191
  curr[el] = curr[el] || { _errors: [] };
431
- curr[el]._errors.push(mapper(issue$1));
4192
+ curr[el]._errors.push(mapper(issue$1$1));
432
4193
  }
433
4194
  curr = curr[el];
434
4195
  i++;
@@ -438,9 +4199,6 @@ function formatError(error, mapper = (issue$1) => issue$1.message) {
438
4199
  processError(error);
439
4200
  return fieldErrors;
440
4201
  }
441
-
442
- //#endregion
443
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/parse.js
444
4202
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
445
4203
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
446
4204
  const result = schema._zod.run({
@@ -455,7 +4213,6 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
455
4213
  }
456
4214
  return result.value;
457
4215
  };
458
- const parse$1 = /* @__PURE__ */ _parse($ZodRealError);
459
4216
  const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
460
4217
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
461
4218
  let result = schema._zod.run({
@@ -470,7 +4227,6 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
470
4227
  }
471
4228
  return result.value;
472
4229
  };
473
- const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError);
474
4230
  const _safeParse = (_Err) => (schema, value, _ctx) => {
475
4231
  const ctx = _ctx ? {
476
4232
  ..._ctx,
@@ -510,41 +4266,30 @@ const _encode = (_Err) => (schema, value, _ctx) => {
510
4266
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
511
4267
  return _parse(_Err)(schema, value, ctx);
512
4268
  };
513
- const encode$1 = /* @__PURE__ */ _encode($ZodRealError);
514
4269
  const _decode = (_Err) => (schema, value, _ctx) => {
515
4270
  return _parse(_Err)(schema, value, _ctx);
516
4271
  };
517
- const decode$1 = /* @__PURE__ */ _decode($ZodRealError);
518
4272
  const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
519
4273
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
520
4274
  return _parseAsync(_Err)(schema, value, ctx);
521
4275
  };
522
- const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError);
523
4276
  const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
524
4277
  return _parseAsync(_Err)(schema, value, _ctx);
525
4278
  };
526
- const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError);
527
4279
  const _safeEncode = (_Err) => (schema, value, _ctx) => {
528
4280
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
529
4281
  return _safeParse(_Err)(schema, value, ctx);
530
4282
  };
531
- const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError);
532
4283
  const _safeDecode = (_Err) => (schema, value, _ctx) => {
533
4284
  return _safeParse(_Err)(schema, value, _ctx);
534
4285
  };
535
- const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError);
536
4286
  const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
537
4287
  const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
538
4288
  return _safeParseAsync(_Err)(schema, value, ctx);
539
4289
  };
540
- const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
541
4290
  const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
542
4291
  return _safeParseAsync(_Err)(schema, value, _ctx);
543
4292
  };
544
- const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
545
-
546
- //#endregion
547
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/regexes.js
548
4293
  const cuid = /^[cC][^\s-]{8,}$/;
549
4294
  const cuid2 = /^[0-9a-z]+$/;
550
4295
  const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
@@ -558,9 +4303,9 @@ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9
558
4303
  /** Returns a regex for validating an RFC 9562/4122 UUID.
559
4304
  *
560
4305
  * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
561
- const uuid = (version$1) => {
562
- if (!version$1) return /^([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)$/;
563
- return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
4306
+ const uuid = (version$1$1) => {
4307
+ if (!version$1$1) return /^([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)$/;
4308
+ return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
564
4309
  };
565
4310
  /** Practical email validation */
566
4311
  const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
@@ -585,11 +4330,11 @@ function time$1(args) {
585
4330
  return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`);
586
4331
  }
587
4332
  function datetime$1(args) {
588
- const time$2 = timeSource({ precision: args.precision });
4333
+ const time$2$1 = timeSource({ precision: args.precision });
589
4334
  const opts = ["Z"];
590
4335
  if (args.local) opts.push("");
591
4336
  if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
592
- const timeRegex = `${time$2}(?:${opts.join("|")})`;
4337
+ const timeRegex = `${time$2$1}(?:${opts.join("|")})`;
593
4338
  return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`);
594
4339
  }
595
4340
  const string$1 = (params) => {
@@ -600,14 +4345,11 @@ const integer = /^-?\d+$/;
600
4345
  const number$1 = /^-?\d+(?:\.\d+)?$/;
601
4346
  const lowercase = /^[^A-Z]*$/;
602
4347
  const uppercase = /^[^a-z]*$/;
603
-
604
- //#endregion
605
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/checks.js
606
4348
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
607
- var _a$1;
4349
+ var _a$1$1;
608
4350
  inst._zod ?? (inst._zod = {});
609
4351
  inst._zod.def = def;
610
- (_a$1 = inst._zod).onattach ?? (_a$1.onattach = []);
4352
+ (_a$1$1 = inst._zod).onattach ?? (_a$1$1.onattach = []);
611
4353
  });
612
4354
  const numericOriginMap = {
613
4355
  number: "number",
@@ -661,8 +4403,8 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan"
661
4403
  const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
662
4404
  $ZodCheck.init(inst, def);
663
4405
  inst._zod.onattach.push((inst$1) => {
664
- var _a$1;
665
- (_a$1 = inst$1._zod.bag).multipleOf ?? (_a$1.multipleOf = def.value);
4406
+ var _a$1$1;
4407
+ (_a$1$1 = inst$1._zod.bag).multipleOf ?? (_a$1$1.multipleOf = def.value);
666
4408
  });
667
4409
  inst._zod.check = (payload) => {
668
4410
  if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -749,9 +4491,9 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma
749
4491
  };
750
4492
  });
751
4493
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
752
- var _a$1;
4494
+ var _a$1$1;
753
4495
  $ZodCheck.init(inst, def);
754
- (_a$1 = inst._zod.def).when ?? (_a$1.when = (payload) => {
4496
+ (_a$1$1 = inst._zod.def).when ?? (_a$1$1.when = (payload) => {
755
4497
  const val = payload.value;
756
4498
  return !nullish(val) && val.length !== void 0;
757
4499
  });
@@ -775,9 +4517,9 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
775
4517
  };
776
4518
  });
777
4519
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
778
- var _a$1;
4520
+ var _a$1$1;
779
4521
  $ZodCheck.init(inst, def);
780
- (_a$1 = inst._zod.def).when ?? (_a$1.when = (payload) => {
4522
+ (_a$1$1 = inst._zod.def).when ?? (_a$1$1.when = (payload) => {
781
4523
  const val = payload.value;
782
4524
  return !nullish(val) && val.length !== void 0;
783
4525
  });
@@ -801,9 +4543,9 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
801
4543
  };
802
4544
  });
803
4545
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
804
- var _a$1;
4546
+ var _a$1$1;
805
4547
  $ZodCheck.init(inst, def);
806
- (_a$1 = inst._zod.def).when ?? (_a$1.when = (payload) => {
4548
+ (_a$1$1 = inst._zod.def).when ?? (_a$1$1.when = (payload) => {
807
4549
  const val = payload.value;
808
4550
  return !nullish(val) && val.length !== void 0;
809
4551
  });
@@ -837,7 +4579,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
837
4579
  };
838
4580
  });
839
4581
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
840
- var _a$1, _b;
4582
+ var _a$1$1, _b;
841
4583
  $ZodCheck.init(inst, def);
842
4584
  inst._zod.onattach.push((inst$1) => {
843
4585
  const bag = inst$1._zod.bag;
@@ -847,7 +4589,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
847
4589
  bag.patterns.add(def.pattern);
848
4590
  }
849
4591
  });
850
- if (def.pattern) (_a$1 = inst._zod).check ?? (_a$1.check = (payload) => {
4592
+ if (def.pattern) (_a$1$1 = inst._zod).check ?? (_a$1$1.check = (payload) => {
851
4593
  def.pattern.lastIndex = 0;
852
4594
  if (def.pattern.test(payload.value)) return;
853
4595
  payload.issues.push({
@@ -959,9 +4701,6 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
959
4701
  payload.value = def.tx(payload.value);
960
4702
  };
961
4703
  });
962
-
963
- //#endregion
964
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/doc.js
965
4704
  var Doc = class {
966
4705
  constructor(args = []) {
967
4706
  this.content = [];
@@ -991,19 +4730,13 @@ var Doc = class {
991
4730
  return new F(...args, lines.join("\n"));
992
4731
  }
993
4732
  };
994
-
995
- //#endregion
996
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/versions.js
997
4733
  const version = {
998
4734
  major: 4,
999
4735
  minor: 3,
1000
4736
  patch: 6
1001
4737
  };
1002
-
1003
- //#endregion
1004
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/schemas.js
1005
4738
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1006
- var _a$1;
4739
+ var _a$1$1;
1007
4740
  inst ?? (inst = {});
1008
4741
  inst._zod.def = def;
1009
4742
  inst._zod.bag = inst._zod.bag || {};
@@ -1012,7 +4745,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1012
4745
  if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1013
4746
  for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1014
4747
  if (checks.length === 0) {
1015
- (_a$1 = inst._zod).deferred ?? (_a$1.deferred = []);
4748
+ (_a$1$1 = inst._zod).deferred ?? (_a$1$1.deferred = []);
1016
4749
  inst._zod.deferred?.push(() => {
1017
4750
  inst._zod.run = inst._zod.parse;
1018
4751
  });
@@ -1302,8 +5035,8 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1302
5035
  });
1303
5036
  function isValidBase64URL(data) {
1304
5037
  if (!base64url.test(data)) return false;
1305
- const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1306
- return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "="));
5038
+ const base64$1$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
5039
+ return isValidBase64(base64$1$1.padEnd(Math.ceil(base64$1$1.length / 4) * 4, "="));
1307
5040
  }
1308
5041
  const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1309
5042
  def.pattern ?? (def.pattern = base64url);
@@ -1498,13 +5231,13 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1498
5231
  }
1499
5232
  return propValues;
1500
5233
  });
1501
- const isObject$1 = isObject;
5234
+ const isObject$1$1 = isObject;
1502
5235
  const catchall = def.catchall;
1503
5236
  let value;
1504
5237
  inst._zod.parse = (payload, ctx) => {
1505
5238
  value ?? (value = _normalized.value);
1506
5239
  const input = payload.value;
1507
- if (!isObject$1(input)) {
5240
+ if (!isObject$1$1(input)) {
1508
5241
  payload.issues.push({
1509
5242
  expected: "object",
1510
5243
  code: "invalid_type",
@@ -1598,16 +5331,15 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
1598
5331
  return (payload, ctx) => fn(shape, payload, ctx);
1599
5332
  };
1600
5333
  let fastpass;
1601
- const isObject$1 = isObject;
5334
+ const isObject$1$1 = isObject;
1602
5335
  const jit = !globalConfig.jitless;
1603
- const allowsEval$1 = allowsEval;
1604
- const fastEnabled = jit && allowsEval$1.value;
5336
+ const fastEnabled = jit && allowsEval.value;
1605
5337
  const catchall = def.catchall;
1606
5338
  let value;
1607
5339
  inst._zod.parse = (payload, ctx) => {
1608
5340
  value ?? (value = _normalized.value);
1609
5341
  const input = payload.value;
1610
- if (!isObject$1(input)) {
5342
+ if (!isObject$1$1(input)) {
1611
5343
  payload.issues.push({
1612
5344
  expected: "object",
1613
5345
  code: "invalid_type",
@@ -2019,9 +5751,6 @@ function handleRefineResult(result, payload, input, inst) {
2019
5751
  payload.issues.push(issue(_iss));
2020
5752
  }
2021
5753
  }
2022
-
2023
- //#endregion
2024
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/registries.js
2025
5754
  var _a;
2026
5755
  var $ZodRegistry = class {
2027
5756
  constructor() {
@@ -2067,9 +5796,6 @@ function registry() {
2067
5796
  }
2068
5797
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2069
5798
  const globalRegistry = globalThis.__zod_globalRegistry;
2070
-
2071
- //#endregion
2072
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/api.js
2073
5799
  /* @__NO_SIDE_EFFECTS__ */
2074
5800
  function _string(Class, params) {
2075
5801
  return new Class({
@@ -2536,10 +6262,10 @@ function _refine(Class, fn, _params) {
2536
6262
  /* @__NO_SIDE_EFFECTS__ */
2537
6263
  function _superRefine(fn) {
2538
6264
  const ch = /* @__PURE__ */ _check((payload) => {
2539
- payload.addIssue = (issue$1) => {
2540
- if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
6265
+ payload.addIssue = (issue$1$1) => {
6266
+ if (typeof issue$1$1 === "string") payload.issues.push(issue(issue$1$1, payload.value, ch._zod.def));
2541
6267
  else {
2542
- const _issue = issue$1;
6268
+ const _issue = issue$1$1;
2543
6269
  if (_issue.fatal) _issue.continue = false;
2544
6270
  _issue.code ?? (_issue.code = "custom");
2545
6271
  _issue.input ?? (_issue.input = payload.value);
@@ -2561,35 +6287,6 @@ function _check(fn, params) {
2561
6287
  ch._zod.check = fn;
2562
6288
  return ch;
2563
6289
  }
2564
- /* @__NO_SIDE_EFFECTS__ */
2565
- function describe$1(description) {
2566
- const ch = new $ZodCheck({ check: "describe" });
2567
- ch._zod.onattach = [(inst) => {
2568
- const existing = globalRegistry.get(inst) ?? {};
2569
- globalRegistry.add(inst, {
2570
- ...existing,
2571
- description
2572
- });
2573
- }];
2574
- ch._zod.check = () => {};
2575
- return ch;
2576
- }
2577
- /* @__NO_SIDE_EFFECTS__ */
2578
- function meta$1(metadata) {
2579
- const ch = new $ZodCheck({ check: "meta" });
2580
- ch._zod.onattach = [(inst) => {
2581
- const existing = globalRegistry.get(inst) ?? {};
2582
- globalRegistry.add(inst, {
2583
- ...existing,
2584
- ...metadata
2585
- });
2586
- }];
2587
- ch._zod.check = () => {};
2588
- return ch;
2589
- }
2590
-
2591
- //#endregion
2592
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
2593
6290
  function initializeContext(params) {
2594
6291
  let target = params?.target ?? "draft-2020-12";
2595
6292
  if (target === "draft-4") target = "draft-04";
@@ -2612,7 +6309,7 @@ function process$2(schema, ctx, _params = {
2612
6309
  path: [],
2613
6310
  schemaPath: []
2614
6311
  }) {
2615
- var _a$1;
6312
+ var _a$1$1;
2616
6313
  const def = schema._zod.def;
2617
6314
  const seen = ctx.seen.get(schema);
2618
6315
  if (seen) {
@@ -2655,7 +6352,7 @@ function process$2(schema, ctx, _params = {
2655
6352
  delete result.schema.examples;
2656
6353
  delete result.schema.default;
2657
6354
  }
2658
- if (ctx.io === "input" && result.schema._prefault) (_a$1 = result.schema).default ?? (_a$1.default = result.schema._prefault);
6355
+ if (ctx.io === "input" && result.schema._prefault) (_a$1$1 = result.schema).default ?? (_a$1$1.default = result.schema._prefault);
2659
6356
  delete result.schema._prefault;
2660
6357
  return ctx.seen.get(schema).schema;
2661
6358
  }
@@ -2873,9 +6570,6 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
2873
6570
  extractDefs(ctx, schema);
2874
6571
  return finalize(ctx, schema);
2875
6572
  };
2876
-
2877
- //#endregion
2878
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
2879
6573
  const formatMap = {
2880
6574
  guid: "uuid",
2881
6575
  url: "uri",
@@ -3084,48 +6778,42 @@ const optionalProcessor = (schema, ctx, _json, params) => {
3084
6778
  const seen = ctx.seen.get(schema);
3085
6779
  seen.ref = def.innerType;
3086
6780
  };
3087
-
3088
- //#endregion
3089
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/iso.js
3090
6781
  const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3091
6782
  $ZodISODateTime.init(inst, def);
3092
6783
  ZodStringFormat.init(inst, def);
3093
6784
  });
3094
6785
  function datetime(params) {
3095
- return _isoDateTime(ZodISODateTime, params);
6786
+ return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3096
6787
  }
3097
6788
  const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
3098
6789
  $ZodISODate.init(inst, def);
3099
6790
  ZodStringFormat.init(inst, def);
3100
6791
  });
3101
6792
  function date(params) {
3102
- return _isoDate(ZodISODate, params);
6793
+ return /* @__PURE__ */ _isoDate(ZodISODate, params);
3103
6794
  }
3104
6795
  const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
3105
6796
  $ZodISOTime.init(inst, def);
3106
6797
  ZodStringFormat.init(inst, def);
3107
6798
  });
3108
6799
  function time(params) {
3109
- return _isoTime(ZodISOTime, params);
6800
+ return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3110
6801
  }
3111
6802
  const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
3112
6803
  $ZodISODuration.init(inst, def);
3113
6804
  ZodStringFormat.init(inst, def);
3114
6805
  });
3115
6806
  function duration(params) {
3116
- return _isoDuration(ZodISODuration, params);
6807
+ return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3117
6808
  }
3118
-
3119
- //#endregion
3120
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/errors.js
3121
6809
  const initializer = (inst, issues) => {
3122
6810
  $ZodError.init(inst, issues);
3123
6811
  inst.name = "ZodError";
3124
6812
  Object.defineProperties(inst, {
3125
6813
  format: { value: (mapper) => formatError(inst, mapper) },
3126
6814
  flatten: { value: (mapper) => flattenError(inst, mapper) },
3127
- addIssue: { value: (issue$1) => {
3128
- inst.issues.push(issue$1);
6815
+ addIssue: { value: (issue$1$1) => {
6816
+ inst.issues.push(issue$1$1);
3129
6817
  inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3130
6818
  } },
3131
6819
  addIssues: { value: (issues$1) => {
@@ -3137,11 +6825,8 @@ const initializer = (inst, issues) => {
3137
6825
  } }
3138
6826
  });
3139
6827
  };
3140
- const ZodError = $constructor("ZodError", initializer);
6828
+ $constructor("ZodError", initializer);
3141
6829
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
3142
-
3143
- //#endregion
3144
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/parse.js
3145
6830
  const parse = /* @__PURE__ */ _parse(ZodRealError);
3146
6831
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3147
6832
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -3154,9 +6839,6 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
3154
6839
  const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
3155
6840
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3156
6841
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3157
-
3158
- //#endregion
3159
- //#region ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
3160
6842
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3161
6843
  $ZodType.init(inst, def);
3162
6844
  Object.assign(inst["~standard"], { jsonSchema: {
@@ -3196,7 +6878,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3196
6878
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3197
6879
  inst.refine = (check, params) => inst.check(refine(check, params));
3198
6880
  inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3199
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
6881
+ inst.overwrite = (fn) => inst.check(/* @__PURE__ */ _overwrite(fn));
3200
6882
  inst.optional = () => optional(inst);
3201
6883
  inst.exactOptional = () => exactOptional(inst);
3202
6884
  inst.nullable = () => nullable(inst);
@@ -3242,55 +6924,55 @@ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3242
6924
  inst.format = bag.format ?? null;
3243
6925
  inst.minLength = bag.minimum ?? null;
3244
6926
  inst.maxLength = bag.maximum ?? null;
3245
- inst.regex = (...args) => inst.check(_regex(...args));
3246
- inst.includes = (...args) => inst.check(_includes(...args));
3247
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
3248
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
3249
- inst.min = (...args) => inst.check(_minLength(...args));
3250
- inst.max = (...args) => inst.check(_maxLength(...args));
3251
- inst.length = (...args) => inst.check(_length(...args));
3252
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
3253
- inst.lowercase = (params) => inst.check(_lowercase(params));
3254
- inst.uppercase = (params) => inst.check(_uppercase(params));
3255
- inst.trim = () => inst.check(_trim());
3256
- inst.normalize = (...args) => inst.check(_normalize(...args));
3257
- inst.toLowerCase = () => inst.check(_toLowerCase());
3258
- inst.toUpperCase = () => inst.check(_toUpperCase());
3259
- inst.slugify = () => inst.check(_slugify());
6927
+ inst.regex = (...args) => inst.check(/* @__PURE__ */ _regex(...args));
6928
+ inst.includes = (...args) => inst.check(/* @__PURE__ */ _includes(...args));
6929
+ inst.startsWith = (...args) => inst.check(/* @__PURE__ */ _startsWith(...args));
6930
+ inst.endsWith = (...args) => inst.check(/* @__PURE__ */ _endsWith(...args));
6931
+ inst.min = (...args) => inst.check(/* @__PURE__ */ _minLength(...args));
6932
+ inst.max = (...args) => inst.check(/* @__PURE__ */ _maxLength(...args));
6933
+ inst.length = (...args) => inst.check(/* @__PURE__ */ _length(...args));
6934
+ inst.nonempty = (...args) => inst.check(/* @__PURE__ */ _minLength(1, ...args));
6935
+ inst.lowercase = (params) => inst.check(/* @__PURE__ */ _lowercase(params));
6936
+ inst.uppercase = (params) => inst.check(/* @__PURE__ */ _uppercase(params));
6937
+ inst.trim = () => inst.check(/* @__PURE__ */ _trim());
6938
+ inst.normalize = (...args) => inst.check(/* @__PURE__ */ _normalize(...args));
6939
+ inst.toLowerCase = () => inst.check(/* @__PURE__ */ _toLowerCase());
6940
+ inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
6941
+ inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
3260
6942
  });
3261
6943
  const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3262
6944
  $ZodString.init(inst, def);
3263
6945
  _ZodString.init(inst, def);
3264
- inst.email = (params) => inst.check(_email(ZodEmail, params));
3265
- inst.url = (params) => inst.check(_url(ZodURL, params));
3266
- inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
3267
- inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
3268
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3269
- inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
3270
- inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
3271
- inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
3272
- inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
3273
- inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
3274
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3275
- inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
3276
- inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
3277
- inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
3278
- inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
3279
- inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
3280
- inst.xid = (params) => inst.check(_xid(ZodXID, params));
3281
- inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
3282
- inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
3283
- inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
3284
- inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
3285
- inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
3286
- inst.e164 = (params) => inst.check(_e164(ZodE164, params));
6946
+ inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
6947
+ inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
6948
+ inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
6949
+ inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
6950
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
6951
+ inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
6952
+ inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
6953
+ inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
6954
+ inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
6955
+ inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
6956
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
6957
+ inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
6958
+ inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
6959
+ inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
6960
+ inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
6961
+ inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
6962
+ inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
6963
+ inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
6964
+ inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
6965
+ inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
6966
+ inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
6967
+ inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
6968
+ inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3287
6969
  inst.datetime = (params) => inst.check(datetime(params));
3288
6970
  inst.date = (params) => inst.check(date(params));
3289
6971
  inst.time = (params) => inst.check(time(params));
3290
6972
  inst.duration = (params) => inst.check(duration(params));
3291
6973
  });
3292
6974
  function string(params) {
3293
- return _string(ZodString, params);
6975
+ return /* @__PURE__ */ _string(ZodString, params);
3294
6976
  }
3295
6977
  const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
3296
6978
  $ZodStringFormat.init(inst, def);
@@ -3376,20 +7058,20 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3376
7058
  $ZodNumber.init(inst, def);
3377
7059
  ZodType.init(inst, def);
3378
7060
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3379
- inst.gt = (value, params) => inst.check(_gt(value, params));
3380
- inst.gte = (value, params) => inst.check(_gte(value, params));
3381
- inst.min = (value, params) => inst.check(_gte(value, params));
3382
- inst.lt = (value, params) => inst.check(_lt(value, params));
3383
- inst.lte = (value, params) => inst.check(_lte(value, params));
3384
- inst.max = (value, params) => inst.check(_lte(value, params));
7061
+ inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
7062
+ inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
7063
+ inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
7064
+ inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
7065
+ inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
7066
+ inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
3385
7067
  inst.int = (params) => inst.check(int(params));
3386
7068
  inst.safe = (params) => inst.check(int(params));
3387
- inst.positive = (params) => inst.check(_gt(0, params));
3388
- inst.nonnegative = (params) => inst.check(_gte(0, params));
3389
- inst.negative = (params) => inst.check(_lt(0, params));
3390
- inst.nonpositive = (params) => inst.check(_lte(0, params));
3391
- inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
3392
- inst.step = (value, params) => inst.check(_multipleOf(value, params));
7069
+ inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(0, params));
7070
+ inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(0, params));
7071
+ inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(0, params));
7072
+ inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(0, params));
7073
+ inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
7074
+ inst.step = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
3393
7075
  inst.finite = () => inst;
3394
7076
  const bag = inst._zod.bag;
3395
7077
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
@@ -3399,14 +7081,14 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3399
7081
  inst.format = bag.format ?? null;
3400
7082
  });
3401
7083
  function number(params) {
3402
- return _number(ZodNumber, params);
7084
+ return /* @__PURE__ */ _number(ZodNumber, params);
3403
7085
  }
3404
7086
  const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
3405
7087
  $ZodNumberFormat.init(inst, def);
3406
7088
  ZodNumber.init(inst, def);
3407
7089
  });
3408
7090
  function int(params) {
3409
- return _int(ZodNumberFormat, params);
7091
+ return /* @__PURE__ */ _int(ZodNumberFormat, params);
3410
7092
  }
3411
7093
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3412
7094
  $ZodUnknown.init(inst, def);
@@ -3414,7 +7096,7 @@ const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3414
7096
  inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
3415
7097
  });
3416
7098
  function unknown() {
3417
- return _unknown(ZodUnknown);
7099
+ return /* @__PURE__ */ _unknown(ZodUnknown);
3418
7100
  }
3419
7101
  const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3420
7102
  $ZodNever.init(inst, def);
@@ -3422,21 +7104,21 @@ const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3422
7104
  inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
3423
7105
  });
3424
7106
  function never(params) {
3425
- return _never(ZodNever, params);
7107
+ return /* @__PURE__ */ _never(ZodNever, params);
3426
7108
  }
3427
7109
  const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
3428
7110
  $ZodArray.init(inst, def);
3429
7111
  ZodType.init(inst, def);
3430
7112
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3431
7113
  inst.element = def.element;
3432
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
3433
- inst.nonempty = (params) => inst.check(_minLength(1, params));
3434
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
3435
- inst.length = (len, params) => inst.check(_length(len, params));
7114
+ inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
7115
+ inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
7116
+ inst.max = (maxLength, params) => inst.check(/* @__PURE__ */ _maxLength(maxLength, params));
7117
+ inst.length = (len, params) => inst.check(/* @__PURE__ */ _length(len, params));
3436
7118
  inst.unwrap = () => inst.element;
3437
7119
  });
3438
7120
  function array(element, params) {
3439
- return _array(ZodArray, element, params);
7121
+ return /* @__PURE__ */ _array(ZodArray, element, params);
3440
7122
  }
3441
7123
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
3442
7124
  $ZodObjectJIT.init(inst, def);
@@ -3553,10 +7235,10 @@ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) =>
3553
7235
  inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
3554
7236
  inst._zod.parse = (payload, _ctx) => {
3555
7237
  if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
3556
- payload.addIssue = (issue$1) => {
3557
- if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
7238
+ payload.addIssue = (issue$1$1) => {
7239
+ if (typeof issue$1$1 === "string") payload.issues.push(issue(issue$1$1, payload.value, def));
3558
7240
  else {
3559
- const _issue = issue$1;
7241
+ const _issue = issue$1$1;
3560
7242
  if (_issue.fatal) _issue.continue = false;
3561
7243
  _issue.code ?? (_issue.code = "custom");
3562
7244
  _issue.input ?? (_issue.input = payload.value);
@@ -3705,16 +7387,11 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
3705
7387
  inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
3706
7388
  });
3707
7389
  function refine(fn, _params = {}) {
3708
- return _refine(ZodCustom, fn, _params);
7390
+ return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
3709
7391
  }
3710
7392
  function superRefine(fn) {
3711
- return _superRefine(fn);
7393
+ return /* @__PURE__ */ _superRefine(fn);
3712
7394
  }
3713
- const describe = describe$1;
3714
- const meta = meta$1;
3715
-
3716
- //#endregion
3717
- //#region ../feature-schema/dist/schema.mjs
3718
7395
  /** Matches any domain prefix: feat-2026-001, proc-2026-001, goal-2026-001, etc. */
3719
7396
  const FEATURE_KEY_PATTERN = /^[a-z][a-z0-9]*-\d{4}-\d{3}$/;
3720
7397
  const FeatureStatusSchema = _enum([
@@ -3758,9 +7435,6 @@ const FeatureSchema = object({
3758
7435
  successCriteria: string().optional(),
3759
7436
  domain: string().optional()
3760
7437
  });
3761
-
3762
- //#endregion
3763
- //#region ../feature-schema/dist/validate.mjs
3764
7438
  function validateFeature(data) {
3765
7439
  const result = FeatureSchema.safeParse(data);
3766
7440
  if (result.success) return {
@@ -3769,14 +7443,11 @@ function validateFeature(data) {
3769
7443
  };
3770
7444
  return {
3771
7445
  success: false,
3772
- errors: result.error.issues.map((issue$1) => {
3773
- return `${issue$1.path.length > 0 ? `${issue$1.path.join(".")}: ` : ""}${issue$1.message}`;
7446
+ errors: result.error.issues.map((issue$1$1) => {
7447
+ return `${issue$1$1.path.length > 0 ? `${issue$1$1.path.join(".")}: ` : ""}${issue$1$1.message}`;
3774
7448
  })
3775
7449
  };
3776
7450
  }
3777
-
3778
- //#endregion
3779
- //#region ../lac-claude/dist/index.mjs
3780
7451
  function createClient() {
3781
7452
  let apiKey = process$1.env.ANTHROPIC_API_KEY;
3782
7453
  if (!apiKey) {
@@ -4493,9 +8164,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
4493
8164
  type: "text",
4494
8165
  text: `Feature "${featureKey}" not found.`
4495
8166
  }] };
8167
+ const childrenOf = /* @__PURE__ */ new Map();
8168
+ for (const { feature } of features) {
8169
+ const parent = feature.lineage?.parent;
8170
+ if (parent) {
8171
+ const existing = childrenOf.get(parent) ?? [];
8172
+ existing.push(feature.featureKey);
8173
+ childrenOf.set(parent, existing);
8174
+ }
8175
+ }
4496
8176
  return { content: [{
4497
8177
  type: "text",
4498
- text: buildLineageTree(root, featureMap, 0)
8178
+ text: buildLineageTree(root, featureMap, childrenOf, 0)
4499
8179
  }] };
4500
8180
  }
4501
8181
  case "lint_workspace": {
@@ -4536,7 +8216,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
4536
8216
  isError: true
4537
8217
  };
4538
8218
  }
4539
- const result = validateFeature(JSON.parse(raw));
8219
+ const result = validateFeature$1(JSON.parse(raw));
4540
8220
  if (!result.success) return {
4541
8221
  content: [{
4542
8222
  type: "text",
@@ -4615,7 +8295,7 @@ function findNearestFeature(startDir) {
4615
8295
  while (true) {
4616
8296
  const candidate = path.join(current, "feature.json");
4617
8297
  if (fs.existsSync(candidate)) try {
4618
- const result = validateFeature(JSON.parse(fs.readFileSync(candidate, "utf-8")));
8298
+ const result = validateFeature$1(JSON.parse(fs.readFileSync(candidate, "utf-8")));
4619
8299
  if (result.success) return result.data;
4620
8300
  } catch {}
4621
8301
  const parent = path.dirname(current);
@@ -4636,7 +8316,7 @@ function walkForFeatures(dir, results) {
4636
8316
  const full = path.join(dir, entry.name);
4637
8317
  if (entry.isDirectory()) walkForFeatures(full, results);
4638
8318
  else if (entry.name === "feature.json") try {
4639
- const result = validateFeature(JSON.parse(fs.readFileSync(full, "utf-8")));
8319
+ const result = validateFeature$1(JSON.parse(fs.readFileSync(full, "utf-8")));
4640
8320
  if (result.success) results.push({
4641
8321
  feature: result.data,
4642
8322
  filePath: full
@@ -4660,10 +8340,10 @@ function formatFeatureSummary(feature) {
4660
8340
  if (feature.lineage?.children?.length) lines.push(`Children : ${feature.lineage.children.join(", ")}`);
4661
8341
  return lines.join("\n");
4662
8342
  }
4663
- function buildLineageTree(feature, map, depth) {
4664
- return [`${" ".repeat(depth)}${statusIcon(feature.status)} ${feature.featureKey} (${feature.status}) — ${feature.title}`, ...(feature.lineage?.children ?? []).flatMap((key) => {
8343
+ function buildLineageTree(feature, map, childrenOf, depth) {
8344
+ return [`${" ".repeat(depth)}${statusIcon(feature.status)} ${feature.featureKey} (${feature.status}) — ${feature.title}`, ...(childrenOf.get(feature.featureKey) ?? feature.lineage?.children ?? []).flatMap((key) => {
4665
8345
  const child = map.get(key);
4666
- return child ? [buildLineageTree(child, map, depth + 1)] : [];
8346
+ return child ? [buildLineageTree(child, map, childrenOf, depth + 1)] : [];
4667
8347
  })].join("\n");
4668
8348
  }
4669
8349
  function statusIcon(status) {