@getexception/cli 0.1.27 → 0.1.29

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.
@@ -15,6 +15,7 @@ __export(external_exports, {
15
15
  $brand: () => $brand,
16
16
  $input: () => $input,
17
17
  $output: () => $output,
18
+ INVALID: () => INVALID,
18
19
  NEVER: () => NEVER,
19
20
  TimePrecision: () => TimePrecision,
20
21
  ZodAny: () => ZodAny,
@@ -48,12 +49,14 @@ __export(external_exports, {
48
49
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
49
50
  ZodFunction: () => ZodFunction,
50
51
  ZodGUID: () => ZodGUID,
52
+ ZodIBAN: () => ZodIBAN,
51
53
  ZodIPv4: () => ZodIPv4,
52
54
  ZodIPv6: () => ZodIPv6,
53
55
  ZodISODate: () => ZodISODate,
54
56
  ZodISODateTime: () => ZodISODateTime,
55
57
  ZodISODuration: () => ZodISODuration,
56
58
  ZodISOTime: () => ZodISOTime,
59
+ ZodInstanceOf: () => ZodInstanceOf,
57
60
  ZodIntersection: () => ZodIntersection,
58
61
  ZodIssueCode: () => ZodIssueCode,
59
62
  ZodJWT: () => ZodJWT,
@@ -119,6 +122,7 @@ __export(external_exports, {
119
122
  creditCard: () => creditCard2,
120
123
  cuid: () => cuid3,
121
124
  cuid2: () => cuid22,
125
+ currencyCode: () => currencyCode2,
122
126
  custom: () => custom,
123
127
  date: () => date2,
124
128
  decode: () => decode2,
@@ -151,6 +155,7 @@ __export(external_exports, {
151
155
  hex: () => hex2,
152
156
  hostname: () => hostname2,
153
157
  httpUrl: () => httpUrl,
158
+ iban: () => iban2,
154
159
  includes: () => _includes,
155
160
  input: () => input,
156
161
  instanceof: () => _instanceof,
@@ -262,6 +267,7 @@ __export(external_exports, {
262
267
  validate: () => validate,
263
268
  validateAsync: () => validateAsync,
264
269
  void: () => _void2,
270
+ withParser: () => withParser,
265
271
  xid: () => xid2,
266
272
  xor: () => xor
267
273
  });
@@ -298,6 +304,7 @@ __export(core_exports2, {
298
304
  $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
299
305
  $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
300
306
  $ZodCheckOverwrite: () => $ZodCheckOverwrite,
307
+ $ZodCheckProperties: () => $ZodCheckProperties,
301
308
  $ZodCheckProperty: () => $ZodCheckProperty,
302
309
  $ZodCheckRegex: () => $ZodCheckRegex,
303
310
  $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
@@ -322,6 +329,7 @@ __export(core_exports2, {
322
329
  $ZodFile: () => $ZodFile,
323
330
  $ZodFunction: () => $ZodFunction,
324
331
  $ZodGUID: () => $ZodGUID,
332
+ $ZodIBAN: () => $ZodIBAN,
325
333
  $ZodIPv4: () => $ZodIPv4,
326
334
  $ZodIPv6: () => $ZodIPv6,
327
335
  $ZodISODate: () => $ZodISODate,
@@ -423,6 +431,7 @@ __export(core_exports2, {
423
431
  _gt: () => _gt,
424
432
  _gte: () => _gte,
425
433
  _guid: () => _guid,
434
+ _iban: () => _iban,
426
435
  _includes: () => _includes,
427
436
  _int: () => _int,
428
437
  _int32: () => _int32,
@@ -514,6 +523,9 @@ __export(core_exports2, {
514
523
  _void: () => _void,
515
524
  _xid: () => _xid,
516
525
  _xor: () => _xor,
526
+ base64Charset: () => base64Charset,
527
+ base64urlCharset: () => base64urlCharset,
528
+ canParseURL: () => canParseURL,
517
529
  clone: () => clone,
518
530
  compile: () => compile,
519
531
  compileFn: () => compileFn,
@@ -540,6 +552,7 @@ __export(core_exports2, {
540
552
  isValidBase64URL: () => isValidBase64URL,
541
553
  isValidCIDRv6: () => isValidCIDRv6,
542
554
  isValidCreditCard: () => isValidCreditCard,
555
+ isValidIBAN: () => isValidIBAN,
543
556
  isValidIPv6: () => isValidIPv6,
544
557
  isValidJWT: () => isValidJWT,
545
558
  locales: () => locales_exports,
@@ -550,7 +563,8 @@ __export(core_exports2, {
550
563
  parseAsync: () => parseAsync,
551
564
  parseURLObject: () => parseURLObject,
552
565
  prettifyError: () => prettifyError,
553
- process: () => process2,
566
+ process: () => processSchema,
567
+ processSchema: () => processSchema,
554
568
  regexes: () => regexes_exports,
555
569
  registry: () => registry,
556
570
  safeDecode: () => safeDecode,
@@ -570,7 +584,9 @@ __export(core_exports2, {
570
584
  util: () => util_exports,
571
585
  validate: () => validate,
572
586
  validateAsync: () => validateAsync,
573
- version: () => version
587
+ validateURL: () => validateURL,
588
+ version: () => version,
589
+ withParser: () => withParser
574
590
  });
575
591
 
576
592
  // node_modules/zod/v4/core/util.js
@@ -602,6 +618,7 @@ __export(util_exports, {
602
618
  createTransparentProxy: () => createTransparentProxy,
603
619
  defineLazy: () => defineLazy,
604
620
  defineLazyInternal: () => defineLazyInternal,
621
+ derived: () => derived,
605
622
  esc: () => esc,
606
623
  escapeRegex: () => escapeRegex,
607
624
  explicitlyAborted: () => explicitlyAborted,
@@ -639,9 +656,11 @@ __export(util_exports, {
639
656
  promiseAllObject: () => promiseAllObject,
640
657
  propertyKeyTypes: () => propertyKeyTypes,
641
658
  randomString: () => randomString,
659
+ rawShape: () => rawShape,
642
660
  required: () => required,
643
661
  safeExtend: () => safeExtend,
644
662
  shallowClone: () => shallowClone,
663
+ sizeCaps: () => sizeCaps,
645
664
  slugify: () => slugify,
646
665
  stringifyPrimitive: () => stringifyPrimitive,
647
666
  toZod: () => toZod,
@@ -679,18 +698,22 @@ function jsonStringifyReplacer(_, value) {
679
698
  return value.toString();
680
699
  return value;
681
700
  }
682
- function cached(getter) {
683
- const set2 = false;
684
- return {
685
- get value() {
686
- if (!set2) {
687
- const value = getter();
688
- Object.defineProperty(this, "value", { value });
689
- return value;
690
- }
691
- throw new Error("cached value already set");
701
+ var Cached = class {
702
+ constructor(getter) {
703
+ this._getter = getter;
704
+ this._value = void 0;
705
+ }
706
+ get value() {
707
+ const getter = this._getter;
708
+ if (getter !== void 0) {
709
+ this._value = getter();
710
+ this._getter = void 0;
692
711
  }
693
- };
712
+ return this._value;
713
+ }
714
+ };
715
+ function cached(getter) {
716
+ return new Cached(getter);
694
717
  }
695
718
  function nullish(input2) {
696
719
  return input2 === null || input2 === void 0;
@@ -742,6 +765,56 @@ function assignProp(target, prop, value) {
742
765
  configurable: true
743
766
  });
744
767
  }
768
+ function rawShape(def) {
769
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
770
+ return desc?.get ? desc.get.raw : desc?.value;
771
+ }
772
+ function sourceShape(schema) {
773
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
774
+ }
775
+ function deferProp(target, key, getter) {
776
+ Object.defineProperty(target, key, {
777
+ get() {
778
+ const value = getter();
779
+ assignProp(this, key, value);
780
+ return value;
781
+ },
782
+ enumerable: true,
783
+ configurable: true
784
+ });
785
+ }
786
+ function putProp(target, key, value) {
787
+ if (key in target)
788
+ assignProp(target, key, value);
789
+ else
790
+ target[key] = value;
791
+ }
792
+ function mirrorShape(target, source, keys, wrap) {
793
+ const raw = sourceShape(source);
794
+ for (const key of keys) {
795
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
796
+ if (!desc.enumerable)
797
+ continue;
798
+ if (desc.get) {
799
+ deferProp(target, key, () => {
800
+ const value = source._zod.def.shape[key];
801
+ return wrap ? wrap(value, key) : value;
802
+ });
803
+ } else
804
+ putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
805
+ }
806
+ }
807
+ function mirrorProps(target, source) {
808
+ for (const key of Reflect.ownKeys(source)) {
809
+ const desc = Object.getOwnPropertyDescriptor(source, key);
810
+ if (!desc.enumerable)
811
+ continue;
812
+ if (desc.get)
813
+ deferProp(target, key, () => source[key]);
814
+ else
815
+ putProp(target, key, desc.value);
816
+ }
817
+ }
745
818
  function mergeDefs(...defs) {
746
819
  const mergedDescriptors = {};
747
820
  for (const def of defs) {
@@ -980,23 +1053,21 @@ function pick(schema, mask) {
980
1053
  if (hasChecks) {
981
1054
  throw new Error(".pick() cannot be used on object schemas containing refinements");
982
1055
  }
983
- const def = mergeDefs(schema._zod.def, {
984
- get shape() {
985
- const newShape = {};
986
- for (const key of Reflect.ownKeys(mask)) {
987
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
988
- throw new Error(`Unrecognized key: "${String(key)}"`);
989
- }
990
- if (!mask[key])
991
- continue;
992
- assignProp(newShape, key, currDef.shape[key]);
993
- }
994
- assignProp(this, "shape", newShape);
995
- return newShape;
996
- },
997
- checks: []
998
- });
999
- return clone(schema, def);
1056
+ const newShape = {};
1057
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
1058
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
1059
+ }
1060
+ function maskedKeys(schema, mask) {
1061
+ const raw = sourceShape(schema);
1062
+ const keys = [];
1063
+ for (const key of Reflect.ownKeys(mask)) {
1064
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
1065
+ throw new Error(`Unrecognized key: "${String(key)}"`);
1066
+ }
1067
+ if (mask[key])
1068
+ keys.push(key);
1069
+ }
1070
+ return keys;
1000
1071
  }
1001
1072
  function omit(schema, mask) {
1002
1073
  const currDef = schema._zod.def;
@@ -1005,23 +1076,10 @@ function omit(schema, mask) {
1005
1076
  if (hasChecks) {
1006
1077
  throw new Error(".omit() cannot be used on object schemas containing refinements");
1007
1078
  }
1008
- const def = mergeDefs(schema._zod.def, {
1009
- get shape() {
1010
- const newShape = { ...schema._zod.def.shape };
1011
- for (const key of Reflect.ownKeys(mask)) {
1012
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
1013
- throw new Error(`Unrecognized key: "${String(key)}"`);
1014
- }
1015
- if (!mask[key])
1016
- continue;
1017
- delete newShape[key];
1018
- }
1019
- assignProp(this, "shape", newShape);
1020
- return newShape;
1021
- },
1022
- checks: []
1023
- });
1024
- return clone(schema, def);
1079
+ const omitted = new Set(maskedKeys(schema, mask));
1080
+ const newShape = {};
1081
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
1082
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
1025
1083
  }
1026
1084
  function extend(schema, shape) {
1027
1085
  if (!isPlainObject(shape)) {
@@ -1030,34 +1088,26 @@ function extend(schema, shape) {
1030
1088
  const checks = schema._zod.def.checks;
1031
1089
  const hasChecks = checks && checks.length > 0;
1032
1090
  if (hasChecks) {
1033
- const existingShape = schema._zod.def.shape;
1091
+ const existingShape = sourceShape(schema);
1034
1092
  for (const key of Reflect.ownKeys(shape)) {
1035
1093
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
1036
1094
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
1037
1095
  }
1038
1096
  }
1039
1097
  }
1040
- const def = mergeDefs(schema._zod.def, {
1041
- get shape() {
1042
- const _shape = { ...schema._zod.def.shape, ...shape };
1043
- assignProp(this, "shape", _shape);
1044
- return _shape;
1045
- }
1046
- });
1047
- return clone(schema, def);
1098
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
1099
+ }
1100
+ function extended(schema, shape) {
1101
+ const newShape = {};
1102
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
1103
+ mirrorProps(newShape, shape);
1104
+ return newShape;
1048
1105
  }
1049
1106
  function safeExtend(schema, shape) {
1050
1107
  if (!isPlainObject(shape)) {
1051
1108
  throw new Error("Invalid input to safeExtend: expected a plain object");
1052
1109
  }
1053
- const def = mergeDefs(schema._zod.def, {
1054
- get shape() {
1055
- const _shape = { ...schema._zod.def.shape, ...shape };
1056
- assignProp(this, "shape", _shape);
1057
- return _shape;
1058
- }
1059
- });
1060
- return clone(schema, def);
1110
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
1061
1111
  }
1062
1112
  function merge(a, b) {
1063
1113
  if (!b?._zod?.def) {
@@ -1066,12 +1116,11 @@ function merge(a, b) {
1066
1116
  if (a._zod.def.checks?.length) {
1067
1117
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
1068
1118
  }
1119
+ const newShape = {};
1120
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
1121
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
1069
1122
  const def = mergeDefs(a._zod.def, {
1070
- get shape() {
1071
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
1072
- assignProp(this, "shape", _shape);
1073
- return _shape;
1074
- },
1123
+ shape: newShape,
1075
1124
  get catchall() {
1076
1125
  return b._zod.def.catchall;
1077
1126
  },
@@ -1086,67 +1135,19 @@ function partial(Class2, schema, mask, name = "partial") {
1086
1135
  if (hasChecks) {
1087
1136
  throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
1088
1137
  }
1089
- const def = mergeDefs(schema._zod.def, {
1090
- get shape() {
1091
- const oldShape = schema._zod.def.shape;
1092
- const shape = { ...oldShape };
1093
- if (mask) {
1094
- for (const key of Reflect.ownKeys(mask)) {
1095
- if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
1096
- throw new Error(`Unrecognized key: "${String(key)}"`);
1097
- }
1098
- if (!mask[key])
1099
- continue;
1100
- shape[key] = Class2 ? new Class2({
1101
- type: "optional",
1102
- innerType: oldShape[key]
1103
- }) : oldShape[key];
1104
- }
1105
- } else {
1106
- for (const key of Reflect.ownKeys(oldShape)) {
1107
- shape[key] = Class2 ? new Class2({
1108
- type: "optional",
1109
- innerType: oldShape[key]
1110
- }) : oldShape[key];
1111
- }
1112
- }
1113
- assignProp(this, "shape", shape);
1114
- return shape;
1115
- },
1116
- checks: []
1117
- });
1118
- return clone(schema, def);
1138
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
1139
+ const newShape = {};
1140
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
1141
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
1119
1142
  }
1120
1143
  function required(Class2, schema, mask) {
1121
- const def = mergeDefs(schema._zod.def, {
1122
- get shape() {
1123
- const oldShape = schema._zod.def.shape;
1124
- const shape = { ...oldShape };
1125
- if (mask) {
1126
- for (const key of Reflect.ownKeys(mask)) {
1127
- if (!Object.prototype.hasOwnProperty.call(shape, key)) {
1128
- throw new Error(`Unrecognized key: "${String(key)}"`);
1129
- }
1130
- if (!mask[key])
1131
- continue;
1132
- shape[key] = new Class2({
1133
- type: "nonoptional",
1134
- innerType: oldShape[key]
1135
- });
1136
- }
1137
- } else {
1138
- for (const key of Reflect.ownKeys(oldShape)) {
1139
- shape[key] = new Class2({
1140
- type: "nonoptional",
1141
- innerType: oldShape[key]
1142
- });
1143
- }
1144
- }
1145
- assignProp(this, "shape", shape);
1146
- return shape;
1147
- }
1148
- });
1149
- return clone(schema, def);
1144
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
1145
+ const newShape = {};
1146
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
1147
+ // overwrite with non-optional
1148
+ selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
1149
+ ));
1150
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
1150
1151
  }
1151
1152
  function aborted(x, startIndex = 0) {
1152
1153
  if (x.aborted === true)
@@ -1179,6 +1180,18 @@ function prefixIssues(path, issues) {
1179
1180
  function unwrapMessage(message) {
1180
1181
  return typeof message === "string" ? message : message?.message;
1181
1182
  }
1183
+ function sizeCaps(defChecks) {
1184
+ const caps = [];
1185
+ for (const ch of defChecks ?? []) {
1186
+ const d = ch._zod.def;
1187
+ if (!/_(length|size)$|_equals$/.test(d.check))
1188
+ break;
1189
+ const max = d.maximum ?? d.length ?? d.size;
1190
+ if (max >= 0)
1191
+ caps.push([max, ch]);
1192
+ }
1193
+ return caps;
1194
+ }
1182
1195
  function attachSchema(issues, start, inst) {
1183
1196
  var _a3;
1184
1197
  for (let i = start; i < issues.length; i++) {
@@ -1196,13 +1209,18 @@ function finalizeIssue(iss, ctx, config2) {
1196
1209
  }
1197
1210
  const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
1198
1211
  const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
1199
- const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
1200
- rest.path ?? (rest.path = []);
1201
- rest.message = message;
1212
+ const full = {};
1213
+ for (const k of Object.keys(iss)) {
1214
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
1215
+ continue;
1216
+ full[k] = iss[k];
1217
+ }
1218
+ full.path ?? (full.path = []);
1219
+ full.message = message;
1202
1220
  if (ctx?.reportInput) {
1203
- rest.input = _input;
1221
+ full.input = iss.input;
1204
1222
  }
1205
- return rest;
1223
+ return full;
1206
1224
  }
1207
1225
  function getSizableOrigin(input2) {
1208
1226
  if (input2 instanceof Set)
@@ -1329,6 +1347,23 @@ function own(inst, key, value, enumerable = true) {
1329
1347
  function hide(inst, key, value) {
1330
1348
  return own(inst, key, value, false);
1331
1349
  }
1350
+ // @__NO_SIDE_EFFECTS__
1351
+ function derived(computes, table) {
1352
+ for (const key in computes) {
1353
+ const compute = computes[key];
1354
+ Object.defineProperty(table, key, {
1355
+ configurable: true,
1356
+ enumerable: true,
1357
+ get() {
1358
+ return own(this, key, compute(this));
1359
+ },
1360
+ set(value) {
1361
+ own(this, key, value);
1362
+ }
1363
+ });
1364
+ }
1365
+ return table;
1366
+ }
1332
1367
  function defineBound(proto, key, fn) {
1333
1368
  Object.defineProperty(proto, key, {
1334
1369
  configurable: true,
@@ -1456,8 +1491,7 @@ function $constructor(name, initializer3, proto, params) {
1456
1491
  } finally {
1457
1492
  _zodDesc.value = void 0;
1458
1493
  }
1459
- }
1460
- if (inst._zod.traits.has(name)) {
1494
+ } else if (inst._zod.traits.has(name)) {
1461
1495
  return;
1462
1496
  }
1463
1497
  inst._zod.traits.add(name);
@@ -1548,16 +1582,12 @@ var _messageDesc = {
1548
1582
  enumerable: true,
1549
1583
  configurable: true
1550
1584
  };
1551
- var _zodDesc2 = { value: void 0, enumerable: false };
1552
1585
  var _issuesDesc = { value: void 0, enumerable: false };
1553
1586
  var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
1554
1587
  var initializer = (inst, def) => {
1555
1588
  inst.name = "$ZodError";
1556
- _zodDesc2.value = inst._zod;
1557
- Object.defineProperty(inst, "_zod", _zodDesc2);
1558
1589
  _issuesDesc.value = def;
1559
1590
  Object.defineProperty(inst, "issues", _issuesDesc);
1560
- _zodDesc2.value = void 0;
1561
1591
  _issuesDesc.value = void 0;
1562
1592
  Object.defineProperty(inst, "message", _messageDesc);
1563
1593
  const proto = Object.getPrototypeOf(inst);
@@ -1591,10 +1621,10 @@ function node(obj, key, make) {
1591
1621
  }
1592
1622
  return obj[key];
1593
1623
  }
1594
- function flattenError(error61, mapper = (issue2) => issue2.message) {
1624
+ function flattenError(error62, mapper = (issue2) => issue2.message) {
1595
1625
  const fieldErrors = {};
1596
1626
  const formErrors = [];
1597
- for (const sub of error61.issues) {
1627
+ for (const sub of error62.issues) {
1598
1628
  if (sub.path.length > 0) {
1599
1629
  node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
1600
1630
  } else {
@@ -1603,10 +1633,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
1603
1633
  }
1604
1634
  return { formErrors, fieldErrors };
1605
1635
  }
1606
- function formatError(error61, mapper = (issue2) => issue2.message) {
1636
+ function formatError(error62, mapper = (issue2) => issue2.message) {
1607
1637
  const fieldErrors = { _errors: [] };
1608
- const processError = (error62, path = []) => {
1609
- for (const issue2 of error62.issues) {
1638
+ const processError = (error63, path = []) => {
1639
+ for (const issue2 of error63.issues) {
1610
1640
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1611
1641
  issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
1612
1642
  } else if (issue2.code === "invalid_key") {
@@ -1648,14 +1678,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
1648
1678
  }
1649
1679
  }
1650
1680
  };
1651
- processError(error61);
1681
+ processError(error62);
1652
1682
  return fieldErrors;
1653
1683
  }
1654
- function treeifyError(error61, mapper = (issue2) => issue2.message) {
1684
+ function treeifyError(error62, mapper = (issue2) => issue2.message) {
1655
1685
  const result = { errors: [] };
1656
- const processError = (error62, path = []) => {
1686
+ const processError = (error63, path = []) => {
1657
1687
  var _a3;
1658
- for (const issue2 of error62.issues) {
1688
+ for (const issue2 of error63.issues) {
1659
1689
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1660
1690
  issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
1661
1691
  } else if (issue2.code === "invalid_key") {
@@ -1697,7 +1727,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
1697
1727
  }
1698
1728
  }
1699
1729
  };
1700
- processError(error61);
1730
+ processError(error62);
1701
1731
  return result;
1702
1732
  }
1703
1733
  function toDotPath(_path) {
@@ -1718,9 +1748,9 @@ function toDotPath(_path) {
1718
1748
  }
1719
1749
  return segs.join("");
1720
1750
  }
1721
- function prettifyError(error61) {
1751
+ function prettifyError(error62) {
1722
1752
  const lines = [];
1723
- const issues = [...error61.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
1753
+ const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
1724
1754
  for (const issue2 of issues) {
1725
1755
  lines.push(`\u2716 ${issue2.message}`);
1726
1756
  if (issue2.path?.length)
@@ -1772,33 +1802,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
1772
1802
  if (result instanceof Promise) {
1773
1803
  throw new $ZodAsyncError();
1774
1804
  }
1775
- return result.issues.length ? {
1776
- success: false,
1777
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1778
- } : { success: true, data: result.value };
1805
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
1779
1806
  };
1780
1807
  var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
1808
+ function failure(Err, issues, ctx) {
1809
+ let error62;
1810
+ return {
1811
+ success: false,
1812
+ get error() {
1813
+ if (!error62) {
1814
+ error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
1815
+ issues = void 0;
1816
+ ctx = void 0;
1817
+ }
1818
+ return error62;
1819
+ },
1820
+ set error(e) {
1821
+ error62 = e;
1822
+ issues = void 0;
1823
+ ctx = void 0;
1824
+ }
1825
+ };
1826
+ }
1781
1827
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
1782
1828
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1783
1829
  let result = schema._zod.run({ value, issues: [] }, ctx);
1784
1830
  if (result instanceof Promise)
1785
1831
  result = await result;
1786
- return result.issues.length ? {
1787
- success: false,
1788
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1789
- } : { success: true, data: result.value };
1832
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
1790
1833
  };
1791
1834
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
1792
1835
  var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
1793
1836
  var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
1794
1837
  var validate = ((schema, value, _ctx) => {
1795
1838
  const validator = schema._zod.bag.validator;
1796
- if (validator !== void 0 && validator(value) !== COMPILE_INVALID)
1797
- return true;
1839
+ if (validator !== void 0) {
1840
+ if (validator(value) !== COMPILE_INVALID)
1841
+ return true;
1842
+ if (validator.definite === true && _ctx === void 0)
1843
+ return false;
1844
+ }
1798
1845
  return validateFallback(schema, value, _ctx);
1799
1846
  });
1800
1847
  function validateFallback(schema, value, _ctx) {
1801
- const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
1848
+ const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
1802
1849
  const fallbackRun = schema._zod.bag.fallbackRun;
1803
1850
  let result;
1804
1851
  if (fallbackRun) {
@@ -1813,7 +1860,7 @@ function validateFallback(schema, value, _ctx) {
1813
1860
  return result.issues.length === 0;
1814
1861
  }
1815
1862
  var validateAsync = async (schema, value, _ctx) => {
1816
- const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
1863
+ const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
1817
1864
  let result = schema._zod.run({ value, issues: [] }, ctx);
1818
1865
  if (result instanceof Promise)
1819
1866
  result = await result;
@@ -1875,6 +1922,7 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
1875
1922
  // node_modules/zod/v4/core/regexes.js
1876
1923
  var regexes_exports = {};
1877
1924
  __export(regexes_exports, {
1925
+ anyString: () => anyString,
1878
1926
  base64: () => base64,
1879
1927
  base64url: () => base64url,
1880
1928
  bigint: () => bigint,
@@ -1885,6 +1933,7 @@ __export(regexes_exports, {
1885
1933
  creditCard: () => creditCard,
1886
1934
  cuid: () => cuid,
1887
1935
  cuid2: () => cuid2,
1936
+ currencyCode: () => currencyCode,
1888
1937
  date: () => date,
1889
1938
  datetime: () => datetime,
1890
1939
  domain: () => domain,
@@ -1898,6 +1947,7 @@ __export(regexes_exports, {
1898
1947
  hostname: () => hostname,
1899
1948
  html5Email: () => html5Email,
1900
1949
  httpProtocol: () => httpProtocol,
1950
+ iban: () => iban,
1901
1951
  idnEmail: () => idnEmail,
1902
1952
  integer: () => integer,
1903
1953
  ipv4: () => ipv4,
@@ -1957,13 +2007,13 @@ var uuid = (version2) => {
1957
2007
  var uuid4 = /* @__PURE__ */ uuid(4);
1958
2008
  var uuid6 = /* @__PURE__ */ uuid(6);
1959
2009
  var uuid7 = /* @__PURE__ */ uuid(7);
1960
- var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
2010
+ var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
1961
2011
  var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
1962
2012
  var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
1963
2013
  var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
1964
2014
  var idnEmail = unicodeEmail;
1965
2015
  var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
1966
- var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
2016
+ var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
1967
2017
  function emoji() {
1968
2018
  return new RegExp(_emoji, "u");
1969
2019
  }
@@ -1976,12 +2026,14 @@ var mac = (delimiter) => {
1976
2026
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
1977
2027
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
1978
2028
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
1979
- var base64url = /^[A-Za-z0-9_-]*$/;
2029
+ var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
1980
2030
  var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
1981
2031
  var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
1982
2032
  var httpProtocol = /^https?$/;
1983
2033
  var e164 = /^\+[1-9]\d{6,14}$/;
1984
2034
  var creditCard = /^\d(?:[ -]?\d){11,18}$/;
2035
+ var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
2036
+ var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
1985
2037
  var 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])))`;
1986
2038
  function anchor(source) {
1987
2039
  return new RegExp(`^${source}$`);
@@ -2003,6 +2055,7 @@ function datetime(args) {
2003
2055
  const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
2004
2056
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
2005
2057
  }
2058
+ var anyString = /^[\s\S]{0,}$/;
2006
2059
  var string = (params) => {
2007
2060
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
2008
2061
  return new RegExp(`^${regex}$`);
@@ -2061,16 +2114,6 @@ var numericOriginMap = {
2061
2114
  var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
2062
2115
  $ZodCheck.init(inst, def);
2063
2116
  const origin = numericOriginMap[typeof def.value];
2064
- inst._zod.onattach.push((inst2) => {
2065
- const bag = inst2._zod.bag;
2066
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
2067
- if (def.value < curr) {
2068
- if (def.inclusive)
2069
- bag.maximum = def.value;
2070
- else
2071
- bag.exclusiveMaximum = def.value;
2072
- }
2073
- });
2074
2117
  inst._zod.check = (payload) => {
2075
2118
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
2076
2119
  return;
@@ -2089,16 +2132,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
2089
2132
  var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
2090
2133
  $ZodCheck.init(inst, def);
2091
2134
  const origin = numericOriginMap[typeof def.value];
2092
- inst._zod.onattach.push((inst2) => {
2093
- const bag = inst2._zod.bag;
2094
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
2095
- if (def.value > curr) {
2096
- if (def.inclusive)
2097
- bag.minimum = def.value;
2098
- else
2099
- bag.exclusiveMinimum = def.value;
2100
- }
2101
- });
2102
2135
  inst._zod.check = (payload) => {
2103
2136
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
2104
2137
  return;
@@ -2116,10 +2149,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
2116
2149
  });
2117
2150
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
2118
2151
  $ZodCheck.init(inst, def);
2119
- inst._zod.onattach.push((inst2) => {
2120
- var _a3;
2121
- (_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
2122
- });
2123
2152
  inst._zod.check = (payload) => {
2124
2153
  if (typeof payload.value !== typeof def.value)
2125
2154
  throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -2145,14 +2174,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2145
2174
  const isInt = def.format?.includes("int");
2146
2175
  const origin = isInt ? "int" : "number";
2147
2176
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
2148
- inst._zod.onattach.push((inst2) => {
2149
- const bag = inst2._zod.bag;
2150
- bag.format = def.format;
2151
- bag.minimum = minimum;
2152
- bag.maximum = maximum;
2153
- if (isInt)
2154
- bag.pattern = integer;
2155
- });
2156
2177
  inst._zod.check = (payload) => {
2157
2178
  const input2 = payload.value;
2158
2179
  if (isInt) {
@@ -2221,12 +2242,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2221
2242
  var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
2222
2243
  $ZodCheck.init(inst, def);
2223
2244
  const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
2224
- inst._zod.onattach.push((inst2) => {
2225
- const bag = inst2._zod.bag;
2226
- bag.format = def.format;
2227
- bag.minimum = minimum;
2228
- bag.maximum = maximum;
2229
- });
2230
2245
  inst._zod.check = (payload) => {
2231
2246
  const input2 = payload.value;
2232
2247
  if (input2 < minimum) {
@@ -2257,11 +2272,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
2257
2272
  var _a3;
2258
2273
  $ZodCheck.init(inst, def);
2259
2274
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
2260
- inst._zod.onattach.push((inst2) => {
2261
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
2262
- if (def.maximum < curr)
2263
- inst2._zod.bag.maximum = def.maximum;
2264
- });
2265
2275
  inst._zod.check = (payload) => {
2266
2276
  const input2 = payload.value;
2267
2277
  const size = input2.size;
@@ -2282,11 +2292,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
2282
2292
  var _a3;
2283
2293
  $ZodCheck.init(inst, def);
2284
2294
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
2285
- inst._zod.onattach.push((inst2) => {
2286
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
2287
- if (def.minimum > curr)
2288
- inst2._zod.bag.minimum = def.minimum;
2289
- });
2290
2295
  inst._zod.check = (payload) => {
2291
2296
  const input2 = payload.value;
2292
2297
  const size = input2.size;
@@ -2307,12 +2312,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
2307
2312
  var _a3;
2308
2313
  $ZodCheck.init(inst, def);
2309
2314
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
2310
- inst._zod.onattach.push((inst2) => {
2311
- const bag = inst2._zod.bag;
2312
- bag.minimum = def.size;
2313
- bag.maximum = def.size;
2314
- bag.size = def.size;
2315
- });
2316
2315
  inst._zod.check = (payload) => {
2317
2316
  const input2 = payload.value;
2318
2317
  const size = input2.size;
@@ -2334,11 +2333,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
2334
2333
  var _a3;
2335
2334
  $ZodCheck.init(inst, def);
2336
2335
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
2337
- inst._zod.onattach.push((inst2) => {
2338
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
2339
- if (def.maximum < curr)
2340
- inst2._zod.bag.maximum = def.maximum;
2341
- });
2342
2336
  inst._zod.check = (payload) => {
2343
2337
  const input2 = payload.value;
2344
2338
  const units = input2.length;
@@ -2361,11 +2355,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
2361
2355
  var _a3;
2362
2356
  $ZodCheck.init(inst, def);
2363
2357
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
2364
- inst._zod.onattach.push((inst2) => {
2365
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
2366
- if (def.minimum > curr)
2367
- inst2._zod.bag.minimum = def.minimum;
2368
- });
2369
2358
  inst._zod.check = (payload) => {
2370
2359
  const input2 = payload.value;
2371
2360
  const units = input2.length;
@@ -2388,12 +2377,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2388
2377
  var _a3;
2389
2378
  $ZodCheck.init(inst, def);
2390
2379
  (_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
2391
- inst._zod.onattach.push((inst2) => {
2392
- const bag = inst2._zod.bag;
2393
- bag.minimum = def.length;
2394
- bag.maximum = def.length;
2395
- bag.length = def.length;
2396
- });
2397
2380
  inst._zod.check = (payload) => {
2398
2381
  const input2 = payload.value;
2399
2382
  const units = input2.length;
@@ -2416,14 +2399,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2416
2399
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
2417
2400
  var _a3, _b;
2418
2401
  $ZodCheck.init(inst, def);
2419
- inst._zod.onattach.push((inst2) => {
2420
- const bag = inst2._zod.bag;
2421
- bag.format = def.format;
2422
- if (def.pattern) {
2423
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
2424
- bag.patterns.add(def.pattern);
2425
- }
2426
- });
2427
2402
  if (def.pattern)
2428
2403
  (_a3 = inst._zod).check ?? (_a3.check = (payload) => {
2429
2404
  def.pattern.lastIndex = 0;
@@ -2473,11 +2448,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
2473
2448
  const escapedRegex = escapeRegex(def.includes);
2474
2449
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
2475
2450
  def.pattern = pattern;
2476
- inst._zod.onattach.push((inst2) => {
2477
- const bag = inst2._zod.bag;
2478
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
2479
- bag.patterns.add(pattern);
2480
- });
2481
2451
  inst._zod.check = (payload) => {
2482
2452
  if (payload.value.includes(def.includes, def.position))
2483
2453
  return;
@@ -2496,11 +2466,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
2496
2466
  $ZodCheck.init(inst, def);
2497
2467
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
2498
2468
  def.pattern ?? (def.pattern = pattern);
2499
- inst._zod.onattach.push((inst2) => {
2500
- const bag = inst2._zod.bag;
2501
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
2502
- bag.patterns.add(pattern);
2503
- });
2504
2469
  inst._zod.check = (payload) => {
2505
2470
  if (payload.value.startsWith(def.prefix))
2506
2471
  return;
@@ -2519,11 +2484,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
2519
2484
  $ZodCheck.init(inst, def);
2520
2485
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
2521
2486
  def.pattern ?? (def.pattern = pattern);
2522
- inst._zod.onattach.push((inst2) => {
2523
- const bag = inst2._zod.bag;
2524
- bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
2525
- bag.patterns.add(pattern);
2526
- });
2527
2487
  inst._zod.check = (payload) => {
2528
2488
  if (payload.value.endsWith(def.suffix))
2529
2489
  return;
@@ -2557,12 +2517,37 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
2557
2517
  return;
2558
2518
  };
2559
2519
  });
2520
+ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
2521
+ $ZodCheck.init(inst, def);
2522
+ hide(inst, Symbol.iterator, function* () {
2523
+ yield inst;
2524
+ });
2525
+ let entries;
2526
+ inst._zod.check = (payload) => {
2527
+ if (payload.value == null) {
2528
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
2529
+ return void 0;
2530
+ }
2531
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
2532
+ const input2 = payload.value;
2533
+ let proms;
2534
+ for (const [key, schema] of entries) {
2535
+ const result = schema._zod.run({ value: input2[key], issues: [] }, {});
2536
+ if (result instanceof Promise) {
2537
+ proms ?? (proms = []);
2538
+ proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
2539
+ } else {
2540
+ handleCheckPropertyResult(result, payload, key);
2541
+ }
2542
+ }
2543
+ if (proms)
2544
+ return Promise.all(proms).then(() => void 0);
2545
+ return void 0;
2546
+ };
2547
+ });
2560
2548
  var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
2561
2549
  $ZodCheck.init(inst, def);
2562
2550
  const mimeSet = new Set(def.mime);
2563
- inst._zod.onattach.push((inst2) => {
2564
- inst2._zod.bag.mime = def.mime;
2565
- });
2566
2551
  inst._zod.check = (payload) => {
2567
2552
  if (mimeSet.has(payload.value.type))
2568
2553
  return;
@@ -2590,10 +2575,14 @@ var Doc = class {
2590
2575
  this.args = args;
2591
2576
  this.closed = closed;
2592
2577
  }
2578
+ // the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
2593
2579
  indented(fn) {
2594
2580
  this.indent += 1;
2595
- fn(this);
2596
- this.indent -= 1;
2581
+ try {
2582
+ fn(this);
2583
+ } finally {
2584
+ this.indent -= 1;
2585
+ }
2597
2586
  }
2598
2587
  write(arg) {
2599
2588
  if (typeof arg === "function") {
@@ -2622,8 +2611,8 @@ ${content.join("\n")}
2622
2611
  // node_modules/zod/v4/core/versions.js
2623
2612
  var version = {
2624
2613
  major: 4,
2625
- minor: 5,
2626
- patch: 4
2614
+ minor: 6,
2615
+ patch: 7
2627
2616
  };
2628
2617
 
2629
2618
  // node_modules/zod/v4/core/schemas.js
@@ -2736,15 +2725,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2736
2725
  own(this, "~standard", value);
2737
2726
  }
2738
2727
  });
2739
- var toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
2728
+ var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
2729
+ async function validateAsync2(inst, value) {
2730
+ const ctx = { async: true };
2731
+ return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
2732
+ }
2740
2733
  function standardProps(inst) {
2741
2734
  return {
2742
2735
  validate: (value) => {
2736
+ const ctx = { async: false };
2743
2737
  try {
2744
- return toStandardResult(safeParse(inst, value));
2738
+ const r = inst._zod.run({ value, issues: [] }, ctx);
2739
+ if (!(r instanceof Promise))
2740
+ return toStandardResult(r, ctx);
2745
2741
  } catch (_) {
2746
- return safeParseAsync(inst, value).then(toStandardResult);
2747
2742
  }
2743
+ return validateAsync2(inst, value);
2748
2744
  },
2749
2745
  vendor: "zod",
2750
2746
  version: 1
@@ -2752,7 +2748,7 @@ function standardProps(inst) {
2752
2748
  }
2753
2749
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
2754
2750
  $ZodType.init(inst, def);
2755
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
2751
+ inst._zod.pattern = def.pattern ?? anyString;
2756
2752
  inst._zod.parse = (payload, _) => {
2757
2753
  if (def.coerce)
2758
2754
  try {
@@ -2804,11 +2800,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
2804
2800
  });
2805
2801
  var URL_BAD_FORMAT = 1;
2806
2802
  var URL_UNPARSEABLE = 2;
2803
+ function canParseURL(input2) {
2804
+ try {
2805
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
2806
+ return URL.canParse(input2);
2807
+ new URL(input2);
2808
+ return true;
2809
+ } catch {
2810
+ return false;
2811
+ }
2812
+ }
2813
+ function validateURL(trimmed, def) {
2814
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
2815
+ return canParseURL(trimmed) || URL_UNPARSEABLE;
2816
+ }
2817
+ return parseURLObject(trimmed, def);
2818
+ }
2807
2819
  function parseURLObject(trimmed, def) {
2808
2820
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
2809
2821
  return URL_BAD_FORMAT;
2810
2822
  }
2811
2823
  try {
2824
+ if (typeof URL !== "undefined") {
2825
+ const URLStatic = URL;
2826
+ if (typeof URLStatic.parse === "function")
2827
+ return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
2828
+ }
2812
2829
  return new URL(trimmed);
2813
2830
  } catch {
2814
2831
  return URL_UNPARSEABLE;
@@ -2831,7 +2848,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2831
2848
  inst._zod.check = (payload) => {
2832
2849
  try {
2833
2850
  const trimmed = payload.value.trim();
2834
- const url2 = parseURLObject(trimmed, def);
2851
+ const url2 = validateURL(trimmed, def);
2835
2852
  if (url2 === URL_BAD_FORMAT) {
2836
2853
  payload.issues.push({
2837
2854
  code: "invalid_format",
@@ -2853,6 +2870,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2853
2870
  });
2854
2871
  return;
2855
2872
  }
2873
+ if (url2 === true) {
2874
+ payload.value = stripTabAndNewline(trimmed);
2875
+ return;
2876
+ }
2856
2877
  if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
2857
2878
  payload.issues.push({
2858
2879
  code: "invalid_format",
@@ -2921,12 +2942,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
2921
2942
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
2922
2943
  def.pattern ?? (def.pattern = datetime(def));
2923
2944
  $ZodStringFormat.init(inst, def);
2924
- if (def.local || def.precision === -1) {
2925
- inst._zod.bag.laxFormat = true;
2926
- inst._zod.onattach.push((s) => {
2927
- s._zod.bag.laxFormat = true;
2928
- });
2929
- }
2930
2945
  });
2931
2946
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
2932
2947
  def.pattern ?? (def.pattern = date);
@@ -2943,23 +2958,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
2943
2958
  var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
2944
2959
  def.pattern ?? (def.pattern = ipv4);
2945
2960
  $ZodStringFormat.init(inst, def);
2946
- inst._zod.bag.format = `ipv4`;
2947
2961
  });
2948
2962
  var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
2949
2963
  function isValidIPv6(value) {
2950
2964
  if (!ipv6Alphabet.test(value))
2951
2965
  return false;
2952
- try {
2953
- new URL(`http://[${value}]`);
2954
- return true;
2955
- } catch {
2956
- return false;
2957
- }
2966
+ return canParseURL(`http://[${value}]`);
2958
2967
  }
2959
2968
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
2960
2969
  def.pattern ?? (def.pattern = ipv6);
2961
2970
  $ZodStringFormat.init(inst, def);
2962
- inst._zod.bag.format = `ipv6`;
2963
2971
  inst._zod.check = (payload) => {
2964
2972
  if (!isValidIPv6(payload.value)) {
2965
2973
  payload.issues.push({
@@ -2975,7 +2983,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
2975
2983
  var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
2976
2984
  def.pattern ?? (def.pattern = mac(def.delimiter));
2977
2985
  $ZodStringFormat.init(inst, def);
2978
- inst._zod.bag.format = `mac`;
2979
2986
  });
2980
2987
  var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
2981
2988
  def.pattern ?? (def.pattern = cidrv4);
@@ -3024,10 +3031,10 @@ function isValidBase64(data) {
3024
3031
  return false;
3025
3032
  }
3026
3033
  }
3034
+ var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
3027
3035
  var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
3028
- def.pattern ?? (def.pattern = base64);
3036
+ def.pattern ?? (def.pattern = base64Charset);
3029
3037
  $ZodStringFormat.init(inst, def);
3030
- inst._zod.bag.contentEncoding = "base64";
3031
3038
  inst._zod.check = (payload) => {
3032
3039
  if (isValidBase64(payload.value))
3033
3040
  return;
@@ -3040,17 +3047,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
3040
3047
  });
3041
3048
  };
3042
3049
  });
3050
+ var base64urlCharset = /^[A-Za-z0-9_-]*$/;
3043
3051
  function isValidBase64URL(data) {
3044
- if (!base64url.test(data))
3052
+ if (!base64urlCharset.test(data))
3045
3053
  return false;
3046
3054
  const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
3047
3055
  const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
3048
3056
  return isValidBase64(padded);
3049
3057
  }
3050
3058
  var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
3051
- def.pattern ?? (def.pattern = base64url);
3059
+ def.pattern ?? (def.pattern = base64urlCharset);
3052
3060
  $ZodStringFormat.init(inst, def);
3053
- inst._zod.bag.contentEncoding = "base64url";
3054
3061
  inst._zod.check = (payload) => {
3055
3062
  if (isValidBase64URL(payload.value))
3056
3063
  return;
@@ -3073,7 +3080,7 @@ function isLuhnAlgo(digits) {
3073
3080
  let bit = 1;
3074
3081
  let sum = 0;
3075
3082
  while (length) {
3076
- const value = +digits[--length];
3083
+ const value = digits.charCodeAt(--length) - 48;
3077
3084
  bit ^= 1;
3078
3085
  sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
3079
3086
  }
@@ -3099,6 +3106,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
3099
3106
  });
3100
3107
  };
3101
3108
  });
3109
+ function isIso7064Mod97(iban3) {
3110
+ let remainder = 0;
3111
+ const len = iban3.length;
3112
+ for (let i = 4; i < len; i++) {
3113
+ const code = iban3.charCodeAt(i);
3114
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
3115
+ }
3116
+ for (let i = 0; i < 4; i++) {
3117
+ const code = iban3.charCodeAt(i);
3118
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
3119
+ }
3120
+ return remainder === 1;
3121
+ }
3122
+ function isValidIBAN(input2) {
3123
+ if (!iban.test(input2))
3124
+ return false;
3125
+ return isIso7064Mod97(input2);
3126
+ }
3127
+ var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
3128
+ def.pattern ?? (def.pattern = iban);
3129
+ $ZodStringFormat.init(inst, def);
3130
+ inst._zod.check = (payload) => {
3131
+ if (isValidIBAN(payload.value))
3132
+ return;
3133
+ payload.issues.push({
3134
+ code: "invalid_format",
3135
+ format: "iban",
3136
+ input: payload.value,
3137
+ inst,
3138
+ continue: !def.abort
3139
+ });
3140
+ };
3141
+ });
3102
3142
  function isValidJWT(token, algorithm = null) {
3103
3143
  try {
3104
3144
  const tokensParts = token.split(".");
@@ -3149,7 +3189,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
3149
3189
  });
3150
3190
  var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
3151
3191
  $ZodType.init(inst, def);
3152
- inst._zod.pattern = inst._zod.bag.pattern ?? number;
3192
+ inst._zod.pattern = number;
3153
3193
  inst._zod.parse = (payload, _ctx) => {
3154
3194
  if (def.coerce)
3155
3195
  try {
@@ -3328,6 +3368,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
3328
3368
  return payload;
3329
3369
  };
3330
3370
  });
3371
+ function capSize(inst, size) {
3372
+ const caps = sizeCaps(inst._zod.def.checks);
3373
+ if (!caps.length)
3374
+ return;
3375
+ const cap = Math.min(...caps.map((c) => c[0]));
3376
+ const parse5 = inst._zod.parse;
3377
+ inst._zod.parse = (payload, ctx) => {
3378
+ const n = size(payload.value);
3379
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
3380
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
3381
+ if (n > max && ch._zod.def.when(payload)) {
3382
+ const start = payload.issues.length;
3383
+ ch._zod.check(payload);
3384
+ payload.issues[start].continue = false;
3385
+ attachSchema(payload.issues, start, inst);
3386
+ return payload;
3387
+ }
3388
+ }
3389
+ }
3390
+ return parse5(payload, ctx);
3391
+ };
3392
+ }
3393
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
3394
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
3395
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
3331
3396
  function handleArrayResult(result, final, index) {
3332
3397
  if (result.issues.length) {
3333
3398
  final.issues.push(...prefixIssues(index, result.issues));
@@ -3351,6 +3416,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3351
3416
  }
3352
3417
  payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
3353
3418
  const proms = [];
3419
+ const abortEarly = ctx?.abortEarly;
3354
3420
  for (let i = 0; i < input2.length; i++) {
3355
3421
  const item = input2[i];
3356
3422
  const result = def.element._zod.run({
@@ -3361,6 +3427,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3361
3427
  proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
3362
3428
  } else {
3363
3429
  handleArrayResult(result, payload, i);
3430
+ if (abortEarly && result.issues.length !== 0 && aborted(result))
3431
+ break;
3364
3432
  }
3365
3433
  }
3366
3434
  if (proms.length) {
@@ -3368,6 +3436,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3368
3436
  }
3369
3437
  return payload;
3370
3438
  };
3439
+ capSize(inst, arraySize);
3371
3440
  });
3372
3441
  function handlePropertyResult(result, final, key, input2, optin, optout) {
3373
3442
  const isPresent = key in input2;
@@ -3393,7 +3462,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
3393
3462
  return;
3394
3463
  }
3395
3464
  if (result.value === void 0) {
3396
- if (isPresent) {
3465
+ if (isPresent || optin === "defaulted" && !isOptionalOut) {
3397
3466
  final.value[key] = void 0;
3398
3467
  }
3399
3468
  } else {
@@ -3422,14 +3491,20 @@ function normalizeDef(def) {
3422
3491
  optionalKeys: new Set(okeys)
3423
3492
  };
3424
3493
  }
3425
- function handleCatchall(proms, input2, payload, ctx, def, inst) {
3494
+ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
3426
3495
  const unrecognized = [];
3427
3496
  const keySet = def.keySet;
3428
3497
  const _catchall = def.catchall._zod;
3429
3498
  const t = _catchall.def.type;
3430
3499
  const optin = _catchall.optin;
3431
3500
  const optout = _catchall.optout;
3501
+ let seen = 0;
3432
3502
  for (const key in input2) {
3503
+ if (abortEarly && payload.issues.length !== seen) {
3504
+ if (aborted(payload, seen))
3505
+ break;
3506
+ seen = payload.issues.length;
3507
+ }
3433
3508
  if (keySet.has(key))
3434
3509
  continue;
3435
3510
  if (key === "__proto__") {
@@ -3464,23 +3539,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
3464
3539
  return payload;
3465
3540
  });
3466
3541
  }
3467
- var propShapes = /* @__PURE__ */ new WeakMap();
3468
3542
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3469
3543
  $ZodType.init(inst, def);
3470
3544
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
3471
- if (!desc?.get) {
3472
- const sh = def.shape;
3473
- propShapes.set(def, sh);
3474
- Object.defineProperty(def, "shape", {
3475
- get: () => {
3476
- const newSh = { ...sh };
3477
- Object.defineProperty(def, "shape", {
3478
- value: newSh
3479
- });
3480
- propShapes.set(def, newSh);
3481
- return newSh;
3482
- }
3483
- });
3545
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
3546
+ if (sh) {
3547
+ const get = () => {
3548
+ const newSh = { ...sh };
3549
+ Object.defineProperty(def, "shape", { value: newSh });
3550
+ get.raw = newSh;
3551
+ return newSh;
3552
+ };
3553
+ get.raw = sh;
3554
+ Object.defineProperty(def, "shape", { get });
3484
3555
  }
3485
3556
  const _normalized = cached(() => normalizeDef(def));
3486
3557
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -3520,7 +3591,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3520
3591
  payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
3521
3592
  const proms = [];
3522
3593
  const shape = value.shape;
3594
+ const abortEarly = ctx?.abortEarly;
3595
+ let seen = payload.issues.length;
3523
3596
  for (const key of value.allKeys) {
3597
+ if (abortEarly && payload.issues.length !== seen) {
3598
+ if (aborted(payload, seen))
3599
+ break;
3600
+ seen = payload.issues.length;
3601
+ }
3524
3602
  if (key === "__proto__")
3525
3603
  continue;
3526
3604
  const el = shape[key];
@@ -3536,7 +3614,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3536
3614
  if (!catchall) {
3537
3615
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
3538
3616
  }
3539
- return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
3617
+ return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
3540
3618
  };
3541
3619
  });
3542
3620
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -3550,10 +3628,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3550
3628
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
3551
3629
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
3552
3630
  const prefixStr = (id, k) => `
3631
+ let ${id}_ab = false;
3553
3632
  for (let i = 0; i < ${id}.issues.length; i++) {
3554
3633
  const iss = ${id}.issues[i];
3555
3634
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
3556
3635
  payload.issues.push(iss);
3636
+ if (iss.continue !== true) ${id}_ab = true;
3637
+ }
3638
+ if (${id}_ab && ctx && ctx.abortEarly) {
3639
+ payload.value = newResult;
3640
+ return payload;
3557
3641
  }`;
3558
3642
  doc.write(`const input = payload.value;`);
3559
3643
  const ids = /* @__PURE__ */ Object.create(null);
@@ -3599,6 +3683,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3599
3683
  input: undefined,
3600
3684
  path: [${k}]
3601
3685
  });
3686
+ if (ctx && ctx.abortEarly) {
3687
+ payload.value = newResult;
3688
+ return payload;
3689
+ }
3602
3690
  }
3603
3691
 
3604
3692
  if (${id}_present) {
@@ -3610,16 +3698,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3610
3698
  doc.write(`
3611
3699
  if (${id}.issues.length) {${prefixStr(id, k)}
3612
3700
  }
3613
-
3614
- if (${id}.value === undefined) {
3615
- if (${isPresent}) {
3616
- newResult[${k}] = undefined;
3617
- }
3701
+ `);
3702
+ if (optin === "defaulted") {
3703
+ doc.write(`newResult[${k}] = ${id}.value;`);
3618
3704
  } else {
3705
+ doc.write(`
3706
+ if (${id}.value !== undefined || ${isPresent}) {
3619
3707
  newResult[${k}] = ${id}.value;
3620
3708
  }
3621
-
3622
3709
  `);
3710
+ }
3623
3711
  }
3624
3712
  }
3625
3713
  doc.write(`payload.value = newResult;`);
@@ -3651,7 +3739,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3651
3739
  payload = fastpass(payload, ctx);
3652
3740
  if (!catchall)
3653
3741
  return payload;
3654
- return handleCatchall([], input2, payload, ctx, value, inst);
3742
+ return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
3655
3743
  }
3656
3744
  return superParse(payload, ctx);
3657
3745
  };
@@ -3783,16 +3871,31 @@ function getDiscriminatedOption(union2, value) {
3783
3871
  const internals = union2._zod;
3784
3872
  let map2 = internals.bag.optionsMap;
3785
3873
  if (!map2) {
3786
- map2 = /* @__PURE__ */ new Map();
3787
- const { options, discriminator } = internals.def;
3788
- for (const option of options) {
3789
- for (const v of option._zod.propValues?.[discriminator] ?? [])
3790
- if (!map2.has(v))
3791
- map2.set(v, option);
3792
- }
3874
+ map2 = discriminatorMap(internals.def);
3793
3875
  internals.bag.optionsMap = map2;
3794
3876
  }
3795
- return map2.get(value);
3877
+ const option = map2.get(value);
3878
+ if (option === null)
3879
+ throw new Error(`Ambiguous discriminator value "${String(value)}"`);
3880
+ return option;
3881
+ }
3882
+ function discriminatorMap(def) {
3883
+ const map2 = /* @__PURE__ */ new Map();
3884
+ for (const option of def.options) {
3885
+ const values = option._zod.propValues?.[def.discriminator];
3886
+ if (!values || values.size === 0)
3887
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
3888
+ for (const value of values) {
3889
+ if (map2.has(value)) {
3890
+ if (value !== void 0)
3891
+ throw new Error(`Duplicate discriminator value "${String(value)}"`);
3892
+ map2.set(value, null);
3893
+ } else {
3894
+ map2.set(value, option);
3895
+ }
3896
+ }
3897
+ }
3898
+ return map2;
3796
3899
  }
3797
3900
  var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
3798
3901
  def.inclusive = false;
@@ -3800,10 +3903,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3800
3903
  const _super = inst._zod.parse;
3801
3904
  defineLazyInternal(inst, "propValues", (zod) => {
3802
3905
  const propValues = {};
3906
+ let undefinedCount = 0;
3803
3907
  for (const option of zod.def.options) {
3804
3908
  const pv = option._zod.propValues;
3805
3909
  if (!pv || Object.keys(pv).length === 0)
3806
3910
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
3911
+ if (pv[zod.def.discriminator]?.has(void 0))
3912
+ undefinedCount++;
3807
3913
  for (const [k, v] of Object.entries(pv)) {
3808
3914
  if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
3809
3915
  assignProp(propValues, k, /* @__PURE__ */ new Set());
@@ -3813,30 +3919,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3813
3919
  }
3814
3920
  }
3815
3921
  }
3922
+ if (!zod.def.unionFallback && undefinedCount > 1)
3923
+ propValues[zod.def.discriminator]?.delete(void 0);
3816
3924
  return propValues;
3817
3925
  });
3818
3926
  def.options.forEach((option, i) => {
3819
- const propShape = propShapes.get(option._zod.def);
3927
+ const propShape = rawShape(option._zod.def);
3820
3928
  if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
3821
3929
  throw new Error(`Invalid discriminated union option at index "${i}"`);
3822
3930
  }
3823
3931
  });
3824
- const disc = cached(() => {
3825
- const opts = def.options;
3826
- const map2 = /* @__PURE__ */ new Map();
3827
- for (const o of opts) {
3828
- const values = o._zod.propValues?.[def.discriminator];
3829
- if (!values || values.size === 0)
3830
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
3831
- for (const v of values) {
3832
- if (map2.has(v)) {
3833
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
3834
- }
3835
- map2.set(v, o);
3836
- }
3837
- }
3838
- return map2;
3839
- });
3932
+ const disc = cached(() => discriminatorMap(def));
3840
3933
  inst._zod.parse = (payload, ctx) => {
3841
3934
  const input2 = payload.value;
3842
3935
  if (!isObject(input2)) {
@@ -3848,8 +3941,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3848
3941
  });
3849
3942
  return payload;
3850
3943
  }
3851
- const opt = disc.value.get(input2?.[def.discriminator]);
3852
- if (opt) {
3944
+ const value = input2?.[def.discriminator];
3945
+ const opt = disc.value.get(value);
3946
+ if (opt && (value !== void 0 || ctx.direction !== "backward")) {
3853
3947
  return opt._zod.run(payload, ctx);
3854
3948
  }
3855
3949
  if (def.unionFallback || ctx.direction === "backward") {
@@ -3860,7 +3954,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3860
3954
  errors: [],
3861
3955
  note: "No matching discriminator",
3862
3956
  discriminator: def.discriminator,
3863
- options: Array.from(disc.value.keys()),
3957
+ options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
3864
3958
  input: input2,
3865
3959
  path: [def.discriminator],
3866
3960
  inst
@@ -4026,6 +4120,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
4026
4120
  }
4027
4121
  }
4028
4122
  const itemResults = new Array(items.length);
4123
+ const abortEarly = def.rest ? ctx?.abortEarly : void 0;
4124
+ let itemAborted = false;
4029
4125
  for (let i = 0; i < items.length; i++) {
4030
4126
  const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
4031
4127
  if (r instanceof Promise) {
@@ -4034,12 +4130,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
4034
4130
  }));
4035
4131
  } else {
4036
4132
  itemResults[i] = r;
4133
+ if (abortEarly && !itemAborted && r.issues.length)
4134
+ itemAborted = aborted(r);
4037
4135
  }
4038
4136
  }
4039
- if (def.rest) {
4137
+ if (def.rest && !itemAborted) {
4040
4138
  let i = items.length - 1;
4041
4139
  const rest = input2.slice(items.length);
4140
+ let seen = payload.issues.length;
4042
4141
  for (const el of rest) {
4142
+ if (abortEarly && payload.issues.length !== seen) {
4143
+ if (aborted(payload, seen))
4144
+ break;
4145
+ seen = payload.issues.length;
4146
+ }
4043
4147
  i++;
4044
4148
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
4045
4149
  if (result instanceof Promise) {
@@ -4267,7 +4371,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4267
4371
  }
4268
4372
  const proms = [];
4269
4373
  payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
4374
+ const abortEarly = ctx?.abortEarly;
4375
+ let seen = payload.issues.length;
4270
4376
  for (const [key, value] of input2) {
4377
+ if (abortEarly && payload.issues.length !== seen) {
4378
+ if (aborted(payload, seen))
4379
+ break;
4380
+ seen = payload.issues.length;
4381
+ }
4271
4382
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
4272
4383
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
4273
4384
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -4282,6 +4393,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4282
4393
  return Promise.all(proms).then(() => payload);
4283
4394
  return payload;
4284
4395
  };
4396
+ capSize(inst, mapSize);
4285
4397
  });
4286
4398
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
4287
4399
  if (keyResult.issues.length) {
@@ -4330,7 +4442,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4330
4442
  }
4331
4443
  const proms = [];
4332
4444
  payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
4445
+ const abortEarly = ctx?.abortEarly;
4446
+ let seen = payload.issues.length;
4333
4447
  for (const item of input2) {
4448
+ if (abortEarly && payload.issues.length !== seen) {
4449
+ if (aborted(payload, seen))
4450
+ break;
4451
+ seen = payload.issues.length;
4452
+ }
4334
4453
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
4335
4454
  if (result instanceof Promise) {
4336
4455
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -4341,6 +4460,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4341
4460
  return Promise.all(proms).then(() => payload);
4342
4461
  return payload;
4343
4462
  };
4463
+ capSize(inst, setSize);
4344
4464
  });
4345
4465
  function handleSetResult(result, final) {
4346
4466
  if (result.issues.length) {
@@ -4353,8 +4473,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4353
4473
  const values = getEnumValues(def.entries);
4354
4474
  const valuesSet = new Set(values);
4355
4475
  inst._zod.values = valuesSet;
4356
- const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
4357
- inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
4476
+ defineLazyInternal(inst, "pattern", (zod) => {
4477
+ const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
4478
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
4479
+ });
4358
4480
  inst._zod.parse = (payload, _ctx) => {
4359
4481
  const input2 = payload.value;
4360
4482
  if (valuesSet.has(input2)) {
@@ -4373,7 +4495,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
4373
4495
  $ZodType.init(inst, def);
4374
4496
  const values = new Set(def.values);
4375
4497
  inst._zod.values = values;
4376
- inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
4498
+ defineLazyInternal(inst, "pattern", (zod) => {
4499
+ const vals = zod.def.values;
4500
+ return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
4501
+ });
4377
4502
  inst._zod.parse = (payload, _ctx) => {
4378
4503
  const input2 = payload.value;
4379
4504
  if (values.has(input2)) {
@@ -4711,20 +4836,62 @@ function handleReadonlyResult(payload) {
4711
4836
  payload.value = Object.freeze(payload.value);
4712
4837
  return payload;
4713
4838
  }
4839
+ function leafPattern(schema) {
4840
+ const def = schema._zod.def;
4841
+ let pattern = def.pattern;
4842
+ let isInt = !!def.format?.includes("int");
4843
+ let minimum;
4844
+ let maximum;
4845
+ for (const ch of def.checks ?? []) {
4846
+ const d = ch._zod.def;
4847
+ if (d.pattern)
4848
+ pattern = d.pattern;
4849
+ isInt || (isInt = !!d.format?.includes("int"));
4850
+ const lo = d.minimum ?? d.length;
4851
+ const hi = d.maximum ?? d.length;
4852
+ if (lo !== void 0 && (minimum === void 0 || lo > minimum))
4853
+ minimum = lo;
4854
+ if (hi !== void 0 && (maximum === void 0 || hi < maximum))
4855
+ maximum = hi;
4856
+ }
4857
+ if (pattern)
4858
+ return pattern.source;
4859
+ if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
4860
+ return "(?!)";
4861
+ if (minimum !== void 0 || maximum !== void 0)
4862
+ return string({ minimum, maximum }).source;
4863
+ const own2 = schema._zod.pattern;
4864
+ return (isInt && own2 === number ? integer : own2)?.source;
4865
+ }
4866
+ function partPattern(schema) {
4867
+ const def = schema._zod.def;
4868
+ const own2 = schema._zod.pattern?.source;
4869
+ const inner = def.innerType ?? schema._zod.innerType;
4870
+ if (inner) {
4871
+ const before = inner._zod.pattern?.source;
4872
+ const after = partPattern(inner);
4873
+ if (own2 && before && after && after !== before) {
4874
+ return own2.replace(cleanRegex(before), () => cleanRegex(after));
4875
+ }
4876
+ return own2;
4877
+ }
4878
+ if (def.options) {
4879
+ const sources = def.options.map(partPattern);
4880
+ if (sources.every(Boolean))
4881
+ return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
4882
+ }
4883
+ return leafPattern(schema);
4884
+ }
4714
4885
  var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
4715
4886
  $ZodType.init(inst, def);
4716
4887
  const regexParts = [];
4717
4888
  for (const part of def.parts) {
4718
4889
  if (typeof part === "object" && part !== null) {
4719
- if (!part._zod.pattern) {
4890
+ const source = partPattern(part);
4891
+ if (!source) {
4720
4892
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
4721
4893
  }
4722
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
4723
- if (!source)
4724
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
4725
- const start = source.startsWith("^") ? 1 : 0;
4726
- const end = source.endsWith("$") ? source.length - 1 : source.length;
4727
- regexParts.push(source.slice(start, end));
4894
+ regexParts.push(cleanRegex(source));
4728
4895
  } else if (part === null || primitiveTypes.has(typeof part)) {
4729
4896
  regexParts.push(escapeRegex(`${part}`));
4730
4897
  } else {
@@ -4899,28 +5066,53 @@ var $ZodCyclicError = class extends Error {
4899
5066
  };
4900
5067
  var STATE = "~memo";
4901
5068
  var NO_ISSUES = [];
5069
+ function isRef(value) {
5070
+ return value !== null && typeof value === "object";
5071
+ }
4902
5072
  function cloneIssues(issues) {
4903
5073
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
4904
5074
  }
4905
5075
  var recursive = /* @__PURE__ */ new WeakMap();
4906
- function isRecursive(inst, stack) {
5076
+ var NONE = 0;
5077
+ var ASSUMED = 1;
5078
+ var PROVEN = 2;
5079
+ function isRecursive(inst, stack, resolve3) {
4907
5080
  const cached2 = recursive.get(inst);
4908
5081
  if (cached2 !== void 0)
4909
- return cached2;
5082
+ return cached2 ? PROVEN : NONE;
4910
5083
  if (stack.has(inst))
4911
- return true;
5084
+ return PROVEN;
4912
5085
  stack.add(inst);
4913
- let result = false;
5086
+ let result = NONE;
4914
5087
  const check2 = (child) => {
4915
- if (!result && child?._zod && isRecursive(child, stack))
4916
- result = true;
5088
+ if (result !== PROVEN && child?._zod) {
5089
+ const answer = isRecursive(child, stack, resolve3);
5090
+ if (answer > result)
5091
+ result = answer;
5092
+ }
5093
+ };
5094
+ const shape = (sh, spread) => {
5095
+ let answer = NONE;
5096
+ for (const key of Reflect.ownKeys(sh)) {
5097
+ const desc = Object.getOwnPropertyDescriptor(sh, key);
5098
+ if (spread && !desc.enumerable)
5099
+ continue;
5100
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve3) : NONE;
5101
+ if (child > answer)
5102
+ answer = child;
5103
+ }
5104
+ return answer;
5105
+ };
5106
+ const merge2 = (answer) => {
5107
+ if (answer > result)
5108
+ result = answer;
4917
5109
  };
4918
5110
  const def = inst._zod.def;
4919
5111
  const kind = def.type;
4920
5112
  switch (kind) {
4921
5113
  case "object": {
4922
- for (const key of Reflect.ownKeys(def.shape))
4923
- check2(def.shape[key]);
5114
+ const raw = rawShape(def);
5115
+ merge2(raw ? shape(raw, true) : ASSUMED);
4924
5116
  check2(def.catchall);
4925
5117
  break;
4926
5118
  }
@@ -4967,10 +5159,12 @@ function isRecursive(inst, stack) {
4967
5159
  check2(def.input);
4968
5160
  check2(def.output);
4969
5161
  break;
4970
- // reading `_zod.innerType` resolves the getter once and caches it
4971
- case "lazy":
4972
- check2(inst._zod.innerType);
5162
+ // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
5163
+ case "lazy": {
5164
+ const inner = def._cachedInner ?? (resolve3 ? inst._zod.innerType : void 0);
5165
+ merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
4973
5166
  break;
5167
+ }
4974
5168
  // a leaf by choice: `parts` are regex fragments, not data positions
4975
5169
  case "template_literal":
4976
5170
  // leaves
@@ -5012,16 +5206,20 @@ function isRecursive(inst, stack) {
5012
5206
  }
5013
5207
  }
5014
5208
  stack.delete(inst);
5015
- recursive.set(inst, result);
5016
- return result;
5209
+ return settle(inst, result);
5210
+ }
5211
+ function settle(inst, answer) {
5212
+ if (answer !== ASSUMED)
5213
+ recursive.set(inst, answer === PROVEN);
5214
+ return answer;
5017
5215
  }
5018
5216
  function isRecursiveSchema(inst) {
5019
- return isRecursive(inst, /* @__PURE__ */ new Set());
5217
+ return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
5020
5218
  }
5021
5219
  function bucketFor(state, inst) {
5022
5220
  let bucket = state.buckets.get(inst);
5023
5221
  if (!bucket) {
5024
- bucket = /* @__PURE__ */ new Map();
5222
+ bucket = /* @__PURE__ */ new WeakMap();
5025
5223
  state.buckets.set(inst, bucket);
5026
5224
  }
5027
5225
  return bucket;
@@ -5057,6 +5255,7 @@ var memo = {
5057
5255
  attach(inst) {
5058
5256
  var _a3;
5059
5257
  let isRecursiveInst;
5258
+ let rechecked = false;
5060
5259
  let lastCtx;
5061
5260
  let lastBucket;
5062
5261
  (_a3 = inst._zod).deferred ?? (_a3.deferred = []);
@@ -5064,20 +5263,24 @@ var memo = {
5064
5263
  const base = inst._zod.parse;
5065
5264
  const wrapped = (payload, ctx) => {
5066
5265
  if (isRecursiveInst === void 0) {
5067
- isRecursiveInst = isRecursive(inst, /* @__PURE__ */ new Set());
5068
- if (!isRecursiveInst) {
5266
+ const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
5267
+ if (walked === NONE) {
5069
5268
  inst._zod.parse = base;
5070
5269
  if (inst._zod.run === wrapped)
5071
5270
  inst._zod.run = base;
5072
5271
  return base(payload, ctx);
5073
5272
  }
5273
+ if (walked === PROVEN || rechecked)
5274
+ isRecursiveInst = true;
5275
+ else
5276
+ rechecked = true;
5074
5277
  }
5075
5278
  const input2 = payload.value;
5076
- if (input2 === null || typeof input2 !== "object")
5279
+ if (!isRef(input2))
5077
5280
  return base(payload, ctx);
5078
5281
  let state = ctx[STATE];
5079
5282
  if (!state) {
5080
- state = { buckets: /* @__PURE__ */ new Map(), backEdges: void 0 };
5283
+ state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
5081
5284
  ctx[STATE] = state;
5082
5285
  }
5083
5286
  let bucket;
@@ -5096,7 +5299,7 @@ var memo = {
5096
5299
  payload.issues.push(...cloneIssues(hit.issues));
5097
5300
  } else {
5098
5301
  payload.memo = true;
5099
- state.backEdges ?? (state.backEdges = /* @__PURE__ */ new Set());
5302
+ state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
5100
5303
  state.backEdges.add(hit.value);
5101
5304
  }
5102
5305
  return payload;
@@ -5128,7 +5331,7 @@ function memoizer() {
5128
5331
  }
5129
5332
  function isBackEdge(ctx, value) {
5130
5333
  const backEdges = ctx[STATE]?.backEdges;
5131
- return backEdges !== void 0 && value !== null && typeof value === "object" && backEdges.has(value);
5334
+ return backEdges !== void 0 && isRef(value) && backEdges.has(value);
5132
5335
  }
5133
5336
 
5134
5337
  // node_modules/zod/v4/locales/index.js
@@ -5185,6 +5388,7 @@ __export(locales_exports, {
5185
5388
  sl: () => sl_default,
5186
5389
  sv: () => sv_default,
5187
5390
  ta: () => ta_default,
5391
+ tg: () => tg_default,
5188
5392
  th: () => th_default,
5189
5393
  tk: () => tk_default,
5190
5394
  tr: () => tr_default,
@@ -5239,6 +5443,8 @@ var error = () => {
5239
5443
  json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
5240
5444
  e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
5241
5445
  credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
5446
+ currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
5447
+ iban: "IBAN",
5242
5448
  jwt: "JWT",
5243
5449
  template_literal: "\u0645\u062F\u062E\u0644"
5244
5450
  };
@@ -5349,6 +5555,8 @@ var error2 = () => {
5349
5555
  json_string: "JSON string",
5350
5556
  e164: "E.164 number",
5351
5557
  credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
5558
+ currency_code: "valyuta kodu",
5559
+ iban: "IBAN",
5352
5560
  jwt: "JWT",
5353
5561
  template_literal: "input"
5354
5562
  };
@@ -5508,6 +5716,8 @@ var error3 = () => {
5508
5716
  json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
5509
5717
  e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
5510
5718
  credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
5719
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
5720
+ iban: "IBAN",
5511
5721
  jwt: "JWT",
5512
5722
  template_literal: "\u0443\u0432\u043E\u0434"
5513
5723
  };
@@ -5625,6 +5835,8 @@ var error4 = () => {
5625
5835
  json_string: "JSON \u043D\u0438\u0437",
5626
5836
  e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
5627
5837
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
5838
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
5839
+ iban: "IBAN",
5628
5840
  jwt: "JWT",
5629
5841
  template_literal: "\u0432\u0445\u043E\u0434"
5630
5842
  };
@@ -5749,6 +5961,8 @@ var error5 = () => {
5749
5961
  json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
5750
5962
  e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
5751
5963
  credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
5964
+ currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
5965
+ iban: "IBAN",
5752
5966
  jwt: "JWT",
5753
5967
  template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
5754
5968
  };
@@ -5861,6 +6075,8 @@ var error6 = () => {
5861
6075
  json_string: "cadena JSON",
5862
6076
  e164: "n\xFAmero E.164",
5863
6077
  credit_card: "n\xFAmero de targeta de cr\xE8dit",
6078
+ currency_code: "codi de moneda",
6079
+ iban: "IBAN",
5864
6080
  jwt: "JWT",
5865
6081
  template_literal: "entrada"
5866
6082
  };
@@ -5973,6 +6189,8 @@ var error7 = () => {
5973
6189
  json_string: "\u062F\u06D5\u0642\u06CC JSON",
5974
6190
  e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
5975
6191
  credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
6192
+ currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
6193
+ iban: "IBAN",
5976
6194
  jwt: "JWT",
5977
6195
  template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
5978
6196
  };
@@ -6104,6 +6322,8 @@ var error8 = () => {
6104
6322
  json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
6105
6323
  e164: "\u010D\xEDslo E.164",
6106
6324
  credit_card: "\u010D\xEDslo kreditn\xED karty",
6325
+ currency_code: "k\xF3d m\u011Bny",
6326
+ iban: "IBAN",
6107
6327
  jwt: "JWT",
6108
6328
  template_literal: "vstup"
6109
6329
  };
@@ -6219,6 +6439,8 @@ var error9 = () => {
6219
6439
  json_string: "JSON-streng",
6220
6440
  e164: "E.164-nummer",
6221
6441
  credit_card: "kreditkortnummer",
6442
+ currency_code: "valutakode",
6443
+ iban: "IBAN",
6222
6444
  jwt: "JWT",
6223
6445
  template_literal: "input"
6224
6446
  };
@@ -6338,6 +6560,8 @@ var error10 = () => {
6338
6560
  json_string: "JSON-String",
6339
6561
  e164: "E.164-Nummer",
6340
6562
  credit_card: "Kreditkartennummer",
6563
+ currency_code: "W\xE4hrungscode",
6564
+ iban: "IBAN",
6341
6565
  jwt: "JWT",
6342
6566
  template_literal: "Eingabe"
6343
6567
  };
@@ -6450,6 +6674,8 @@ var error11 = () => {
6450
6674
  json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
6451
6675
  e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
6452
6676
  credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
6677
+ currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
6678
+ iban: "IBAN",
6453
6679
  jwt: "JWT",
6454
6680
  template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
6455
6681
  };
@@ -6560,7 +6786,9 @@ var error12 = () => {
6560
6786
  base64url: "base64url-encoded string",
6561
6787
  json_string: "JSON string",
6562
6788
  e164: "E.164 number",
6789
+ currency_code: "currency code",
6563
6790
  credit_card: "credit card number",
6791
+ iban: "IBAN",
6564
6792
  jwt: "JWT",
6565
6793
  template_literal: "input"
6566
6794
  };
@@ -6684,6 +6912,8 @@ var error13 = () => {
6684
6912
  json_string: "JSON-karaktraro",
6685
6913
  e164: "E.164-nombro",
6686
6914
  credit_card: "kreditkarta numero",
6915
+ currency_code: "valuta kodo",
6916
+ iban: "IBAN",
6687
6917
  jwt: "JWT",
6688
6918
  template_literal: "enigo"
6689
6919
  };
@@ -6796,6 +7026,8 @@ var error14 = () => {
6796
7026
  json_string: "cadena JSON",
6797
7027
  e164: "n\xFAmero E.164",
6798
7028
  credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
7029
+ currency_code: "c\xF3digo de moneda",
7030
+ iban: "IBAN",
6799
7031
  jwt: "JWT",
6800
7032
  template_literal: "entrada"
6801
7033
  };
@@ -6932,6 +7164,8 @@ var error15 = () => {
6932
7164
  json_string: "JSON \u0631\u0634\u062A\u0647",
6933
7165
  e164: "E.164 \u0639\u062F\u062F",
6934
7166
  credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
7167
+ currency_code: "\u06A9\u062F \u0627\u0631\u0632",
7168
+ iban: "IBAN",
6935
7169
  jwt: "JWT",
6936
7170
  template_literal: "\u0648\u0631\u0648\u062F\u06CC"
6937
7171
  };
@@ -7054,6 +7288,8 @@ var error16 = () => {
7054
7288
  json_string: "JSON-merkkijono",
7055
7289
  e164: "E.164-luku",
7056
7290
  credit_card: "luottokortin numero",
7291
+ currency_code: "valuuttakoodi",
7292
+ iban: "IBAN",
7057
7293
  jwt: "JWT",
7058
7294
  template_literal: "templaattimerkkijono"
7059
7295
  };
@@ -7165,6 +7401,8 @@ var error17 = () => {
7165
7401
  json_string: "cha\xEEne de caract\xE8res JSON",
7166
7402
  e164: "num\xE9ro au format E.164",
7167
7403
  credit_card: "num\xE9ro de carte de cr\xE9dit",
7404
+ currency_code: "code de devise",
7405
+ iban: "IBAN",
7168
7406
  jwt: "JWT",
7169
7407
  template_literal: "entr\xE9e"
7170
7408
  };
@@ -7294,6 +7532,8 @@ var error18 = () => {
7294
7532
  json_string: "cha\xEEne JSON",
7295
7533
  e164: "num\xE9ro E.164",
7296
7534
  credit_card: "num\xE9ro de carte de cr\xE9dit",
7535
+ currency_code: "code de devise",
7536
+ iban: "IBAN",
7297
7537
  jwt: "JWT",
7298
7538
  template_literal: "entr\xE9e"
7299
7539
  };
@@ -7405,6 +7645,8 @@ var error19 = () => {
7405
7645
  json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
7406
7646
  e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
7407
7647
  credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
7648
+ currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
7649
+ iban: "IBAN",
7408
7650
  jwt: "JWT",
7409
7651
  template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
7410
7652
  };
@@ -7553,6 +7795,8 @@ var error20 = () => {
7553
7795
  json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
7554
7796
  e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
7555
7797
  credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
7798
+ currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
7799
+ iban: { label: "IBAN", gender: "m" },
7556
7800
  jwt: { label: "JWT", gender: "m" },
7557
7801
  template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
7558
7802
  ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
@@ -7717,6 +7961,8 @@ var error21 = () => {
7717
7961
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
7718
7962
  e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
7719
7963
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
7964
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
7965
+ iban: "IBAN",
7720
7966
  jwt: "JWT",
7721
7967
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
7722
7968
  };
@@ -7826,6 +8072,8 @@ var error22 = () => {
7826
8072
  json_string: "JSON tekst",
7827
8073
  e164: "E.164 broj",
7828
8074
  credit_card: "broj kreditne kartice",
8075
+ currency_code: "kod valute",
8076
+ iban: "IBAN",
7829
8077
  jwt: "JWT",
7830
8078
  template_literal: "unos"
7831
8079
  };
@@ -7952,6 +8200,8 @@ var error23 = () => {
7952
8200
  json_string: "JSON string",
7953
8201
  e164: "E.164 sz\xE1m",
7954
8202
  credit_card: "hitelk\xE1rtyasz\xE1m",
8203
+ currency_code: "p\xE9nznemk\xF3d",
8204
+ iban: "IBAN",
7955
8205
  jwt: "JWT",
7956
8206
  template_literal: "bemenet"
7957
8207
  };
@@ -8104,6 +8354,8 @@ var error24 = () => {
8104
8354
  json_string: "JSON \u057F\u0578\u0572",
8105
8355
  e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
8106
8356
  credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
8357
+ currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
8358
+ iban: "IBAN",
8107
8359
  jwt: "JWT",
8108
8360
  template_literal: "\u0574\u0578\u0582\u057F\u0584"
8109
8361
  };
@@ -8221,6 +8473,8 @@ var error25 = () => {
8221
8473
  json_string: "string JSON",
8222
8474
  e164: "angka E.164",
8223
8475
  credit_card: "nomor kartu kredit",
8476
+ currency_code: "kode mata uang",
8477
+ iban: "IBAN",
8224
8478
  jwt: "JWT",
8225
8479
  template_literal: "input"
8226
8480
  };
@@ -8331,6 +8585,8 @@ var error26 = () => {
8331
8585
  json_string: "JSON strengur",
8332
8586
  e164: "E.164 t\xF6lugildi",
8333
8587
  credit_card: "kreditkortan\xFAmer",
8588
+ currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
8589
+ iban: "IBAN",
8334
8590
  jwt: "JWT",
8335
8591
  template_literal: "gildi"
8336
8592
  };
@@ -8444,6 +8700,8 @@ var error27 = () => {
8444
8700
  json_string: "stringa JSON",
8445
8701
  e164: "numero E.164",
8446
8702
  credit_card: "numero di carta di credito",
8703
+ currency_code: "codice valuta",
8704
+ iban: "IBAN",
8447
8705
  jwt: "JWT",
8448
8706
  template_literal: "input"
8449
8707
  };
@@ -8556,6 +8814,8 @@ var error28 = () => {
8556
8814
  json_string: "JSON\u6587\u5B57\u5217",
8557
8815
  e164: "E.164\u756A\u53F7",
8558
8816
  credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
8817
+ currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
8818
+ iban: "IBAN",
8559
8819
  jwt: "JWT",
8560
8820
  template_literal: "\u5165\u529B\u5024"
8561
8821
  };
@@ -8667,6 +8927,8 @@ var error29 = () => {
8667
8927
  json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
8668
8928
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
8669
8929
  credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
8930
+ currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
8931
+ iban: "IBAN",
8670
8932
  jwt: "JWT",
8671
8933
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
8672
8934
  };
@@ -8783,6 +9045,8 @@ var error30 = () => {
8783
9045
  json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
8784
9046
  e164: "\u179B\u17C1\u1781 E.164",
8785
9047
  credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
9048
+ currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
9049
+ iban: "IBAN",
8786
9050
  jwt: "JWT",
8787
9051
  template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
8788
9052
  };
@@ -8902,6 +9166,8 @@ var error31 = () => {
8902
9166
  json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
8903
9167
  e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
8904
9168
  credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
9169
+ currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
9170
+ iban: "IBAN",
8905
9171
  jwt: "JWT",
8906
9172
  template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
8907
9173
  };
@@ -9016,6 +9282,8 @@ var error32 = () => {
9016
9282
  json_string: "JSON \uBB38\uC790\uC5F4",
9017
9283
  e164: "E.164 \uBC88\uD638",
9018
9284
  credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
9285
+ currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
9286
+ iban: "IBAN",
9019
9287
  jwt: "JWT",
9020
9288
  template_literal: "\uC785\uB825"
9021
9289
  };
@@ -9213,6 +9481,8 @@ var error33 = () => {
9213
9481
  json_string: "JSON eilut\u0117",
9214
9482
  e164: "E.164 numeris",
9215
9483
  credit_card: "kredito kortel\u0117s numeris",
9484
+ currency_code: "valiutos kodas",
9485
+ iban: "IBAN",
9216
9486
  jwt: "JWT",
9217
9487
  template_literal: "\u012Fvestis"
9218
9488
  };
@@ -9337,6 +9607,8 @@ var error34 = () => {
9337
9607
  json_string: "JSON \u043D\u0438\u0437\u0430",
9338
9608
  e164: "E.164 \u0431\u0440\u043E\u0458",
9339
9609
  credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
9610
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
9611
+ iban: "IBAN",
9340
9612
  jwt: "JWT",
9341
9613
  template_literal: "\u0432\u043D\u0435\u0441"
9342
9614
  };
@@ -9450,6 +9722,8 @@ var error35 = () => {
9450
9722
  json_string: "string JSON",
9451
9723
  e164: "nombor E.164",
9452
9724
  credit_card: "nombor kad kredit",
9725
+ currency_code: "kod mata wang",
9726
+ iban: "IBAN",
9453
9727
  jwt: "JWT",
9454
9728
  template_literal: "input"
9455
9729
  };
@@ -9561,6 +9835,8 @@ var error36 = () => {
9561
9835
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
9562
9836
  e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
9563
9837
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
9838
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
9839
+ iban: "IBAN",
9564
9840
  jwt: "JWT",
9565
9841
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
9566
9842
  };
@@ -9671,6 +9947,8 @@ var error37 = () => {
9671
9947
  json_string: "JSON string",
9672
9948
  e164: "E.164-nummer",
9673
9949
  credit_card: "creditcardnummer",
9950
+ currency_code: "valutacode",
9951
+ iban: "IBAN",
9674
9952
  jwt: "JWT",
9675
9953
  template_literal: "invoer"
9676
9954
  };
@@ -9785,6 +10063,8 @@ var error38 = () => {
9785
10063
  json_string: "JSON-streng",
9786
10064
  e164: "E.164-nummer",
9787
10065
  credit_card: "kredittkortnummer",
10066
+ currency_code: "valutakode",
10067
+ iban: "IBAN",
9788
10068
  jwt: "JWT",
9789
10069
  template_literal: "input"
9790
10070
  };
@@ -9897,6 +10177,8 @@ var error39 = () => {
9897
10177
  json_string: "JSON-streng",
9898
10178
  e164: "E.164-nummer",
9899
10179
  credit_card: "kredittkortnummer",
10180
+ currency_code: "valutakode",
10181
+ iban: "IBAN",
9900
10182
  jwt: "JWT",
9901
10183
  template_literal: "input"
9902
10184
  };
@@ -10009,6 +10291,8 @@ var error40 = () => {
10009
10291
  json_string: "JSON metin",
10010
10292
  e164: "E.164 say\u0131s\u0131",
10011
10293
  credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
10294
+ currency_code: "para birimi kodu",
10295
+ iban: "IBAN",
10012
10296
  jwt: "JWT",
10013
10297
  template_literal: "giren"
10014
10298
  };
@@ -10122,6 +10406,8 @@ var error41 = () => {
10122
10406
  json_string: "JSON \u0645\u062A\u0646",
10123
10407
  e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
10124
10408
  credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
10409
+ currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
10410
+ iban: "IBAN",
10125
10411
  jwt: "JWT",
10126
10412
  template_literal: "\u0648\u0631\u0648\u062F\u064A"
10127
10413
  };
@@ -10240,6 +10526,8 @@ var error42 = () => {
10240
10526
  json_string: "ci\u0105g znak\xF3w w formacie JSON",
10241
10527
  e164: "liczba E.164",
10242
10528
  credit_card: "numer karty kredytowej",
10529
+ currency_code: "kod waluty",
10530
+ iban: "IBAN",
10243
10531
  jwt: "JWT",
10244
10532
  template_literal: "wej\u015Bcie"
10245
10533
  };
@@ -10353,6 +10641,8 @@ var error43 = () => {
10353
10641
  json_string: "o texto JSON",
10354
10642
  e164: "o n\xFAmero E.164",
10355
10643
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
10644
+ currency_code: "o c\xF3digo de moeda",
10645
+ iban: "o IBAN",
10356
10646
  jwt: "o JWT",
10357
10647
  template_literal: "a entrada"
10358
10648
  };
@@ -10430,8 +10720,8 @@ var error43 = () => {
10430
10720
  case "not_multiple_of":
10431
10721
  return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
10432
10722
  case "unrecognized_keys": {
10433
- const plural = issue2.keys.length > 1 ? "s" : "";
10434
- return `Chave${plural} inv\xE1lida${plural}: ${joinValues(issue2.keys, ", ")}`;
10723
+ const plural2 = issue2.keys.length > 1 ? "s" : "";
10724
+ return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
10435
10725
  }
10436
10726
  case "invalid_key":
10437
10727
  return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
@@ -10495,6 +10785,8 @@ var error44 = () => {
10495
10785
  json_string: "o texto JSON",
10496
10786
  e164: "o n\xFAmero E.164",
10497
10787
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
10788
+ currency_code: "o c\xF3digo de moeda",
10789
+ iban: "o IBAN",
10498
10790
  jwt: "o JWT",
10499
10791
  template_literal: "a entrada"
10500
10792
  };
@@ -10573,8 +10865,8 @@ var error44 = () => {
10573
10865
  case "not_multiple_of":
10574
10866
  return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
10575
10867
  case "unrecognized_keys": {
10576
- const plural = issue2.keys.length > 1 ? "s" : "";
10577
- return `Chave${plural} inv\xE1lida${plural}: ${joinValues(issue2.keys, ", ")}`;
10868
+ const plural2 = issue2.keys.length > 1 ? "s" : "";
10869
+ return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
10578
10870
  }
10579
10871
  case "invalid_key":
10580
10872
  return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
@@ -10638,6 +10930,8 @@ var error45 = () => {
10638
10930
  json_string: "\u0219ir JSON",
10639
10931
  e164: "num\u0103r E.164",
10640
10932
  credit_card: "num\u0103r de card de credit",
10933
+ currency_code: "cod valutar",
10934
+ iban: "IBAN",
10641
10935
  jwt: "JWT",
10642
10936
  template_literal: "intrare"
10643
10937
  };
@@ -10809,6 +11103,8 @@ var error46 = () => {
10809
11103
  json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
10810
11104
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
10811
11105
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
11106
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
11107
+ iban: "IBAN",
10812
11108
  jwt: "JWT",
10813
11109
  template_literal: "\u0432\u0432\u043E\u0434"
10814
11110
  };
@@ -10926,6 +11222,8 @@ var error47 = () => {
10926
11222
  json_string: "re\u0165azec vo form\xE1te JSON",
10927
11223
  e164: "\u010D\xEDslo E.164",
10928
11224
  credit_card: "\u010D\xEDslo kreditnej karty",
11225
+ currency_code: "k\xF3d meny",
11226
+ iban: "IBAN",
10929
11227
  jwt: "JWT",
10930
11228
  template_literal: "vstup"
10931
11229
  };
@@ -11041,6 +11339,8 @@ var error48 = () => {
11041
11339
  json_string: "JSON niz",
11042
11340
  e164: "E.164 \u0161tevilka",
11043
11341
  credit_card: "\u0161tevilka kreditne kartice",
11342
+ currency_code: "koda valute",
11343
+ iban: "IBAN",
11044
11344
  jwt: "JWT",
11045
11345
  template_literal: "vnos"
11046
11346
  };
@@ -11154,6 +11454,8 @@ var error49 = () => {
11154
11454
  json_string: "JSON-str\xE4ng",
11155
11455
  e164: "E.164-nummer",
11156
11456
  credit_card: "kreditkortsnummer",
11457
+ currency_code: "valutakod",
11458
+ iban: "IBAN",
11157
11459
  jwt: "JWT",
11158
11460
  template_literal: "mall-literal"
11159
11461
  };
@@ -11268,6 +11570,8 @@ var error50 = () => {
11268
11570
  json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
11269
11571
  e164: "E.164 \u0B8E\u0BA3\u0BCD",
11270
11572
  credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
11573
+ currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
11574
+ iban: "IBAN",
11271
11575
  jwt: "JWT",
11272
11576
  template_literal: "input"
11273
11577
  };
@@ -11341,23 +11645,23 @@ function ta_default() {
11341
11645
  };
11342
11646
  }
11343
11647
 
11344
- // node_modules/zod/v4/locales/th.js
11648
+ // node_modules/zod/v4/locales/tg.js
11345
11649
  var error51 = () => {
11346
11650
  const Sizable = {
11347
- string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11348
- file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11349
- array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11350
- set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11351
- map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
11651
+ string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
11652
+ file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
11653
+ array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
11654
+ set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
11655
+ map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
11352
11656
  };
11353
11657
  function getSizing(origin) {
11354
11658
  return Sizable[origin] ?? null;
11355
11659
  }
11356
11660
  const FormatDictionary = {
11357
- regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
11358
- email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
11661
+ regex: "\u0432\u0443\u0440\u0443\u0434",
11662
+ email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
11359
11663
  url: "URL",
11360
- emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
11664
+ emoji: "\u044D\u043C\u043E\u04B7\u0438",
11361
11665
  uuid: "UUID",
11362
11666
  uuidv4: "UUIDv4",
11363
11667
  uuidv6: "UUIDv6",
@@ -11368,20 +11672,139 @@ var error51 = () => {
11368
11672
  ulid: "ULID",
11369
11673
  xid: "XID",
11370
11674
  ksuid: "KSUID",
11371
- datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11372
- date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
11373
- time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11374
- duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11375
- ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
11376
- ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
11377
- mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
11378
- cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
11379
- cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
11380
- base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
11381
- base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
11382
- json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
11383
- e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
11675
+ datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
11676
+ date: "\u0441\u0430\u043D\u0430\u0438 ISO",
11677
+ time: "\u0432\u0430\u049B\u0442\u0438 ISO",
11678
+ duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
11679
+ ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
11680
+ ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
11681
+ mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
11682
+ cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
11683
+ cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
11684
+ base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
11685
+ base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
11686
+ json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
11687
+ e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
11688
+ credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
11689
+ currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
11690
+ iban: "IBAN",
11691
+ jwt: "JWT",
11692
+ template_literal: "\u0432\u0443\u0440\u0443\u0434"
11693
+ };
11694
+ const TypeDictionary = {
11695
+ nan: "NaN",
11696
+ number: "\u0440\u0430\u049B\u0430\u043C",
11697
+ string: "\u0441\u0430\u0442\u0440",
11698
+ array: "\u043C\u0430\u0441\u0441\u0438\u0432",
11699
+ object: "\u043E\u0431\u044A\u0435\u043A\u0442",
11700
+ date: "\u0441\u0430\u043D\u0430"
11701
+ };
11702
+ return (issue2) => {
11703
+ switch (issue2.code) {
11704
+ case "invalid_type": {
11705
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
11706
+ const receivedType = parsedType(issue2.input);
11707
+ const received = TypeDictionary[receivedType] ?? receivedType;
11708
+ return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
11709
+ }
11710
+ case "invalid_value":
11711
+ if (issue2.values.length === 1)
11712
+ return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
11713
+ return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
11714
+ case "too_big": {
11715
+ const adj = issue2.inclusive ? "<=" : "<";
11716
+ const sizing = getSizing(issue2.origin);
11717
+ if (sizing)
11718
+ return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
11719
+ return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
11720
+ }
11721
+ case "too_small": {
11722
+ const adj = issue2.inclusive ? ">=" : ">";
11723
+ const sizing = getSizing(issue2.origin);
11724
+ if (sizing)
11725
+ return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
11726
+ return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
11727
+ }
11728
+ case "invalid_format": {
11729
+ const _issue = issue2;
11730
+ if (_issue.format === "starts_with")
11731
+ return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
11732
+ if (_issue.format === "ends_with")
11733
+ return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
11734
+ if (_issue.format === "includes")
11735
+ return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
11736
+ if (_issue.format === "regex")
11737
+ return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
11738
+ return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
11739
+ }
11740
+ case "not_multiple_of":
11741
+ return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
11742
+ case "unrecognized_keys":
11743
+ return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
11744
+ case "invalid_key":
11745
+ return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
11746
+ case "invalid_union":
11747
+ if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
11748
+ const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
11749
+ return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
11750
+ }
11751
+ return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
11752
+ case "invalid_element":
11753
+ return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
11754
+ default:
11755
+ return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
11756
+ }
11757
+ };
11758
+ };
11759
+ function tg_default() {
11760
+ return {
11761
+ localeError: error51()
11762
+ };
11763
+ }
11764
+
11765
+ // node_modules/zod/v4/locales/th.js
11766
+ var error52 = () => {
11767
+ const Sizable = {
11768
+ string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11769
+ file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11770
+ array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11771
+ set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
11772
+ map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
11773
+ };
11774
+ function getSizing(origin) {
11775
+ return Sizable[origin] ?? null;
11776
+ }
11777
+ const FormatDictionary = {
11778
+ regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
11779
+ email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
11780
+ url: "URL",
11781
+ emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
11782
+ uuid: "UUID",
11783
+ uuidv4: "UUIDv4",
11784
+ uuidv6: "UUIDv6",
11785
+ nanoid: "nanoid",
11786
+ guid: "GUID",
11787
+ cuid: "cuid",
11788
+ cuid2: "cuid2",
11789
+ ulid: "ULID",
11790
+ xid: "XID",
11791
+ ksuid: "KSUID",
11792
+ datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11793
+ date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
11794
+ time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11795
+ duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
11796
+ ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
11797
+ ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
11798
+ mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
11799
+ cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
11800
+ cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
11801
+ base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
11802
+ base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
11803
+ json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
11804
+ e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
11384
11805
  credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
11806
+ currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
11807
+ iban: "IBAN",
11385
11808
  jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
11386
11809
  template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
11387
11810
  };
@@ -11451,12 +11874,12 @@ var error51 = () => {
11451
11874
  };
11452
11875
  function th_default() {
11453
11876
  return {
11454
- localeError: error51()
11877
+ localeError: error52()
11455
11878
  };
11456
11879
  }
11457
11880
 
11458
11881
  // node_modules/zod/v4/locales/tk.js
11459
- var error52 = () => {
11882
+ var error53 = () => {
11460
11883
  const Sizable = {
11461
11884
  string: { unit: "simwol", verb: "bolmaly" },
11462
11885
  file: { unit: "ba\xFDt", verb: "bolmaly" },
@@ -11496,6 +11919,8 @@ var error52 = () => {
11496
11919
  json_string: "JSON setiri",
11497
11920
  e164: "E.164 nomeri",
11498
11921
  credit_card: "kredit kartyny\u0148 nomeri",
11922
+ currency_code: "wal\xFDuta kody",
11923
+ iban: "IBAN",
11499
11924
  jwt: "JWT",
11500
11925
  template_literal: "\u015Fablon"
11501
11926
  };
@@ -11557,12 +11982,12 @@ var error52 = () => {
11557
11982
  };
11558
11983
  function tk_default() {
11559
11984
  return {
11560
- localeError: error52()
11985
+ localeError: error53()
11561
11986
  };
11562
11987
  }
11563
11988
 
11564
11989
  // node_modules/zod/v4/locales/tr.js
11565
- var error53 = () => {
11990
+ var error54 = () => {
11566
11991
  const Sizable = {
11567
11992
  string: { unit: "karakter", verb: "olmal\u0131" },
11568
11993
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -11602,6 +12027,8 @@ var error53 = () => {
11602
12027
  json_string: "JSON dizesi",
11603
12028
  e164: "E.164 say\u0131s\u0131",
11604
12029
  credit_card: "kredi kart\u0131 numaras\u0131",
12030
+ currency_code: "para birimi kodu",
12031
+ iban: "IBAN",
11605
12032
  jwt: "JWT",
11606
12033
  template_literal: "\u015Eablon dizesi"
11607
12034
  };
@@ -11666,12 +12093,12 @@ var error53 = () => {
11666
12093
  };
11667
12094
  function tr_default() {
11668
12095
  return {
11669
- localeError: error53()
12096
+ localeError: error54()
11670
12097
  };
11671
12098
  }
11672
12099
 
11673
12100
  // node_modules/zod/v4/locales/uk.js
11674
- var error54 = () => {
12101
+ var error55 = () => {
11675
12102
  const Sizable = {
11676
12103
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
11677
12104
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -11711,6 +12138,8 @@ var error54 = () => {
11711
12138
  json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
11712
12139
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
11713
12140
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
12141
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
12142
+ iban: "IBAN",
11714
12143
  jwt: "JWT",
11715
12144
  template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
11716
12145
  };
@@ -11778,7 +12207,7 @@ var error54 = () => {
11778
12207
  };
11779
12208
  function uk_default() {
11780
12209
  return {
11781
- localeError: error54()
12210
+ localeError: error55()
11782
12211
  };
11783
12212
  }
11784
12213
 
@@ -11788,7 +12217,7 @@ function ua_default() {
11788
12217
  }
11789
12218
 
11790
12219
  // node_modules/zod/v4/locales/ur.js
11791
- var error55 = () => {
12220
+ var error56 = () => {
11792
12221
  const Sizable = {
11793
12222
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
11794
12223
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -11828,6 +12257,8 @@ var error55 = () => {
11828
12257
  json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
11829
12258
  e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
11830
12259
  credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
12260
+ currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
12261
+ iban: "IBAN",
11831
12262
  jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
11832
12263
  template_literal: "\u0627\u0646 \u067E\u0679"
11833
12264
  };
@@ -11897,12 +12328,12 @@ var error55 = () => {
11897
12328
  };
11898
12329
  function ur_default() {
11899
12330
  return {
11900
- localeError: error55()
12331
+ localeError: error56()
11901
12332
  };
11902
12333
  }
11903
12334
 
11904
12335
  // node_modules/zod/v4/locales/uz.js
11905
- var error56 = () => {
12336
+ var error57 = () => {
11906
12337
  const Sizable = {
11907
12338
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
11908
12339
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
@@ -11942,6 +12373,8 @@ var error56 = () => {
11942
12373
  json_string: "JSON satr",
11943
12374
  e164: "E.164 raqam",
11944
12375
  credit_card: "kredit karta raqami",
12376
+ currency_code: "valyuta kodi",
12377
+ iban: "IBAN",
11945
12378
  jwt: "JWT",
11946
12379
  template_literal: "kirish"
11947
12380
  };
@@ -12009,12 +12442,12 @@ var error56 = () => {
12009
12442
  };
12010
12443
  function uz_default() {
12011
12444
  return {
12012
- localeError: error56()
12445
+ localeError: error57()
12013
12446
  };
12014
12447
  }
12015
12448
 
12016
12449
  // node_modules/zod/v4/locales/vi.js
12017
- var error57 = () => {
12450
+ var error58 = () => {
12018
12451
  const Sizable = {
12019
12452
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
12020
12453
  file: { unit: "byte", verb: "c\xF3" },
@@ -12054,6 +12487,8 @@ var error57 = () => {
12054
12487
  json_string: "chu\u1ED7i JSON",
12055
12488
  e164: "s\u1ED1 E.164",
12056
12489
  credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
12490
+ currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
12491
+ iban: "IBAN",
12057
12492
  jwt: "JWT",
12058
12493
  template_literal: "\u0111\u1EA7u v\xE0o"
12059
12494
  };
@@ -12121,12 +12556,12 @@ var error57 = () => {
12121
12556
  };
12122
12557
  function vi_default() {
12123
12558
  return {
12124
- localeError: error57()
12559
+ localeError: error58()
12125
12560
  };
12126
12561
  }
12127
12562
 
12128
12563
  // node_modules/zod/v4/locales/zh-CN.js
12129
- var error58 = () => {
12564
+ var error59 = () => {
12130
12565
  const Sizable = {
12131
12566
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
12132
12567
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -12166,6 +12601,8 @@ var error58 = () => {
12166
12601
  json_string: "JSON\u5B57\u7B26\u4E32",
12167
12602
  e164: "E.164\u53F7\u7801",
12168
12603
  credit_card: "\u4FE1\u7528\u5361\u53F7",
12604
+ currency_code: "\u8D27\u5E01\u4EE3\u7801",
12605
+ iban: "IBAN",
12169
12606
  jwt: "JWT",
12170
12607
  template_literal: "\u8F93\u5165"
12171
12608
  };
@@ -12234,12 +12671,12 @@ var error58 = () => {
12234
12671
  };
12235
12672
  function zh_CN_default() {
12236
12673
  return {
12237
- localeError: error58()
12674
+ localeError: error59()
12238
12675
  };
12239
12676
  }
12240
12677
 
12241
12678
  // node_modules/zod/v4/locales/zh-TW.js
12242
- var error59 = () => {
12679
+ var error60 = () => {
12243
12680
  const Sizable = {
12244
12681
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
12245
12682
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -12279,6 +12716,8 @@ var error59 = () => {
12279
12716
  json_string: "JSON \u5B57\u4E32",
12280
12717
  e164: "E.164 \u6578\u503C",
12281
12718
  credit_card: "\u4FE1\u7528\u5361\u865F",
12719
+ currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
12720
+ iban: "IBAN",
12282
12721
  jwt: "JWT",
12283
12722
  template_literal: "\u8F38\u5165"
12284
12723
  };
@@ -12345,12 +12784,12 @@ var error59 = () => {
12345
12784
  };
12346
12785
  function zh_TW_default() {
12347
12786
  return {
12348
- localeError: error59()
12787
+ localeError: error60()
12349
12788
  };
12350
12789
  }
12351
12790
 
12352
12791
  // node_modules/zod/v4/locales/yo.js
12353
- var error60 = () => {
12792
+ var error61 = () => {
12354
12793
  const Sizable = {
12355
12794
  string: { unit: "\xE0mi", verb: "n\xED" },
12356
12795
  file: { unit: "bytes", verb: "n\xED" },
@@ -12390,6 +12829,8 @@ var error60 = () => {
12390
12829
  json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
12391
12830
  e164: "n\u1ECD\u0301mb\xE0 E.164",
12392
12831
  credit_card: "n\u1ECDmba kaadi gbese",
12832
+ currency_code: "koodu ow\xF3",
12833
+ iban: "IBAN",
12393
12834
  jwt: "JWT",
12394
12835
  template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
12395
12836
  };
@@ -12456,7 +12897,7 @@ var error60 = () => {
12456
12897
  };
12457
12898
  function yo_default() {
12458
12899
  return {
12459
- localeError: error60()
12900
+ localeError: error61()
12460
12901
  };
12461
12902
  }
12462
12903
 
@@ -12536,31 +12977,8 @@ function compileValidator(schema, parser) {
12536
12977
  function compile(schema, options) {
12537
12978
  try {
12538
12979
  const parser = compileFn(schema);
12539
- const clone2 = clone(schema);
12540
- const liveRun = schema._zod.run;
12541
- const originalRun = liveRun.__originalRun ?? liveRun;
12542
- const wrapped = (payload, ctx) => {
12543
- if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
12544
- return originalRun(payload, ctx);
12545
- }
12546
- if (ctx && isBackEdge(ctx, payload.value)) {
12547
- return originalRun(payload, ctx);
12548
- }
12549
- const out = parser(payload.value);
12550
- if (out !== INVALID) {
12551
- payload.value = out;
12552
- return payload;
12553
- }
12554
- if (ctx)
12555
- ctx[FALLBACK_FLAG] = true;
12556
- return originalRun(payload, ctx);
12557
- };
12558
- wrapped.__originalRun = originalRun;
12559
- clone2._zod.bag.fallbackRun = originalRun;
12980
+ const clone2 = withParser(schema, parser);
12560
12981
  clone2._zod.bag.validator = compileValidator(schema, parser);
12561
- clone2._zod.run = wrapped;
12562
- if (!liveRun.__originalRun)
12563
- installCompiledUserMethods(clone2, schema, parser);
12564
12982
  return clone2;
12565
12983
  } catch (err) {
12566
12984
  if (options?.strict)
@@ -12568,6 +12986,37 @@ function compile(schema, options) {
12568
12986
  return schema;
12569
12987
  }
12570
12988
  }
12989
+ function withParser(schema, parser) {
12990
+ if (isRecursiveSchema(schema)) {
12991
+ throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
12992
+ }
12993
+ const clone2 = clone(schema);
12994
+ const liveRun = schema._zod.run;
12995
+ const originalRun = liveRun.__originalRun ?? liveRun;
12996
+ const wrapped = (payload, ctx) => {
12997
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
12998
+ return originalRun(payload, ctx);
12999
+ }
13000
+ if (ctx && isBackEdge(ctx, payload.value)) {
13001
+ return originalRun(payload, ctx);
13002
+ }
13003
+ const out = parser(payload.value);
13004
+ if (out !== INVALID) {
13005
+ payload.value = out;
13006
+ return payload;
13007
+ }
13008
+ if (ctx)
13009
+ ctx[FALLBACK_FLAG] = true;
13010
+ return originalRun(payload, ctx);
13011
+ };
13012
+ wrapped.__originalRun = originalRun;
13013
+ clone2._zod.bag.fallbackRun = originalRun;
13014
+ clone2._zod.bag.validator = parser;
13015
+ clone2._zod.run = wrapped;
13016
+ if (!liveRun.__originalRun)
13017
+ installCompiledUserMethods(clone2, schema, parser);
13018
+ return clone2;
13019
+ }
12571
13020
  function installCompiledUserMethods(target, source, parser) {
12572
13021
  const targetAny = target;
12573
13022
  const sourceAny = source;
@@ -12604,7 +13053,8 @@ function compileFn(schema, options) {
12604
13053
  const ctx = {
12605
13054
  constants: /* @__PURE__ */ new Map(),
12606
13055
  constantCounter: 0,
12607
- varCounter: 0
13056
+ varCounter: 0,
13057
+ definite: true
12608
13058
  };
12609
13059
  const doc = new Doc(["input"]);
12610
13060
  const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
@@ -12628,6 +13078,7 @@ ${code}
12628
13078
  if (options?.debug) {
12629
13079
  fn.code = fullCode;
12630
13080
  }
13081
+ fn.definite = ctx.definite;
12631
13082
  return fn;
12632
13083
  }
12633
13084
  function addConstant(ctx, value) {
@@ -12639,6 +13090,10 @@ function addConstant(ctx, value) {
12639
13090
  ctx.constants.set(name, value);
12640
13091
  return name;
12641
13092
  }
13093
+ function addUserConstant(ctx, fn) {
13094
+ ctx.definite = false;
13095
+ return addConstant(ctx, fn);
13096
+ }
12642
13097
  function newVar(ctx) {
12643
13098
  return `v${ctx.varCounter++}`;
12644
13099
  }
@@ -12671,6 +13126,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
12671
13126
  }
12672
13127
  }
12673
13128
  function emitRuntimeIsland(doc, ctx, schema, accessor) {
13129
+ ctx.definite = false;
12674
13130
  const schemaConst = addConstant(ctx, schema);
12675
13131
  const runConst = addConstant(ctx, runtimeRun);
12676
13132
  const outVar = newVar(ctx);
@@ -12751,6 +13207,9 @@ function generateChecks(doc, ctx, schema, accessor) {
12751
13207
  case "property":
12752
13208
  generatePropertyCheck(doc, ctx, def, currentAccessor);
12753
13209
  break;
13210
+ case "properties":
13211
+ generatePropertiesChecks(doc, ctx, def, currentAccessor);
13212
+ break;
12754
13213
  case "overwrite": {
12755
13214
  const newAccessor = newVar(ctx);
12756
13215
  generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
@@ -12859,6 +13318,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
12859
13318
  doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
12860
13319
  }
12861
13320
  }
13321
+ function generatePropertiesChecks(doc, ctx, def, accessor) {
13322
+ if (def.when) {
13323
+ throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
13324
+ }
13325
+ doc.write(`if (${accessor} == null) return INVALID;`);
13326
+ const shape = def.shape;
13327
+ for (const key of Reflect.ownKeys(shape)) {
13328
+ const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
13329
+ const inputVar = newVar(ctx);
13330
+ doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
13331
+ compileChild(doc, ctx, shape[key], inputVar, false);
13332
+ }
13333
+ }
12862
13334
  function generatePropertyCheck(doc, ctx, def, accessor) {
12863
13335
  const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
12864
13336
  generateCheck(doc, ctx, def.schema, propAccessor);
@@ -12886,7 +13358,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
12886
13358
  if (isAsyncFunction(def.fn)) {
12887
13359
  throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
12888
13360
  }
12889
- const fnConst = addConstant(ctx, def.fn);
13361
+ const fnConst = addUserConstant(ctx, def.fn);
12890
13362
  const throwAsyncConst = addConstant(ctx, throwAsync);
12891
13363
  const resVar = newVar(ctx);
12892
13364
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -12906,7 +13378,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
12906
13378
  throwAsync();
12907
13379
  return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
12908
13380
  };
12909
- const helperConst = addConstant(ctx, helperFn);
13381
+ const helperConst = addUserConstant(ctx, helperFn);
12910
13382
  const outVar = newVar(ctx);
12911
13383
  doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
12912
13384
  doc.write(`if (${outVar} === INVALID) return INVALID;`);
@@ -12940,7 +13412,7 @@ var PATTERN_IS_COMPLETE = /* @__PURE__ */ new Set([
12940
13412
  "uuid",
12941
13413
  "xid"
12942
13414
  ]);
12943
- function generateStringFormatCheck(doc, ctx, def, accessor) {
13415
+ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
12944
13416
  const fmt = def.format;
12945
13417
  if (fmt === "base64") {
12946
13418
  const validator = addConstant(ctx, isValidBase64);
@@ -12973,9 +13445,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
12973
13445
  doc.write(`if (!${validator}(${accessor})) return INVALID;`);
12974
13446
  return accessor;
12975
13447
  }
13448
+ if (fmt === "iban") {
13449
+ const validator = addConstant(ctx, isValidIBAN);
13450
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
13451
+ return accessor;
13452
+ }
12976
13453
  const formatDef = def;
12977
13454
  if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
12978
- const parseConst = addConstant(ctx, parseURLObject);
13455
+ const parseConst = addConstant(ctx, validateURL);
12979
13456
  const defConst = addConstant(ctx, def);
12980
13457
  const trimVar = newVar(ctx);
12981
13458
  const urlVar = newVar(ctx);
@@ -12990,6 +13467,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
12990
13467
  const protocolConst = addConstant(ctx, urlProtocolOk);
12991
13468
  doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
12992
13469
  }
13470
+ if (!needsValue)
13471
+ return null;
12993
13472
  const outputVar = newVar(ctx);
12994
13473
  const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
12995
13474
  doc.write(`const ${outputVar} = ${outputExpr};`);
@@ -13049,7 +13528,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
13049
13528
  let typeAccessor;
13050
13529
  switch (type) {
13051
13530
  case "string":
13052
- typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
13531
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
13053
13532
  break;
13054
13533
  case "number":
13055
13534
  typeAccessor = generateNumberCheck(doc, schema, accessor);
@@ -13170,12 +13649,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
13170
13649
  return null;
13171
13650
  return generateChecks(doc, ctx, schema, typeAccessor);
13172
13651
  }
13173
- function generateStringCheck(doc, ctx, schema, accessor) {
13652
+ function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
13174
13653
  doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
13175
13654
  const def = schema._zod.def;
13176
13655
  if (def.format === void 0)
13177
13656
  return accessor;
13178
- return generateStringFormatCheck(doc, ctx, def, accessor);
13657
+ return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
13179
13658
  }
13180
13659
  function generateNumberCheck(doc, schema, accessor) {
13181
13660
  doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
@@ -13293,7 +13772,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
13293
13772
  }
13294
13773
  }
13295
13774
  const outputVar = newVar(ctx);
13296
- const hasConditionalKeys = allKeys.some((k) => mayOutputUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
13775
+ const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
13297
13776
  if (!buildsValue) {
13298
13777
  if (unknownKeysMode === "schema") {
13299
13778
  const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
@@ -13320,7 +13799,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
13320
13799
  const out = propOutputs.get(k);
13321
13800
  if (dropsWhenAbsent(propShape[k])) {
13322
13801
  doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
13323
- } else if (mayOutputUndefined(propShape[k])) {
13802
+ } else if (mayOmitUndefined(propShape[k])) {
13324
13803
  doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
13325
13804
  } else {
13326
13805
  doc.write(`${outputVar}[${kx}] = ${out};`);
@@ -13453,6 +13932,9 @@ function fastPathAcceptsAbsence(schema) {
13453
13932
  function dropsWhenAbsent(schema) {
13454
13933
  return schema._zod.optin === "optional" && schema._zod.optout === "optional";
13455
13934
  }
13935
+ function mayOmitUndefined(schema) {
13936
+ return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
13937
+ }
13456
13938
  function mayOutputUndefined(schema) {
13457
13939
  const def = schema._zod.def;
13458
13940
  switch (def.type) {
@@ -13509,9 +13991,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
13509
13991
  doc.write(`}`);
13510
13992
  return outputVar;
13511
13993
  }
13994
+ function generateSizeGate(doc, schema, size) {
13995
+ for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
13996
+ doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
13997
+ }
13998
+ }
13512
13999
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
13513
14000
  const def = schema._zod.def;
13514
14001
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
14002
+ generateSizeGate(doc, schema, `${accessor}.length`);
13515
14003
  const outputVar = buildsValue ? newVar(ctx) : null;
13516
14004
  const iVar = newVar(ctx);
13517
14005
  const elemVar = newVar(ctx);
@@ -13795,6 +14283,7 @@ function literalEquality(ctx, accessor, value) {
13795
14283
  }
13796
14284
  function generateIntersectionCheck(doc, ctx, schema, accessor) {
13797
14285
  const def = schema._zod.def;
14286
+ ctx.definite = false;
13798
14287
  const leftOutput = compileChild(doc, ctx, def.left, accessor);
13799
14288
  const rightOutput = compileChild(doc, ctx, def.right, accessor);
13800
14289
  const mergeConst = addConstant(ctx, mergeValues);
@@ -13848,14 +14337,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
13848
14337
  const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
13849
14338
  if (!keyIsBareString) {
13850
14339
  const isLoose = def.mode === "loose";
13851
- const keyFast = addConstant(ctx, compileFn(def.keyType));
14340
+ const keyFn = compileFn(def.keyType);
14341
+ if (keyFn.definite === false)
14342
+ ctx.definite = false;
14343
+ const keyFast = addConstant(ctx, keyFn);
13852
14344
  const numericConst = addConstant(ctx, number);
13853
- const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
13854
14345
  const outKeyVar = newVar(ctx);
13855
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
13856
- doc.indented((d) => {
13857
- d.write(`if (${kVar} === "__proto__") continue;`);
13858
- d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
14346
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
13859
14347
  d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
13860
14348
  d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
13861
14349
  if (isLoose) {
@@ -13869,21 +14357,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
13869
14357
  const valOutput = compileChild(d, ctx, def.valueType, valueVar);
13870
14358
  d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
13871
14359
  });
13872
- doc.write(`}`);
13873
14360
  return outputVar;
13874
14361
  }
13875
- const propIsEnumerable = addConstant(ctx, Object.prototype.propertyIsEnumerable);
13876
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
13877
- doc.indented((d) => {
13878
- d.write(`if (${kVar} === "__proto__") continue;`);
13879
- d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
13880
- d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
14362
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
13881
14363
  d.write(`const ${valVar} = ${accessor}[${kVar}];`);
13882
14364
  const valOutput = compileChild(d, ctx, def.valueType, valVar);
13883
14365
  d.write(`${outputVar}[${kVar}] = ${valOutput};`);
14366
+ }, `return INVALID;`);
14367
+ return outputVar;
14368
+ }
14369
+ function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
14370
+ const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
14371
+ const symsVar = newVar(ctx);
14372
+ const keysVar = newVar(ctx);
14373
+ const iVar = newVar(ctx);
14374
+ doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
14375
+ doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
14376
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
14377
+ doc.indented((d) => {
14378
+ d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
14379
+ d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
14380
+ body(d);
14381
+ });
14382
+ doc.write(`}`);
14383
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
14384
+ doc.indented((d) => {
14385
+ d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
14386
+ d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
14387
+ if (onSymbol)
14388
+ d.write(onSymbol);
14389
+ else
14390
+ body(d);
13884
14391
  });
13885
14392
  doc.write(`}`);
13886
- return outputVar;
13887
14393
  }
13888
14394
  function literalPropertyKey(ctx, key) {
13889
14395
  if (typeof key === "string")
@@ -13893,6 +14399,7 @@ function literalPropertyKey(ctx, key) {
13893
14399
  function generateMapCheck(doc, ctx, schema, accessor) {
13894
14400
  const def = schema._zod.def;
13895
14401
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
14402
+ generateSizeGate(doc, schema, `${accessor}.size`);
13896
14403
  const outputVar = newVar(ctx);
13897
14404
  const kVar = newVar(ctx);
13898
14405
  const valVar = newVar(ctx);
@@ -13909,6 +14416,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
13909
14416
  function generateSetCheck(doc, ctx, schema, accessor) {
13910
14417
  const def = schema._zod.def;
13911
14418
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
14419
+ generateSizeGate(doc, schema, `${accessor}.size`);
13912
14420
  const outputVar = newVar(ctx);
13913
14421
  const valVar = newVar(ctx);
13914
14422
  doc.write(`const ${outputVar} = new Set();`);
@@ -13936,7 +14444,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
13936
14444
  }
13937
14445
  function generateLazyCheck(doc, ctx, schema, accessor) {
13938
14446
  const def = schema._zod.def;
13939
- const getterConst = addConstant(ctx, def.getter);
14447
+ const getterConst = addUserConstant(ctx, def.getter);
13940
14448
  const cacheConst = addConstant(ctx, { parser: null });
13941
14449
  doc.write(`if (!${cacheConst}.parser) {`);
13942
14450
  doc.indented((d) => {
@@ -13969,7 +14477,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
13969
14477
  return INVALID;
13970
14478
  return fakePayload.issues.length === 0 ? result : INVALID;
13971
14479
  };
13972
- const helperConst = addConstant(ctx, helperFn);
14480
+ const helperConst = addUserConstant(ctx, helperFn);
13973
14481
  const transformedVar = newVar(ctx);
13974
14482
  doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
13975
14483
  doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
@@ -13987,7 +14495,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
13987
14495
  if (isAsyncFunction(def.fn)) {
13988
14496
  throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
13989
14497
  }
13990
- const fnConst = addConstant(ctx, def.fn);
14498
+ const fnConst = addUserConstant(ctx, def.fn);
13991
14499
  const throwAsyncConst = addConstant(ctx, throwAsync);
13992
14500
  const resVar = newVar(ctx);
13993
14501
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -14020,7 +14528,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
14020
14528
  });
14021
14529
  doc.write(`})();`);
14022
14530
  const innerConst = addConstant(ctx, def.innerType);
14023
- const catchConst = addConstant(ctx, def.catchValue);
14531
+ const catchConst = addUserConstant(ctx, def.catchValue);
14024
14532
  const catchHelperConst = addConstant(ctx, runtimeCatch);
14025
14533
  doc.write(`if (${outputVar} === INVALID) {`);
14026
14534
  doc.indented((d) => {
@@ -14044,7 +14552,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
14044
14552
  return INVALID;
14045
14553
  return fakePayload.issues.length === 0 ? result : INVALID;
14046
14554
  };
14047
- const helperConst = addConstant(ctx, helperFn);
14555
+ const helperConst = addUserConstant(ctx, helperFn);
14048
14556
  const outputVar = newVar(ctx);
14049
14557
  doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
14050
14558
  doc.write(`if (${outputVar} === INVALID) return INVALID;`);
@@ -14054,20 +14562,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
14054
14562
  }
14055
14563
 
14056
14564
  // node_modules/zod/v4/core/api.js
14565
+ function snapshotChecks(def) {
14566
+ if (def.checks)
14567
+ def.checks = [...def.checks];
14568
+ return def;
14569
+ }
14057
14570
  // @__NO_SIDE_EFFECTS__
14058
14571
  function _string(Class2, params) {
14059
- return new Class2({
14060
- type: "string",
14061
- ...normalizeParams(params)
14062
- });
14572
+ return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
14063
14573
  }
14064
14574
  // @__NO_SIDE_EFFECTS__
14065
14575
  function _coercedString(Class2, params) {
14066
- return new Class2({
14067
- type: "string",
14068
- coerce: true,
14069
- ...normalizeParams(params)
14070
- });
14576
+ return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
14071
14577
  }
14072
14578
  // @__NO_SIDE_EFFECTS__
14073
14579
  function _email(Class2, params) {
@@ -14303,6 +14809,16 @@ function _creditCard(Class2, params) {
14303
14809
  });
14304
14810
  }
14305
14811
  // @__NO_SIDE_EFFECTS__
14812
+ function _iban(Class2, params) {
14813
+ return new Class2({
14814
+ type: "string",
14815
+ format: "iban",
14816
+ check: "string_format",
14817
+ abort: false,
14818
+ ...normalizeParams(params)
14819
+ });
14820
+ }
14821
+ // @__NO_SIDE_EFFECTS__
14306
14822
  function _jwt(Class2, params) {
14307
14823
  return new Class2({
14308
14824
  type: "string",
@@ -14361,20 +14877,11 @@ function _isoDuration(Class2, params) {
14361
14877
  }
14362
14878
  // @__NO_SIDE_EFFECTS__
14363
14879
  function _number(Class2, params) {
14364
- return new Class2({
14365
- type: "number",
14366
- checks: [],
14367
- ...normalizeParams(params)
14368
- });
14880
+ return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
14369
14881
  }
14370
14882
  // @__NO_SIDE_EFFECTS__
14371
14883
  function _coercedNumber(Class2, params) {
14372
- return new Class2({
14373
- type: "number",
14374
- coerce: true,
14375
- checks: [],
14376
- ...normalizeParams(params)
14377
- });
14884
+ return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
14378
14885
  }
14379
14886
  // @__NO_SIDE_EFFECTS__
14380
14887
  function _int(Class2, params) {
@@ -14716,8 +15223,12 @@ function _property(property, schema, params) {
14716
15223
  });
14717
15224
  }
14718
15225
  // @__NO_SIDE_EFFECTS__
14719
- function _properties(shape) {
14720
- return Object.entries(shape).map(([property, schema]) => new $ZodCheckProperty({ check: "property", property, schema }));
15226
+ function _properties(shape, params) {
15227
+ return new $ZodCheckProperties({
15228
+ check: "properties",
15229
+ shape,
15230
+ ...normalizeParams(params)
15231
+ });
14721
15232
  }
14722
15233
  // @__NO_SIDE_EFFECTS__
14723
15234
  function _mime(types, params) {
@@ -15154,7 +15665,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
15154
15665
  Object.assign(json2, result);
15155
15666
  return true;
15156
15667
  }
15157
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
15668
+ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
15158
15669
  var _a3;
15159
15670
  const def = schema._zod.def;
15160
15671
  const seen = ctx.seen.get(schema);
@@ -15193,7 +15704,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
15193
15704
  if (parent) {
15194
15705
  if (!result.ref)
15195
15706
  result.ref = parent;
15196
- process2(parent, ctx, params);
15707
+ processSchema(parent, ctx, params);
15197
15708
  ctx.seen.get(parent).isParent = true;
15198
15709
  }
15199
15710
  }
@@ -15300,7 +15811,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15300
15811
  if (seen.count > 1) {
15301
15812
  if (ctx.reused === "ref") {
15302
15813
  extractToDef(entry);
15303
- continue;
15304
15814
  }
15305
15815
  }
15306
15816
  }
@@ -15628,19 +16138,107 @@ function isTransforming(_schema, _ctx) {
15628
16138
  }
15629
16139
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
15630
16140
  const ctx = initializeContext({ ...params, processors });
15631
- process2(schema, ctx);
16141
+ processSchema(schema, ctx);
15632
16142
  extractDefs(ctx, schema);
15633
16143
  return finalize(ctx, schema);
15634
16144
  };
15635
16145
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
15636
16146
  const { libraryOptions, target } = params ?? {};
15637
16147
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
15638
- process2(schema, ctx);
16148
+ processSchema(schema, ctx);
15639
16149
  extractDefs(ctx, schema);
15640
16150
  return finalize(ctx, schema);
15641
16151
  };
15642
16152
 
15643
16153
  // node_modules/zod/v4/core/json-schema-processors.js
16154
+ var narrowMin = (agg, key, value) => {
16155
+ if (agg[key] === void 0 || value > agg[key])
16156
+ agg[key] = value;
16157
+ };
16158
+ var narrowMax = (agg, key, value) => {
16159
+ if (agg[key] === void 0 || value < agg[key])
16160
+ agg[key] = value;
16161
+ };
16162
+ var narrowBoth = (agg, value) => {
16163
+ narrowMin(agg, "minimum", value);
16164
+ narrowMax(agg, "maximum", value);
16165
+ };
16166
+ var addDivisor = (agg, value) => {
16167
+ agg.multipleOf ?? (agg.multipleOf = []);
16168
+ if (!agg.multipleOf.includes(value))
16169
+ agg.multipleOf.push(value);
16170
+ };
16171
+ var addPattern = (agg, pattern) => {
16172
+ agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
16173
+ agg.patterns.add(pattern);
16174
+ };
16175
+ var intersectMime = (agg, mime) => {
16176
+ agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
16177
+ };
16178
+ var setFormat = (agg, format) => {
16179
+ agg.format = format;
16180
+ if (format.includes("int"))
16181
+ agg.isInt = true;
16182
+ };
16183
+ var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
16184
+ var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
16185
+ var formatContributor = (ranges) => (agg, def) => {
16186
+ setFormat(agg, def.format);
16187
+ const [minimum, maximum] = ranges[def.format];
16188
+ narrowMin(agg, "minimum", minimum);
16189
+ narrowMax(agg, "maximum", maximum);
16190
+ };
16191
+ var contributors = {
16192
+ greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
16193
+ less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
16194
+ multiple_of: (agg, def) => addDivisor(agg, def.value),
16195
+ number_format: formatContributor(NUMBER_FORMAT_RANGES),
16196
+ bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
16197
+ min_length: minContributor,
16198
+ max_length: maxContributor,
16199
+ length_equals: (agg, def) => narrowBoth(agg, def.length),
16200
+ min_size: minContributor,
16201
+ max_size: maxContributor,
16202
+ size_equals: (agg, def) => narrowBoth(agg, def.size),
16203
+ string_format: (agg, def) => {
16204
+ setFormat(agg, def.format);
16205
+ if (def.pattern)
16206
+ addPattern(agg, def.pattern);
16207
+ if (def.format === "base64" || def.format === "base64url")
16208
+ agg.contentEncoding = def.format;
16209
+ if (def.local || def.precision === -1)
16210
+ agg.laxFormat = true;
16211
+ },
16212
+ mime_type: (agg, def) => intersectMime(agg, def.mime)
16213
+ };
16214
+ function aggregateChecks(schema) {
16215
+ const agg = {};
16216
+ const def = schema._zod.def;
16217
+ const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
16218
+ for (const ch of list)
16219
+ contributors[ch._zod.def.check]?.(agg, ch._zod.def);
16220
+ const bag = schema._zod.bag;
16221
+ if (bag.minimum !== void 0)
16222
+ narrowMin(agg, "minimum", bag.minimum);
16223
+ if (bag.exclusiveMinimum !== void 0)
16224
+ narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
16225
+ if (bag.maximum !== void 0)
16226
+ narrowMax(agg, "maximum", bag.maximum);
16227
+ if (bag.exclusiveMaximum !== void 0)
16228
+ narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
16229
+ if (bag.multipleOf !== void 0)
16230
+ addDivisor(agg, bag.multipleOf);
16231
+ if (bag.format !== void 0) {
16232
+ agg.format ?? (agg.format = bag.format);
16233
+ if (bag.format.includes("int"))
16234
+ agg.isInt = true;
16235
+ }
16236
+ if (bag.mime)
16237
+ intersectMime(agg, bag.mime);
16238
+ for (const pattern of bag.patterns ?? [])
16239
+ addPattern(agg, pattern);
16240
+ return agg;
16241
+ }
15644
16242
  var formatMap = {
15645
16243
  guid: "uuid",
15646
16244
  url: "uri",
@@ -15649,10 +16247,15 @@ var formatMap = {
15649
16247
  regex: ""
15650
16248
  // do not set
15651
16249
  };
16250
+ var exactPatterns = /* @__PURE__ */ new Map([
16251
+ [base64Charset, base64],
16252
+ [base64urlCharset, base64url]
16253
+ ]);
16254
+ var exactPattern = (p) => exactPatterns.get(p) ?? p;
15652
16255
  var stringProcessor = (schema, ctx, _json, _params) => {
15653
16256
  const json2 = _json;
15654
16257
  json2.type = "string";
15655
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
16258
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
15656
16259
  if (typeof minimum === "number")
15657
16260
  json2.minLength = minimum;
15658
16261
  if (typeof maximum === "number")
@@ -15668,7 +16271,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
15668
16271
  if (contentEncoding)
15669
16272
  json2.contentEncoding = contentEncoding;
15670
16273
  if (patterns && patterns.size > 0) {
15671
- const patternList = [...patterns];
16274
+ const patternList = [...patterns].map(exactPattern);
15672
16275
  if (patternList.length === 1)
15673
16276
  json2.pattern = patternList[0].source;
15674
16277
  else if (patternList.length > 1) {
@@ -15683,11 +16286,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
15683
16286
  };
15684
16287
  var numberProcessor = (schema, ctx, _json, params) => {
15685
16288
  const json2 = _json;
15686
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
15687
- if (typeof format === "string" && format.includes("int"))
15688
- json2.type = "integer";
15689
- else
15690
- json2.type = "number";
16289
+ const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
16290
+ json2.type = isInt ? "integer" : "number";
15691
16291
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
15692
16292
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
15693
16293
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -15711,11 +16311,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
15711
16311
  } else if (typeof maximum === "number") {
15712
16312
  json2.maximum = maximum;
15713
16313
  }
15714
- if (typeof multipleOf === "number") {
15715
- if (Number.isFinite(multipleOf) && multipleOf !== 0)
15716
- json2.multipleOf = Math.abs(multipleOf);
15717
- else
15718
- handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
16314
+ if (multipleOf) {
16315
+ const divisors = /* @__PURE__ */ new Set();
16316
+ for (const divisor of multipleOf) {
16317
+ if (Number.isFinite(divisor) && divisor !== 0)
16318
+ divisors.add(Math.abs(divisor));
16319
+ else
16320
+ handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
16321
+ }
16322
+ const [first, ...rest] = divisors;
16323
+ if (first !== void 0)
16324
+ json2.multipleOf = first;
16325
+ if (rest.length)
16326
+ json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
15719
16327
  }
15720
16328
  };
15721
16329
  var booleanProcessor = (_schema, _ctx, json2, _params) => {
@@ -15818,27 +16426,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
15818
16426
  };
15819
16427
  var fileProcessor = (schema, _ctx, json2, _params) => {
15820
16428
  const _json = json2;
15821
- const file2 = {
15822
- type: "string",
15823
- format: "binary",
15824
- contentEncoding: "binary"
15825
- };
15826
- const { minimum, maximum, mime } = schema._zod.bag;
16429
+ _json.type = "string";
16430
+ _json.format = "binary";
16431
+ _json.contentEncoding = "binary";
16432
+ const { minimum, maximum, mime } = aggregateChecks(schema);
15827
16433
  if (minimum !== void 0)
15828
- file2.minLength = minimum;
16434
+ _json.minLength = minimum;
15829
16435
  if (maximum !== void 0)
15830
- file2.maxLength = maximum;
15831
- if (mime) {
15832
- if (mime.length === 1) {
15833
- file2.contentMediaType = mime[0];
15834
- Object.assign(_json, file2);
15835
- } else {
15836
- Object.assign(_json, file2);
15837
- _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
15838
- }
15839
- } else {
15840
- Object.assign(_json, file2);
15841
- }
16436
+ _json.maxLength = maximum;
16437
+ if (!mime)
16438
+ return;
16439
+ if (mime.length === 0)
16440
+ _json.not = {};
16441
+ else if (mime.length === 1)
16442
+ _json.contentMediaType = mime[0];
16443
+ else
16444
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
15842
16445
  };
15843
16446
  var successProcessor = (_schema, _ctx, json2, _params) => {
15844
16447
  json2.type = "boolean";
@@ -15861,13 +16464,13 @@ var setProcessor = (schema, ctx, json2, params) => {
15861
16464
  var arrayProcessor = (schema, ctx, _json, params) => {
15862
16465
  const json2 = _json;
15863
16466
  const def = schema._zod.def;
15864
- const { minimum, maximum } = schema._zod.bag;
16467
+ const { minimum, maximum } = aggregateChecks(schema);
15865
16468
  if (typeof minimum === "number")
15866
16469
  json2.minItems = minimum;
15867
16470
  if (typeof maximum === "number")
15868
16471
  json2.maxItems = maximum;
15869
16472
  json2.type = "array";
15870
- json2.items = process2(def.element, ctx, {
16473
+ json2.items = processSchema(def.element, ctx, {
15871
16474
  ...params,
15872
16475
  path: [...params.path, "items"]
15873
16476
  });
@@ -15893,22 +16496,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
15893
16496
  json2.type = "object";
15894
16497
  json2.properties = {};
15895
16498
  for (const key in shape) {
15896
- assignProp(json2.properties, key, process2(shape[key], ctx, {
16499
+ assignProp(json2.properties, key, processSchema(shape[key], ctx, {
15897
16500
  ...params,
15898
16501
  path: [...params.path, "properties", key]
15899
16502
  }));
15900
16503
  }
15901
- const allKeys = new Set(Object.keys(shape));
15902
- const requiredKeys = new Set([...allKeys].filter((key) => {
16504
+ const requiredKeys = [];
16505
+ for (const key of Object.keys(shape)) {
15903
16506
  const field = def.shape[key];
15904
- if (ctx.io === "input") {
15905
- return inputOptin(field) === void 0;
15906
- } else {
15907
- return field._zod.optout === void 0;
16507
+ if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
16508
+ requiredKeys.push(key);
15908
16509
  }
15909
- }));
15910
- if (requiredKeys.size > 0) {
15911
- json2.required = Array.from(requiredKeys);
16510
+ }
16511
+ if (requiredKeys.length > 0) {
16512
+ json2.required = requiredKeys;
15912
16513
  }
15913
16514
  if (def.catchall?._zod.def.type === "never") {
15914
16515
  json2.additionalProperties = false;
@@ -15916,7 +16517,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
15916
16517
  if (ctx.io === "output")
15917
16518
  json2.additionalProperties = false;
15918
16519
  } else if (def.catchall) {
15919
- json2.additionalProperties = process2(def.catchall, ctx, {
16520
+ json2.additionalProperties = processSchema(def.catchall, ctx, {
15920
16521
  ...params,
15921
16522
  path: [...params.path, "additionalProperties"]
15922
16523
  });
@@ -15925,7 +16526,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
15925
16526
  var unionProcessor = (schema, ctx, json2, params) => {
15926
16527
  const def = schema._zod.def;
15927
16528
  const isExclusive = def.inclusive === false;
15928
- const options = def.options.map((x, i) => process2(x, ctx, {
16529
+ const options = def.options.map((x, i) => processSchema(x, ctx, {
15929
16530
  ...params,
15930
16531
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
15931
16532
  }));
@@ -15937,11 +16538,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
15937
16538
  };
15938
16539
  var intersectionProcessor = (schema, ctx, json2, params) => {
15939
16540
  const def = schema._zod.def;
15940
- const a = process2(def.left, ctx, {
16541
+ const a = processSchema(def.left, ctx, {
15941
16542
  ...params,
15942
16543
  path: [...params.path, "allOf", 0]
15943
16544
  });
15944
- const b = process2(def.right, ctx, {
16545
+ const b = processSchema(def.right, ctx, {
15945
16546
  ...params,
15946
16547
  path: [...params.path, "allOf", 1]
15947
16548
  });
@@ -15959,11 +16560,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
15959
16560
  json2.type = "array";
15960
16561
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
15961
16562
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
15962
- const prefixItems = def.items.map((x, i) => process2(x, ctx, {
16563
+ const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
15963
16564
  ...params,
15964
16565
  path: [...params.path, prefixPath, i]
15965
16566
  }));
15966
- const rest = def.rest ? process2(def.rest, ctx, {
16567
+ const rest = def.rest ? processSchema(def.rest, ctx, {
15967
16568
  ...params,
15968
16569
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
15969
16570
  }) : null;
@@ -16011,7 +16612,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
16011
16612
  if (isClosed)
16012
16613
  json2.maxItems = maxItems;
16013
16614
  }
16014
- const { minimum, maximum } = schema._zod.bag;
16615
+ const { minimum, maximum } = aggregateChecks(schema);
16015
16616
  if (typeof minimum === "number")
16016
16617
  json2.minItems = minimum;
16017
16618
  if (typeof maximum === "number")
@@ -16085,20 +16686,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
16085
16686
  const def = schema._zod.def;
16086
16687
  json2.type = "object";
16087
16688
  const keyType = def.keyType;
16088
- const keyBag = keyType._zod.bag;
16089
- const patterns = keyBag?.patterns;
16689
+ const patterns = aggregateChecks(keyType).patterns;
16090
16690
  if (def.mode === "loose" && patterns && patterns.size > 0) {
16091
- const valueSchema = process2(def.valueType, ctx, {
16691
+ const valueSchema = processSchema(def.valueType, ctx, {
16092
16692
  ...params,
16093
16693
  path: [...params.path, "patternProperties", "*"]
16094
16694
  });
16095
16695
  json2.patternProperties = {};
16096
16696
  for (const pattern of patterns) {
16097
- assignProp(json2.patternProperties, pattern.source, valueSchema);
16697
+ assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
16098
16698
  }
16099
16699
  } else {
16100
16700
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
16101
- json2.propertyNames = process2(def.keyType, ctx, {
16701
+ json2.propertyNames = processSchema(def.keyType, ctx, {
16102
16702
  ...params,
16103
16703
  path: [...params.path, "propertyNames"]
16104
16704
  });
@@ -16110,7 +16710,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
16110
16710
  }
16111
16711
  pending.push(schema);
16112
16712
  }
16113
- json2.additionalProperties = process2(def.valueType, ctx, {
16713
+ json2.additionalProperties = processSchema(def.valueType, ctx, {
16114
16714
  ...params,
16115
16715
  path: [...params.path, "additionalProperties"]
16116
16716
  });
@@ -16126,7 +16726,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
16126
16726
  };
16127
16727
  var nullableProcessor = (schema, ctx, json2, params) => {
16128
16728
  const def = schema._zod.def;
16129
- const inner = process2(def.innerType, ctx, params);
16729
+ const inner = processSchema(def.innerType, ctx, params);
16130
16730
  const seen = ctx.seen.get(schema);
16131
16731
  if (ctx.target === "openapi-3.0") {
16132
16732
  seen.ref = def.innerType;
@@ -16137,7 +16737,7 @@ var nullableProcessor = (schema, ctx, json2, params) => {
16137
16737
  };
16138
16738
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
16139
16739
  const def = schema._zod.def;
16140
- process2(def.innerType, ctx, params);
16740
+ processSchema(def.innerType, ctx, params);
16141
16741
  const seen = ctx.seen.get(schema);
16142
16742
  seen.ref = def.innerType;
16143
16743
  };
@@ -16157,7 +16757,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
16157
16757
  }
16158
16758
  var defaultProcessor = (schema, ctx, json2, params) => {
16159
16759
  const def = schema._zod.def;
16160
- process2(def.innerType, ctx, params);
16760
+ processSchema(def.innerType, ctx, params);
16161
16761
  const seen = ctx.seen.get(schema);
16162
16762
  seen.ref = def.innerType;
16163
16763
  const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
@@ -16166,7 +16766,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
16166
16766
  };
16167
16767
  var prefaultProcessor = (schema, ctx, json2, params) => {
16168
16768
  const def = schema._zod.def;
16169
- process2(def.innerType, ctx, params);
16769
+ processSchema(def.innerType, ctx, params);
16170
16770
  const seen = ctx.seen.get(schema);
16171
16771
  seen.ref = def.innerType;
16172
16772
  if (ctx.io !== "input")
@@ -16177,7 +16777,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
16177
16777
  };
16178
16778
  var catchProcessor = (schema, ctx, json2, params) => {
16179
16779
  const def = schema._zod.def;
16180
- process2(def.innerType, ctx, params);
16780
+ processSchema(def.innerType, ctx, params);
16181
16781
  const seen = ctx.seen.get(schema);
16182
16782
  seen.ref = def.innerType;
16183
16783
  let catchValue;
@@ -16193,32 +16793,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
16193
16793
  const def = schema._zod.def;
16194
16794
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
16195
16795
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
16196
- process2(innerType, ctx, params);
16796
+ processSchema(innerType, ctx, params);
16197
16797
  const seen = ctx.seen.get(schema);
16198
16798
  seen.ref = innerType;
16199
16799
  };
16200
16800
  var readonlyProcessor = (schema, ctx, json2, params) => {
16201
16801
  const def = schema._zod.def;
16202
- process2(def.innerType, ctx, params);
16802
+ processSchema(def.innerType, ctx, params);
16203
16803
  const seen = ctx.seen.get(schema);
16204
16804
  seen.ref = def.innerType;
16205
16805
  json2.readOnly = true;
16206
16806
  };
16207
16807
  var promiseProcessor = (schema, ctx, _json, params) => {
16208
16808
  const def = schema._zod.def;
16209
- process2(def.innerType, ctx, params);
16809
+ processSchema(def.innerType, ctx, params);
16210
16810
  const seen = ctx.seen.get(schema);
16211
16811
  seen.ref = def.innerType;
16212
16812
  };
16213
16813
  var optionalProcessor = (schema, ctx, _json, params) => {
16214
16814
  const def = schema._zod.def;
16215
- process2(def.innerType, ctx, params);
16815
+ processSchema(def.innerType, ctx, params);
16216
16816
  const seen = ctx.seen.get(schema);
16217
16817
  seen.ref = def.innerType;
16218
16818
  };
16219
16819
  var lazyProcessor = (schema, ctx, _json, params) => {
16220
16820
  const innerType = schema._zod.innerType;
16221
- process2(innerType, ctx, params);
16821
+ processSchema(innerType, ctx, params);
16222
16822
  const seen = ctx.seen.get(schema);
16223
16823
  seen.ref = innerType;
16224
16824
  };
@@ -16270,7 +16870,7 @@ function toJSONSchema(input2, params) {
16270
16870
  const defs = {};
16271
16871
  for (const entry of registry2._idmap.entries()) {
16272
16872
  const [_, schema] = entry;
16273
- process2(schema, ctx2);
16873
+ processSchema(schema, ctx2);
16274
16874
  }
16275
16875
  const schemas = {};
16276
16876
  const external = {
@@ -16293,7 +16893,7 @@ function toJSONSchema(input2, params) {
16293
16893
  return { schemas };
16294
16894
  }
16295
16895
  const ctx = initializeContext({ ...params, processors: allProcessors });
16296
- process2(input2, ctx);
16896
+ processSchema(input2, ctx);
16297
16897
  extractDefs(ctx, input2);
16298
16898
  return finalize(ctx, input2);
16299
16899
  }
@@ -16352,7 +16952,7 @@ var JSONSchemaGenerator = class {
16352
16952
  * This must be called before emit().
16353
16953
  */
16354
16954
  process(schema, _params = { path: [], schemaPath: [] }) {
16355
- return process2(schema, this.ctx, _params);
16955
+ return processSchema(schema, this.ctx, _params);
16356
16956
  }
16357
16957
  /**
16358
16958
  * Emit the final JSON Schema after processing.
@@ -16409,12 +17009,14 @@ __export(schemas_exports2, {
16409
17009
  ZodFile: () => ZodFile,
16410
17010
  ZodFunction: () => ZodFunction,
16411
17011
  ZodGUID: () => ZodGUID,
17012
+ ZodIBAN: () => ZodIBAN,
16412
17013
  ZodIPv4: () => ZodIPv4,
16413
17014
  ZodIPv6: () => ZodIPv6,
16414
17015
  ZodISODate: () => ZodISODate,
16415
17016
  ZodISODateTime: () => ZodISODateTime,
16416
17017
  ZodISODuration: () => ZodISODuration,
16417
17018
  ZodISOTime: () => ZodISOTime,
17019
+ ZodInstanceOf: () => ZodInstanceOf,
16418
17020
  ZodIntersection: () => ZodIntersection,
16419
17021
  ZodJWT: () => ZodJWT,
16420
17022
  ZodKSUID: () => ZodKSUID,
@@ -16473,6 +17075,7 @@ __export(schemas_exports2, {
16473
17075
  creditCard: () => creditCard2,
16474
17076
  cuid: () => cuid3,
16475
17077
  cuid2: () => cuid22,
17078
+ currencyCode: () => currencyCode2,
16476
17079
  custom: () => custom,
16477
17080
  date: () => date2,
16478
17081
  describe: () => describe2,
@@ -16491,6 +17094,7 @@ __export(schemas_exports2, {
16491
17094
  hex: () => hex2,
16492
17095
  hostname: () => hostname2,
16493
17096
  httpUrl: () => httpUrl,
17097
+ iban: () => iban2,
16494
17098
  instanceof: () => _instanceof,
16495
17099
  int: () => int,
16496
17100
  int32: () => int32,
@@ -16793,6 +17397,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
16793
17397
  set spa(value) {
16794
17398
  util_exports.own(this, "spa", value);
16795
17399
  },
17400
+ validate(data, params) {
17401
+ return validate(this, data, params);
17402
+ },
17403
+ validateAsync(data, params) {
17404
+ return validateAsync(this, data, params);
17405
+ },
16796
17406
  encode: function _encode2(data, params) {
16797
17407
  return encode2(this, data, params, { callee: _encode2 });
16798
17408
  },
@@ -16829,61 +17439,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
16829
17439
  return this._zod.def;
16830
17440
  }
16831
17441
  });
16832
- var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
16833
- $ZodString.init(inst, def);
16834
- ZodType.init(inst, def);
16835
- inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
16836
- const bag = inst._zod.bag;
16837
- inst.format = bag.format ?? null;
16838
- inst.minLength = bag.minimum ?? null;
16839
- inst.maxLength = bag.maximum ?? null;
16840
- }, {
16841
- regex(...args) {
16842
- return this.check(_regex(...args));
16843
- },
16844
- includes(...args) {
16845
- return this.check(_includes(...args));
16846
- },
16847
- startsWith(...args) {
16848
- return this.check(_startsWith(...args));
16849
- },
16850
- endsWith(...args) {
16851
- return this.check(_endsWith(...args));
16852
- },
16853
- min(...args) {
16854
- return this.check(_minLength(...args));
16855
- },
16856
- max(...args) {
16857
- return this.check(_maxLength(...args));
16858
- },
16859
- length(...args) {
16860
- return this.check(_length(...args));
16861
- },
16862
- nonempty(...args) {
16863
- return this.check(_minLength(1, ...args));
16864
- },
16865
- lowercase(params) {
16866
- return this.check(_lowercase(params));
16867
- },
16868
- uppercase(params) {
16869
- return this.check(_uppercase(params));
17442
+ var _ZodString = /* @__PURE__ */ $constructor(
17443
+ "_ZodString",
17444
+ (inst, def) => {
17445
+ $ZodString.init(inst, def);
17446
+ ZodType.init(inst, def);
17447
+ inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
16870
17448
  },
16871
- trim() {
16872
- return this.check(_trim());
16873
- },
16874
- normalize(...args) {
16875
- return this.check(_normalize(...args));
16876
- },
16877
- toLowerCase() {
16878
- return this.check(_toLowerCase());
16879
- },
16880
- toUpperCase() {
16881
- return this.check(_toUpperCase());
16882
- },
16883
- slugify() {
16884
- return this.check(_slugify());
16885
- }
16886
- });
17449
+ /* @__PURE__ */ util_exports.derived({
17450
+ format: (inst) => aggregateChecks(inst).format ?? null,
17451
+ minLength: (inst) => aggregateChecks(inst).minimum ?? null,
17452
+ maxLength: (inst) => aggregateChecks(inst).maximum ?? null
17453
+ }, {
17454
+ regex(...args) {
17455
+ return this.check(_regex(...args));
17456
+ },
17457
+ includes(...args) {
17458
+ return this.check(_includes(...args));
17459
+ },
17460
+ startsWith(...args) {
17461
+ return this.check(_startsWith(...args));
17462
+ },
17463
+ endsWith(...args) {
17464
+ return this.check(_endsWith(...args));
17465
+ },
17466
+ min(...args) {
17467
+ return this.check(_minLength(...args));
17468
+ },
17469
+ max(...args) {
17470
+ return this.check(_maxLength(...args));
17471
+ },
17472
+ length(...args) {
17473
+ return this.check(_length(...args));
17474
+ },
17475
+ nonempty(...args) {
17476
+ return this.check(_minLength(1, ...args));
17477
+ },
17478
+ lowercase(params) {
17479
+ return this.check(_lowercase(params));
17480
+ },
17481
+ uppercase(params) {
17482
+ return this.check(_uppercase(params));
17483
+ },
17484
+ trim() {
17485
+ return this.check(_trim());
17486
+ },
17487
+ normalize(...args) {
17488
+ return this.check(_normalize(...args));
17489
+ },
17490
+ toLowerCase() {
17491
+ return this.check(_toLowerCase());
17492
+ },
17493
+ toUpperCase() {
17494
+ return this.check(_toUpperCase());
17495
+ },
17496
+ slugify() {
17497
+ return this.check(_slugify());
17498
+ }
17499
+ })
17500
+ );
16887
17501
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
16888
17502
  $ZodString.init(inst, def);
16889
17503
  _ZodString.init(inst, def);
@@ -17029,8 +17643,8 @@ function url(params) {
17029
17643
  }
17030
17644
  function httpUrl(params) {
17031
17645
  return _url(ZodURL, {
17032
- protocol: regexes_exports.httpProtocol,
17033
- hostname: regexes_exports.domain,
17646
+ protocol: httpProtocol,
17647
+ hostname: domain,
17034
17648
  ...util_exports.normalizeParams(params)
17035
17649
  });
17036
17650
  }
@@ -17146,6 +17760,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
17146
17760
  function creditCard2(params) {
17147
17761
  return _creditCard(ZodCreditCard, params);
17148
17762
  }
17763
+ var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
17764
+ $ZodIBAN.init(inst, def);
17765
+ ZodStringFormat.init(inst, def);
17766
+ });
17767
+ function iban2(params) {
17768
+ return _iban(ZodIBAN, params);
17769
+ }
17149
17770
  var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
17150
17771
  $ZodJWT.init(inst, def);
17151
17772
  ZodStringFormat.init(inst, def);
@@ -17161,10 +17782,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
17161
17782
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
17162
17783
  }
17163
17784
  function hostname2(_params) {
17164
- return _stringFormat(ZodCustomStringFormat, "hostname", regexes_exports.hostname, _params);
17785
+ return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
17165
17786
  }
17166
17787
  function hex2(_params) {
17167
- return _stringFormat(ZodCustomStringFormat, "hex", regexes_exports.hex, _params);
17788
+ return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
17789
+ }
17790
+ function currencyCode2(_params) {
17791
+ return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
17168
17792
  }
17169
17793
  function hash(alg, params) {
17170
17794
  const enc = params?.enc ?? "hex";
@@ -17174,63 +17798,76 @@ function hash(alg, params) {
17174
17798
  throw new Error(`Unrecognized hash format: ${format}`);
17175
17799
  return _stringFormat(ZodCustomStringFormat, format, regex, params);
17176
17800
  }
17177
- var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
17178
- $ZodNumber.init(inst, def);
17179
- ZodType.init(inst, def);
17180
- inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
17181
- const bag = inst._zod.bag;
17182
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
17183
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
17184
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
17185
- inst.isFinite = true;
17186
- inst.format = bag.format ?? null;
17187
- }, {
17188
- gt(value, params) {
17189
- return this.check(_gt(value, params));
17190
- },
17191
- gte(value, params) {
17192
- return this.check(_gte(value, params));
17193
- },
17194
- min(value, params) {
17195
- return this.check(_gte(value, params));
17196
- },
17197
- lt(value, params) {
17198
- return this.check(_lt(value, params));
17199
- },
17200
- lte(value, params) {
17201
- return this.check(_lte(value, params));
17202
- },
17203
- max(value, params) {
17204
- return this.check(_lte(value, params));
17205
- },
17206
- int(params) {
17207
- return this.check(int(params));
17208
- },
17209
- safe(params) {
17210
- return this.check(int(params));
17211
- },
17212
- positive(params) {
17213
- return this.check(_gt(0, params));
17214
- },
17215
- nonnegative(params) {
17216
- return this.check(_gte(0, params));
17217
- },
17218
- negative(params) {
17219
- return this.check(_lt(0, params));
17220
- },
17221
- nonpositive(params) {
17222
- return this.check(_lte(0, params));
17223
- },
17224
- multipleOf(value, params) {
17225
- return this.check(_multipleOf(value, params));
17801
+ var ZodNumber = /* @__PURE__ */ $constructor(
17802
+ "ZodNumber",
17803
+ (inst, def) => {
17804
+ $ZodNumber.init(inst, def);
17805
+ ZodType.init(inst, def);
17806
+ inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
17807
+ inst.isFinite = true;
17226
17808
  },
17227
- step(value, params) {
17228
- return this.check(_multipleOf(value, params));
17229
- },
17230
- finite() {
17231
- return this;
17232
- }
17233
- });
17809
+ /* @__PURE__ */ util_exports.derived({
17810
+ minValue: (inst) => {
17811
+ const { minimum, exclusiveMinimum } = aggregateChecks(inst);
17812
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
17813
+ },
17814
+ maxValue: (inst) => {
17815
+ const { maximum, exclusiveMaximum } = aggregateChecks(inst);
17816
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
17817
+ },
17818
+ isInt: (inst) => {
17819
+ const { isInt, multipleOf } = aggregateChecks(inst);
17820
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
17821
+ },
17822
+ format: (inst) => aggregateChecks(inst).format ?? null
17823
+ }, {
17824
+ gt(value, params) {
17825
+ return this.check(_gt(value, params));
17826
+ },
17827
+ gte(value, params) {
17828
+ return this.check(_gte(value, params));
17829
+ },
17830
+ min(value, params) {
17831
+ return this.check(_gte(value, params));
17832
+ },
17833
+ lt(value, params) {
17834
+ return this.check(_lt(value, params));
17835
+ },
17836
+ lte(value, params) {
17837
+ return this.check(_lte(value, params));
17838
+ },
17839
+ max(value, params) {
17840
+ return this.check(_lte(value, params));
17841
+ },
17842
+ int(params) {
17843
+ return this.check(int(params));
17844
+ },
17845
+ safe(params) {
17846
+ return this.check(int(params));
17847
+ },
17848
+ positive(params) {
17849
+ return this.check(_gt(0, params));
17850
+ },
17851
+ nonnegative(params) {
17852
+ return this.check(_gte(0, params));
17853
+ },
17854
+ negative(params) {
17855
+ return this.check(_lt(0, params));
17856
+ },
17857
+ nonpositive(params) {
17858
+ return this.check(_lte(0, params));
17859
+ },
17860
+ multipleOf(value, params) {
17861
+ return this.check(_multipleOf(value, params));
17862
+ },
17863
+ step(value, params) {
17864
+ return this.check(_multipleOf(value, params));
17865
+ },
17866
+ finite() {
17867
+ return this;
17868
+ }
17869
+ })
17870
+ );
17234
17871
  function number2(params) {
17235
17872
  return _number(ZodNumber, params);
17236
17873
  }
@@ -17261,49 +17898,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
17261
17898
  function boolean2(params) {
17262
17899
  return _boolean(ZodBoolean, params);
17263
17900
  }
17264
- var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
17265
- $ZodBigInt.init(inst, def);
17266
- ZodType.init(inst, def);
17267
- inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
17268
- const bag = inst._zod.bag;
17269
- inst.minValue = bag.minimum ?? null;
17270
- inst.maxValue = bag.maximum ?? null;
17271
- inst.format = bag.format ?? null;
17272
- }, {
17273
- gte(value, params) {
17274
- return this.check(_gte(value, params));
17275
- },
17276
- min(value, params) {
17277
- return this.check(_gte(value, params));
17901
+ var ZodBigInt = /* @__PURE__ */ $constructor(
17902
+ "ZodBigInt",
17903
+ (inst, def) => {
17904
+ $ZodBigInt.init(inst, def);
17905
+ ZodType.init(inst, def);
17906
+ inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
17278
17907
  },
17279
- gt(value, params) {
17280
- return this.check(_gt(value, params));
17281
- },
17282
- lt(value, params) {
17283
- return this.check(_lt(value, params));
17284
- },
17285
- lte(value, params) {
17286
- return this.check(_lte(value, params));
17287
- },
17288
- max(value, params) {
17289
- return this.check(_lte(value, params));
17290
- },
17291
- positive(params) {
17292
- return this.check(_gt(BigInt(0), params));
17293
- },
17294
- negative(params) {
17295
- return this.check(_lt(BigInt(0), params));
17296
- },
17297
- nonpositive(params) {
17298
- return this.check(_lte(BigInt(0), params));
17299
- },
17300
- nonnegative(params) {
17301
- return this.check(_gte(BigInt(0), params));
17302
- },
17303
- multipleOf(value, params) {
17304
- return this.check(_multipleOf(value, params));
17305
- }
17306
- });
17908
+ /* @__PURE__ */ util_exports.derived({
17909
+ minValue: (inst) => aggregateChecks(inst).minimum ?? null,
17910
+ maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
17911
+ format: (inst) => aggregateChecks(inst).format ?? null
17912
+ }, {
17913
+ gte(value, params) {
17914
+ return this.check(_gte(value, params));
17915
+ },
17916
+ min(value, params) {
17917
+ return this.check(_gte(value, params));
17918
+ },
17919
+ gt(value, params) {
17920
+ return this.check(_gt(value, params));
17921
+ },
17922
+ lt(value, params) {
17923
+ return this.check(_lt(value, params));
17924
+ },
17925
+ lte(value, params) {
17926
+ return this.check(_lte(value, params));
17927
+ },
17928
+ max(value, params) {
17929
+ return this.check(_lte(value, params));
17930
+ },
17931
+ positive(params) {
17932
+ return this.check(_gt(BigInt(0), params));
17933
+ },
17934
+ negative(params) {
17935
+ return this.check(_lt(BigInt(0), params));
17936
+ },
17937
+ nonpositive(params) {
17938
+ return this.check(_lte(BigInt(0), params));
17939
+ },
17940
+ nonnegative(params) {
17941
+ return this.check(_gte(BigInt(0), params));
17942
+ },
17943
+ multipleOf(value, params) {
17944
+ return this.check(_multipleOf(value, params));
17945
+ }
17946
+ })
17947
+ );
17307
17948
  function bigint2(params) {
17308
17949
  return _bigint(ZodBigInt, params);
17309
17950
  }
@@ -17373,16 +18014,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
17373
18014
  function _void2(params) {
17374
18015
  return _void(ZodVoid, params);
17375
18016
  }
17376
- var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
17377
- $ZodDate.init(inst, def);
17378
- ZodType.init(inst, def);
17379
- inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
17380
- inst.min = (value, params) => inst.check(_gte(value, params));
17381
- inst.max = (value, params) => inst.check(_lte(value, params));
17382
- const c = inst._zod.bag;
17383
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
17384
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
17385
- });
18017
+ var ZodDate = /* @__PURE__ */ $constructor(
18018
+ "ZodDate",
18019
+ (inst, def) => {
18020
+ $ZodDate.init(inst, def);
18021
+ ZodType.init(inst, def);
18022
+ inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
18023
+ inst.min = (value, params) => inst.check(_gte(value, params));
18024
+ inst.max = (value, params) => inst.check(_lte(value, params));
18025
+ },
18026
+ /* @__PURE__ */ util_exports.derived({
18027
+ minDate: (inst) => {
18028
+ const { minimum } = aggregateChecks(inst);
18029
+ return minimum ? new Date(minimum) : null;
18030
+ },
18031
+ maxDate: (inst) => {
18032
+ const { maximum } = aggregateChecks(inst);
18033
+ return maximum ? new Date(maximum) : null;
18034
+ }
18035
+ }, {})
18036
+ );
17386
18037
  function date2(params) {
17387
18038
  return _date(ZodDate, params);
17388
18039
  }
@@ -17427,19 +18078,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
17427
18078
  return _enum2(Object.keys(this._zod.def.shape));
17428
18079
  },
17429
18080
  catchall(catchall) {
17430
- return this.clone({ ...this._zod.def, catchall });
18081
+ return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
17431
18082
  },
17432
18083
  passthrough() {
17433
- return this.clone({ ...this._zod.def, catchall: unknown() });
18084
+ return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
17434
18085
  },
17435
18086
  loose() {
17436
- return this.clone({ ...this._zod.def, catchall: unknown() });
18087
+ return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
17437
18088
  },
17438
18089
  strict() {
17439
- return this.clone({ ...this._zod.def, catchall: never() });
18090
+ return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
17440
18091
  },
17441
18092
  strip() {
17442
- return this.clone({ ...this._zod.def, catchall: void 0 });
18093
+ return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
17443
18094
  },
17444
18095
  extend(incoming) {
17445
18096
  return util_exports.extend(this, incoming);
@@ -17658,7 +18309,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
17658
18309
  ZodType.init(inst, def);
17659
18310
  inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
17660
18311
  inst.enum = def.entries;
17661
- inst.options = Object.values(def.entries);
18312
+ inst.options = [...inst._zod.values];
17662
18313
  const keys = new Set(Object.keys(def.entries));
17663
18314
  inst.extract = (values, params) => {
17664
18315
  const newEntries = {};
@@ -18021,8 +18672,15 @@ function superRefine(fn, params) {
18021
18672
  }
18022
18673
  var describe2 = describe;
18023
18674
  var meta2 = meta;
18675
+ var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
18676
+ ZodCustom.init(inst, def);
18677
+ }, {
18678
+ properties(shape, params) {
18679
+ return this.check(_properties(shape, params));
18680
+ }
18681
+ });
18024
18682
  function _instanceof(cls, params = {}) {
18025
- const inst = new ZodCustom({
18683
+ const inst = new ZodInstanceOf({
18026
18684
  type: "custom",
18027
18685
  check: "custom",
18028
18686
  fn: (data) => data instanceof cls,
@@ -18227,27 +18885,188 @@ function resolveRef(ref, ctx) {
18227
18885
  }
18228
18886
  throw new Error(`Reference not found: ${ref}`);
18229
18887
  }
18230
- function checkPropertyNames(objectSchema, keySchema) {
18888
+ function checkObjectGuards(objectSchema, guards) {
18231
18889
  const guard = z.transform((value) => value).check((payload) => {
18232
18890
  const value = payload.value;
18233
18891
  if (typeof value !== "object" || value === null || Array.isArray(value))
18234
18892
  return;
18235
- for (const key of Object.getOwnPropertyNames(value)) {
18236
- const result = keySchema.safeParse(key);
18237
- if (result.success)
18238
- continue;
18893
+ const keys = Object.getOwnPropertyNames(value);
18894
+ if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
18239
18895
  payload.issues.push({
18240
- code: "invalid_key",
18241
- origin: "record",
18242
- issues: result.error.issues,
18243
- input: key,
18244
- path: [key],
18896
+ origin: "object",
18897
+ code: "too_small",
18898
+ minimum: guards.minProperties,
18899
+ inclusive: true,
18900
+ message: `Too small: expected object to have >=${guards.minProperties} properties`,
18901
+ input: value,
18902
+ inst: objectSchema,
18903
+ continue: true
18904
+ });
18905
+ }
18906
+ if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
18907
+ payload.issues.push({
18908
+ origin: "object",
18909
+ code: "too_big",
18910
+ maximum: guards.maxProperties,
18911
+ inclusive: true,
18912
+ message: `Too big: expected object to have <=${guards.maxProperties} properties`,
18913
+ input: value,
18914
+ inst: objectSchema,
18245
18915
  continue: true
18246
18916
  });
18247
18917
  }
18918
+ if (guards.keySchema) {
18919
+ for (const key of keys) {
18920
+ const result = guards.keySchema.safeParse(key);
18921
+ if (result.success)
18922
+ continue;
18923
+ payload.issues.push({
18924
+ code: "invalid_key",
18925
+ origin: "record",
18926
+ issues: result.error.issues,
18927
+ input: key,
18928
+ path: [key],
18929
+ continue: true
18930
+ });
18931
+ }
18932
+ }
18248
18933
  });
18249
18934
  return guard.pipe(objectSchema);
18250
18935
  }
18936
+ function canonicalKey(value, seen) {
18937
+ if (value === null)
18938
+ return "z";
18939
+ const type = typeof value;
18940
+ if (type !== "object") {
18941
+ if (type === "number" && Number.isNaN(value))
18942
+ return null;
18943
+ const raw = String(value);
18944
+ return `${type[0]}${raw.length}:${raw}`;
18945
+ }
18946
+ if (seen.has(value))
18947
+ return null;
18948
+ seen.add(value);
18949
+ try {
18950
+ if (Array.isArray(value)) {
18951
+ const parts2 = [];
18952
+ for (const item of value) {
18953
+ const key = canonicalKey(item, seen);
18954
+ if (key === null)
18955
+ return null;
18956
+ parts2.push(key);
18957
+ }
18958
+ return `a${parts2.length}:[${parts2.join(",")}]`;
18959
+ }
18960
+ const keys = Object.keys(value).sort();
18961
+ const parts = [];
18962
+ for (const k of keys) {
18963
+ const key = canonicalKey(value[k], seen);
18964
+ if (key === null)
18965
+ return null;
18966
+ parts.push(`${k.length}:${k}=${key}`);
18967
+ }
18968
+ return `o${parts.length}:{${parts.join(",")}}`;
18969
+ } finally {
18970
+ seen.delete(value);
18971
+ }
18972
+ }
18973
+ var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
18974
+ "items",
18975
+ "prefixItems",
18976
+ "additionalItems",
18977
+ "additionalProperties",
18978
+ "contains",
18979
+ "propertyNames",
18980
+ "not",
18981
+ "if",
18982
+ "then",
18983
+ "else",
18984
+ "allOf",
18985
+ "anyOf",
18986
+ "oneOf",
18987
+ "unevaluatedItems",
18988
+ "unevaluatedProperties",
18989
+ "contentSchema"
18990
+ ]);
18991
+ var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
18992
+ "properties",
18993
+ "patternProperties",
18994
+ "dependentSchemas",
18995
+ "dependencies",
18996
+ "$defs",
18997
+ "definitions"
18998
+ ]);
18999
+ function containsRef(value) {
19000
+ if (typeof value !== "object" || value === null)
19001
+ return false;
19002
+ if (Array.isArray(value))
19003
+ return value.some(containsRef);
19004
+ if (typeof value.$ref === "string")
19005
+ return true;
19006
+ return Object.entries(value).some(([key, sub]) => {
19007
+ if (SCHEMA_KEYWORDS.has(key))
19008
+ return containsRef(sub);
19009
+ if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
19010
+ return false;
19011
+ return Object.values(sub).some(containsRef);
19012
+ });
19013
+ }
19014
+ function plural(n) {
19015
+ return n === 1 ? "element" : "elements";
19016
+ }
19017
+ function checkArrayGuards(arraySchema, guards) {
19018
+ const guard = z.transform((value) => value).check((payload) => {
19019
+ const items = payload.value;
19020
+ if (!Array.isArray(items))
19021
+ return;
19022
+ if (guards.uniqueItems === true) {
19023
+ const firstSeen = /* @__PURE__ */ new Map();
19024
+ for (let i = 0; i < items.length; i++) {
19025
+ const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
19026
+ if (key === null)
19027
+ continue;
19028
+ const first = firstSeen.get(key);
19029
+ if (first === void 0) {
19030
+ firstSeen.set(key, i);
19031
+ continue;
19032
+ }
19033
+ payload.issues.push({
19034
+ code: "custom",
19035
+ message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
19036
+ input: items,
19037
+ path: [i],
19038
+ continue: true
19039
+ });
19040
+ }
19041
+ }
19042
+ if (guards.containsSchema) {
19043
+ const minContains = guards.minContains ?? 1;
19044
+ const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
19045
+ let matches = 0;
19046
+ for (const item of items) {
19047
+ if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
19048
+ break;
19049
+ }
19050
+ if (matches < minContains) {
19051
+ payload.issues.push({
19052
+ code: "custom",
19053
+ message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
19054
+ input: items,
19055
+ continue: true
19056
+ });
19057
+ }
19058
+ if (guards.maxContains !== void 0 && matches > guards.maxContains) {
19059
+ payload.issues.push({
19060
+ code: "custom",
19061
+ message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
19062
+ input: items,
19063
+ continue: true
19064
+ });
19065
+ }
19066
+ }
19067
+ });
19068
+ return guard.pipe(arraySchema);
19069
+ }
18251
19070
  function getTupleRest(restSchema, ctx) {
18252
19071
  if (restSchema === false) {
18253
19072
  return void 0;
@@ -18377,6 +19196,8 @@ function convertBaseSchema(schema, ctx) {
18377
19196
  stringSchema = stringSchema.check(z.e164());
18378
19197
  } else if (format === "credit_card") {
18379
19198
  stringSchema = stringSchema.check(z.creditCard());
19199
+ } else if (format === "iban") {
19200
+ stringSchema = stringSchema.check(z.iban());
18380
19201
  } else if (format === "jwt") {
18381
19202
  stringSchema = stringSchema.check(z.jwt());
18382
19203
  } else if (format === "emoji") {
@@ -18509,9 +19330,16 @@ function convertBaseSchema(schema, ctx) {
18509
19330
  zodSchema = objectSchema.passthrough();
18510
19331
  }
18511
19332
  }
18512
- if (schema.propertyNames !== void 0 && schema.propertyNames !== true) {
18513
- const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
18514
- zodSchema = checkPropertyNames(zodSchema, convertSchema(keyJSONSchema, ctx));
19333
+ const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
19334
+ const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
19335
+ const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
19336
+ if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
19337
+ let keySchema;
19338
+ if (hasKeyGuard) {
19339
+ const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
19340
+ keySchema = convertSchema(keyJSONSchema, ctx);
19341
+ }
19342
+ zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
18515
19343
  }
18516
19344
  break;
18517
19345
  }
@@ -18557,6 +19385,14 @@ function convertBaseSchema(schema, ctx) {
18557
19385
  } else {
18558
19386
  zodSchema = z.array(z.any());
18559
19387
  }
19388
+ if (schema.uniqueItems === true || schema.contains !== void 0) {
19389
+ zodSchema = checkArrayGuards(zodSchema, {
19390
+ uniqueItems: schema.uniqueItems === true,
19391
+ containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
19392
+ minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
19393
+ maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
19394
+ });
19395
+ }
18560
19396
  break;
18561
19397
  }
18562
19398
  default:
@@ -18614,8 +19450,23 @@ function convertSchema(schema, ctx) {
18614
19450
  extraMeta[key] = schema[key];
18615
19451
  }
18616
19452
  }
18617
- if (schema.propertyNames !== void 0 && schema.type === "object" && schema.$ref === void 0) {
18618
- extraMeta.propertyNames = schema.propertyNames;
19453
+ if (schema.type === "object" && schema.$ref === void 0) {
19454
+ if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
19455
+ extraMeta.propertyNames = schema.propertyNames;
19456
+ }
19457
+ for (const key of ["minProperties", "maxProperties"]) {
19458
+ if (schema[key] !== void 0)
19459
+ extraMeta[key] = schema[key];
19460
+ }
19461
+ }
19462
+ if (schema.type === "array" && schema.$ref === void 0) {
19463
+ if (schema.contains !== void 0 && !containsRef(schema.contains)) {
19464
+ extraMeta.contains = schema.contains;
19465
+ }
19466
+ for (const key of ["uniqueItems", "minContains", "maxContains"]) {
19467
+ if (schema[key] !== void 0)
19468
+ extraMeta[key] = schema[key];
19469
+ }
18619
19470
  }
18620
19471
  for (const key of Object.keys(schema)) {
18621
19472
  if (!RECOGNIZED_KEYS.has(key)) {
@@ -18952,6 +19803,26 @@ var releaseRegistrationSchema = external_exports.object({
18952
19803
  deployment: deploymentSchema
18953
19804
  }).strict();
18954
19805
 
19806
+ // packages/protocol/src/event-metadata.ts
19807
+ var EVENT_METADATA_LIMITS = {
19808
+ userId: 128,
19809
+ tagName: 32,
19810
+ tagValue: 120,
19811
+ tags: 50,
19812
+ tagFilters: 5
19813
+ };
19814
+ var tagNameSchema = external_exports.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,31}$/).refine(
19815
+ (value) => !["constructor", "prototype", "__proto__"].includes(value)
19816
+ );
19817
+ var allowedTagsSchema = external_exports.array(tagNameSchema).max(EVENT_METADATA_LIMITS.tags).transform((values) => [...new Set(values)]);
19818
+ var END_USER_ID_PATTERN = /^[a-zA-Z0-9_-]+(?::[a-zA-Z0-9_-]+)?(?![\s\S])/;
19819
+ var endUserIdSchema = external_exports.string().max(EVENT_METADATA_LIMITS.userId).regex(END_USER_ID_PATTERN);
19820
+ var tagFilterSchema = external_exports.object({
19821
+ name: tagNameSchema,
19822
+ value: external_exports.string().max(EVENT_METADATA_LIMITS.tagValue),
19823
+ operator: external_exports.enum(["eq", "neq"]).optional()
19824
+ }).strict();
19825
+
18955
19826
  // packages/protocol/src/diagnostics.ts
18956
19827
  var API_REASONS = [
18957
19828
  "network_error",
@@ -19068,6 +19939,7 @@ var safeEventSchema = external_exports.object({
19068
19939
  message: external_exports.string().max(1024),
19069
19940
  exceptionType: external_exports.string().max(120),
19070
19941
  handled: external_exports.boolean(),
19942
+ endUserId: endUserIdSchema.optional(),
19071
19943
  environment: environmentNameSchema,
19072
19944
  release: external_exports.string().max(160).optional(),
19073
19945
  appVersion: appVersionSchema.optional(),
@@ -19076,7 +19948,7 @@ var safeEventSchema = external_exports.object({
19076
19948
  api: apiContextSchema.optional(),
19077
19949
  browser: browserContextSchema.optional(),
19078
19950
  frames: external_exports.array(safeFrameSchema).max(100),
19079
- tags: external_exports.record(external_exports.string().max(32), external_exports.string().max(120)),
19951
+ tags: external_exports.record(tagNameSchema, external_exports.string().max(EVENT_METADATA_LIMITS.tagValue)).refine((tags) => Object.keys(tags).length <= EVENT_METADATA_LIMITS.tags),
19080
19952
  breadcrumbs: external_exports.array(safeBreadcrumbSchema).max(50)
19081
19953
  }).strict();
19082
19954
 
@@ -19120,19 +19992,19 @@ var CliError = class extends Error {
19120
19992
  httpStatus;
19121
19993
  requestId;
19122
19994
  };
19123
- function formatDiagnostic(error61) {
19995
+ function formatDiagnostic(error62) {
19124
19996
  const safe = diagnosticSchema.safeParse({
19125
19997
  version: 1,
19126
- code: error61 instanceof CliError ? error61.code : "COMMAND_FAILED",
19127
- ...error61 instanceof CliError ? { httpStatus: error61.httpStatus, requestId: error61.requestId } : {}
19998
+ code: error62 instanceof CliError ? error62.code : "COMMAND_FAILED",
19999
+ ...error62 instanceof CliError ? { httpStatus: error62.httpStatus, requestId: error62.requestId } : {}
19128
20000
  });
19129
20001
  return `GETEXCEPTION_DIAGNOSTIC ${JSON.stringify(
19130
20002
  safe.success ? safe.data : { version: 1, code: "COMMAND_FAILED" }
19131
20003
  )}
19132
20004
  `;
19133
20005
  }
19134
- function networkError(error61, httpStatus) {
19135
- let current = error61;
20006
+ function networkError(error62, httpStatus) {
20007
+ let current = error62;
19136
20008
  for (let depth = 0; depth < 4 && current instanceof Error; depth++) {
19137
20009
  const candidate = current.code;
19138
20010
  const code = typeof candidate === "string" ? candidate : "";
@@ -19214,8 +20086,8 @@ async function responseJson(response) {
19214
20086
  }
19215
20087
  chunks.push(value);
19216
20088
  }
19217
- } catch (error61) {
19218
- throw error61 instanceof CliError ? error61 : networkError(error61, response.status);
20089
+ } catch (error62) {
20090
+ throw error62 instanceof CliError ? error62 : networkError(error62, response.status);
19219
20091
  } finally {
19220
20092
  reader.releaseLock();
19221
20093
  }
@@ -19258,13 +20130,13 @@ async function httpError(response) {
19258
20130
  }
19259
20131
 
19260
20132
  // packages/cli/src/api.ts
19261
- function retryableNetworkError(error61) {
20133
+ function retryableNetworkError(error62) {
19262
20134
  return [
19263
20135
  "NETWORK_DNS",
19264
20136
  "NETWORK_CONNECTION",
19265
20137
  "NETWORK_TIMEOUT",
19266
20138
  "NETWORK_ERROR"
19267
- ].includes(error61.code);
20139
+ ].includes(error62.code);
19268
20140
  }
19269
20141
  function projectApi(address, project, token, transport = fetch, options = {}) {
19270
20142
  let url2;
@@ -19310,9 +20182,9 @@ function projectApi(address, project, token, transport = fetch, options = {}) {
19310
20182
  ...options.signal ? [options.signal] : []
19311
20183
  ])
19312
20184
  });
19313
- } catch (error61) {
19314
- const failure = networkError(error61);
19315
- if (retryableNetworkError(failure) && attempt < 2) {
20185
+ } catch (error62) {
20186
+ const failure2 = networkError(error62);
20187
+ if (retryableNetworkError(failure2) && attempt < 2) {
19316
20188
  await delay(
19317
20189
  Math.min(1e3 * 2 ** attempt, Math.max(1, deadline - Date.now())),
19318
20190
  void 0,
@@ -19320,7 +20192,7 @@ function projectApi(address, project, token, transport = fetch, options = {}) {
19320
20192
  );
19321
20193
  continue;
19322
20194
  }
19323
- throw failure;
20195
+ throw failure2;
19324
20196
  }
19325
20197
  if (response.ok) {
19326
20198
  return responseJson(response);
@@ -19861,8 +20733,8 @@ function validateGitLabContext(value, env, options) {
19861
20733
  }
19862
20734
  return context;
19863
20735
  }
19864
- function safeDiagnostic(error61) {
19865
- return error61 instanceof CliError ? error61.code : "COMMAND_FAILED";
20736
+ function safeDiagnostic(error62) {
20737
+ return error62 instanceof CliError ? error62.code : "COMMAND_FAILED";
19866
20738
  }
19867
20739
  function report(result, environment, log) {
19868
20740
  const ok = result.maps === "ready" && result.registration !== "failed" && !result.cleanupFailed;
@@ -19936,9 +20808,9 @@ async function deployWithGetException(options) {
19936
20808
  setRuntimeEnv(response.release, response.deployment.environment);
19937
20809
  }
19938
20810
  result.maps = "release" in response && response.sourceMaps.enabled ? "incomplete" : "disabled";
19939
- } catch (error61) {
20811
+ } catch (error62) {
19940
20812
  result.maps = "failed";
19941
- result.diagnostic = safeDiagnostic(error61);
20813
+ result.diagnostic = safeDiagnostic(error62);
19942
20814
  }
19943
20815
  }
19944
20816
  await options.beforeBuild?.({ ...safeEnv });
@@ -19980,9 +20852,9 @@ async function deployWithGetException(options) {
19980
20852
  options.transport
19981
20853
  );
19982
20854
  result.registration = "registered";
19983
- } catch (error61) {
20855
+ } catch (error62) {
19984
20856
  result.registration = "failed";
19985
- result.diagnostic = safeDiagnostic(error61);
20857
+ result.diagnostic = safeDiagnostic(error62);
19986
20858
  }
19987
20859
  }
19988
20860
  if (mapsDirectory && credential) {
@@ -19997,14 +20869,14 @@ async function deployWithGetException(options) {
19997
20869
  credential,
19998
20870
  options.transport
19999
20871
  );
20000
- } catch (error61) {
20872
+ } catch (error62) {
20001
20873
  failed = true;
20002
- result.diagnostic = safeDiagnostic(error61);
20874
+ result.diagnostic = safeDiagnostic(error62);
20003
20875
  }
20004
20876
  }
20005
- } catch (error61) {
20877
+ } catch (error62) {
20006
20878
  failed = true;
20007
- result.diagnostic = safeDiagnostic(error61);
20879
+ result.diagnostic = safeDiagnostic(error62);
20008
20880
  }
20009
20881
  result.maps = failed ? "incomplete" : "ready";
20010
20882
  }
@@ -20058,9 +20930,9 @@ async function prepareSourceMaps(options) {
20058
20930
  release: options.release,
20059
20931
  buildId: options.buildId
20060
20932
  };
20061
- } catch (error61) {
20933
+ } catch (error62) {
20062
20934
  await rm3(output2, { recursive: true, force: true });
20063
- throw error61;
20935
+ throw error62;
20064
20936
  }
20065
20937
  }
20066
20938
  async function uploadSourceMaps(options, transport = fetch) {
@@ -20106,10 +20978,10 @@ async function uploadSourceMaps(options, transport = fetch) {
20106
20978
  );
20107
20979
  }
20108
20980
  return { status: "ready", batches: batches.length };
20109
- } catch (error61) {
20981
+ } catch (error62) {
20110
20982
  return {
20111
20983
  status: "unavailable",
20112
- diagnostic: formatDiagnostic(error61).trim()
20984
+ diagnostic: formatDiagnostic(error62).trim()
20113
20985
  };
20114
20986
  }
20115
20987
  }