@settlemint/sdk-utils 2.4.1-prb0c72988 → 2.4.1-prb593b885

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.
@@ -10,7 +10,9 @@ var __export = (target, all) => {
10
10
  };
11
11
 
12
12
  //#endregion
13
- //#region ../../node_modules/zod/dist/esm/v4/core/core.js
13
+ //#region ../../node_modules/zod/v4/core/core.js
14
+ /** A special constant with type `never` */
15
+ const NEVER = Object.freeze({ status: "aborted" });
14
16
  function $constructor(name, initializer$2, params) {
15
17
  function init(inst, def) {
16
18
  var _a;
@@ -61,7 +63,7 @@ function config(newConfig) {
61
63
  }
62
64
 
63
65
  //#endregion
64
- //#region ../../node_modules/zod/dist/esm/v4/core/util.js
66
+ //#region ../../node_modules/zod/v4/core/util.js
65
67
  var util_exports = {};
66
68
  __export(util_exports, {
67
69
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -76,6 +78,7 @@ __export(util_exports, {
76
78
  assertNotEqual: () => assertNotEqual,
77
79
  assignProp: () => assignProp,
78
80
  cached: () => cached,
81
+ captureStackTrace: () => captureStackTrace,
79
82
  cleanEnum: () => cleanEnum,
80
83
  cleanRegex: () => cleanRegex,
81
84
  clone: () => clone,
@@ -214,10 +217,14 @@ function randomString(length = 10) {
214
217
  function esc(str) {
215
218
  return JSON.stringify(str);
216
219
  }
220
+ const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
217
221
  function isObject(data) {
218
222
  return typeof data === "object" && data !== null && !Array.isArray(data);
219
223
  }
220
224
  const allowsEval = cached(() => {
225
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
226
+ return false;
227
+ }
221
228
  try {
222
229
  const F = Function;
223
230
  new F("");
@@ -226,9 +233,6 @@ const allowsEval = cached(() => {
226
233
  return false;
227
234
  }
228
235
  });
229
- function _isObject(o) {
230
- return Object.prototype.toString.call(o) === "[object Object]";
231
- }
232
236
  function isPlainObject(o) {
233
237
  if (isObject(o) === false) return false;
234
238
  const ctor = o.constructor;
@@ -408,6 +412,9 @@ function omit(schema, mask) {
408
412
  });
409
413
  }
410
414
  function extend(schema, shape) {
415
+ if (!isPlainObject(shape)) {
416
+ throw new Error("Invalid input to extend: expected a plain object");
417
+ }
411
418
  const def = {
412
419
  ...schema._zod.def,
413
420
  get shape() {
@@ -495,7 +502,7 @@ function required(Class$1, schema, mask) {
495
502
  }
496
503
  function aborted(x, startIndex = 0) {
497
504
  for (let i = startIndex; i < x.issues.length; i++) {
498
- if (x.issues[i].continue !== true) return true;
505
+ if (x.issues[i]?.continue !== true) return true;
499
506
  }
500
507
  return false;
501
508
  }
@@ -559,7 +566,7 @@ var Class = class {
559
566
  };
560
567
 
561
568
  //#endregion
562
- //#region ../../node_modules/zod/dist/esm/v4/core/errors.js
569
+ //#region ../../node_modules/zod/v4/core/errors.js
563
570
  const initializer$1 = (inst, def) => {
564
571
  inst.name = "$ZodError";
565
572
  Object.defineProperty(inst, "_zod", {
@@ -576,13 +583,17 @@ const initializer$1 = (inst, def) => {
576
583
  },
577
584
  enumerable: true
578
585
  });
586
+ Object.defineProperty(inst, "toString", {
587
+ value: () => inst.message,
588
+ enumerable: false
589
+ });
579
590
  };
580
591
  const $ZodError = $constructor("$ZodError", initializer$1);
581
592
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
582
- function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
593
+ function flattenError(error$39, mapper = (issue$1) => issue$1.message) {
583
594
  const fieldErrors = {};
584
595
  const formErrors = [];
585
- for (const sub of error$37.issues) {
596
+ for (const sub of error$39.issues) {
586
597
  if (sub.path.length > 0) {
587
598
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
588
599
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -595,13 +606,13 @@ function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
595
606
  fieldErrors
596
607
  };
597
608
  }
598
- function formatError(error$37, _mapper) {
609
+ function formatError(error$39, _mapper) {
599
610
  const mapper = _mapper || function(issue$1) {
600
611
  return issue$1.message;
601
612
  };
602
613
  const fieldErrors = { _errors: [] };
603
- const processError = (error$38) => {
604
- for (const issue$1 of error$38.issues) {
614
+ const processError = (error$40) => {
615
+ for (const issue$1 of error$40.issues) {
605
616
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
606
617
  issue$1.errors.map((issues) => processError({ issues }));
607
618
  } else if (issue$1.code === "invalid_key") {
@@ -628,17 +639,17 @@ function formatError(error$37, _mapper) {
628
639
  }
629
640
  }
630
641
  };
631
- processError(error$37);
642
+ processError(error$39);
632
643
  return fieldErrors;
633
644
  }
634
- function treeifyError(error$37, _mapper) {
645
+ function treeifyError(error$39, _mapper) {
635
646
  const mapper = _mapper || function(issue$1) {
636
647
  return issue$1.message;
637
648
  };
638
649
  const result = { errors: [] };
639
- const processError = (error$38, path = []) => {
650
+ const processError = (error$40, path = []) => {
640
651
  var _a, _b;
641
- for (const issue$1 of error$38.issues) {
652
+ for (const issue$1 of error$40.issues) {
642
653
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
643
654
  issue$1.errors.map((issues) => processError({ issues }, issue$1.path));
644
655
  } else if (issue$1.code === "invalid_key") {
@@ -673,7 +684,7 @@ function treeifyError(error$37, _mapper) {
673
684
  }
674
685
  }
675
686
  };
676
- processError(error$37);
687
+ processError(error$39);
677
688
  return result;
678
689
  }
679
690
  /** Format a ZodError as a human-readable string in the following form.
@@ -721,9 +732,9 @@ function toDotPath(path) {
721
732
  }
722
733
  return segs.join("");
723
734
  }
724
- function prettifyError(error$37) {
735
+ function prettifyError(error$39) {
725
736
  const lines = [];
726
- const issues = [...error$37.issues].sort((a, b) => a.path.length - b.path.length);
737
+ const issues = [...error$39.issues].sort((a, b) => a.path.length - b.path.length);
727
738
  for (const issue$1 of issues) {
728
739
  lines.push(`✖ ${issue$1.message}`);
729
740
  if (issue$1.path?.length) lines.push(` → at ${toDotPath(issue$1.path)}`);
@@ -732,7 +743,7 @@ function prettifyError(error$37) {
732
743
  }
733
744
 
734
745
  //#endregion
735
- //#region ../../node_modules/zod/dist/esm/v4/core/parse.js
746
+ //#region ../../node_modules/zod/v4/core/parse.js
736
747
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
737
748
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
738
749
  const result = schema._zod.run({
@@ -744,7 +755,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
744
755
  }
745
756
  if (result.issues.length) {
746
757
  const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
747
- Error.captureStackTrace(e, _params?.callee);
758
+ captureStackTrace(e, _params?.callee);
748
759
  throw e;
749
760
  }
750
761
  return result.value;
@@ -759,7 +770,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
759
770
  if (result instanceof Promise) result = await result;
760
771
  if (result.issues.length) {
761
772
  const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
762
- Error.captureStackTrace(e, params?.callee);
773
+ captureStackTrace(e, params?.callee);
763
774
  throw e;
764
775
  }
765
776
  return result.value;
@@ -804,10 +815,9 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
804
815
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
805
816
 
806
817
  //#endregion
807
- //#region ../../node_modules/zod/dist/esm/v4/core/regexes.js
818
+ //#region ../../node_modules/zod/v4/core/regexes.js
808
819
  var regexes_exports = {};
809
820
  __export(regexes_exports, {
810
- _emoji: () => _emoji$1,
811
821
  base64: () => base64$1,
812
822
  base64url: () => base64url$1,
813
823
  bigint: () => bigint$2,
@@ -893,27 +903,23 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
893
903
  const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
894
904
  const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
895
905
  const e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
896
- const dateSource = `((\\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])))`;
906
+ const dateSource = `(?:(?:\\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])))`;
897
907
  const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
898
908
  function timeSource(args) {
899
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
900
- if (args.precision) {
901
- regex = `${regex}\\.\\d{${args.precision}}`;
902
- } else if (args.precision == null) {
903
- regex = `${regex}(\\.\\d+)?`;
904
- }
909
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
910
+ const regex = 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+)?)?`;
905
911
  return regex;
906
912
  }
907
913
  function time$1(args) {
908
914
  return new RegExp(`^${timeSource(args)}$`);
909
915
  }
910
916
  function datetime$1(args) {
911
- let regex = `${dateSource}T${timeSource(args)}`;
912
- const opts = [];
913
- opts.push(args.local ? `Z?` : `Z`);
914
- if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
915
- regex = `${regex}(${opts.join("|")})`;
916
- return new RegExp(`^${regex}$`);
917
+ const time$2 = timeSource({ precision: args.precision });
918
+ const opts = ["Z"];
919
+ if (args.local) opts.push("");
920
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
921
+ const timeRegex = `${time$2}(?:${opts.join("|")})`;
922
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
917
923
  }
918
924
  const string$2 = (params) => {
919
925
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
@@ -929,7 +935,7 @@ const lowercase = /^[^A-Z]*$/;
929
935
  const uppercase = /^[^a-z]*$/;
930
936
 
931
937
  //#endregion
932
- //#region ../../node_modules/zod/dist/esm/v4/core/checks.js
938
+ //#region ../../node_modules/zod/v4/core/checks.js
933
939
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
934
940
  var _a;
935
941
  inst._zod ?? (inst._zod = {});
@@ -1120,11 +1126,12 @@ const $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntForma
1120
1126
  };
1121
1127
  });
1122
1128
  const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1129
+ var _a;
1123
1130
  $ZodCheck.init(inst, def);
1124
- inst._zod.when = (payload) => {
1131
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1125
1132
  const val = payload.value;
1126
1133
  return !nullish$1(val) && val.size !== undefined;
1127
- };
1134
+ });
1128
1135
  inst._zod.onattach.push((inst$1) => {
1129
1136
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1130
1137
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1144,11 +1151,12 @@ const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst,
1144
1151
  };
1145
1152
  });
1146
1153
  const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1154
+ var _a;
1147
1155
  $ZodCheck.init(inst, def);
1148
- inst._zod.when = (payload) => {
1156
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1149
1157
  const val = payload.value;
1150
1158
  return !nullish$1(val) && val.size !== undefined;
1151
- };
1159
+ });
1152
1160
  inst._zod.onattach.push((inst$1) => {
1153
1161
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1154
1162
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1168,11 +1176,12 @@ const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst,
1168
1176
  };
1169
1177
  });
1170
1178
  const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1179
+ var _a;
1171
1180
  $ZodCheck.init(inst, def);
1172
- inst._zod.when = (payload) => {
1181
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1173
1182
  const val = payload.value;
1174
1183
  return !nullish$1(val) && val.size !== undefined;
1175
- };
1184
+ });
1176
1185
  inst._zod.onattach.push((inst$1) => {
1177
1186
  const bag = inst$1._zod.bag;
1178
1187
  bag.minimum = def.size;
@@ -1193,6 +1202,8 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1193
1202
  code: "too_small",
1194
1203
  minimum: def.size
1195
1204
  },
1205
+ inclusive: true,
1206
+ exact: true,
1196
1207
  input: payload.value,
1197
1208
  inst,
1198
1209
  continue: !def.abort
@@ -1200,11 +1211,12 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1200
1211
  };
1201
1212
  });
1202
1213
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1214
+ var _a;
1203
1215
  $ZodCheck.init(inst, def);
1204
- inst._zod.when = (payload) => {
1216
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1205
1217
  const val = payload.value;
1206
1218
  return !nullish$1(val) && val.length !== undefined;
1207
- };
1219
+ });
1208
1220
  inst._zod.onattach.push((inst$1) => {
1209
1221
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1210
1222
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1226,11 +1238,12 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
1226
1238
  };
1227
1239
  });
1228
1240
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1241
+ var _a;
1229
1242
  $ZodCheck.init(inst, def);
1230
- inst._zod.when = (payload) => {
1243
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1231
1244
  const val = payload.value;
1232
1245
  return !nullish$1(val) && val.length !== undefined;
1233
- };
1246
+ });
1234
1247
  inst._zod.onattach.push((inst$1) => {
1235
1248
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1236
1249
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1252,11 +1265,12 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
1252
1265
  };
1253
1266
  });
1254
1267
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1268
+ var _a;
1255
1269
  $ZodCheck.init(inst, def);
1256
- inst._zod.when = (payload) => {
1270
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1257
1271
  const val = payload.value;
1258
1272
  return !nullish$1(val) && val.length !== undefined;
1259
- };
1273
+ });
1260
1274
  inst._zod.onattach.push((inst$1) => {
1261
1275
  const bag = inst$1._zod.bag;
1262
1276
  bag.minimum = def.length;
@@ -1278,6 +1292,8 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1278
1292
  code: "too_small",
1279
1293
  minimum: def.length
1280
1294
  },
1295
+ inclusive: true,
1296
+ exact: true,
1281
1297
  input: payload.value,
1282
1298
  inst,
1283
1299
  continue: !def.abort
@@ -1285,7 +1301,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1285
1301
  };
1286
1302
  });
1287
1303
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1288
- var _a;
1304
+ var _a, _b;
1289
1305
  $ZodCheck.init(inst, def);
1290
1306
  inst._zod.onattach.push((inst$1) => {
1291
1307
  const bag = inst$1._zod.bag;
@@ -1295,8 +1311,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1295
1311
  bag.patterns.add(def.pattern);
1296
1312
  }
1297
1313
  });
1298
- (_a = inst._zod).check ?? (_a.check = (payload) => {
1299
- if (!def.pattern) throw new Error("Not implemented.");
1314
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
1300
1315
  def.pattern.lastIndex = 0;
1301
1316
  if (def.pattern.test(payload.value)) return;
1302
1317
  payload.issues.push({
@@ -1309,6 +1324,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1309
1324
  continue: !def.abort
1310
1325
  });
1311
1326
  });
1327
+ else (_b = inst._zod).check ?? (_b.check = () => {});
1312
1328
  });
1313
1329
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1314
1330
  $ZodCheckStringFormat.init(inst, def);
@@ -1432,7 +1448,6 @@ const $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (ins
1432
1448
  code: "invalid_value",
1433
1449
  values: def.mime,
1434
1450
  input: payload.value.type,
1435
- path: ["type"],
1436
1451
  inst
1437
1452
  });
1438
1453
  };
@@ -1445,7 +1460,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1445
1460
  });
1446
1461
 
1447
1462
  //#endregion
1448
- //#region ../../node_modules/zod/dist/esm/v4/core/doc.js
1463
+ //#region ../../node_modules/zod/v4/core/doc.js
1449
1464
  var Doc = class {
1450
1465
  constructor(args = []) {
1451
1466
  this.content = [];
@@ -1481,19 +1496,18 @@ var Doc = class {
1481
1496
  };
1482
1497
 
1483
1498
  //#endregion
1484
- //#region ../../node_modules/zod/dist/esm/v4/core/versions.js
1499
+ //#region ../../node_modules/zod/v4/core/versions.js
1485
1500
  const version = {
1486
1501
  major: 4,
1487
1502
  minor: 0,
1488
- patch: 0
1503
+ patch: 2
1489
1504
  };
1490
1505
 
1491
1506
  //#endregion
1492
- //#region ../../node_modules/zod/dist/esm/v4/core/schemas.js
1507
+ //#region ../../node_modules/zod/v4/core/schemas.js
1493
1508
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1494
1509
  var _a;
1495
1510
  inst ?? (inst = {});
1496
- inst._zod.id = def.type + "_" + randomString(10);
1497
1511
  inst._zod.def = def;
1498
1512
  inst._zod.bag = inst._zod.bag || {};
1499
1513
  inst._zod.version = version;
@@ -1516,13 +1530,11 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1516
1530
  let isAborted = aborted(payload);
1517
1531
  let asyncResult;
1518
1532
  for (const ch of checks$1) {
1519
- if (ch._zod.when) {
1520
- const shouldRun = ch._zod.when(payload);
1533
+ if (ch._zod.def.when) {
1534
+ const shouldRun = ch._zod.def.when(payload);
1521
1535
  if (!shouldRun) continue;
1522
- } else {
1523
- if (isAborted) {
1524
- continue;
1525
- }
1536
+ } else if (isAborted) {
1537
+ continue;
1526
1538
  }
1527
1539
  const currLen = payload.issues.length;
1528
1540
  const _ = ch._zod.check(payload);
@@ -1622,7 +1634,9 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1622
1634
  $ZodStringFormat.init(inst, def);
1623
1635
  inst._zod.check = (payload) => {
1624
1636
  try {
1625
- const url$1 = new URL(payload.value);
1637
+ const orig = payload.value;
1638
+ const url$1 = new URL(orig);
1639
+ const href = url$1.href;
1626
1640
  if (def.hostname) {
1627
1641
  def.hostname.lastIndex = 0;
1628
1642
  if (!def.hostname.test(url$1.hostname)) {
@@ -1651,6 +1665,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1651
1665
  });
1652
1666
  }
1653
1667
  }
1668
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1669
+ payload.value = href.slice(0, -1);
1670
+ } else {
1671
+ payload.value = href;
1672
+ }
1654
1673
  return;
1655
1674
  } catch (_) {
1656
1675
  payload.issues.push({
@@ -1821,6 +1840,7 @@ function isValidJWT(token, algorithm = null) {
1821
1840
  const tokensParts = token.split(".");
1822
1841
  if (tokensParts.length !== 3) return false;
1823
1842
  const [header] = tokensParts;
1843
+ if (!header) return false;
1824
1844
  const parsedHeader = JSON.parse(atob(header));
1825
1845
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1826
1846
  if (!parsedHeader.alg) return false;
@@ -1843,6 +1863,19 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1843
1863
  });
1844
1864
  };
1845
1865
  });
1866
+ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
1867
+ $ZodStringFormat.init(inst, def);
1868
+ inst._zod.check = (payload) => {
1869
+ if (def.fn(payload.value)) return;
1870
+ payload.issues.push({
1871
+ code: "invalid_format",
1872
+ format: def.format,
1873
+ input: payload.value,
1874
+ inst,
1875
+ continue: !def.abort
1876
+ });
1877
+ };
1878
+ });
1846
1879
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1847
1880
  $ZodType.init(inst, def);
1848
1881
  inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
@@ -1894,12 +1927,11 @@ const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1894
1927
  if (def.coerce) try {
1895
1928
  payload.value = BigInt(payload.value);
1896
1929
  } catch (_) {}
1897
- const { value: input } = payload;
1898
- if (typeof input === "bigint") return payload;
1930
+ if (typeof payload.value === "bigint") return payload;
1899
1931
  payload.issues.push({
1900
1932
  expected: "bigint",
1901
1933
  code: "invalid_type",
1902
- input,
1934
+ input: payload.value,
1903
1935
  inst
1904
1936
  });
1905
1937
  return payload;
@@ -1912,7 +1944,7 @@ const $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def)
1912
1944
  const $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
1913
1945
  $ZodType.init(inst, def);
1914
1946
  inst._zod.parse = (payload, _ctx) => {
1915
- const { value: input } = payload;
1947
+ const input = payload.value;
1916
1948
  if (typeof input === "symbol") return payload;
1917
1949
  payload.issues.push({
1918
1950
  expected: "symbol",
@@ -1927,8 +1959,10 @@ const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def)
1927
1959
  $ZodType.init(inst, def);
1928
1960
  inst._zod.pattern = _undefined$2;
1929
1961
  inst._zod.values = new Set([undefined]);
1962
+ inst._zod.optin = "optional";
1963
+ inst._zod.optout = "optional";
1930
1964
  inst._zod.parse = (payload, _ctx) => {
1931
- const { value: input } = payload;
1965
+ const input = payload.value;
1932
1966
  if (typeof input === "undefined") return payload;
1933
1967
  payload.issues.push({
1934
1968
  expected: "undefined",
@@ -1944,7 +1978,7 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1944
1978
  inst._zod.pattern = _null$2;
1945
1979
  inst._zod.values = new Set([null]);
1946
1980
  inst._zod.parse = (payload, _ctx) => {
1947
- const { value: input } = payload;
1981
+ const input = payload.value;
1948
1982
  if (input === null) return payload;
1949
1983
  payload.issues.push({
1950
1984
  expected: "null",
@@ -1978,7 +2012,7 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1978
2012
  const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
1979
2013
  $ZodType.init(inst, def);
1980
2014
  inst._zod.parse = (payload, _ctx) => {
1981
- const { value: input } = payload;
2015
+ const input = payload.value;
1982
2016
  if (typeof input === "undefined") return payload;
1983
2017
  payload.issues.push({
1984
2018
  expected: "void",
@@ -2109,19 +2143,20 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2109
2143
  "payload",
2110
2144
  "ctx"
2111
2145
  ]);
2112
- const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
2146
+ const normalized = _normalized.value;
2113
2147
  const parseStr = (key) => {
2114
2148
  const k = esc(key);
2115
2149
  return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2116
2150
  };
2117
2151
  doc.write(`const input = payload.value;`);
2118
2152
  const ids = Object.create(null);
2119
- for (const key of keys) {
2120
- ids[key] = randomString(15);
2153
+ let counter = 0;
2154
+ for (const key of normalized.keys) {
2155
+ ids[key] = `key_${counter++}`;
2121
2156
  }
2122
2157
  doc.write(`const newResult = {}`);
2123
- for (const key of keys) {
2124
- if (optionalKeys$1.has(key)) {
2158
+ for (const key of normalized.keys) {
2159
+ if (normalized.optionalKeys.has(key)) {
2125
2160
  const id = ids[key];
2126
2161
  doc.write(`const ${id} = ${parseStr(key)};`);
2127
2162
  const k = esc(key);
@@ -2166,7 +2201,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2166
2201
  const jit = !globalConfig.jitless;
2167
2202
  const allowsEval$1 = allowsEval;
2168
2203
  const fastEnabled = jit && allowsEval$1.value;
2169
- const { catchall } = def;
2204
+ const catchall = def.catchall;
2170
2205
  let value;
2171
2206
  inst._zod.parse = (payload, ctx) => {
2172
2207
  value ?? (value = _normalized.value);
@@ -2196,12 +2231,10 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2196
2231
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2197
2232
  if (r instanceof Promise) {
2198
2233
  proms.push(r.then((r$1) => isOptional ? handleOptionalObjectResult(r$1, payload, key, input) : handleObjectResult(r$1, payload, key)));
2234
+ } else if (isOptional) {
2235
+ handleOptionalObjectResult(r, payload, key, input);
2199
2236
  } else {
2200
- if (isOptional) {
2201
- handleOptionalObjectResult(r, payload, key, input);
2202
- } else {
2203
- handleObjectResult(r, payload, key);
2204
- }
2237
+ handleObjectResult(r, payload, key);
2205
2238
  }
2206
2239
  }
2207
2240
  }
@@ -2259,6 +2292,8 @@ function handleUnionResults(results, final, inst, ctx) {
2259
2292
  }
2260
2293
  const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
2261
2294
  $ZodType.init(inst, def);
2295
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
2296
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
2262
2297
  defineLazy(inst._zod, "values", () => {
2263
2298
  if (def.options.every((o) => o._zod.values)) {
2264
2299
  return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
@@ -2358,7 +2393,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2358
2393
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2359
2394
  $ZodType.init(inst, def);
2360
2395
  inst._zod.parse = (payload, ctx) => {
2361
- const { value: input } = payload;
2396
+ const input = payload.value;
2362
2397
  const left = def.left._zod.run({
2363
2398
  value: input,
2364
2399
  issues: []
@@ -2815,6 +2850,9 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2815
2850
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2816
2851
  });
2817
2852
  inst._zod.parse = (payload, ctx) => {
2853
+ if (def.innerType._zod.optin === "optional") {
2854
+ return def.innerType._zod.run(payload, ctx);
2855
+ }
2818
2856
  if (payload.value === undefined) {
2819
2857
  return payload;
2820
2858
  }
@@ -2914,7 +2952,7 @@ const $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
2914
2952
  });
2915
2953
  const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2916
2954
  $ZodType.init(inst, def);
2917
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2955
+ inst._zod.optin = "optional";
2918
2956
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2919
2957
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2920
2958
  inst._zod.parse = (payload, ctx) => {
@@ -2985,6 +3023,7 @@ function handlePipeResult(left, def, ctx) {
2985
3023
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2986
3024
  $ZodType.init(inst, def);
2987
3025
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
3026
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2988
3027
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2989
3028
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2990
3029
  inst._zod.parse = (payload, ctx) => {
@@ -3035,7 +3074,7 @@ const $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral",
3035
3074
  input: payload.value,
3036
3075
  inst,
3037
3076
  code: "invalid_format",
3038
- format: "template_literal",
3077
+ format: def.format ?? "template_literal",
3039
3078
  pattern: inst._zod.pattern.source
3040
3079
  });
3041
3080
  return payload;
@@ -3095,8 +3134,8 @@ function handleRefineResult(result, payload, input, inst) {
3095
3134
  }
3096
3135
 
3097
3136
  //#endregion
3098
- //#region ../../node_modules/zod/dist/esm/v4/locales/ar.js
3099
- const error$36 = () => {
3137
+ //#region ../../node_modules/zod/v4/locales/ar.js
3138
+ const error$38 = () => {
3100
3139
  const Sizable = {
3101
3140
  string: {
3102
3141
  unit: "حرف",
@@ -3118,7 +3157,7 @@ const error$36 = () => {
3118
3157
  function getSizing(origin) {
3119
3158
  return Sizable[origin] ?? null;
3120
3159
  }
3121
- const parsedType$2 = (data) => {
3160
+ const parsedType$3 = (data) => {
3122
3161
  const t = typeof data;
3123
3162
  switch (t) {
3124
3163
  case "number": {
@@ -3170,7 +3209,7 @@ const error$36 = () => {
3170
3209
  };
3171
3210
  return (issue$1) => {
3172
3211
  switch (issue$1.code) {
3173
- case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$2(issue$1.input)}`;
3212
+ case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$3(issue$1.input)}`;
3174
3213
  case "invalid_value":
3175
3214
  if (issue$1.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue$1.values[0])}`;
3176
3215
  return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue$1.values, "|")}`;
@@ -3206,12 +3245,12 @@ const error$36 = () => {
3206
3245
  };
3207
3246
  };
3208
3247
  function ar_default() {
3209
- return { localeError: error$36() };
3248
+ return { localeError: error$38() };
3210
3249
  }
3211
3250
 
3212
3251
  //#endregion
3213
- //#region ../../node_modules/zod/dist/esm/v4/locales/az.js
3214
- const error$35 = () => {
3252
+ //#region ../../node_modules/zod/v4/locales/az.js
3253
+ const error$37 = () => {
3215
3254
  const Sizable = {
3216
3255
  string: {
3217
3256
  unit: "simvol",
@@ -3233,7 +3272,7 @@ const error$35 = () => {
3233
3272
  function getSizing(origin) {
3234
3273
  return Sizable[origin] ?? null;
3235
3274
  }
3236
- const parsedType$2 = (data) => {
3275
+ const parsedType$3 = (data) => {
3237
3276
  const t = typeof data;
3238
3277
  switch (t) {
3239
3278
  case "number": {
@@ -3285,7 +3324,7 @@ const error$35 = () => {
3285
3324
  };
3286
3325
  return (issue$1) => {
3287
3326
  switch (issue$1.code) {
3288
- case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$2(issue$1.input)}`;
3327
+ case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$3(issue$1.input)}`;
3289
3328
  case "invalid_value":
3290
3329
  if (issue$1.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue$1.values[0])}`;
3291
3330
  return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue$1.values, "|")}`;
@@ -3319,11 +3358,11 @@ const error$35 = () => {
3319
3358
  };
3320
3359
  };
3321
3360
  function az_default() {
3322
- return { localeError: error$35() };
3361
+ return { localeError: error$37() };
3323
3362
  }
3324
3363
 
3325
3364
  //#endregion
3326
- //#region ../../node_modules/zod/dist/esm/v4/locales/be.js
3365
+ //#region ../../node_modules/zod/v4/locales/be.js
3327
3366
  function getBelarusianPlural(count, one, few, many) {
3328
3367
  const absCount = Math.abs(count);
3329
3368
  const lastDigit = absCount % 10;
@@ -3339,7 +3378,7 @@ function getBelarusianPlural(count, one, few, many) {
3339
3378
  }
3340
3379
  return many;
3341
3380
  }
3342
- const error$34 = () => {
3381
+ const error$36 = () => {
3343
3382
  const Sizable = {
3344
3383
  string: {
3345
3384
  unit: {
@@ -3377,7 +3416,7 @@ const error$34 = () => {
3377
3416
  function getSizing(origin) {
3378
3417
  return Sizable[origin] ?? null;
3379
3418
  }
3380
- const parsedType$2 = (data) => {
3419
+ const parsedType$3 = (data) => {
3381
3420
  const t = typeof data;
3382
3421
  switch (t) {
3383
3422
  case "number": {
@@ -3429,7 +3468,7 @@ const error$34 = () => {
3429
3468
  };
3430
3469
  return (issue$1) => {
3431
3470
  switch (issue$1.code) {
3432
- case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$2(issue$1.input)}`;
3471
+ case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$3(issue$1.input)}`;
3433
3472
  case "invalid_value":
3434
3473
  if (issue$1.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue$1.values[0])}`;
3435
3474
  return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue$1.values, "|")}`;
@@ -3471,12 +3510,12 @@ const error$34 = () => {
3471
3510
  };
3472
3511
  };
3473
3512
  function be_default() {
3474
- return { localeError: error$34() };
3513
+ return { localeError: error$36() };
3475
3514
  }
3476
3515
 
3477
3516
  //#endregion
3478
- //#region ../../node_modules/zod/dist/esm/v4/locales/ca.js
3479
- const error$33 = () => {
3517
+ //#region ../../node_modules/zod/v4/locales/ca.js
3518
+ const error$35 = () => {
3480
3519
  const Sizable = {
3481
3520
  string: {
3482
3521
  unit: "caràcters",
@@ -3498,7 +3537,7 @@ const error$33 = () => {
3498
3537
  function getSizing(origin) {
3499
3538
  return Sizable[origin] ?? null;
3500
3539
  }
3501
- const parsedType$2 = (data) => {
3540
+ const parsedType$3 = (data) => {
3502
3541
  const t = typeof data;
3503
3542
  switch (t) {
3504
3543
  case "number": {
@@ -3550,7 +3589,7 @@ const error$33 = () => {
3550
3589
  };
3551
3590
  return (issue$1) => {
3552
3591
  switch (issue$1.code) {
3553
- case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$2(issue$1.input)}`;
3592
+ case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$3(issue$1.input)}`;
3554
3593
  case "invalid_value":
3555
3594
  if (issue$1.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue$1.values[0])}`;
3556
3595
  return `Opció invàlida: s'esperava una de ${joinValues(issue$1.values, " o ")}`;
@@ -3588,12 +3627,12 @@ const error$33 = () => {
3588
3627
  };
3589
3628
  };
3590
3629
  function ca_default() {
3591
- return { localeError: error$33() };
3630
+ return { localeError: error$35() };
3592
3631
  }
3593
3632
 
3594
3633
  //#endregion
3595
- //#region ../../node_modules/zod/dist/esm/v4/locales/cs.js
3596
- const error$32 = () => {
3634
+ //#region ../../node_modules/zod/v4/locales/cs.js
3635
+ const error$34 = () => {
3597
3636
  const Sizable = {
3598
3637
  string: {
3599
3638
  unit: "znaků",
@@ -3615,7 +3654,7 @@ const error$32 = () => {
3615
3654
  function getSizing(origin) {
3616
3655
  return Sizable[origin] ?? null;
3617
3656
  }
3618
- const parsedType$2 = (data) => {
3657
+ const parsedType$3 = (data) => {
3619
3658
  const t = typeof data;
3620
3659
  switch (t) {
3621
3660
  case "number": {
@@ -3685,7 +3724,7 @@ const error$32 = () => {
3685
3724
  };
3686
3725
  return (issue$1) => {
3687
3726
  switch (issue$1.code) {
3688
- case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$2(issue$1.input)}`;
3727
+ case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$3(issue$1.input)}`;
3689
3728
  case "invalid_value":
3690
3729
  if (issue$1.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue$1.values[0])}`;
3691
3730
  return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue$1.values, "|")}`;
@@ -3723,12 +3762,12 @@ const error$32 = () => {
3723
3762
  };
3724
3763
  };
3725
3764
  function cs_default() {
3726
- return { localeError: error$32() };
3765
+ return { localeError: error$34() };
3727
3766
  }
3728
3767
 
3729
3768
  //#endregion
3730
- //#region ../../node_modules/zod/dist/esm/v4/locales/de.js
3731
- const error$31 = () => {
3769
+ //#region ../../node_modules/zod/v4/locales/de.js
3770
+ const error$33 = () => {
3732
3771
  const Sizable = {
3733
3772
  string: {
3734
3773
  unit: "Zeichen",
@@ -3750,7 +3789,7 @@ const error$31 = () => {
3750
3789
  function getSizing(origin) {
3751
3790
  return Sizable[origin] ?? null;
3752
3791
  }
3753
- const parsedType$2 = (data) => {
3792
+ const parsedType$3 = (data) => {
3754
3793
  const t = typeof data;
3755
3794
  switch (t) {
3756
3795
  case "number": {
@@ -3802,7 +3841,7 @@ const error$31 = () => {
3802
3841
  };
3803
3842
  return (issue$1) => {
3804
3843
  switch (issue$1.code) {
3805
- case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$2(issue$1.input)}`;
3844
+ case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$3(issue$1.input)}`;
3806
3845
  case "invalid_value":
3807
3846
  if (issue$1.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue$1.values[0])}`;
3808
3847
  return `Ungültige Option: erwartet eine von ${joinValues(issue$1.values, "|")}`;
@@ -3838,12 +3877,12 @@ const error$31 = () => {
3838
3877
  };
3839
3878
  };
3840
3879
  function de_default() {
3841
- return { localeError: error$31() };
3880
+ return { localeError: error$33() };
3842
3881
  }
3843
3882
 
3844
3883
  //#endregion
3845
- //#region ../../node_modules/zod/dist/esm/v4/locales/en.js
3846
- const parsedType$1 = (data) => {
3884
+ //#region ../../node_modules/zod/v4/locales/en.js
3885
+ const parsedType$2 = (data) => {
3847
3886
  const t = typeof data;
3848
3887
  switch (t) {
3849
3888
  case "number": {
@@ -3863,7 +3902,7 @@ const parsedType$1 = (data) => {
3863
3902
  }
3864
3903
  return t;
3865
3904
  };
3866
- const error$30 = () => {
3905
+ const error$32 = () => {
3867
3906
  const Sizable = {
3868
3907
  string: {
3869
3908
  unit: "characters",
@@ -3917,7 +3956,7 @@ const error$30 = () => {
3917
3956
  };
3918
3957
  return (issue$1) => {
3919
3958
  switch (issue$1.code) {
3920
- case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$1(issue$1.input)}`;
3959
+ case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$2(issue$1.input)}`;
3921
3960
  case "invalid_value":
3922
3961
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
3923
3962
  return `Invalid option: expected one of ${joinValues(issue$1.values, "|")}`;
@@ -3955,12 +3994,127 @@ const error$30 = () => {
3955
3994
  };
3956
3995
  };
3957
3996
  function en_default() {
3958
- return { localeError: error$30() };
3997
+ return { localeError: error$32() };
3959
3998
  }
3960
3999
 
3961
4000
  //#endregion
3962
- //#region ../../node_modules/zod/dist/esm/v4/locales/es.js
3963
- const error$29 = () => {
4001
+ //#region ../../node_modules/zod/v4/locales/eo.js
4002
+ const parsedType$1 = (data) => {
4003
+ const t = typeof data;
4004
+ switch (t) {
4005
+ case "number": {
4006
+ return Number.isNaN(data) ? "NaN" : "nombro";
4007
+ }
4008
+ case "object": {
4009
+ if (Array.isArray(data)) {
4010
+ return "tabelo";
4011
+ }
4012
+ if (data === null) {
4013
+ return "senvalora";
4014
+ }
4015
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
4016
+ return data.constructor.name;
4017
+ }
4018
+ }
4019
+ }
4020
+ return t;
4021
+ };
4022
+ const error$31 = () => {
4023
+ const Sizable = {
4024
+ string: {
4025
+ unit: "karaktrojn",
4026
+ verb: "havi"
4027
+ },
4028
+ file: {
4029
+ unit: "bajtojn",
4030
+ verb: "havi"
4031
+ },
4032
+ array: {
4033
+ unit: "elementojn",
4034
+ verb: "havi"
4035
+ },
4036
+ set: {
4037
+ unit: "elementojn",
4038
+ verb: "havi"
4039
+ }
4040
+ };
4041
+ function getSizing(origin) {
4042
+ return Sizable[origin] ?? null;
4043
+ }
4044
+ const Nouns = {
4045
+ regex: "enigo",
4046
+ email: "retadreso",
4047
+ url: "URL",
4048
+ emoji: "emoĝio",
4049
+ uuid: "UUID",
4050
+ uuidv4: "UUIDv4",
4051
+ uuidv6: "UUIDv6",
4052
+ nanoid: "nanoid",
4053
+ guid: "GUID",
4054
+ cuid: "cuid",
4055
+ cuid2: "cuid2",
4056
+ ulid: "ULID",
4057
+ xid: "XID",
4058
+ ksuid: "KSUID",
4059
+ datetime: "ISO-datotempo",
4060
+ date: "ISO-dato",
4061
+ time: "ISO-tempo",
4062
+ duration: "ISO-daŭro",
4063
+ ipv4: "IPv4-adreso",
4064
+ ipv6: "IPv6-adreso",
4065
+ cidrv4: "IPv4-rango",
4066
+ cidrv6: "IPv6-rango",
4067
+ base64: "64-ume kodita karaktraro",
4068
+ base64url: "URL-64-ume kodita karaktraro",
4069
+ json_string: "JSON-karaktraro",
4070
+ e164: "E.164-nombro",
4071
+ jwt: "JWT",
4072
+ template_literal: "enigo"
4073
+ };
4074
+ return (issue$1) => {
4075
+ switch (issue$1.code) {
4076
+ case "invalid_type": return `Nevalida enigo: atendiĝis ${issue$1.expected}, riceviĝis ${parsedType$1(issue$1.input)}`;
4077
+ case "invalid_value":
4078
+ if (issue$1.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue$1.values[0])}`;
4079
+ return `Nevalida opcio: atendiĝis unu el ${joinValues(issue$1.values, "|")}`;
4080
+ case "too_big": {
4081
+ const adj = issue$1.inclusive ? "<=" : "<";
4082
+ const sizing = getSizing(issue$1.origin);
4083
+ if (sizing) return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
4084
+ return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()}`;
4085
+ }
4086
+ case "too_small": {
4087
+ const adj = issue$1.inclusive ? ">=" : ">";
4088
+ const sizing = getSizing(issue$1.origin);
4089
+ if (sizing) {
4090
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} havu ${adj}${issue$1.minimum.toString()} ${sizing.unit}`;
4091
+ }
4092
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} estu ${adj}${issue$1.minimum.toString()}`;
4093
+ }
4094
+ case "invalid_format": {
4095
+ const _issue = issue$1;
4096
+ if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
4097
+ if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
4098
+ if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
4099
+ if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
4100
+ return `Nevalida ${Nouns[_issue.format] ?? issue$1.format}`;
4101
+ }
4102
+ case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue$1.divisor}`;
4103
+ case "unrecognized_keys": return `Nekonata${issue$1.keys.length > 1 ? "j" : ""} ŝlosilo${issue$1.keys.length > 1 ? "j" : ""}: ${joinValues(issue$1.keys, ", ")}`;
4104
+ case "invalid_key": return `Nevalida ŝlosilo en ${issue$1.origin}`;
4105
+ case "invalid_union": return "Nevalida enigo";
4106
+ case "invalid_element": return `Nevalida valoro en ${issue$1.origin}`;
4107
+ default: return `Nevalida enigo`;
4108
+ }
4109
+ };
4110
+ };
4111
+ function eo_default() {
4112
+ return { localeError: error$31() };
4113
+ }
4114
+
4115
+ //#endregion
4116
+ //#region ../../node_modules/zod/v4/locales/es.js
4117
+ const error$30 = () => {
3964
4118
  const Sizable = {
3965
4119
  string: {
3966
4120
  unit: "caracteres",
@@ -3982,7 +4136,7 @@ const error$29 = () => {
3982
4136
  function getSizing(origin) {
3983
4137
  return Sizable[origin] ?? null;
3984
4138
  }
3985
- const parsedType$2 = (data) => {
4139
+ const parsedType$3 = (data) => {
3986
4140
  const t = typeof data;
3987
4141
  switch (t) {
3988
4142
  case "number": {
@@ -4034,7 +4188,7 @@ const error$29 = () => {
4034
4188
  };
4035
4189
  return (issue$1) => {
4036
4190
  switch (issue$1.code) {
4037
- case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$2(issue$1.input)}`;
4191
+ case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$3(issue$1.input)}`;
4038
4192
  case "invalid_value":
4039
4193
  if (issue$1.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue$1.values[0])}`;
4040
4194
  return `Opción inválida: se esperaba una de ${joinValues(issue$1.values, "|")}`;
@@ -4070,12 +4224,12 @@ const error$29 = () => {
4070
4224
  };
4071
4225
  };
4072
4226
  function es_default() {
4073
- return { localeError: error$29() };
4227
+ return { localeError: error$30() };
4074
4228
  }
4075
4229
 
4076
4230
  //#endregion
4077
- //#region ../../node_modules/zod/dist/esm/v4/locales/fa.js
4078
- const error$28 = () => {
4231
+ //#region ../../node_modules/zod/v4/locales/fa.js
4232
+ const error$29 = () => {
4079
4233
  const Sizable = {
4080
4234
  string: {
4081
4235
  unit: "کاراکتر",
@@ -4097,7 +4251,7 @@ const error$28 = () => {
4097
4251
  function getSizing(origin) {
4098
4252
  return Sizable[origin] ?? null;
4099
4253
  }
4100
- const parsedType$2 = (data) => {
4254
+ const parsedType$3 = (data) => {
4101
4255
  const t = typeof data;
4102
4256
  switch (t) {
4103
4257
  case "number": {
@@ -4149,7 +4303,7 @@ const error$28 = () => {
4149
4303
  };
4150
4304
  return (issue$1) => {
4151
4305
  switch (issue$1.code) {
4152
- case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$2(issue$1.input)} دریافت شد`;
4306
+ case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$3(issue$1.input)} دریافت شد`;
4153
4307
  case "invalid_value":
4154
4308
  if (issue$1.values.length === 1) {
4155
4309
  return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue$1.values[0])} می‌بود`;
@@ -4197,12 +4351,12 @@ const error$28 = () => {
4197
4351
  };
4198
4352
  };
4199
4353
  function fa_default() {
4200
- return { localeError: error$28() };
4354
+ return { localeError: error$29() };
4201
4355
  }
4202
4356
 
4203
4357
  //#endregion
4204
- //#region ../../node_modules/zod/dist/esm/v4/locales/fi.js
4205
- const error$27 = () => {
4358
+ //#region ../../node_modules/zod/v4/locales/fi.js
4359
+ const error$28 = () => {
4206
4360
  const Sizable = {
4207
4361
  string: {
4208
4362
  unit: "merkkiä",
@@ -4240,7 +4394,7 @@ const error$27 = () => {
4240
4394
  function getSizing(origin) {
4241
4395
  return Sizable[origin] ?? null;
4242
4396
  }
4243
- const parsedType$2 = (data) => {
4397
+ const parsedType$3 = (data) => {
4244
4398
  const t = typeof data;
4245
4399
  switch (t) {
4246
4400
  case "number": {
@@ -4292,7 +4446,7 @@ const error$27 = () => {
4292
4446
  };
4293
4447
  return (issue$1) => {
4294
4448
  switch (issue$1.code) {
4295
- case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$2(issue$1.input)}`;
4449
+ case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$3(issue$1.input)}`;
4296
4450
  case "invalid_value":
4297
4451
  if (issue$1.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue$1.values[0])}`;
4298
4452
  return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue$1.values, "|")}`;
@@ -4332,12 +4486,12 @@ const error$27 = () => {
4332
4486
  };
4333
4487
  };
4334
4488
  function fi_default() {
4335
- return { localeError: error$27() };
4489
+ return { localeError: error$28() };
4336
4490
  }
4337
4491
 
4338
4492
  //#endregion
4339
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr.js
4340
- const error$26 = () => {
4493
+ //#region ../../node_modules/zod/v4/locales/fr.js
4494
+ const error$27 = () => {
4341
4495
  const Sizable = {
4342
4496
  string: {
4343
4497
  unit: "caractères",
@@ -4359,7 +4513,7 @@ const error$26 = () => {
4359
4513
  function getSizing(origin) {
4360
4514
  return Sizable[origin] ?? null;
4361
4515
  }
4362
- const parsedType$2 = (data) => {
4516
+ const parsedType$3 = (data) => {
4363
4517
  const t = typeof data;
4364
4518
  switch (t) {
4365
4519
  case "number": {
@@ -4411,7 +4565,7 @@ const error$26 = () => {
4411
4565
  };
4412
4566
  return (issue$1) => {
4413
4567
  switch (issue$1.code) {
4414
- case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$2(issue$1.input)} reçu`;
4568
+ case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$3(issue$1.input)} reçu`;
4415
4569
  case "invalid_value":
4416
4570
  if (issue$1.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue$1.values[0])} attendu`;
4417
4571
  return `Option invalide : une valeur parmi ${joinValues(issue$1.values, "|")} attendue`;
@@ -4447,12 +4601,12 @@ const error$26 = () => {
4447
4601
  };
4448
4602
  };
4449
4603
  function fr_default() {
4450
- return { localeError: error$26() };
4604
+ return { localeError: error$27() };
4451
4605
  }
4452
4606
 
4453
4607
  //#endregion
4454
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr-CA.js
4455
- const error$25 = () => {
4608
+ //#region ../../node_modules/zod/v4/locales/fr-CA.js
4609
+ const error$26 = () => {
4456
4610
  const Sizable = {
4457
4611
  string: {
4458
4612
  unit: "caractères",
@@ -4474,7 +4628,7 @@ const error$25 = () => {
4474
4628
  function getSizing(origin) {
4475
4629
  return Sizable[origin] ?? null;
4476
4630
  }
4477
- const parsedType$2 = (data) => {
4631
+ const parsedType$3 = (data) => {
4478
4632
  const t = typeof data;
4479
4633
  switch (t) {
4480
4634
  case "number": {
@@ -4526,7 +4680,7 @@ const error$25 = () => {
4526
4680
  };
4527
4681
  return (issue$1) => {
4528
4682
  switch (issue$1.code) {
4529
- case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$2(issue$1.input)}`;
4683
+ case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$3(issue$1.input)}`;
4530
4684
  case "invalid_value":
4531
4685
  if (issue$1.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue$1.values[0])}`;
4532
4686
  return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue$1.values, "|")}`;
@@ -4564,12 +4718,12 @@ const error$25 = () => {
4564
4718
  };
4565
4719
  };
4566
4720
  function fr_CA_default() {
4567
- return { localeError: error$25() };
4721
+ return { localeError: error$26() };
4568
4722
  }
4569
4723
 
4570
4724
  //#endregion
4571
- //#region ../../node_modules/zod/dist/esm/v4/locales/he.js
4572
- const error$24 = () => {
4725
+ //#region ../../node_modules/zod/v4/locales/he.js
4726
+ const error$25 = () => {
4573
4727
  const Sizable = {
4574
4728
  string: {
4575
4729
  unit: "אותיות",
@@ -4591,7 +4745,7 @@ const error$24 = () => {
4591
4745
  function getSizing(origin) {
4592
4746
  return Sizable[origin] ?? null;
4593
4747
  }
4594
- const parsedType$2 = (data) => {
4748
+ const parsedType$3 = (data) => {
4595
4749
  const t = typeof data;
4596
4750
  switch (t) {
4597
4751
  case "number": {
@@ -4643,7 +4797,7 @@ const error$24 = () => {
4643
4797
  };
4644
4798
  return (issue$1) => {
4645
4799
  switch (issue$1.code) {
4646
- case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$2(issue$1.input)}`;
4800
+ case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$3(issue$1.input)}`;
4647
4801
  case "invalid_value":
4648
4802
  if (issue$1.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue$1.values[0])}`;
4649
4803
  return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue$1.values, "|")}`;
@@ -4679,12 +4833,12 @@ const error$24 = () => {
4679
4833
  };
4680
4834
  };
4681
4835
  function he_default() {
4682
- return { localeError: error$24() };
4836
+ return { localeError: error$25() };
4683
4837
  }
4684
4838
 
4685
4839
  //#endregion
4686
- //#region ../../node_modules/zod/dist/esm/v4/locales/hu.js
4687
- const error$23 = () => {
4840
+ //#region ../../node_modules/zod/v4/locales/hu.js
4841
+ const error$24 = () => {
4688
4842
  const Sizable = {
4689
4843
  string: {
4690
4844
  unit: "karakter",
@@ -4706,7 +4860,7 @@ const error$23 = () => {
4706
4860
  function getSizing(origin) {
4707
4861
  return Sizable[origin] ?? null;
4708
4862
  }
4709
- const parsedType$2 = (data) => {
4863
+ const parsedType$3 = (data) => {
4710
4864
  const t = typeof data;
4711
4865
  switch (t) {
4712
4866
  case "number": {
@@ -4758,7 +4912,7 @@ const error$23 = () => {
4758
4912
  };
4759
4913
  return (issue$1) => {
4760
4914
  switch (issue$1.code) {
4761
- case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$2(issue$1.input)}`;
4915
+ case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$3(issue$1.input)}`;
4762
4916
  case "invalid_value":
4763
4917
  if (issue$1.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue$1.values[0])}`;
4764
4918
  return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue$1.values, "|")}`;
@@ -4794,12 +4948,12 @@ const error$23 = () => {
4794
4948
  };
4795
4949
  };
4796
4950
  function hu_default() {
4797
- return { localeError: error$23() };
4951
+ return { localeError: error$24() };
4798
4952
  }
4799
4953
 
4800
4954
  //#endregion
4801
- //#region ../../node_modules/zod/dist/esm/v4/locales/id.js
4802
- const error$22 = () => {
4955
+ //#region ../../node_modules/zod/v4/locales/id.js
4956
+ const error$23 = () => {
4803
4957
  const Sizable = {
4804
4958
  string: {
4805
4959
  unit: "karakter",
@@ -4821,7 +4975,7 @@ const error$22 = () => {
4821
4975
  function getSizing(origin) {
4822
4976
  return Sizable[origin] ?? null;
4823
4977
  }
4824
- const parsedType$2 = (data) => {
4978
+ const parsedType$3 = (data) => {
4825
4979
  const t = typeof data;
4826
4980
  switch (t) {
4827
4981
  case "number": {
@@ -4873,7 +5027,7 @@ const error$22 = () => {
4873
5027
  };
4874
5028
  return (issue$1) => {
4875
5029
  switch (issue$1.code) {
4876
- case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5030
+ case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
4877
5031
  case "invalid_value":
4878
5032
  if (issue$1.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue$1.values[0])}`;
4879
5033
  return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue$1.values, "|")}`;
@@ -4909,12 +5063,12 @@ const error$22 = () => {
4909
5063
  };
4910
5064
  };
4911
5065
  function id_default() {
4912
- return { localeError: error$22() };
5066
+ return { localeError: error$23() };
4913
5067
  }
4914
5068
 
4915
5069
  //#endregion
4916
- //#region ../../node_modules/zod/dist/esm/v4/locales/it.js
4917
- const error$21 = () => {
5070
+ //#region ../../node_modules/zod/v4/locales/it.js
5071
+ const error$22 = () => {
4918
5072
  const Sizable = {
4919
5073
  string: {
4920
5074
  unit: "caratteri",
@@ -4936,7 +5090,7 @@ const error$21 = () => {
4936
5090
  function getSizing(origin) {
4937
5091
  return Sizable[origin] ?? null;
4938
5092
  }
4939
- const parsedType$2 = (data) => {
5093
+ const parsedType$3 = (data) => {
4940
5094
  const t = typeof data;
4941
5095
  switch (t) {
4942
5096
  case "number": {
@@ -4988,7 +5142,7 @@ const error$21 = () => {
4988
5142
  };
4989
5143
  return (issue$1) => {
4990
5144
  switch (issue$1.code) {
4991
- case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$2(issue$1.input)}`;
5145
+ case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$3(issue$1.input)}`;
4992
5146
  case "invalid_value":
4993
5147
  if (issue$1.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue$1.values[0])}`;
4994
5148
  return `Opzione non valida: atteso uno tra ${joinValues(issue$1.values, "|")}`;
@@ -5024,12 +5178,12 @@ const error$21 = () => {
5024
5178
  };
5025
5179
  };
5026
5180
  function it_default() {
5027
- return { localeError: error$21() };
5181
+ return { localeError: error$22() };
5028
5182
  }
5029
5183
 
5030
5184
  //#endregion
5031
- //#region ../../node_modules/zod/dist/esm/v4/locales/ja.js
5032
- const error$20 = () => {
5185
+ //#region ../../node_modules/zod/v4/locales/ja.js
5186
+ const error$21 = () => {
5033
5187
  const Sizable = {
5034
5188
  string: {
5035
5189
  unit: "文字",
@@ -5051,7 +5205,7 @@ const error$20 = () => {
5051
5205
  function getSizing(origin) {
5052
5206
  return Sizable[origin] ?? null;
5053
5207
  }
5054
- const parsedType$2 = (data) => {
5208
+ const parsedType$3 = (data) => {
5055
5209
  const t = typeof data;
5056
5210
  switch (t) {
5057
5211
  case "number": {
@@ -5103,21 +5257,21 @@ const error$20 = () => {
5103
5257
  };
5104
5258
  return (issue$1) => {
5105
5259
  switch (issue$1.code) {
5106
- case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$2(issue$1.input)}が入力されました`;
5260
+ case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$3(issue$1.input)}が入力されました`;
5107
5261
  case "invalid_value":
5108
5262
  if (issue$1.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue$1.values[0])}が期待されました`;
5109
5263
  return `無効な選択: ${joinValues(issue$1.values, "、")}のいずれかである必要があります`;
5110
5264
  case "too_big": {
5111
- const adj = issue$1.inclusive ? "<=" : "<";
5265
+ const adj = issue$1.inclusive ? "以下である" : "より小さい";
5112
5266
  const sizing = getSizing(issue$1.origin);
5113
- if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
5114
- return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}である必要があります`;
5267
+ if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
5268
+ return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}必要があります`;
5115
5269
  }
5116
5270
  case "too_small": {
5117
- const adj = issue$1.inclusive ? ">=" : ">";
5271
+ const adj = issue$1.inclusive ? "以上である" : "より大きい";
5118
5272
  const sizing = getSizing(issue$1.origin);
5119
- if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}である必要があります`;
5120
- return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}である必要があります`;
5273
+ if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}必要があります`;
5274
+ return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}必要があります`;
5121
5275
  }
5122
5276
  case "invalid_format": {
5123
5277
  const _issue = issue$1;
@@ -5137,12 +5291,12 @@ const error$20 = () => {
5137
5291
  };
5138
5292
  };
5139
5293
  function ja_default() {
5140
- return { localeError: error$20() };
5294
+ return { localeError: error$21() };
5141
5295
  }
5142
5296
 
5143
5297
  //#endregion
5144
- //#region ../../node_modules/zod/dist/esm/v4/locales/kh.js
5145
- const error$19 = () => {
5298
+ //#region ../../node_modules/zod/v4/locales/kh.js
5299
+ const error$20 = () => {
5146
5300
  const Sizable = {
5147
5301
  string: {
5148
5302
  unit: "តួអក្សរ",
@@ -5164,7 +5318,7 @@ const error$19 = () => {
5164
5318
  function getSizing(origin) {
5165
5319
  return Sizable[origin] ?? null;
5166
5320
  }
5167
- const parsedType$2 = (data) => {
5321
+ const parsedType$3 = (data) => {
5168
5322
  const t = typeof data;
5169
5323
  switch (t) {
5170
5324
  case "number": {
@@ -5216,7 +5370,7 @@ const error$19 = () => {
5216
5370
  };
5217
5371
  return (issue$1) => {
5218
5372
  switch (issue$1.code) {
5219
- case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$2(issue$1.input)}`;
5373
+ case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$3(issue$1.input)}`;
5220
5374
  case "invalid_value":
5221
5375
  if (issue$1.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue$1.values[0])}`;
5222
5376
  return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue$1.values, "|")}`;
@@ -5254,12 +5408,12 @@ const error$19 = () => {
5254
5408
  };
5255
5409
  };
5256
5410
  function kh_default() {
5257
- return { localeError: error$19() };
5411
+ return { localeError: error$20() };
5258
5412
  }
5259
5413
 
5260
5414
  //#endregion
5261
- //#region ../../node_modules/zod/dist/esm/v4/locales/ko.js
5262
- const error$18 = () => {
5415
+ //#region ../../node_modules/zod/v4/locales/ko.js
5416
+ const error$19 = () => {
5263
5417
  const Sizable = {
5264
5418
  string: {
5265
5419
  unit: "문자",
@@ -5281,7 +5435,7 @@ const error$18 = () => {
5281
5435
  function getSizing(origin) {
5282
5436
  return Sizable[origin] ?? null;
5283
5437
  }
5284
- const parsedType$2 = (data) => {
5438
+ const parsedType$3 = (data) => {
5285
5439
  const t = typeof data;
5286
5440
  switch (t) {
5287
5441
  case "number": {
@@ -5333,7 +5487,7 @@ const error$18 = () => {
5333
5487
  };
5334
5488
  return (issue$1) => {
5335
5489
  switch (issue$1.code) {
5336
- case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$2(issue$1.input)}입니다`;
5490
+ case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$3(issue$1.input)}입니다`;
5337
5491
  case "invalid_value":
5338
5492
  if (issue$1.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue$1.values[0])} 이어야 합니다`;
5339
5493
  return `잘못된 옵션: ${joinValues(issue$1.values, "또는 ")} 중 하나여야 합니다`;
@@ -5375,12 +5529,12 @@ const error$18 = () => {
5375
5529
  };
5376
5530
  };
5377
5531
  function ko_default() {
5378
- return { localeError: error$18() };
5532
+ return { localeError: error$19() };
5379
5533
  }
5380
5534
 
5381
5535
  //#endregion
5382
- //#region ../../node_modules/zod/dist/esm/v4/locales/mk.js
5383
- const error$17 = () => {
5536
+ //#region ../../node_modules/zod/v4/locales/mk.js
5537
+ const error$18 = () => {
5384
5538
  const Sizable = {
5385
5539
  string: {
5386
5540
  unit: "знаци",
@@ -5402,7 +5556,7 @@ const error$17 = () => {
5402
5556
  function getSizing(origin) {
5403
5557
  return Sizable[origin] ?? null;
5404
5558
  }
5405
- const parsedType$2 = (data) => {
5559
+ const parsedType$3 = (data) => {
5406
5560
  const t = typeof data;
5407
5561
  switch (t) {
5408
5562
  case "number": {
@@ -5454,7 +5608,7 @@ const error$17 = () => {
5454
5608
  };
5455
5609
  return (issue$1) => {
5456
5610
  switch (issue$1.code) {
5457
- case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$2(issue$1.input)}`;
5611
+ case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$3(issue$1.input)}`;
5458
5612
  case "invalid_value":
5459
5613
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
5460
5614
  return `Грешана опција: се очекува една ${joinValues(issue$1.values, "|")}`;
@@ -5492,12 +5646,12 @@ const error$17 = () => {
5492
5646
  };
5493
5647
  };
5494
5648
  function mk_default() {
5495
- return { localeError: error$17() };
5649
+ return { localeError: error$18() };
5496
5650
  }
5497
5651
 
5498
5652
  //#endregion
5499
- //#region ../../node_modules/zod/dist/esm/v4/locales/ms.js
5500
- const error$16 = () => {
5653
+ //#region ../../node_modules/zod/v4/locales/ms.js
5654
+ const error$17 = () => {
5501
5655
  const Sizable = {
5502
5656
  string: {
5503
5657
  unit: "aksara",
@@ -5519,7 +5673,7 @@ const error$16 = () => {
5519
5673
  function getSizing(origin) {
5520
5674
  return Sizable[origin] ?? null;
5521
5675
  }
5522
- const parsedType$2 = (data) => {
5676
+ const parsedType$3 = (data) => {
5523
5677
  const t = typeof data;
5524
5678
  switch (t) {
5525
5679
  case "number": {
@@ -5571,7 +5725,7 @@ const error$16 = () => {
5571
5725
  };
5572
5726
  return (issue$1) => {
5573
5727
  switch (issue$1.code) {
5574
- case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5728
+ case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
5575
5729
  case "invalid_value":
5576
5730
  if (issue$1.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue$1.values[0])}`;
5577
5731
  return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue$1.values, "|")}`;
@@ -5607,12 +5761,12 @@ const error$16 = () => {
5607
5761
  };
5608
5762
  };
5609
5763
  function ms_default() {
5610
- return { localeError: error$16() };
5764
+ return { localeError: error$17() };
5611
5765
  }
5612
5766
 
5613
5767
  //#endregion
5614
- //#region ../../node_modules/zod/dist/esm/v4/locales/nl.js
5615
- const error$15 = () => {
5768
+ //#region ../../node_modules/zod/v4/locales/nl.js
5769
+ const error$16 = () => {
5616
5770
  const Sizable = {
5617
5771
  string: { unit: "tekens" },
5618
5772
  file: { unit: "bytes" },
@@ -5622,7 +5776,7 @@ const error$15 = () => {
5622
5776
  function getSizing(origin) {
5623
5777
  return Sizable[origin] ?? null;
5624
5778
  }
5625
- const parsedType$2 = (data) => {
5779
+ const parsedType$3 = (data) => {
5626
5780
  const t = typeof data;
5627
5781
  switch (t) {
5628
5782
  case "number": {
@@ -5674,7 +5828,7 @@ const error$15 = () => {
5674
5828
  };
5675
5829
  return (issue$1) => {
5676
5830
  switch (issue$1.code) {
5677
- case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$2(issue$1.input)}`;
5831
+ case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$3(issue$1.input)}`;
5678
5832
  case "invalid_value":
5679
5833
  if (issue$1.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue$1.values[0])}`;
5680
5834
  return `Ongeldige optie: verwacht één van ${joinValues(issue$1.values, "|")}`;
@@ -5712,12 +5866,12 @@ const error$15 = () => {
5712
5866
  };
5713
5867
  };
5714
5868
  function nl_default() {
5715
- return { localeError: error$15() };
5869
+ return { localeError: error$16() };
5716
5870
  }
5717
5871
 
5718
5872
  //#endregion
5719
- //#region ../../node_modules/zod/dist/esm/v4/locales/no.js
5720
- const error$14 = () => {
5873
+ //#region ../../node_modules/zod/v4/locales/no.js
5874
+ const error$15 = () => {
5721
5875
  const Sizable = {
5722
5876
  string: {
5723
5877
  unit: "tegn",
@@ -5739,7 +5893,7 @@ const error$14 = () => {
5739
5893
  function getSizing(origin) {
5740
5894
  return Sizable[origin] ?? null;
5741
5895
  }
5742
- const parsedType$2 = (data) => {
5896
+ const parsedType$3 = (data) => {
5743
5897
  const t = typeof data;
5744
5898
  switch (t) {
5745
5899
  case "number": {
@@ -5791,7 +5945,7 @@ const error$14 = () => {
5791
5945
  };
5792
5946
  return (issue$1) => {
5793
5947
  switch (issue$1.code) {
5794
- case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$2(issue$1.input)}`;
5948
+ case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$3(issue$1.input)}`;
5795
5949
  case "invalid_value":
5796
5950
  if (issue$1.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue$1.values[0])}`;
5797
5951
  return `Ugyldig valg: forventet en av ${joinValues(issue$1.values, "|")}`;
@@ -5827,12 +5981,12 @@ const error$14 = () => {
5827
5981
  };
5828
5982
  };
5829
5983
  function no_default() {
5830
- return { localeError: error$14() };
5984
+ return { localeError: error$15() };
5831
5985
  }
5832
5986
 
5833
5987
  //#endregion
5834
- //#region ../../node_modules/zod/dist/esm/v4/locales/ota.js
5835
- const error$13 = () => {
5988
+ //#region ../../node_modules/zod/v4/locales/ota.js
5989
+ const error$14 = () => {
5836
5990
  const Sizable = {
5837
5991
  string: {
5838
5992
  unit: "harf",
@@ -5854,7 +6008,7 @@ const error$13 = () => {
5854
6008
  function getSizing(origin) {
5855
6009
  return Sizable[origin] ?? null;
5856
6010
  }
5857
- const parsedType$2 = (data) => {
6011
+ const parsedType$3 = (data) => {
5858
6012
  const t = typeof data;
5859
6013
  switch (t) {
5860
6014
  case "number": {
@@ -5906,7 +6060,7 @@ const error$13 = () => {
5906
6060
  };
5907
6061
  return (issue$1) => {
5908
6062
  switch (issue$1.code) {
5909
- case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$2(issue$1.input)}`;
6063
+ case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$3(issue$1.input)}`;
5910
6064
  case "invalid_value":
5911
6065
  if (issue$1.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue$1.values[0])}`;
5912
6066
  return `Fâsit tercih: mûteberler ${joinValues(issue$1.values, "|")}`;
@@ -5942,11 +6096,138 @@ const error$13 = () => {
5942
6096
  };
5943
6097
  };
5944
6098
  function ota_default() {
6099
+ return { localeError: error$14() };
6100
+ }
6101
+
6102
+ //#endregion
6103
+ //#region ../../node_modules/zod/v4/locales/ps.js
6104
+ const error$13 = () => {
6105
+ const Sizable = {
6106
+ string: {
6107
+ unit: "توکي",
6108
+ verb: "ولري"
6109
+ },
6110
+ file: {
6111
+ unit: "بایټس",
6112
+ verb: "ولري"
6113
+ },
6114
+ array: {
6115
+ unit: "توکي",
6116
+ verb: "ولري"
6117
+ },
6118
+ set: {
6119
+ unit: "توکي",
6120
+ verb: "ولري"
6121
+ }
6122
+ };
6123
+ function getSizing(origin) {
6124
+ return Sizable[origin] ?? null;
6125
+ }
6126
+ const parsedType$3 = (data) => {
6127
+ const t = typeof data;
6128
+ switch (t) {
6129
+ case "number": {
6130
+ return Number.isNaN(data) ? "NaN" : "عدد";
6131
+ }
6132
+ case "object": {
6133
+ if (Array.isArray(data)) {
6134
+ return "ارې";
6135
+ }
6136
+ if (data === null) {
6137
+ return "null";
6138
+ }
6139
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
6140
+ return data.constructor.name;
6141
+ }
6142
+ }
6143
+ }
6144
+ return t;
6145
+ };
6146
+ const Nouns = {
6147
+ regex: "ورودي",
6148
+ email: "بریښنالیک",
6149
+ url: "یو آر ال",
6150
+ emoji: "ایموجي",
6151
+ uuid: "UUID",
6152
+ uuidv4: "UUIDv4",
6153
+ uuidv6: "UUIDv6",
6154
+ nanoid: "nanoid",
6155
+ guid: "GUID",
6156
+ cuid: "cuid",
6157
+ cuid2: "cuid2",
6158
+ ulid: "ULID",
6159
+ xid: "XID",
6160
+ ksuid: "KSUID",
6161
+ datetime: "نیټه او وخت",
6162
+ date: "نېټه",
6163
+ time: "وخت",
6164
+ duration: "موده",
6165
+ ipv4: "د IPv4 پته",
6166
+ ipv6: "د IPv6 پته",
6167
+ cidrv4: "د IPv4 ساحه",
6168
+ cidrv6: "د IPv6 ساحه",
6169
+ base64: "base64-encoded متن",
6170
+ base64url: "base64url-encoded متن",
6171
+ json_string: "JSON متن",
6172
+ e164: "د E.164 شمېره",
6173
+ jwt: "JWT",
6174
+ template_literal: "ورودي"
6175
+ };
6176
+ return (issue$1) => {
6177
+ switch (issue$1.code) {
6178
+ case "invalid_type": return `ناسم ورودي: باید ${issue$1.expected} وای, مګر ${parsedType$3(issue$1.input)} ترلاسه شو`;
6179
+ case "invalid_value":
6180
+ if (issue$1.values.length === 1) {
6181
+ return `ناسم ورودي: باید ${stringifyPrimitive(issue$1.values[0])} وای`;
6182
+ }
6183
+ return `ناسم انتخاب: باید یو له ${joinValues(issue$1.values, "|")} څخه وای`;
6184
+ case "too_big": {
6185
+ const adj = issue$1.inclusive ? "<=" : "<";
6186
+ const sizing = getSizing(issue$1.origin);
6187
+ if (sizing) {
6188
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
6189
+ }
6190
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} وي`;
6191
+ }
6192
+ case "too_small": {
6193
+ const adj = issue$1.inclusive ? ">=" : ">";
6194
+ const sizing = getSizing(issue$1.origin);
6195
+ if (sizing) {
6196
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} ${sizing.unit} ولري`;
6197
+ }
6198
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} وي`;
6199
+ }
6200
+ case "invalid_format": {
6201
+ const _issue = issue$1;
6202
+ if (_issue.format === "starts_with") {
6203
+ return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
6204
+ }
6205
+ if (_issue.format === "ends_with") {
6206
+ return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
6207
+ }
6208
+ if (_issue.format === "includes") {
6209
+ return `ناسم متن: باید "${_issue.includes}" ولري`;
6210
+ }
6211
+ if (_issue.format === "regex") {
6212
+ return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
6213
+ }
6214
+ return `${Nouns[_issue.format] ?? issue$1.format} ناسم دی`;
6215
+ }
6216
+ case "not_multiple_of": return `ناسم عدد: باید د ${issue$1.divisor} مضرب وي`;
6217
+ case "unrecognized_keys": return `ناسم ${issue$1.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue$1.keys, ", ")}`;
6218
+ case "invalid_key": return `ناسم کلیډ په ${issue$1.origin} کې`;
6219
+ case "invalid_union": return `ناسمه ورودي`;
6220
+ case "invalid_element": return `ناسم عنصر په ${issue$1.origin} کې`;
6221
+ default: return `ناسمه ورودي`;
6222
+ }
6223
+ };
6224
+ };
6225
+ function ps_default() {
5945
6226
  return { localeError: error$13() };
5946
6227
  }
5947
6228
 
5948
6229
  //#endregion
5949
- //#region ../../node_modules/zod/dist/esm/v4/locales/pl.js
6230
+ //#region ../../node_modules/zod/v4/locales/pl.js
5950
6231
  const error$12 = () => {
5951
6232
  const Sizable = {
5952
6233
  string: {
@@ -5969,7 +6250,7 @@ const error$12 = () => {
5969
6250
  function getSizing(origin) {
5970
6251
  return Sizable[origin] ?? null;
5971
6252
  }
5972
- const parsedType$2 = (data) => {
6253
+ const parsedType$3 = (data) => {
5973
6254
  const t = typeof data;
5974
6255
  switch (t) {
5975
6256
  case "number": {
@@ -6021,7 +6302,7 @@ const error$12 = () => {
6021
6302
  };
6022
6303
  return (issue$1) => {
6023
6304
  switch (issue$1.code) {
6024
- case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$2(issue$1.input)}`;
6305
+ case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$3(issue$1.input)}`;
6025
6306
  case "invalid_value":
6026
6307
  if (issue$1.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue$1.values[0])}`;
6027
6308
  return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue$1.values, "|")}`;
@@ -6063,7 +6344,7 @@ function pl_default() {
6063
6344
  }
6064
6345
 
6065
6346
  //#endregion
6066
- //#region ../../node_modules/zod/dist/esm/v4/locales/pt.js
6347
+ //#region ../../node_modules/zod/v4/locales/pt.js
6067
6348
  const error$11 = () => {
6068
6349
  const Sizable = {
6069
6350
  string: {
@@ -6086,7 +6367,7 @@ const error$11 = () => {
6086
6367
  function getSizing(origin) {
6087
6368
  return Sizable[origin] ?? null;
6088
6369
  }
6089
- const parsedType$2 = (data) => {
6370
+ const parsedType$3 = (data) => {
6090
6371
  const t = typeof data;
6091
6372
  switch (t) {
6092
6373
  case "number": {
@@ -6138,7 +6419,7 @@ const error$11 = () => {
6138
6419
  };
6139
6420
  return (issue$1) => {
6140
6421
  switch (issue$1.code) {
6141
- case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$2(issue$1.input)}`;
6422
+ case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$3(issue$1.input)}`;
6142
6423
  case "invalid_value":
6143
6424
  if (issue$1.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue$1.values[0])}`;
6144
6425
  return `Opção inválida: esperada uma das ${joinValues(issue$1.values, "|")}`;
@@ -6178,7 +6459,7 @@ function pt_default() {
6178
6459
  }
6179
6460
 
6180
6461
  //#endregion
6181
- //#region ../../node_modules/zod/dist/esm/v4/locales/ru.js
6462
+ //#region ../../node_modules/zod/v4/locales/ru.js
6182
6463
  function getRussianPlural(count, one, few, many) {
6183
6464
  const absCount = Math.abs(count);
6184
6465
  const lastDigit = absCount % 10;
@@ -6232,7 +6513,7 @@ const error$10 = () => {
6232
6513
  function getSizing(origin) {
6233
6514
  return Sizable[origin] ?? null;
6234
6515
  }
6235
- const parsedType$2 = (data) => {
6516
+ const parsedType$3 = (data) => {
6236
6517
  const t = typeof data;
6237
6518
  switch (t) {
6238
6519
  case "number": {
@@ -6284,7 +6565,7 @@ const error$10 = () => {
6284
6565
  };
6285
6566
  return (issue$1) => {
6286
6567
  switch (issue$1.code) {
6287
- case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$2(issue$1.input)}`;
6568
+ case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$3(issue$1.input)}`;
6288
6569
  case "invalid_value":
6289
6570
  if (issue$1.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue$1.values[0])}`;
6290
6571
  return `Неверный вариант: ожидалось одно из ${joinValues(issue$1.values, "|")}`;
@@ -6330,7 +6611,7 @@ function ru_default() {
6330
6611
  }
6331
6612
 
6332
6613
  //#endregion
6333
- //#region ../../node_modules/zod/dist/esm/v4/locales/sl.js
6614
+ //#region ../../node_modules/zod/v4/locales/sl.js
6334
6615
  const error$9 = () => {
6335
6616
  const Sizable = {
6336
6617
  string: {
@@ -6353,7 +6634,7 @@ const error$9 = () => {
6353
6634
  function getSizing(origin) {
6354
6635
  return Sizable[origin] ?? null;
6355
6636
  }
6356
- const parsedType$2 = (data) => {
6637
+ const parsedType$3 = (data) => {
6357
6638
  const t = typeof data;
6358
6639
  switch (t) {
6359
6640
  case "number": {
@@ -6405,7 +6686,7 @@ const error$9 = () => {
6405
6686
  };
6406
6687
  return (issue$1) => {
6407
6688
  switch (issue$1.code) {
6408
- case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$2(issue$1.input)}`;
6689
+ case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$3(issue$1.input)}`;
6409
6690
  case "invalid_value":
6410
6691
  if (issue$1.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue$1.values[0])}`;
6411
6692
  return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue$1.values, "|")}`;
@@ -6447,7 +6728,7 @@ function sl_default() {
6447
6728
  }
6448
6729
 
6449
6730
  //#endregion
6450
- //#region ../../node_modules/zod/dist/esm/v4/locales/sv.js
6731
+ //#region ../../node_modules/zod/v4/locales/sv.js
6451
6732
  const error$8 = () => {
6452
6733
  const Sizable = {
6453
6734
  string: {
@@ -6470,7 +6751,7 @@ const error$8 = () => {
6470
6751
  function getSizing(origin) {
6471
6752
  return Sizable[origin] ?? null;
6472
6753
  }
6473
- const parsedType$2 = (data) => {
6754
+ const parsedType$3 = (data) => {
6474
6755
  const t = typeof data;
6475
6756
  switch (t) {
6476
6757
  case "number": {
@@ -6522,7 +6803,7 @@ const error$8 = () => {
6522
6803
  };
6523
6804
  return (issue$1) => {
6524
6805
  switch (issue$1.code) {
6525
- case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$2(issue$1.input)}`;
6806
+ case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$3(issue$1.input)}`;
6526
6807
  case "invalid_value":
6527
6808
  if (issue$1.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue$1.values[0])}`;
6528
6809
  return `Ogiltigt val: förväntade en av ${joinValues(issue$1.values, "|")}`;
@@ -6566,7 +6847,7 @@ function sv_default() {
6566
6847
  }
6567
6848
 
6568
6849
  //#endregion
6569
- //#region ../../node_modules/zod/dist/esm/v4/locales/ta.js
6850
+ //#region ../../node_modules/zod/v4/locales/ta.js
6570
6851
  const error$7 = () => {
6571
6852
  const Sizable = {
6572
6853
  string: {
@@ -6589,7 +6870,7 @@ const error$7 = () => {
6589
6870
  function getSizing(origin) {
6590
6871
  return Sizable[origin] ?? null;
6591
6872
  }
6592
- const parsedType$2 = (data) => {
6873
+ const parsedType$3 = (data) => {
6593
6874
  const t = typeof data;
6594
6875
  switch (t) {
6595
6876
  case "number": {
@@ -6641,7 +6922,7 @@ const error$7 = () => {
6641
6922
  };
6642
6923
  return (issue$1) => {
6643
6924
  switch (issue$1.code) {
6644
- case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$2(issue$1.input)}`;
6925
+ case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$3(issue$1.input)}`;
6645
6926
  case "invalid_value":
6646
6927
  if (issue$1.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue$1.values[0])}`;
6647
6928
  return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue$1.values, "|")} இல் ஒன்று`;
@@ -6683,7 +6964,7 @@ function ta_default() {
6683
6964
  }
6684
6965
 
6685
6966
  //#endregion
6686
- //#region ../../node_modules/zod/dist/esm/v4/locales/th.js
6967
+ //#region ../../node_modules/zod/v4/locales/th.js
6687
6968
  const error$6 = () => {
6688
6969
  const Sizable = {
6689
6970
  string: {
@@ -6706,7 +6987,7 @@ const error$6 = () => {
6706
6987
  function getSizing(origin) {
6707
6988
  return Sizable[origin] ?? null;
6708
6989
  }
6709
- const parsedType$2 = (data) => {
6990
+ const parsedType$3 = (data) => {
6710
6991
  const t = typeof data;
6711
6992
  switch (t) {
6712
6993
  case "number": {
@@ -6758,7 +7039,7 @@ const error$6 = () => {
6758
7039
  };
6759
7040
  return (issue$1) => {
6760
7041
  switch (issue$1.code) {
6761
- case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$2(issue$1.input)}`;
7042
+ case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$3(issue$1.input)}`;
6762
7043
  case "invalid_value":
6763
7044
  if (issue$1.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue$1.values[0])}`;
6764
7045
  return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue$1.values, "|")}`;
@@ -6800,7 +7081,7 @@ function th_default() {
6800
7081
  }
6801
7082
 
6802
7083
  //#endregion
6803
- //#region ../../node_modules/zod/dist/esm/v4/locales/tr.js
7084
+ //#region ../../node_modules/zod/v4/locales/tr.js
6804
7085
  const parsedType = (data) => {
6805
7086
  const t = typeof data;
6806
7087
  switch (t) {
@@ -6913,7 +7194,7 @@ function tr_default() {
6913
7194
  }
6914
7195
 
6915
7196
  //#endregion
6916
- //#region ../../node_modules/zod/dist/esm/v4/locales/ua.js
7197
+ //#region ../../node_modules/zod/v4/locales/ua.js
6917
7198
  const error$4 = () => {
6918
7199
  const Sizable = {
6919
7200
  string: {
@@ -6936,7 +7217,7 @@ const error$4 = () => {
6936
7217
  function getSizing(origin) {
6937
7218
  return Sizable[origin] ?? null;
6938
7219
  }
6939
- const parsedType$2 = (data) => {
7220
+ const parsedType$3 = (data) => {
6940
7221
  const t = typeof data;
6941
7222
  switch (t) {
6942
7223
  case "number": {
@@ -6988,7 +7269,7 @@ const error$4 = () => {
6988
7269
  };
6989
7270
  return (issue$1) => {
6990
7271
  switch (issue$1.code) {
6991
- case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$2(issue$1.input)}`;
7272
+ case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$3(issue$1.input)}`;
6992
7273
  case "invalid_value":
6993
7274
  if (issue$1.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue$1.values[0])}`;
6994
7275
  return `Неправильна опція: очікується одне з ${joinValues(issue$1.values, "|")}`;
@@ -7028,7 +7309,7 @@ function ua_default() {
7028
7309
  }
7029
7310
 
7030
7311
  //#endregion
7031
- //#region ../../node_modules/zod/dist/esm/v4/locales/ur.js
7312
+ //#region ../../node_modules/zod/v4/locales/ur.js
7032
7313
  const error$3 = () => {
7033
7314
  const Sizable = {
7034
7315
  string: {
@@ -7051,7 +7332,7 @@ const error$3 = () => {
7051
7332
  function getSizing(origin) {
7052
7333
  return Sizable[origin] ?? null;
7053
7334
  }
7054
- const parsedType$2 = (data) => {
7335
+ const parsedType$3 = (data) => {
7055
7336
  const t = typeof data;
7056
7337
  switch (t) {
7057
7338
  case "number": {
@@ -7103,7 +7384,7 @@ const error$3 = () => {
7103
7384
  };
7104
7385
  return (issue$1) => {
7105
7386
  switch (issue$1.code) {
7106
- case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$2(issue$1.input)} موصول ہوا`;
7387
+ case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$3(issue$1.input)} موصول ہوا`;
7107
7388
  case "invalid_value":
7108
7389
  if (issue$1.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue$1.values[0])} متوقع تھا`;
7109
7390
  return `غلط آپشن: ${joinValues(issue$1.values, "|")} میں سے ایک متوقع تھا`;
@@ -7145,7 +7426,7 @@ function ur_default() {
7145
7426
  }
7146
7427
 
7147
7428
  //#endregion
7148
- //#region ../../node_modules/zod/dist/esm/v4/locales/vi.js
7429
+ //#region ../../node_modules/zod/v4/locales/vi.js
7149
7430
  const error$2 = () => {
7150
7431
  const Sizable = {
7151
7432
  string: {
@@ -7168,7 +7449,7 @@ const error$2 = () => {
7168
7449
  function getSizing(origin) {
7169
7450
  return Sizable[origin] ?? null;
7170
7451
  }
7171
- const parsedType$2 = (data) => {
7452
+ const parsedType$3 = (data) => {
7172
7453
  const t = typeof data;
7173
7454
  switch (t) {
7174
7455
  case "number": {
@@ -7220,7 +7501,7 @@ const error$2 = () => {
7220
7501
  };
7221
7502
  return (issue$1) => {
7222
7503
  switch (issue$1.code) {
7223
- case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$2(issue$1.input)}`;
7504
+ case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$3(issue$1.input)}`;
7224
7505
  case "invalid_value":
7225
7506
  if (issue$1.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue$1.values[0])}`;
7226
7507
  return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue$1.values, "|")}`;
@@ -7260,7 +7541,7 @@ function vi_default() {
7260
7541
  }
7261
7542
 
7262
7543
  //#endregion
7263
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-CN.js
7544
+ //#region ../../node_modules/zod/v4/locales/zh-CN.js
7264
7545
  const error$1 = () => {
7265
7546
  const Sizable = {
7266
7547
  string: {
@@ -7283,7 +7564,7 @@ const error$1 = () => {
7283
7564
  function getSizing(origin) {
7284
7565
  return Sizable[origin] ?? null;
7285
7566
  }
7286
- const parsedType$2 = (data) => {
7567
+ const parsedType$3 = (data) => {
7287
7568
  const t = typeof data;
7288
7569
  switch (t) {
7289
7570
  case "number": {
@@ -7335,7 +7616,7 @@ const error$1 = () => {
7335
7616
  };
7336
7617
  return (issue$1) => {
7337
7618
  switch (issue$1.code) {
7338
- case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$2(issue$1.input)}`;
7619
+ case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$3(issue$1.input)}`;
7339
7620
  case "invalid_value":
7340
7621
  if (issue$1.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue$1.values[0])}`;
7341
7622
  return `无效选项:期望以下之一 ${joinValues(issue$1.values, "|")}`;
@@ -7375,7 +7656,7 @@ function zh_CN_default() {
7375
7656
  }
7376
7657
 
7377
7658
  //#endregion
7378
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-TW.js
7659
+ //#region ../../node_modules/zod/v4/locales/zh-TW.js
7379
7660
  const error = () => {
7380
7661
  const Sizable = {
7381
7662
  string: {
@@ -7398,7 +7679,7 @@ const error = () => {
7398
7679
  function getSizing(origin) {
7399
7680
  return Sizable[origin] ?? null;
7400
7681
  }
7401
- const parsedType$2 = (data) => {
7682
+ const parsedType$3 = (data) => {
7402
7683
  const t = typeof data;
7403
7684
  switch (t) {
7404
7685
  case "number": {
@@ -7450,7 +7731,7 @@ const error = () => {
7450
7731
  };
7451
7732
  return (issue$1) => {
7452
7733
  switch (issue$1.code) {
7453
- case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$2(issue$1.input)}`;
7734
+ case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$3(issue$1.input)}`;
7454
7735
  case "invalid_value":
7455
7736
  if (issue$1.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue$1.values[0])}`;
7456
7737
  return `無效的選項:預期為以下其中之一 ${joinValues(issue$1.values, "|")}`;
@@ -7492,7 +7773,7 @@ function zh_TW_default() {
7492
7773
  }
7493
7774
 
7494
7775
  //#endregion
7495
- //#region ../../node_modules/zod/dist/esm/v4/locales/index.js
7776
+ //#region ../../node_modules/zod/v4/locales/index.js
7496
7777
  var locales_exports = {};
7497
7778
  __export(locales_exports, {
7498
7779
  ar: () => ar_default,
@@ -7502,6 +7783,7 @@ __export(locales_exports, {
7502
7783
  cs: () => cs_default,
7503
7784
  de: () => de_default,
7504
7785
  en: () => en_default,
7786
+ eo: () => eo_default,
7505
7787
  es: () => es_default,
7506
7788
  fa: () => fa_default,
7507
7789
  fi: () => fi_default,
@@ -7520,6 +7802,7 @@ __export(locales_exports, {
7520
7802
  no: () => no_default,
7521
7803
  ota: () => ota_default,
7522
7804
  pl: () => pl_default,
7805
+ ps: () => ps_default,
7523
7806
  pt: () => pt_default,
7524
7807
  ru: () => ru_default,
7525
7808
  sl: () => sl_default,
@@ -7535,12 +7818,12 @@ __export(locales_exports, {
7535
7818
  });
7536
7819
 
7537
7820
  //#endregion
7538
- //#region ../../node_modules/zod/dist/esm/v4/core/registries.js
7821
+ //#region ../../node_modules/zod/v4/core/registries.js
7539
7822
  const $output = Symbol("ZodOutput");
7540
7823
  const $input = Symbol("ZodInput");
7541
7824
  var $ZodRegistry = class {
7542
7825
  constructor() {
7543
- this._map = new WeakMap();
7826
+ this._map = new Map();
7544
7827
  this._idmap = new Map();
7545
7828
  }
7546
7829
  add(schema, ..._meta) {
@@ -7554,7 +7837,16 @@ var $ZodRegistry = class {
7554
7837
  }
7555
7838
  return this;
7556
7839
  }
7840
+ clear() {
7841
+ this._map = new Map();
7842
+ this._idmap = new Map();
7843
+ return this;
7844
+ }
7557
7845
  remove(schema) {
7846
+ const meta = this._map.get(schema);
7847
+ if (meta && typeof meta === "object" && "id" in meta) {
7848
+ this._idmap.delete(meta.id);
7849
+ }
7558
7850
  this._map.delete(schema);
7559
7851
  return this;
7560
7852
  }
@@ -7580,7 +7872,7 @@ function registry() {
7580
7872
  const globalRegistry = /* @__PURE__ */ registry();
7581
7873
 
7582
7874
  //#endregion
7583
- //#region ../../node_modules/zod/dist/esm/v4/core/api.js
7875
+ //#region ../../node_modules/zod/v4/core/api.js
7584
7876
  function _string(Class$1, params) {
7585
7877
  return new Class$1({
7586
7878
  type: "string",
@@ -7795,6 +8087,13 @@ function _jwt(Class$1, params) {
7795
8087
  ...normalizeParams(params)
7796
8088
  });
7797
8089
  }
8090
+ const TimePrecision = {
8091
+ Any: null,
8092
+ Minute: -1,
8093
+ Second: 0,
8094
+ Millisecond: 3,
8095
+ Microsecond: 6
8096
+ };
7798
8097
  function _isoDateTime(Class$1, params) {
7799
8098
  return new Class$1({
7800
8099
  type: "string",
@@ -8361,8 +8660,8 @@ function _refine(Class$1, fn, _params) {
8361
8660
  return schema;
8362
8661
  }
8363
8662
  function _stringbool(Classes, _params) {
8364
- const { case: _case, error: error$37, truthy, falsy } = normalizeParams(_params);
8365
- let truthyArray = truthy ?? [
8663
+ const params = normalizeParams(_params);
8664
+ let truthyArray = params.truthy ?? [
8366
8665
  "true",
8367
8666
  "1",
8368
8667
  "yes",
@@ -8370,7 +8669,7 @@ function _stringbool(Classes, _params) {
8370
8669
  "y",
8371
8670
  "enabled"
8372
8671
  ];
8373
- let falsyArray = falsy ?? [
8672
+ let falsyArray = params.falsy ?? [
8374
8673
  "false",
8375
8674
  "0",
8376
8675
  "no",
@@ -8378,7 +8677,7 @@ function _stringbool(Classes, _params) {
8378
8677
  "n",
8379
8678
  "disabled"
8380
8679
  ];
8381
- if (_case !== "sensitive") {
8680
+ if (params.case !== "sensitive") {
8382
8681
  truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8383
8682
  falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8384
8683
  }
@@ -8392,7 +8691,7 @@ function _stringbool(Classes, _params) {
8392
8691
  type: "transform",
8393
8692
  transform: (input, payload) => {
8394
8693
  let data = input;
8395
- if (_case !== "sensitive") data = data.toLowerCase();
8694
+ if (params.case !== "sensitive") data = data.toLowerCase();
8396
8695
  if (truthySet.has(data)) {
8397
8696
  return true;
8398
8697
  } else if (falsySet.has(data)) {
@@ -8408,31 +8707,47 @@ function _stringbool(Classes, _params) {
8408
8707
  return {};
8409
8708
  }
8410
8709
  },
8411
- error: error$37
8710
+ error: params.error
8412
8711
  });
8413
8712
  const innerPipe = new _Pipe({
8414
8713
  type: "pipe",
8415
8714
  in: new _String({
8416
8715
  type: "string",
8417
- error: error$37
8716
+ error: params.error
8418
8717
  }),
8419
8718
  out: tx,
8420
- error: error$37
8719
+ error: params.error
8421
8720
  });
8422
8721
  const outerPipe = new _Pipe({
8423
8722
  type: "pipe",
8424
8723
  in: innerPipe,
8425
8724
  out: new _Boolean({
8426
8725
  type: "boolean",
8427
- error: error$37
8726
+ error: params.error
8428
8727
  }),
8429
- error: error$37
8728
+ error: params.error
8430
8729
  });
8431
8730
  return outerPipe;
8432
8731
  }
8732
+ function _stringFormat(Class$1, format, fnOrRegex, _params = {}) {
8733
+ const params = normalizeParams(_params);
8734
+ const def = {
8735
+ ...normalizeParams(_params),
8736
+ check: "string_format",
8737
+ type: "string",
8738
+ format,
8739
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
8740
+ ...params
8741
+ };
8742
+ if (fnOrRegex instanceof RegExp) {
8743
+ def.pattern = fnOrRegex;
8744
+ }
8745
+ const inst = new Class$1(def);
8746
+ return inst;
8747
+ }
8433
8748
 
8434
8749
  //#endregion
8435
- //#region ../../node_modules/zod/dist/esm/v4/core/function.js
8750
+ //#region ../../node_modules/zod/v4/core/function.js
8436
8751
  var $ZodFunction = class {
8437
8752
  constructor(def) {
8438
8753
  this._def = def;
@@ -8503,7 +8818,7 @@ function _function(params) {
8503
8818
  }
8504
8819
 
8505
8820
  //#endregion
8506
- //#region ../../node_modules/zod/dist/esm/v4/core/to-json-schema.js
8821
+ //#region ../../node_modules/zod/v4/core/to-json-schema.js
8507
8822
  var JSONSchemaGenerator = class {
8508
8823
  constructor(params) {
8509
8824
  this.counter = 0;
@@ -8539,431 +8854,435 @@ var JSONSchemaGenerator = class {
8539
8854
  const result = {
8540
8855
  schema: {},
8541
8856
  count: 1,
8542
- cycle: undefined
8543
- };
8544
- this.seen.set(schema, result);
8545
- if (schema._zod.toJSONSchema) {
8546
- result.schema = schema._zod.toJSONSchema();
8547
- }
8548
- const params = {
8549
- ..._params,
8550
- schemaPath: [..._params.schemaPath, schema],
8857
+ cycle: undefined,
8551
8858
  path: _params.path
8552
8859
  };
8553
- const parent = schema._zod.parent;
8554
- if (parent) {
8555
- result.ref = parent;
8556
- this.process(parent, params);
8557
- this.seen.get(parent).isParent = true;
8860
+ this.seen.set(schema, result);
8861
+ const overrideSchema = schema._zod.toJSONSchema?.();
8862
+ if (overrideSchema) {
8863
+ result.schema = overrideSchema;
8558
8864
  } else {
8559
- const _json = result.schema;
8560
- switch (def.type) {
8561
- case "string": {
8562
- const json$1 = _json;
8563
- json$1.type = "string";
8564
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8565
- if (typeof minimum === "number") json$1.minLength = minimum;
8566
- if (typeof maximum === "number") json$1.maxLength = maximum;
8567
- if (format) {
8568
- json$1.format = formatMap[format] ?? format;
8569
- if (json$1.format === "") delete json$1.format;
8865
+ const params = {
8866
+ ..._params,
8867
+ schemaPath: [..._params.schemaPath, schema],
8868
+ path: _params.path
8869
+ };
8870
+ const parent = schema._zod.parent;
8871
+ if (parent) {
8872
+ result.ref = parent;
8873
+ this.process(parent, params);
8874
+ this.seen.get(parent).isParent = true;
8875
+ } else {
8876
+ const _json = result.schema;
8877
+ switch (def.type) {
8878
+ case "string": {
8879
+ const json$1 = _json;
8880
+ json$1.type = "string";
8881
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8882
+ if (typeof minimum === "number") json$1.minLength = minimum;
8883
+ if (typeof maximum === "number") json$1.maxLength = maximum;
8884
+ if (format) {
8885
+ json$1.format = formatMap[format] ?? format;
8886
+ if (json$1.format === "") delete json$1.format;
8887
+ }
8888
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
8889
+ if (patterns && patterns.size > 0) {
8890
+ const regexes = [...patterns];
8891
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
8892
+ else if (regexes.length > 1) {
8893
+ result.schema.allOf = [...regexes.map((regex) => ({
8894
+ ...this.target === "draft-7" ? { type: "string" } : {},
8895
+ pattern: regex.source
8896
+ }))];
8897
+ }
8898
+ }
8899
+ break;
8570
8900
  }
8571
- if (contentEncoding) json$1.contentEncoding = contentEncoding;
8572
- if (patterns && patterns.size > 0) {
8573
- const regexes = [...patterns];
8574
- if (regexes.length === 1) json$1.pattern = regexes[0].source;
8575
- else if (regexes.length > 1) {
8576
- result.schema.allOf = [...regexes.map((regex) => ({
8577
- ...this.target === "draft-7" ? { type: "string" } : {},
8578
- pattern: regex.source
8579
- }))];
8901
+ case "number": {
8902
+ const json$1 = _json;
8903
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8904
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8905
+ else json$1.type = "number";
8906
+ if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8907
+ if (typeof minimum === "number") {
8908
+ json$1.minimum = minimum;
8909
+ if (typeof exclusiveMinimum === "number") {
8910
+ if (exclusiveMinimum >= minimum) delete json$1.minimum;
8911
+ else delete json$1.exclusiveMinimum;
8912
+ }
8580
8913
  }
8914
+ if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8915
+ if (typeof maximum === "number") {
8916
+ json$1.maximum = maximum;
8917
+ if (typeof exclusiveMaximum === "number") {
8918
+ if (exclusiveMaximum <= maximum) delete json$1.maximum;
8919
+ else delete json$1.exclusiveMaximum;
8920
+ }
8921
+ }
8922
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8923
+ break;
8581
8924
  }
8582
- break;
8583
- }
8584
- case "number": {
8585
- const json$1 = _json;
8586
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8587
- if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8588
- else json$1.type = "number";
8589
- if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8590
- if (typeof minimum === "number") {
8591
- json$1.minimum = minimum;
8592
- if (typeof exclusiveMinimum === "number") {
8593
- if (exclusiveMinimum >= minimum) delete json$1.minimum;
8594
- else delete json$1.exclusiveMinimum;
8925
+ case "boolean": {
8926
+ const json$1 = _json;
8927
+ json$1.type = "boolean";
8928
+ break;
8929
+ }
8930
+ case "bigint": {
8931
+ if (this.unrepresentable === "throw") {
8932
+ throw new Error("BigInt cannot be represented in JSON Schema");
8595
8933
  }
8934
+ break;
8596
8935
  }
8597
- if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8598
- if (typeof maximum === "number") {
8599
- json$1.maximum = maximum;
8600
- if (typeof exclusiveMaximum === "number") {
8601
- if (exclusiveMaximum <= maximum) delete json$1.maximum;
8602
- else delete json$1.exclusiveMaximum;
8936
+ case "symbol": {
8937
+ if (this.unrepresentable === "throw") {
8938
+ throw new Error("Symbols cannot be represented in JSON Schema");
8603
8939
  }
8940
+ break;
8604
8941
  }
8605
- if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8606
- break;
8607
- }
8608
- case "boolean": {
8609
- const json$1 = _json;
8610
- json$1.type = "boolean";
8611
- break;
8612
- }
8613
- case "bigint": {
8614
- if (this.unrepresentable === "throw") {
8615
- throw new Error("BigInt cannot be represented in JSON Schema");
8942
+ case "null": {
8943
+ _json.type = "null";
8944
+ break;
8616
8945
  }
8617
- break;
8618
- }
8619
- case "symbol": {
8620
- if (this.unrepresentable === "throw") {
8621
- throw new Error("Symbols cannot be represented in JSON Schema");
8946
+ case "any": {
8947
+ break;
8622
8948
  }
8623
- break;
8624
- }
8625
- case "undefined": {
8626
- const json$1 = _json;
8627
- json$1.type = "null";
8628
- break;
8629
- }
8630
- case "null": {
8631
- _json.type = "null";
8632
- break;
8633
- }
8634
- case "any": {
8635
- break;
8636
- }
8637
- case "unknown": {
8638
- break;
8639
- }
8640
- case "never": {
8641
- _json.not = {};
8642
- break;
8643
- }
8644
- case "void": {
8645
- if (this.unrepresentable === "throw") {
8646
- throw new Error("Void cannot be represented in JSON Schema");
8949
+ case "unknown": {
8950
+ break;
8647
8951
  }
8648
- break;
8649
- }
8650
- case "date": {
8651
- if (this.unrepresentable === "throw") {
8652
- throw new Error("Date cannot be represented in JSON Schema");
8952
+ case "undefined": {
8953
+ if (this.unrepresentable === "throw") {
8954
+ throw new Error("Undefined cannot be represented in JSON Schema");
8955
+ }
8956
+ break;
8653
8957
  }
8654
- break;
8655
- }
8656
- case "array": {
8657
- const json$1 = _json;
8658
- const { minimum, maximum } = schema._zod.bag;
8659
- if (typeof minimum === "number") json$1.minItems = minimum;
8660
- if (typeof maximum === "number") json$1.maxItems = maximum;
8661
- json$1.type = "array";
8662
- json$1.items = this.process(def.element, {
8663
- ...params,
8664
- path: [...params.path, "items"]
8665
- });
8666
- break;
8667
- }
8668
- case "object": {
8669
- const json$1 = _json;
8670
- json$1.type = "object";
8671
- json$1.properties = {};
8672
- const shape = def.shape;
8673
- for (const key in shape) {
8674
- json$1.properties[key] = this.process(shape[key], {
8675
- ...params,
8676
- path: [
8677
- ...params.path,
8678
- "properties",
8679
- key
8680
- ]
8681
- });
8958
+ case "void": {
8959
+ if (this.unrepresentable === "throw") {
8960
+ throw new Error("Void cannot be represented in JSON Schema");
8961
+ }
8962
+ break;
8682
8963
  }
8683
- const allKeys = new Set(Object.keys(shape));
8684
- const requiredKeys = new Set([...allKeys].filter((key) => {
8685
- const v = def.shape[key]._zod;
8686
- if (this.io === "input") {
8687
- return v.optin === undefined;
8688
- } else {
8689
- return v.optout === undefined;
8964
+ case "never": {
8965
+ _json.not = {};
8966
+ break;
8967
+ }
8968
+ case "date": {
8969
+ if (this.unrepresentable === "throw") {
8970
+ throw new Error("Date cannot be represented in JSON Schema");
8690
8971
  }
8691
- }));
8692
- if (requiredKeys.size > 0) {
8693
- json$1.required = Array.from(requiredKeys);
8972
+ break;
8694
8973
  }
8695
- if (def.catchall?._zod.def.type === "never") {
8696
- json$1.additionalProperties = false;
8697
- } else if (!def.catchall) {
8698
- if (this.io === "output") json$1.additionalProperties = false;
8699
- } else if (def.catchall) {
8700
- json$1.additionalProperties = this.process(def.catchall, {
8974
+ case "array": {
8975
+ const json$1 = _json;
8976
+ const { minimum, maximum } = schema._zod.bag;
8977
+ if (typeof minimum === "number") json$1.minItems = minimum;
8978
+ if (typeof maximum === "number") json$1.maxItems = maximum;
8979
+ json$1.type = "array";
8980
+ json$1.items = this.process(def.element, {
8701
8981
  ...params,
8702
- path: [...params.path, "additionalProperties"]
8982
+ path: [...params.path, "items"]
8703
8983
  });
8984
+ break;
8704
8985
  }
8705
- break;
8706
- }
8707
- case "union": {
8708
- const json$1 = _json;
8709
- json$1.anyOf = def.options.map((x, i) => this.process(x, {
8710
- ...params,
8711
- path: [
8712
- ...params.path,
8713
- "anyOf",
8714
- i
8715
- ]
8716
- }));
8717
- break;
8718
- }
8719
- case "intersection": {
8720
- const json$1 = _json;
8721
- const a = this.process(def.left, {
8722
- ...params,
8723
- path: [
8724
- ...params.path,
8725
- "allOf",
8726
- 0
8727
- ]
8728
- });
8729
- const b = this.process(def.right, {
8730
- ...params,
8731
- path: [
8732
- ...params.path,
8733
- "allOf",
8734
- 1
8735
- ]
8736
- });
8737
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
8738
- const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
8739
- json$1.allOf = allOf;
8740
- break;
8741
- }
8742
- case "tuple": {
8743
- const json$1 = _json;
8744
- json$1.type = "array";
8745
- const prefixItems = def.items.map((x, i) => this.process(x, {
8746
- ...params,
8747
- path: [
8748
- ...params.path,
8749
- "prefixItems",
8750
- i
8751
- ]
8752
- }));
8753
- if (this.target === "draft-2020-12") {
8754
- json$1.prefixItems = prefixItems;
8755
- } else {
8756
- json$1.items = prefixItems;
8986
+ case "object": {
8987
+ const json$1 = _json;
8988
+ json$1.type = "object";
8989
+ json$1.properties = {};
8990
+ const shape = def.shape;
8991
+ for (const key in shape) {
8992
+ json$1.properties[key] = this.process(shape[key], {
8993
+ ...params,
8994
+ path: [
8995
+ ...params.path,
8996
+ "properties",
8997
+ key
8998
+ ]
8999
+ });
9000
+ }
9001
+ const allKeys = new Set(Object.keys(shape));
9002
+ const requiredKeys = new Set([...allKeys].filter((key) => {
9003
+ const v = def.shape[key]._zod;
9004
+ if (this.io === "input") {
9005
+ return v.optin === undefined;
9006
+ } else {
9007
+ return v.optout === undefined;
9008
+ }
9009
+ }));
9010
+ if (requiredKeys.size > 0) {
9011
+ json$1.required = Array.from(requiredKeys);
9012
+ }
9013
+ if (def.catchall?._zod.def.type === "never") {
9014
+ json$1.additionalProperties = false;
9015
+ } else if (!def.catchall) {
9016
+ if (this.io === "output") json$1.additionalProperties = false;
9017
+ } else if (def.catchall) {
9018
+ json$1.additionalProperties = this.process(def.catchall, {
9019
+ ...params,
9020
+ path: [...params.path, "additionalProperties"]
9021
+ });
9022
+ }
9023
+ break;
8757
9024
  }
8758
- if (def.rest) {
8759
- const rest = this.process(def.rest, {
9025
+ case "union": {
9026
+ const json$1 = _json;
9027
+ json$1.anyOf = def.options.map((x, i) => this.process(x, {
8760
9028
  ...params,
8761
- path: [...params.path, "items"]
9029
+ path: [
9030
+ ...params.path,
9031
+ "anyOf",
9032
+ i
9033
+ ]
9034
+ }));
9035
+ break;
9036
+ }
9037
+ case "intersection": {
9038
+ const json$1 = _json;
9039
+ const a = this.process(def.left, {
9040
+ ...params,
9041
+ path: [
9042
+ ...params.path,
9043
+ "allOf",
9044
+ 0
9045
+ ]
9046
+ });
9047
+ const b = this.process(def.right, {
9048
+ ...params,
9049
+ path: [
9050
+ ...params.path,
9051
+ "allOf",
9052
+ 1
9053
+ ]
8762
9054
  });
9055
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
9056
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
9057
+ json$1.allOf = allOf;
9058
+ break;
9059
+ }
9060
+ case "tuple": {
9061
+ const json$1 = _json;
9062
+ json$1.type = "array";
9063
+ const prefixItems = def.items.map((x, i) => this.process(x, {
9064
+ ...params,
9065
+ path: [
9066
+ ...params.path,
9067
+ "prefixItems",
9068
+ i
9069
+ ]
9070
+ }));
8763
9071
  if (this.target === "draft-2020-12") {
8764
- json$1.items = rest;
9072
+ json$1.prefixItems = prefixItems;
8765
9073
  } else {
8766
- json$1.additionalItems = rest;
9074
+ json$1.items = prefixItems;
9075
+ }
9076
+ if (def.rest) {
9077
+ const rest = this.process(def.rest, {
9078
+ ...params,
9079
+ path: [...params.path, "items"]
9080
+ });
9081
+ if (this.target === "draft-2020-12") {
9082
+ json$1.items = rest;
9083
+ } else {
9084
+ json$1.additionalItems = rest;
9085
+ }
8767
9086
  }
9087
+ if (def.rest) {
9088
+ json$1.items = this.process(def.rest, {
9089
+ ...params,
9090
+ path: [...params.path, "items"]
9091
+ });
9092
+ }
9093
+ const { minimum, maximum } = schema._zod.bag;
9094
+ if (typeof minimum === "number") json$1.minItems = minimum;
9095
+ if (typeof maximum === "number") json$1.maxItems = maximum;
9096
+ break;
8768
9097
  }
8769
- if (def.rest) {
8770
- json$1.items = this.process(def.rest, {
9098
+ case "record": {
9099
+ const json$1 = _json;
9100
+ json$1.type = "object";
9101
+ json$1.propertyNames = this.process(def.keyType, {
8771
9102
  ...params,
8772
- path: [...params.path, "items"]
9103
+ path: [...params.path, "propertyNames"]
8773
9104
  });
9105
+ json$1.additionalProperties = this.process(def.valueType, {
9106
+ ...params,
9107
+ path: [...params.path, "additionalProperties"]
9108
+ });
9109
+ break;
8774
9110
  }
8775
- const { minimum, maximum } = schema._zod.bag;
8776
- if (typeof minimum === "number") json$1.minItems = minimum;
8777
- if (typeof maximum === "number") json$1.maxItems = maximum;
8778
- break;
8779
- }
8780
- case "record": {
8781
- const json$1 = _json;
8782
- json$1.type = "object";
8783
- json$1.propertyNames = this.process(def.keyType, {
8784
- ...params,
8785
- path: [...params.path, "propertyNames"]
8786
- });
8787
- json$1.additionalProperties = this.process(def.valueType, {
8788
- ...params,
8789
- path: [...params.path, "additionalProperties"]
8790
- });
8791
- break;
8792
- }
8793
- case "map": {
8794
- if (this.unrepresentable === "throw") {
8795
- throw new Error("Map cannot be represented in JSON Schema");
9111
+ case "map": {
9112
+ if (this.unrepresentable === "throw") {
9113
+ throw new Error("Map cannot be represented in JSON Schema");
9114
+ }
9115
+ break;
8796
9116
  }
8797
- break;
8798
- }
8799
- case "set": {
8800
- if (this.unrepresentable === "throw") {
8801
- throw new Error("Set cannot be represented in JSON Schema");
9117
+ case "set": {
9118
+ if (this.unrepresentable === "throw") {
9119
+ throw new Error("Set cannot be represented in JSON Schema");
9120
+ }
9121
+ break;
9122
+ }
9123
+ case "enum": {
9124
+ const json$1 = _json;
9125
+ const values = getEnumValues(def.entries);
9126
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
9127
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
9128
+ json$1.enum = values;
9129
+ break;
8802
9130
  }
8803
- break;
8804
- }
8805
- case "enum": {
8806
- const json$1 = _json;
8807
- const values = getEnumValues(def.entries);
8808
- if (values.every((v) => typeof v === "number")) json$1.type = "number";
8809
- if (values.every((v) => typeof v === "string")) json$1.type = "string";
8810
- json$1.enum = values;
8811
- break;
8812
- }
8813
- case "literal": {
8814
- const json$1 = _json;
8815
- const vals = [];
8816
- for (const val of def.values) {
8817
- if (val === undefined) {
8818
- if (this.unrepresentable === "throw") {
8819
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
8820
- } else {}
8821
- } else if (typeof val === "bigint") {
8822
- if (this.unrepresentable === "throw") {
8823
- throw new Error("BigInt literals cannot be represented in JSON Schema");
9131
+ case "literal": {
9132
+ const json$1 = _json;
9133
+ const vals = [];
9134
+ for (const val of def.values) {
9135
+ if (val === undefined) {
9136
+ if (this.unrepresentable === "throw") {
9137
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
9138
+ } else {}
9139
+ } else if (typeof val === "bigint") {
9140
+ if (this.unrepresentable === "throw") {
9141
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
9142
+ } else {
9143
+ vals.push(Number(val));
9144
+ }
8824
9145
  } else {
8825
- vals.push(Number(val));
9146
+ vals.push(val);
8826
9147
  }
9148
+ }
9149
+ if (vals.length === 0) {} else if (vals.length === 1) {
9150
+ const val = vals[0];
9151
+ json$1.type = val === null ? "null" : typeof val;
9152
+ json$1.const = val;
8827
9153
  } else {
8828
- vals.push(val);
9154
+ if (vals.every((v) => typeof v === "number")) json$1.type = "number";
9155
+ if (vals.every((v) => typeof v === "string")) json$1.type = "string";
9156
+ if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
9157
+ if (vals.every((v) => v === null)) json$1.type = "null";
9158
+ json$1.enum = vals;
8829
9159
  }
9160
+ break;
8830
9161
  }
8831
- if (vals.length === 0) {} else if (vals.length === 1) {
8832
- const val = vals[0];
8833
- json$1.type = val === null ? "null" : typeof val;
8834
- json$1.const = val;
8835
- } else {
8836
- if (vals.every((v) => typeof v === "number")) json$1.type = "number";
8837
- if (vals.every((v) => typeof v === "string")) json$1.type = "string";
8838
- if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
8839
- if (vals.every((v) => v === null)) json$1.type = "null";
8840
- json$1.enum = vals;
8841
- }
8842
- break;
8843
- }
8844
- case "file": {
8845
- const json$1 = _json;
8846
- const file$1 = {
8847
- type: "string",
8848
- format: "binary",
8849
- contentEncoding: "binary"
8850
- };
8851
- const { minimum, maximum, mime } = schema._zod.bag;
8852
- if (minimum !== undefined) file$1.minLength = minimum;
8853
- if (maximum !== undefined) file$1.maxLength = maximum;
8854
- if (mime) {
8855
- if (mime.length === 1) {
8856
- file$1.contentMediaType = mime[0];
8857
- Object.assign(json$1, file$1);
9162
+ case "file": {
9163
+ const json$1 = _json;
9164
+ const file$1 = {
9165
+ type: "string",
9166
+ format: "binary",
9167
+ contentEncoding: "binary"
9168
+ };
9169
+ const { minimum, maximum, mime } = schema._zod.bag;
9170
+ if (minimum !== undefined) file$1.minLength = minimum;
9171
+ if (maximum !== undefined) file$1.maxLength = maximum;
9172
+ if (mime) {
9173
+ if (mime.length === 1) {
9174
+ file$1.contentMediaType = mime[0];
9175
+ Object.assign(json$1, file$1);
9176
+ } else {
9177
+ json$1.anyOf = mime.map((m) => {
9178
+ const mFile = {
9179
+ ...file$1,
9180
+ contentMediaType: m
9181
+ };
9182
+ return mFile;
9183
+ });
9184
+ }
8858
9185
  } else {
8859
- json$1.anyOf = mime.map((m) => {
8860
- const mFile = {
8861
- ...file$1,
8862
- contentMediaType: m
8863
- };
8864
- return mFile;
8865
- });
9186
+ Object.assign(json$1, file$1);
8866
9187
  }
8867
- } else {
8868
- Object.assign(json$1, file$1);
9188
+ break;
8869
9189
  }
8870
- break;
8871
- }
8872
- case "transform": {
8873
- if (this.unrepresentable === "throw") {
8874
- throw new Error("Transforms cannot be represented in JSON Schema");
9190
+ case "transform": {
9191
+ if (this.unrepresentable === "throw") {
9192
+ throw new Error("Transforms cannot be represented in JSON Schema");
9193
+ }
9194
+ break;
8875
9195
  }
8876
- break;
8877
- }
8878
- case "nullable": {
8879
- const inner = this.process(def.innerType, params);
8880
- _json.anyOf = [inner, { type: "null" }];
8881
- break;
8882
- }
8883
- case "nonoptional": {
8884
- this.process(def.innerType, params);
8885
- result.ref = def.innerType;
8886
- break;
8887
- }
8888
- case "success": {
8889
- const json$1 = _json;
8890
- json$1.type = "boolean";
8891
- break;
8892
- }
8893
- case "default": {
8894
- this.process(def.innerType, params);
8895
- result.ref = def.innerType;
8896
- _json.default = def.defaultValue;
8897
- break;
8898
- }
8899
- case "prefault": {
8900
- this.process(def.innerType, params);
8901
- result.ref = def.innerType;
8902
- if (this.io === "input") _json._prefault = def.defaultValue;
8903
- break;
8904
- }
8905
- case "catch": {
8906
- this.process(def.innerType, params);
8907
- result.ref = def.innerType;
8908
- let catchValue;
8909
- try {
8910
- catchValue = def.catchValue(undefined);
8911
- } catch {
8912
- throw new Error("Dynamic catch values are not supported in JSON Schema");
9196
+ case "nullable": {
9197
+ const inner = this.process(def.innerType, params);
9198
+ _json.anyOf = [inner, { type: "null" }];
9199
+ break;
8913
9200
  }
8914
- _json.default = catchValue;
8915
- break;
8916
- }
8917
- case "nan": {
8918
- if (this.unrepresentable === "throw") {
8919
- throw new Error("NaN cannot be represented in JSON Schema");
9201
+ case "nonoptional": {
9202
+ this.process(def.innerType, params);
9203
+ result.ref = def.innerType;
9204
+ break;
8920
9205
  }
8921
- break;
8922
- }
8923
- case "template_literal": {
8924
- const json$1 = _json;
8925
- const pattern = schema._zod.pattern;
8926
- if (!pattern) throw new Error("Pattern not found in template literal");
8927
- json$1.type = "string";
8928
- json$1.pattern = pattern.source;
8929
- break;
8930
- }
8931
- case "pipe": {
8932
- const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8933
- this.process(innerType, params);
8934
- result.ref = innerType;
8935
- break;
8936
- }
8937
- case "readonly": {
8938
- this.process(def.innerType, params);
8939
- result.ref = def.innerType;
8940
- _json.readOnly = true;
8941
- break;
8942
- }
8943
- case "promise": {
8944
- this.process(def.innerType, params);
8945
- result.ref = def.innerType;
8946
- break;
8947
- }
8948
- case "optional": {
8949
- this.process(def.innerType, params);
8950
- result.ref = def.innerType;
8951
- break;
8952
- }
8953
- case "lazy": {
8954
- const innerType = schema._zod.innerType;
8955
- this.process(innerType, params);
8956
- result.ref = innerType;
8957
- break;
8958
- }
8959
- case "custom": {
8960
- if (this.unrepresentable === "throw") {
8961
- throw new Error("Custom types cannot be represented in JSON Schema");
9206
+ case "success": {
9207
+ const json$1 = _json;
9208
+ json$1.type = "boolean";
9209
+ break;
9210
+ }
9211
+ case "default": {
9212
+ this.process(def.innerType, params);
9213
+ result.ref = def.innerType;
9214
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
9215
+ break;
9216
+ }
9217
+ case "prefault": {
9218
+ this.process(def.innerType, params);
9219
+ result.ref = def.innerType;
9220
+ if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
9221
+ break;
9222
+ }
9223
+ case "catch": {
9224
+ this.process(def.innerType, params);
9225
+ result.ref = def.innerType;
9226
+ let catchValue;
9227
+ try {
9228
+ catchValue = def.catchValue(undefined);
9229
+ } catch {
9230
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
9231
+ }
9232
+ _json.default = catchValue;
9233
+ break;
9234
+ }
9235
+ case "nan": {
9236
+ if (this.unrepresentable === "throw") {
9237
+ throw new Error("NaN cannot be represented in JSON Schema");
9238
+ }
9239
+ break;
9240
+ }
9241
+ case "template_literal": {
9242
+ const json$1 = _json;
9243
+ const pattern = schema._zod.pattern;
9244
+ if (!pattern) throw new Error("Pattern not found in template literal");
9245
+ json$1.type = "string";
9246
+ json$1.pattern = pattern.source;
9247
+ break;
9248
+ }
9249
+ case "pipe": {
9250
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
9251
+ this.process(innerType, params);
9252
+ result.ref = innerType;
9253
+ break;
9254
+ }
9255
+ case "readonly": {
9256
+ this.process(def.innerType, params);
9257
+ result.ref = def.innerType;
9258
+ _json.readOnly = true;
9259
+ break;
9260
+ }
9261
+ case "promise": {
9262
+ this.process(def.innerType, params);
9263
+ result.ref = def.innerType;
9264
+ break;
9265
+ }
9266
+ case "optional": {
9267
+ this.process(def.innerType, params);
9268
+ result.ref = def.innerType;
9269
+ break;
9270
+ }
9271
+ case "lazy": {
9272
+ const innerType = schema._zod.innerType;
9273
+ this.process(innerType, params);
9274
+ result.ref = innerType;
9275
+ break;
9276
+ }
9277
+ case "custom": {
9278
+ if (this.unrepresentable === "throw") {
9279
+ throw new Error("Custom types cannot be represented in JSON Schema");
9280
+ }
9281
+ break;
9282
+ }
9283
+ default: {
9284
+ def;
8962
9285
  }
8963
- break;
8964
- }
8965
- default: {
8966
- def;
8967
9286
  }
8968
9287
  }
8969
9288
  }
@@ -8990,12 +9309,15 @@ var JSONSchemaGenerator = class {
8990
9309
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
8991
9310
  if (params.external) {
8992
9311
  const externalId = params.external.registry.get(entry[0])?.id;
8993
- if (externalId) return { ref: params.external.uri(externalId) };
9312
+ const uriGenerator = params.external.uri ?? ((id$1) => id$1);
9313
+ if (externalId) {
9314
+ return { ref: uriGenerator(externalId) };
9315
+ }
8994
9316
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
8995
9317
  entry[1].defId = id;
8996
9318
  return {
8997
9319
  defId: id,
8998
- ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}`
9320
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
8999
9321
  };
9000
9322
  }
9001
9323
  if (entry[1] === root) {
@@ -9023,6 +9345,14 @@ var JSONSchemaGenerator = class {
9023
9345
  }
9024
9346
  schema$1.$ref = ref;
9025
9347
  };
9348
+ if (params.cycles === "throw") {
9349
+ for (const entry of this.seen.entries()) {
9350
+ const seen = entry[1];
9351
+ if (seen.cycle) {
9352
+ throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9353
+ }
9354
+ }
9355
+ }
9026
9356
  for (const entry of this.seen.entries()) {
9027
9357
  const seen = entry[1];
9028
9358
  if (schema === entry[0]) {
@@ -9042,11 +9372,7 @@ var JSONSchemaGenerator = class {
9042
9372
  continue;
9043
9373
  }
9044
9374
  if (seen.cycle) {
9045
- if (params.cycles === "throw") {
9046
- throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9047
- } else if (params.cycles === "ref") {
9048
- extractToDef(entry);
9049
- }
9375
+ extractToDef(entry);
9050
9376
  continue;
9051
9377
  }
9052
9378
  if (seen.count > 1) {
@@ -9078,7 +9404,8 @@ var JSONSchemaGenerator = class {
9078
9404
  }
9079
9405
  if (!seen.isParent) this.override({
9080
9406
  zodSchema,
9081
- jsonSchema: schema$1
9407
+ jsonSchema: schema$1,
9408
+ path: seen.path ?? []
9082
9409
  });
9083
9410
  };
9084
9411
  for (const entry of [...this.seen.entries()].reverse()) {
@@ -9092,6 +9419,11 @@ var JSONSchemaGenerator = class {
9092
9419
  } else {
9093
9420
  console.warn(`Invalid target: ${this.target}`);
9094
9421
  }
9422
+ if (params.external?.uri) {
9423
+ const id = params.external.registry.get(schema)?.id;
9424
+ if (!id) throw new Error("Schema is missing an `id` property");
9425
+ result.$id = params.external.uri(id);
9426
+ }
9095
9427
  Object.assign(result, root.def);
9096
9428
  const defs = params.external?.defs ?? {};
9097
9429
  for (const entry of this.seen.entries()) {
@@ -9100,11 +9432,13 @@ var JSONSchemaGenerator = class {
9100
9432
  defs[seen.defId] = seen.def;
9101
9433
  }
9102
9434
  }
9103
- if (!params.external && Object.keys(defs).length > 0) {
9104
- if (this.target === "draft-2020-12") {
9105
- result.$defs = defs;
9106
- } else {
9107
- result.definitions = defs;
9435
+ if (params.external) {} else {
9436
+ if (Object.keys(defs).length > 0) {
9437
+ if (this.target === "draft-2020-12") {
9438
+ result.$defs = defs;
9439
+ } else {
9440
+ result.definitions = defs;
9441
+ }
9108
9442
  }
9109
9443
  }
9110
9444
  try {
@@ -9125,7 +9459,7 @@ function toJSONSchema(input, _params) {
9125
9459
  const schemas = {};
9126
9460
  const external = {
9127
9461
  registry: input,
9128
- uri: _params?.uri || ((id) => id),
9462
+ uri: _params?.uri,
9129
9463
  defs
9130
9464
  };
9131
9465
  for (const entry of input._idmap.entries()) {
@@ -9236,11 +9570,11 @@ function isTransforming(_schema, _ctx) {
9236
9570
  }
9237
9571
 
9238
9572
  //#endregion
9239
- //#region ../../node_modules/zod/dist/esm/v4/core/json-schema.js
9573
+ //#region ../../node_modules/zod/v4/core/json-schema.js
9240
9574
  var json_schema_exports = {};
9241
9575
 
9242
9576
  //#endregion
9243
- //#region ../../node_modules/zod/dist/esm/v4/core/index.js
9577
+ //#region ../../node_modules/zod/v4/core/index.js
9244
9578
  var core_exports = {};
9245
9579
  __export(core_exports, {
9246
9580
  $ZodAny: () => $ZodAny,
@@ -9279,6 +9613,7 @@ __export(core_exports, {
9279
9613
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
9280
9614
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
9281
9615
  $ZodCustom: () => $ZodCustom,
9616
+ $ZodCustomStringFormat: () => $ZodCustomStringFormat,
9282
9617
  $ZodDate: () => $ZodDate,
9283
9618
  $ZodDefault: () => $ZodDefault,
9284
9619
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
@@ -9343,6 +9678,8 @@ __export(core_exports, {
9343
9678
  Doc: () => Doc,
9344
9679
  JSONSchema: () => json_schema_exports,
9345
9680
  JSONSchemaGenerator: () => JSONSchemaGenerator,
9681
+ NEVER: () => NEVER,
9682
+ TimePrecision: () => TimePrecision,
9346
9683
  _any: () => _any,
9347
9684
  _array: () => _array,
9348
9685
  _base64: () => _base64,
@@ -9432,6 +9769,7 @@ __export(core_exports, {
9432
9769
  _size: () => _size,
9433
9770
  _startsWith: () => _startsWith,
9434
9771
  _string: () => _string,
9772
+ _stringFormat: () => _stringFormat,
9435
9773
  _stringbool: () => _stringbool,
9436
9774
  _success: () => _success,
9437
9775
  _symbol: () => _symbol,
@@ -9481,7 +9819,7 @@ __export(core_exports, {
9481
9819
  });
9482
9820
 
9483
9821
  //#endregion
9484
- //#region ../../node_modules/zod/dist/esm/v4/classic/iso.js
9822
+ //#region ../../node_modules/zod/v4/classic/iso.js
9485
9823
  var iso_exports = {};
9486
9824
  __export(iso_exports, {
9487
9825
  ZodISODate: () => ZodISODate,
@@ -9523,7 +9861,7 @@ function duration(params) {
9523
9861
  }
9524
9862
 
9525
9863
  //#endregion
9526
- //#region ../../node_modules/zod/dist/esm/v4/classic/errors.js
9864
+ //#region ../../node_modules/zod/v4/classic/errors.js
9527
9865
  const initializer = (inst, issues) => {
9528
9866
  $ZodError.init(inst, issues);
9529
9867
  inst.name = "ZodError";
@@ -9541,14 +9879,14 @@ const ZodError = $constructor("ZodError", initializer);
9541
9879
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
9542
9880
 
9543
9881
  //#endregion
9544
- //#region ../../node_modules/zod/dist/esm/v4/classic/parse.js
9882
+ //#region ../../node_modules/zod/v4/classic/parse.js
9545
9883
  const parse = /* @__PURE__ */ _parse(ZodRealError);
9546
9884
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
9547
9885
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
9548
9886
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
9549
9887
 
9550
9888
  //#endregion
9551
- //#region ../../node_modules/zod/dist/esm/v4/classic/schemas.js
9889
+ //#region ../../node_modules/zod/v4/classic/schemas.js
9552
9890
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
9553
9891
  $ZodType.init(inst, def);
9554
9892
  inst.def = def;
@@ -9816,6 +10154,13 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9816
10154
  function jwt(params) {
9817
10155
  return _jwt(ZodJWT, params);
9818
10156
  }
10157
+ const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
10158
+ $ZodCustomStringFormat.init(inst, def);
10159
+ ZodStringFormat.init(inst, def);
10160
+ });
10161
+ function stringFormat(format, fnOrRegex, _params = {}) {
10162
+ return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
10163
+ }
9819
10164
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
9820
10165
  $ZodNumber.init(inst, def);
9821
10166
  ZodType.init(inst, def);
@@ -9985,9 +10330,7 @@ function keyof(schema) {
9985
10330
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
9986
10331
  $ZodObject.init(inst, def);
9987
10332
  ZodType.init(inst, def);
9988
- defineLazy(inst, "shape", () => {
9989
- return Object.fromEntries(Object.entries(inst._zod.def.shape));
9990
- });
10333
+ defineLazy(inst, "shape", () => def.shape);
9991
10334
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
9992
10335
  inst.catchall = (catchall) => inst.clone({
9993
10336
  ...inst._zod.def,
@@ -10432,11 +10775,8 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
10432
10775
  $ZodCustom.init(inst, def);
10433
10776
  ZodType.init(inst, def);
10434
10777
  });
10435
- function check(fn, params) {
10436
- const ch = new $ZodCheck({
10437
- check: "custom",
10438
- ...normalizeParams(params)
10439
- });
10778
+ function check(fn) {
10779
+ const ch = new $ZodCheck({ check: "custom" });
10440
10780
  ch._zod.check = fn;
10441
10781
  return ch;
10442
10782
  }
@@ -10446,7 +10786,7 @@ function custom(fn, _params) {
10446
10786
  function refine(fn, _params = {}) {
10447
10787
  return _refine(ZodCustom, fn, _params);
10448
10788
  }
10449
- function superRefine(fn, params) {
10789
+ function superRefine(fn) {
10450
10790
  const ch = check((payload) => {
10451
10791
  payload.addIssue = (issue$1) => {
10452
10792
  if (typeof issue$1 === "string") {
@@ -10462,7 +10802,7 @@ function superRefine(fn, params) {
10462
10802
  }
10463
10803
  };
10464
10804
  return fn(payload.value, payload);
10465
- }, params);
10805
+ });
10466
10806
  return ch;
10467
10807
  }
10468
10808
  function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
@@ -10500,7 +10840,7 @@ function preprocess(fn, schema) {
10500
10840
  }
10501
10841
 
10502
10842
  //#endregion
10503
- //#region ../../node_modules/zod/dist/esm/v4/classic/compat.js
10843
+ //#region ../../node_modules/zod/v4/classic/compat.js
10504
10844
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
10505
10845
  const ZodIssueCode = {
10506
10846
  invalid_type: "invalid_type",
@@ -10515,10 +10855,6 @@ const ZodIssueCode = {
10515
10855
  invalid_value: "invalid_value",
10516
10856
  custom: "custom"
10517
10857
  };
10518
- /** @deprecated Not necessary in Zod 4. */
10519
- const INVALID = Object.freeze({ status: "aborted" });
10520
- /** A special constant with type `never` */
10521
- const NEVER = INVALID;
10522
10858
  /** @deprecated Use `z.config(params)` instead. */
10523
10859
  function setErrorMap(map$1) {
10524
10860
  config({ customError: map$1 });
@@ -10529,7 +10865,7 @@ function getErrorMap() {
10529
10865
  }
10530
10866
 
10531
10867
  //#endregion
10532
- //#region ../../node_modules/zod/dist/esm/v4/classic/coerce.js
10868
+ //#region ../../node_modules/zod/v4/classic/coerce.js
10533
10869
  var coerce_exports = {};
10534
10870
  __export(coerce_exports, {
10535
10871
  bigint: () => bigint,
@@ -10555,13 +10891,14 @@ function date(params) {
10555
10891
  }
10556
10892
 
10557
10893
  //#endregion
10558
- //#region ../../node_modules/zod/dist/esm/v4/classic/external.js
10894
+ //#region ../../node_modules/zod/v4/classic/external.js
10559
10895
  var external_exports = {};
10560
10896
  __export(external_exports, {
10561
10897
  $brand: () => $brand,
10562
10898
  $input: () => $input,
10563
10899
  $output: () => $output,
10564
10900
  NEVER: () => NEVER,
10901
+ TimePrecision: () => TimePrecision,
10565
10902
  ZodAny: () => ZodAny,
10566
10903
  ZodArray: () => ZodArray,
10567
10904
  ZodBase64: () => ZodBase64,
@@ -10575,6 +10912,7 @@ __export(external_exports, {
10575
10912
  ZodCUID2: () => ZodCUID2,
10576
10913
  ZodCatch: () => ZodCatch,
10577
10914
  ZodCustom: () => ZodCustom,
10915
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
10578
10916
  ZodDate: () => ZodDate,
10579
10917
  ZodDefault: () => ZodDefault,
10580
10918
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
@@ -10736,6 +11074,7 @@ __export(external_exports, {
10736
11074
  startsWith: () => _startsWith,
10737
11075
  strictObject: () => strictObject,
10738
11076
  string: () => string$1,
11077
+ stringFormat: () => stringFormat,
10739
11078
  stringbool: () => stringbool,
10740
11079
  success: () => success,
10741
11080
  superRefine: () => superRefine,
@@ -10766,11 +11105,11 @@ __export(external_exports, {
10766
11105
  config(en_default());
10767
11106
 
10768
11107
  //#endregion
10769
- //#region ../../node_modules/zod/dist/esm/v4/classic/index.js
11108
+ //#region ../../node_modules/zod/v4/classic/index.js
10770
11109
  var classic_default = external_exports;
10771
11110
 
10772
11111
  //#endregion
10773
- //#region ../../node_modules/zod/dist/esm/v4/index.js
11112
+ //#region ../../node_modules/zod/v4/index.js
10774
11113
  var v4_default = classic_default;
10775
11114
 
10776
11115
  //#endregion
@@ -10791,12 +11130,12 @@ var v4_default = classic_default;
10791
11130
  function validate(schema, value) {
10792
11131
  try {
10793
11132
  return schema.parse(value);
10794
- } catch (error$37) {
10795
- if (error$37 instanceof ZodError) {
10796
- const formattedErrors = error$37.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
10797
- throw new Error(`Validation error${error$37.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
11133
+ } catch (error$39) {
11134
+ if (error$39 instanceof ZodError) {
11135
+ const formattedErrors = error$39.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
11136
+ throw new Error(`Validation error${error$39.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
10798
11137
  }
10799
- throw error$37;
11138
+ throw error$39;
10800
11139
  }
10801
11140
  }
10802
11141