@hasna/skills 0.10.5 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -622,36 +622,38 @@ var require_Alias = __commonJS((exports) => {
622
622
  if (node.anchor === this.source)
623
623
  found = node;
624
624
  }
625
+ if (found && ctx) {
626
+ const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
627
+ let data = anchors2.get(found);
628
+ if (!data) {
629
+ toJS.toJS(found, null, ctx);
630
+ data = anchors2.get(found);
631
+ }
632
+ if (data?.res === undefined) {
633
+ const msg = "This should not happen: Alias anchor was not resolved?";
634
+ throw new ReferenceError(msg);
635
+ }
636
+ if (maxAliasCount >= 0) {
637
+ data.count += 1;
638
+ if (data.aliasCount === 0)
639
+ data.aliasCount = getAliasCount(doc2, found, anchors2);
640
+ if (data.count * data.aliasCount > maxAliasCount) {
641
+ const msg = "Excessive alias count indicates a resource exhaustion attack";
642
+ throw new ReferenceError(msg);
643
+ }
644
+ }
645
+ }
625
646
  return found;
626
647
  }
627
648
  toJSON(_arg, ctx) {
628
649
  if (!ctx)
629
650
  return { source: this.source };
630
- const { anchors: anchors2, doc, maxAliasCount } = ctx;
631
- const source = this.resolve(doc, ctx);
651
+ const source = this.resolve(ctx.doc, ctx);
632
652
  if (!source) {
633
653
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
634
654
  throw new ReferenceError(msg);
635
655
  }
636
- let data = anchors2.get(source);
637
- if (!data) {
638
- toJS.toJS(source, null, ctx);
639
- data = anchors2.get(source);
640
- }
641
- if (data?.res === undefined) {
642
- const msg = "This should not happen: Alias anchor was not resolved?";
643
- throw new ReferenceError(msg);
644
- }
645
- if (maxAliasCount >= 0) {
646
- data.count += 1;
647
- if (data.aliasCount === 0)
648
- data.aliasCount = getAliasCount(doc, source, anchors2);
649
- if (data.count * data.aliasCount > maxAliasCount) {
650
- const msg = "Excessive alias count indicates a resource exhaustion attack";
651
- throw new ReferenceError(msg);
652
- }
653
- }
654
- return data.res;
656
+ return ctx.anchors.get(source).res;
655
657
  }
656
658
  toString(ctx, _onComment, _onChompKeep) {
657
659
  const src = `*${this.source}`;
@@ -4413,33 +4415,32 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4413
4415
  }
4414
4416
  if (badChar)
4415
4417
  onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
4416
- return foldLines(source);
4418
+ return unfoldLines(source);
4417
4419
  }
4418
4420
  function singleQuotedValue(source, onError) {
4419
4421
  if (source[source.length - 1] !== "'" || source.length === 1)
4420
4422
  onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
4421
- return foldLines(source.slice(1, -1)).replace(/''/g, "'");
4423
+ return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
4422
4424
  }
4423
- function foldLines(source) {
4424
- let first, line;
4425
+ function unfoldLines(source) {
4426
+ const line = /(.*?)\r?\n/sy;
4427
+ let match = line.exec(source);
4428
+ if (!match)
4429
+ return source;
4430
+ let trimEnd, trimBoth;
4425
4431
  try {
4426
- first = new RegExp(`(.*?)(?<![ ])[ ]*\r?
4427
- `, "sy");
4428
- line = new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
4429
- `, "sy");
4432
+ trimEnd = new RegExp("(?<![ \t])[ \t]+$");
4433
+ trimBoth = new RegExp("^[ \t]+|(?<![ \t])[ \t]+$", "g");
4430
4434
  } catch {
4431
- first = /(.*?)[ \t]*\r?\n/sy;
4432
- line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
4435
+ trimEnd = /[ \t]+$/;
4436
+ trimBoth = /^[ \t]+|[ \t]+$/g;
4433
4437
  }
4434
- let match = first.exec(source);
4435
- if (!match)
4436
- return source;
4437
- let res = match[1];
4438
+ let res = match[1].replace(trimEnd, "");
4438
4439
  let sep2 = " ";
4439
- let pos = first.lastIndex;
4440
- line.lastIndex = pos;
4440
+ let pos = line.lastIndex;
4441
4441
  while (match = line.exec(source)) {
4442
- if (match[1] === "") {
4442
+ const lm = match[1].replace(trimBoth, "");
4443
+ if (lm === "") {
4443
4444
  if (sep2 === `
4444
4445
  `)
4445
4446
  res += sep2;
@@ -4447,7 +4448,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4447
4448
  sep2 = `
4448
4449
  `;
4449
4450
  } else {
4450
- res += sep2 + match[1];
4451
+ res += sep2 + lm;
4451
4452
  sep2 = " ";
4452
4453
  }
4453
4454
  pos = line.lastIndex;
@@ -9611,7 +9612,7 @@ import { isAbsolute as isAbsolute11, join as join23, resolve as resolve11 } from
9611
9612
  // package.json
9612
9613
  var package_default = {
9613
9614
  name: "@hasna/skills",
9614
- version: "0.10.5",
9615
+ version: "0.10.6",
9615
9616
  description: "Skills library for AI coding agents",
9616
9617
  type: "module",
9617
9618
  bin: {
@@ -16867,6 +16868,7 @@ function captureDiscoveryPathSources(paths) {
16867
16868
  return paths.map((path) => ({ path, hashMode: "path-bytes", sha256: hashDiscoveryPathFile(path, budget) }));
16868
16869
  }
16869
16870
  function assertProjectDiscovery(agent, directories, home, canonical4 = resolve14, reviewed) {
16871
+ const homeConfigPath = canonical4(agentDiscoveryConfigPath(home, agent));
16870
16872
  for (const directory of directories) {
16871
16873
  const isHome = resolve14(directory) === resolve14(home);
16872
16874
  if (agent === "hermes") {
@@ -16880,7 +16882,8 @@ function assertProjectDiscovery(agent, directories, home, canonical4 = resolve14
16880
16882
  const path = canonical4(join26(directory, suffix)), raw = read2(path);
16881
16883
  if (raw === null)
16882
16884
  continue;
16883
- if (agent === "claude" && suffix === ".claude/settings.json" && path === canonical4(join26(home, suffix)))
16885
+ const isRootAliasedHomeConfig = agent === "claude" && suffix === ".claude/settings.json" || agent === "codex" && suffix === ".codex/config.toml";
16886
+ if (isRootAliasedHomeConfig && path === homeConfigPath)
16884
16887
  continue;
16885
16888
  if (suffix.endsWith(".jsonc"))
16886
16889
  throw new Error(`NATIVE_SKILL_DRIFT: project JSONC discovery configuration requires review: ${path}`);
@@ -18156,6 +18159,7 @@ var exports_external = {};
18156
18159
  __export(exports_external, {
18157
18160
  xor: () => xor,
18158
18161
  xid: () => xid2,
18162
+ withParser: () => withParser,
18159
18163
  void: () => _void2,
18160
18164
  validateAsync: () => validateAsync,
18161
18165
  validate: () => validate,
@@ -18267,6 +18271,7 @@ __export(exports_external, {
18267
18271
  instanceof: () => _instanceof,
18268
18272
  input: () => input,
18269
18273
  includes: () => _includes,
18274
+ iban: () => iban2,
18270
18275
  httpUrl: () => httpUrl,
18271
18276
  hostname: () => hostname3,
18272
18277
  hex: () => hex2,
@@ -18299,6 +18304,7 @@ __export(exports_external, {
18299
18304
  decode: () => decode2,
18300
18305
  date: () => date2,
18301
18306
  custom: () => custom,
18307
+ currencyCode: () => currencyCode2,
18302
18308
  cuid2: () => cuid22,
18303
18309
  cuid: () => cuid3,
18304
18310
  creditCard: () => creditCard2,
@@ -18364,12 +18370,14 @@ __export(exports_external, {
18364
18370
  ZodJWT: () => ZodJWT,
18365
18371
  ZodIssueCode: () => ZodIssueCode,
18366
18372
  ZodIntersection: () => ZodIntersection,
18373
+ ZodInstanceOf: () => ZodInstanceOf,
18367
18374
  ZodISOTime: () => ZodISOTime,
18368
18375
  ZodISODuration: () => ZodISODuration,
18369
18376
  ZodISODateTime: () => ZodISODateTime,
18370
18377
  ZodISODate: () => ZodISODate,
18371
18378
  ZodIPv6: () => ZodIPv6,
18372
18379
  ZodIPv4: () => ZodIPv4,
18380
+ ZodIBAN: () => ZodIBAN,
18373
18381
  ZodGUID: () => ZodGUID,
18374
18382
  ZodFunction: () => ZodFunction,
18375
18383
  ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
@@ -18403,6 +18411,7 @@ __export(exports_external, {
18403
18411
  ZodAny: () => ZodAny,
18404
18412
  TimePrecision: () => TimePrecision,
18405
18413
  NEVER: () => NEVER,
18414
+ INVALID: () => INVALID,
18406
18415
  $output: () => $output,
18407
18416
  $input: () => $input,
18408
18417
  $brand: () => $brand
@@ -18411,7 +18420,9 @@ __export(exports_external, {
18411
18420
  // node_modules/zod/v4/core/index.js
18412
18421
  var exports_core2 = {};
18413
18422
  __export(exports_core2, {
18423
+ withParser: () => withParser,
18414
18424
  version: () => version,
18425
+ validateURL: () => validateURL,
18415
18426
  validateAsync: () => validateAsync,
18416
18427
  validate: () => validate,
18417
18428
  util: () => exports_util,
@@ -18431,7 +18442,8 @@ __export(exports_core2, {
18431
18442
  safeDecode: () => safeDecode,
18432
18443
  registry: () => registry,
18433
18444
  regexes: () => exports_regexes,
18434
- process: () => process2,
18445
+ processSchema: () => processSchema,
18446
+ process: () => processSchema,
18435
18447
  prettifyError: () => prettifyError,
18436
18448
  parseURLObject: () => parseURLObject,
18437
18449
  parseAsync: () => parseAsync,
@@ -18442,6 +18454,7 @@ __export(exports_core2, {
18442
18454
  locales: () => exports_locales,
18443
18455
  isValidJWT: () => isValidJWT,
18444
18456
  isValidIPv6: () => isValidIPv6,
18457
+ isValidIBAN: () => isValidIBAN,
18445
18458
  isValidCreditCard: () => isValidCreditCard,
18446
18459
  isValidCIDRv6: () => isValidCIDRv6,
18447
18460
  isValidBase64URL: () => isValidBase64URL,
@@ -18468,6 +18481,9 @@ __export(exports_core2, {
18468
18481
  compileFn: () => compileFn,
18469
18482
  compile: () => compile,
18470
18483
  clone: () => clone,
18484
+ canParseURL: () => canParseURL,
18485
+ base64urlCharset: () => base64urlCharset,
18486
+ base64Charset: () => base64Charset,
18471
18487
  _xor: () => _xor,
18472
18488
  _xid: () => _xid,
18473
18489
  _void: () => _void,
@@ -18559,6 +18575,7 @@ __export(exports_core2, {
18559
18575
  _int32: () => _int32,
18560
18576
  _int: () => _int,
18561
18577
  _includes: () => _includes,
18578
+ _iban: () => _iban,
18562
18579
  _guid: () => _guid,
18563
18580
  _gte: () => _gte,
18564
18581
  _gt: () => _gt,
@@ -18660,6 +18677,7 @@ __export(exports_core2, {
18660
18677
  $ZodISODate: () => $ZodISODate,
18661
18678
  $ZodIPv6: () => $ZodIPv6,
18662
18679
  $ZodIPv4: () => $ZodIPv4,
18680
+ $ZodIBAN: () => $ZodIBAN,
18663
18681
  $ZodGUID: () => $ZodGUID,
18664
18682
  $ZodFunction: () => $ZodFunction,
18665
18683
  $ZodFile: () => $ZodFile,
@@ -18684,6 +18702,7 @@ __export(exports_core2, {
18684
18702
  $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
18685
18703
  $ZodCheckRegex: () => $ZodCheckRegex,
18686
18704
  $ZodCheckProperty: () => $ZodCheckProperty,
18705
+ $ZodCheckProperties: () => $ZodCheckProperties,
18687
18706
  $ZodCheckOverwrite: () => $ZodCheckOverwrite,
18688
18707
  $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
18689
18708
  $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
@@ -18728,6 +18747,7 @@ __export(exports_util, {
18728
18747
  shallowClone: () => shallowClone,
18729
18748
  safeExtend: () => safeExtend,
18730
18749
  required: () => required,
18750
+ rawShape: () => rawShape,
18731
18751
  randomString: () => randomString,
18732
18752
  propertyKeyTypes: () => propertyKeyTypes,
18733
18753
  promiseAllObject: () => promiseAllObject,
@@ -18765,6 +18785,7 @@ __export(exports_util, {
18765
18785
  explicitlyAborted: () => explicitlyAborted,
18766
18786
  escapeRegex: () => escapeRegex,
18767
18787
  esc: () => esc,
18788
+ derived: () => derived,
18768
18789
  defineLazyInternal: () => defineLazyInternal,
18769
18790
  defineLazy: () => defineLazy,
18770
18791
  createTransparentProxy: () => createTransparentProxy,
@@ -18819,18 +18840,23 @@ function jsonStringifyReplacer(_, value) {
18819
18840
  return value.toString();
18820
18841
  return value;
18821
18842
  }
18822
- function cached(getter) {
18823
- const set = false;
18824
- return {
18825
- get value() {
18826
- if (!set) {
18827
- const value = getter();
18828
- Object.defineProperty(this, "value", { value });
18829
- return value;
18830
- }
18831
- throw new Error("cached value already set");
18843
+
18844
+ class Cached {
18845
+ constructor(getter) {
18846
+ this._getter = getter;
18847
+ this._value = undefined;
18848
+ }
18849
+ get value() {
18850
+ const getter = this._getter;
18851
+ if (getter !== undefined) {
18852
+ this._value = getter();
18853
+ this._getter = undefined;
18832
18854
  }
18833
- };
18855
+ return this._value;
18856
+ }
18857
+ }
18858
+ function cached(getter) {
18859
+ return new Cached(getter);
18834
18860
  }
18835
18861
  function nullish(input) {
18836
18862
  return input === null || input === undefined;
@@ -18881,6 +18907,56 @@ function assignProp(target, prop, value) {
18881
18907
  configurable: true
18882
18908
  });
18883
18909
  }
18910
+ function rawShape(def) {
18911
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
18912
+ return desc?.get ? desc.get.raw : desc?.value;
18913
+ }
18914
+ function sourceShape(schema) {
18915
+ return rawShape(schema._zod.def) ?? schema._zod.def.shape;
18916
+ }
18917
+ function deferProp(target, key, getter) {
18918
+ Object.defineProperty(target, key, {
18919
+ get() {
18920
+ const value = getter();
18921
+ assignProp(this, key, value);
18922
+ return value;
18923
+ },
18924
+ enumerable: true,
18925
+ configurable: true
18926
+ });
18927
+ }
18928
+ function putProp(target, key, value) {
18929
+ if (key in target)
18930
+ assignProp(target, key, value);
18931
+ else
18932
+ target[key] = value;
18933
+ }
18934
+ function mirrorShape(target, source, keys, wrap) {
18935
+ const raw = sourceShape(source);
18936
+ for (const key of keys) {
18937
+ const desc = Object.getOwnPropertyDescriptor(raw, key);
18938
+ if (!desc.enumerable)
18939
+ continue;
18940
+ if (desc.get) {
18941
+ deferProp(target, key, () => {
18942
+ const value = source._zod.def.shape[key];
18943
+ return wrap ? wrap(value, key) : value;
18944
+ });
18945
+ } else
18946
+ putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
18947
+ }
18948
+ }
18949
+ function mirrorProps(target, source) {
18950
+ for (const key of Reflect.ownKeys(source)) {
18951
+ const desc = Object.getOwnPropertyDescriptor(source, key);
18952
+ if (!desc.enumerable)
18953
+ continue;
18954
+ if (desc.get)
18955
+ deferProp(target, key, () => source[key]);
18956
+ else
18957
+ putProp(target, key, desc.value);
18958
+ }
18959
+ }
18884
18960
  function mergeDefs(...defs) {
18885
18961
  const mergedDescriptors = {};
18886
18962
  for (const def of defs) {
@@ -19118,23 +19194,21 @@ function pick(schema, mask) {
19118
19194
  if (hasChecks) {
19119
19195
  throw new Error(".pick() cannot be used on object schemas containing refinements");
19120
19196
  }
19121
- const def = mergeDefs(schema._zod.def, {
19122
- get shape() {
19123
- const newShape = {};
19124
- for (const key of Reflect.ownKeys(mask)) {
19125
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
19126
- throw new Error(`Unrecognized key: "${String(key)}"`);
19127
- }
19128
- if (!mask[key])
19129
- continue;
19130
- assignProp(newShape, key, currDef.shape[key]);
19131
- }
19132
- assignProp(this, "shape", newShape);
19133
- return newShape;
19134
- },
19135
- checks: []
19136
- });
19137
- return clone(schema, def);
19197
+ const newShape = {};
19198
+ mirrorShape(newShape, schema, maskedKeys(schema, mask));
19199
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
19200
+ }
19201
+ function maskedKeys(schema, mask) {
19202
+ const raw = sourceShape(schema);
19203
+ const keys = [];
19204
+ for (const key of Reflect.ownKeys(mask)) {
19205
+ if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
19206
+ throw new Error(`Unrecognized key: "${String(key)}"`);
19207
+ }
19208
+ if (mask[key])
19209
+ keys.push(key);
19210
+ }
19211
+ return keys;
19138
19212
  }
19139
19213
  function omit(schema, mask) {
19140
19214
  const currDef = schema._zod.def;
@@ -19143,23 +19217,10 @@ function omit(schema, mask) {
19143
19217
  if (hasChecks) {
19144
19218
  throw new Error(".omit() cannot be used on object schemas containing refinements");
19145
19219
  }
19146
- const def = mergeDefs(schema._zod.def, {
19147
- get shape() {
19148
- const newShape = { ...schema._zod.def.shape };
19149
- for (const key of Reflect.ownKeys(mask)) {
19150
- if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
19151
- throw new Error(`Unrecognized key: "${String(key)}"`);
19152
- }
19153
- if (!mask[key])
19154
- continue;
19155
- delete newShape[key];
19156
- }
19157
- assignProp(this, "shape", newShape);
19158
- return newShape;
19159
- },
19160
- checks: []
19161
- });
19162
- return clone(schema, def);
19220
+ const omitted = new Set(maskedKeys(schema, mask));
19221
+ const newShape = {};
19222
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
19223
+ return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
19163
19224
  }
19164
19225
  function extend(schema, shape) {
19165
19226
  if (!isPlainObject(shape)) {
@@ -19168,34 +19229,26 @@ function extend(schema, shape) {
19168
19229
  const checks = schema._zod.def.checks;
19169
19230
  const hasChecks = checks && checks.length > 0;
19170
19231
  if (hasChecks) {
19171
- const existingShape = schema._zod.def.shape;
19232
+ const existingShape = sourceShape(schema);
19172
19233
  for (const key of Reflect.ownKeys(shape)) {
19173
19234
  if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
19174
19235
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
19175
19236
  }
19176
19237
  }
19177
19238
  }
19178
- const def = mergeDefs(schema._zod.def, {
19179
- get shape() {
19180
- const _shape = { ...schema._zod.def.shape, ...shape };
19181
- assignProp(this, "shape", _shape);
19182
- return _shape;
19183
- }
19184
- });
19185
- return clone(schema, def);
19239
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
19240
+ }
19241
+ function extended(schema, shape) {
19242
+ const newShape = {};
19243
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
19244
+ mirrorProps(newShape, shape);
19245
+ return newShape;
19186
19246
  }
19187
19247
  function safeExtend(schema, shape) {
19188
19248
  if (!isPlainObject(shape)) {
19189
19249
  throw new Error("Invalid input to safeExtend: expected a plain object");
19190
19250
  }
19191
- const def = mergeDefs(schema._zod.def, {
19192
- get shape() {
19193
- const _shape = { ...schema._zod.def.shape, ...shape };
19194
- assignProp(this, "shape", _shape);
19195
- return _shape;
19196
- }
19197
- });
19198
- return clone(schema, def);
19251
+ return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
19199
19252
  }
19200
19253
  function merge(a, b) {
19201
19254
  if (!b?._zod?.def) {
@@ -19204,12 +19257,11 @@ function merge(a, b) {
19204
19257
  if (a._zod.def.checks?.length) {
19205
19258
  throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
19206
19259
  }
19260
+ const newShape = {};
19261
+ mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
19262
+ mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
19207
19263
  const def = mergeDefs(a._zod.def, {
19208
- get shape() {
19209
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
19210
- assignProp(this, "shape", _shape);
19211
- return _shape;
19212
- },
19264
+ shape: newShape,
19213
19265
  get catchall() {
19214
19266
  return b._zod.def.catchall;
19215
19267
  },
@@ -19224,67 +19276,16 @@ function partial(Class, schema, mask, name = "partial") {
19224
19276
  if (hasChecks) {
19225
19277
  throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
19226
19278
  }
19227
- const def = mergeDefs(schema._zod.def, {
19228
- get shape() {
19229
- const oldShape = schema._zod.def.shape;
19230
- const shape = { ...oldShape };
19231
- if (mask) {
19232
- for (const key of Reflect.ownKeys(mask)) {
19233
- if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
19234
- throw new Error(`Unrecognized key: "${String(key)}"`);
19235
- }
19236
- if (!mask[key])
19237
- continue;
19238
- shape[key] = Class ? new Class({
19239
- type: "optional",
19240
- innerType: oldShape[key]
19241
- }) : oldShape[key];
19242
- }
19243
- } else {
19244
- for (const key of Reflect.ownKeys(oldShape)) {
19245
- shape[key] = Class ? new Class({
19246
- type: "optional",
19247
- innerType: oldShape[key]
19248
- }) : oldShape[key];
19249
- }
19250
- }
19251
- assignProp(this, "shape", shape);
19252
- return shape;
19253
- },
19254
- checks: []
19255
- });
19256
- return clone(schema, def);
19279
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
19280
+ const newShape = {};
19281
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })));
19282
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
19257
19283
  }
19258
19284
  function required(Class, schema, mask) {
19259
- const def = mergeDefs(schema._zod.def, {
19260
- get shape() {
19261
- const oldShape = schema._zod.def.shape;
19262
- const shape = { ...oldShape };
19263
- if (mask) {
19264
- for (const key of Reflect.ownKeys(mask)) {
19265
- if (!Object.prototype.hasOwnProperty.call(shape, key)) {
19266
- throw new Error(`Unrecognized key: "${String(key)}"`);
19267
- }
19268
- if (!mask[key])
19269
- continue;
19270
- shape[key] = new Class({
19271
- type: "nonoptional",
19272
- innerType: oldShape[key]
19273
- });
19274
- }
19275
- } else {
19276
- for (const key of Reflect.ownKeys(oldShape)) {
19277
- shape[key] = new Class({
19278
- type: "nonoptional",
19279
- innerType: oldShape[key]
19280
- });
19281
- }
19282
- }
19283
- assignProp(this, "shape", shape);
19284
- return shape;
19285
- }
19286
- });
19287
- return clone(schema, def);
19285
+ const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
19286
+ const newShape = {};
19287
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
19288
+ return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
19288
19289
  }
19289
19290
  function aborted(x, startIndex = 0) {
19290
19291
  if (x.aborted === true)
@@ -19334,13 +19335,18 @@ function finalizeIssue(iss, ctx, config) {
19334
19335
  }
19335
19336
  const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
19336
19337
  const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
19337
- const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
19338
- rest.path ?? (rest.path = []);
19339
- rest.message = message;
19338
+ const full = {};
19339
+ for (const k of Object.keys(iss)) {
19340
+ if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
19341
+ continue;
19342
+ full[k] = iss[k];
19343
+ }
19344
+ full.path ?? (full.path = []);
19345
+ full.message = message;
19340
19346
  if (ctx?.reportInput) {
19341
- rest.input = _input;
19347
+ full.input = iss.input;
19342
19348
  }
19343
- return rest;
19349
+ return full;
19344
19350
  }
19345
19351
  function getSizableOrigin(input) {
19346
19352
  if (input instanceof Set)
@@ -19467,6 +19473,22 @@ function own(inst, key, value, enumerable = true) {
19467
19473
  function hide(inst, key, value) {
19468
19474
  return own(inst, key, value, false);
19469
19475
  }
19476
+ function derived(computes, table) {
19477
+ for (const key in computes) {
19478
+ const compute = computes[key];
19479
+ Object.defineProperty(table, key, {
19480
+ configurable: true,
19481
+ enumerable: true,
19482
+ get() {
19483
+ return own(this, key, compute(this));
19484
+ },
19485
+ set(value) {
19486
+ own(this, key, value);
19487
+ }
19488
+ });
19489
+ }
19490
+ return table;
19491
+ }
19470
19492
  function defineBound(proto, key, fn) {
19471
19493
  Object.defineProperty(proto, key, {
19472
19494
  configurable: true,
@@ -19593,8 +19615,7 @@ function $constructor(name, initializer, proto, params) {
19593
19615
  } finally {
19594
19616
  _zodDesc.value = undefined;
19595
19617
  }
19596
- }
19597
- if (inst._zod.traits.has(name)) {
19618
+ } else if (inst._zod.traits.has(name)) {
19598
19619
  return;
19599
19620
  }
19600
19621
  inst._zod.traits.add(name);
@@ -19687,16 +19708,12 @@ var _messageDesc = {
19687
19708
  enumerable: true,
19688
19709
  configurable: true
19689
19710
  };
19690
- var _zodDesc2 = { value: undefined, enumerable: false };
19691
19711
  var _issuesDesc = { value: undefined, enumerable: false };
19692
19712
  var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
19693
19713
  var initializer = (inst, def) => {
19694
19714
  inst.name = "$ZodError";
19695
- _zodDesc2.value = inst._zod;
19696
- Object.defineProperty(inst, "_zod", _zodDesc2);
19697
19715
  _issuesDesc.value = def;
19698
19716
  Object.defineProperty(inst, "issues", _issuesDesc);
19699
- _zodDesc2.value = undefined;
19700
19717
  _issuesDesc.value = undefined;
19701
19718
  Object.defineProperty(inst, "message", _messageDesc);
19702
19719
  const proto = Object.getPrototypeOf(inst);
@@ -19912,33 +19929,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
19912
19929
  if (result instanceof Promise) {
19913
19930
  throw new $ZodAsyncError;
19914
19931
  }
19915
- return result.issues.length ? {
19916
- success: false,
19917
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
19918
- } : { success: true, data: result.value };
19932
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
19919
19933
  };
19920
19934
  var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
19935
+ function failure(Err, issues, ctx) {
19936
+ let error;
19937
+ return {
19938
+ success: false,
19939
+ get error() {
19940
+ if (!error) {
19941
+ error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
19942
+ issues = undefined;
19943
+ ctx = undefined;
19944
+ }
19945
+ return error;
19946
+ },
19947
+ set error(e2) {
19948
+ error = e2;
19949
+ issues = undefined;
19950
+ ctx = undefined;
19951
+ }
19952
+ };
19953
+ }
19921
19954
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
19922
19955
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
19923
19956
  let result = schema._zod.run({ value, issues: [] }, ctx);
19924
19957
  if (result instanceof Promise)
19925
19958
  result = await result;
19926
- return result.issues.length ? {
19927
- success: false,
19928
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
19929
- } : { success: true, data: result.value };
19959
+ return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
19930
19960
  };
19931
19961
  var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
19932
19962
  var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
19933
19963
  var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
19934
19964
  var validate = (schema, value, _ctx) => {
19935
19965
  const validator = schema._zod.bag.validator;
19936
- if (validator !== undefined && validator(value) !== COMPILE_INVALID)
19937
- return true;
19966
+ if (validator !== undefined) {
19967
+ if (validator(value) !== COMPILE_INVALID)
19968
+ return true;
19969
+ if (validator.definite === true && _ctx === undefined)
19970
+ return false;
19971
+ }
19938
19972
  return validateFallback(schema, value, _ctx);
19939
19973
  };
19940
19974
  function validateFallback(schema, value, _ctx) {
19941
- const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
19975
+ const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
19942
19976
  const fallbackRun = schema._zod.bag.fallbackRun;
19943
19977
  let result;
19944
19978
  if (fallbackRun) {
@@ -19953,7 +19987,7 @@ function validateFallback(schema, value, _ctx) {
19953
19987
  return result.issues.length === 0;
19954
19988
  }
19955
19989
  var validateAsync = async (schema, value, _ctx) => {
19956
- const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
19990
+ const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
19957
19991
  let result = schema._zod.run({ value, issues: [] }, ctx);
19958
19992
  if (result instanceof Promise)
19959
19993
  result = await result;
@@ -20052,6 +20086,7 @@ __export(exports_regexes, {
20052
20086
  ipv4: () => ipv4,
20053
20087
  integer: () => integer,
20054
20088
  idnEmail: () => idnEmail,
20089
+ iban: () => iban,
20055
20090
  httpProtocol: () => httpProtocol,
20056
20091
  html5Email: () => html5Email,
20057
20092
  hostname: () => hostname2,
@@ -20065,6 +20100,7 @@ __export(exports_regexes, {
20065
20100
  domain: () => domain,
20066
20101
  datetime: () => datetime,
20067
20102
  date: () => date,
20103
+ currencyCode: () => currencyCode,
20068
20104
  cuid2: () => cuid2,
20069
20105
  cuid: () => cuid,
20070
20106
  creditCard: () => creditCard,
@@ -20074,7 +20110,8 @@ __export(exports_regexes, {
20074
20110
  boolean: () => boolean,
20075
20111
  bigint: () => bigint,
20076
20112
  base64url: () => base64url,
20077
- base64: () => base64
20113
+ base64: () => base64,
20114
+ anyString: () => anyString
20078
20115
  });
20079
20116
  var cuid = /^[cC][0-9a-z]{6,}$/;
20080
20117
  var cuid2 = /^[0-9a-z]+$/;
@@ -20096,13 +20133,13 @@ var uuid = (version) => {
20096
20133
  var uuid4 = /* @__PURE__ */ uuid(4);
20097
20134
  var uuid6 = /* @__PURE__ */ uuid(6);
20098
20135
  var uuid7 = /* @__PURE__ */ uuid(7);
20099
- var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
20136
+ 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,}$/;
20100
20137
  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])?)*$/;
20101
20138
  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,}))$/;
20102
20139
  var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
20103
20140
  var idnEmail = unicodeEmail;
20104
20141
  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])?)*$/;
20105
- var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
20142
+ var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
20106
20143
  function emoji() {
20107
20144
  return new RegExp(_emoji, "u");
20108
20145
  }
@@ -20115,12 +20152,14 @@ var mac = (delimiter) => {
20115
20152
  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])$/;
20116
20153
  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])$/;
20117
20154
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
20118
- var base64url = /^[A-Za-z0-9_-]*$/;
20155
+ var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
20119
20156
  var hostname2 = /^(?=.{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])?)*\.?$/;
20120
20157
  var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
20121
20158
  var httpProtocol = /^https?$/;
20122
20159
  var e164 = /^\+[1-9]\d{6,14}$/;
20123
20160
  var creditCard = /^\d(?:[ -]?\d){11,18}$/;
20161
+ 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)$/;
20162
+ var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
20124
20163
  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])))`;
20125
20164
  function anchor(source) {
20126
20165
  return new RegExp(`^${source}$`);
@@ -20142,6 +20181,7 @@ function datetime(args) {
20142
20181
  const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
20143
20182
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
20144
20183
  }
20184
+ var anyString = /^[\s\S]{0,}$/;
20145
20185
  var string = (params) => {
20146
20186
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
20147
20187
  return new RegExp(`^${regex}$`);
@@ -20200,16 +20240,6 @@ var numericOriginMap = {
20200
20240
  var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
20201
20241
  $ZodCheck.init(inst, def);
20202
20242
  const origin = numericOriginMap[typeof def.value];
20203
- inst._zod.onattach.push((inst2) => {
20204
- const bag = inst2._zod.bag;
20205
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
20206
- if (def.value < curr) {
20207
- if (def.inclusive)
20208
- bag.maximum = def.value;
20209
- else
20210
- bag.exclusiveMaximum = def.value;
20211
- }
20212
- });
20213
20243
  inst._zod.check = (payload) => {
20214
20244
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
20215
20245
  return;
@@ -20228,16 +20258,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
20228
20258
  var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
20229
20259
  $ZodCheck.init(inst, def);
20230
20260
  const origin = numericOriginMap[typeof def.value];
20231
- inst._zod.onattach.push((inst2) => {
20232
- const bag = inst2._zod.bag;
20233
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
20234
- if (def.value > curr) {
20235
- if (def.inclusive)
20236
- bag.minimum = def.value;
20237
- else
20238
- bag.exclusiveMinimum = def.value;
20239
- }
20240
- });
20241
20261
  inst._zod.check = (payload) => {
20242
20262
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
20243
20263
  return;
@@ -20255,10 +20275,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
20255
20275
  });
20256
20276
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
20257
20277
  $ZodCheck.init(inst, def);
20258
- inst._zod.onattach.push((inst2) => {
20259
- var _a2;
20260
- (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
20261
- });
20262
20278
  inst._zod.check = (payload) => {
20263
20279
  if (typeof payload.value !== typeof def.value)
20264
20280
  throw new Error("Cannot mix number and bigint in multiple_of check.");
@@ -20281,14 +20297,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
20281
20297
  const isInt = def.format?.includes("int");
20282
20298
  const origin = isInt ? "int" : "number";
20283
20299
  const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
20284
- inst._zod.onattach.push((inst2) => {
20285
- const bag = inst2._zod.bag;
20286
- bag.format = def.format;
20287
- bag.minimum = minimum;
20288
- bag.maximum = maximum;
20289
- if (isInt)
20290
- bag.pattern = integer;
20291
- });
20292
20300
  inst._zod.check = (payload) => {
20293
20301
  const input = payload.value;
20294
20302
  if (isInt) {
@@ -20357,12 +20365,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
20357
20365
  var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
20358
20366
  $ZodCheck.init(inst, def);
20359
20367
  const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
20360
- inst._zod.onattach.push((inst2) => {
20361
- const bag = inst2._zod.bag;
20362
- bag.format = def.format;
20363
- bag.minimum = minimum;
20364
- bag.maximum = maximum;
20365
- });
20366
20368
  inst._zod.check = (payload) => {
20367
20369
  const input = payload.value;
20368
20370
  if (input < minimum) {
@@ -20393,11 +20395,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
20393
20395
  var _a2;
20394
20396
  $ZodCheck.init(inst, def);
20395
20397
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20396
- inst._zod.onattach.push((inst2) => {
20397
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
20398
- if (def.maximum < curr)
20399
- inst2._zod.bag.maximum = def.maximum;
20400
- });
20401
20398
  inst._zod.check = (payload) => {
20402
20399
  const input = payload.value;
20403
20400
  const size = input.size;
@@ -20418,11 +20415,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
20418
20415
  var _a2;
20419
20416
  $ZodCheck.init(inst, def);
20420
20417
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20421
- inst._zod.onattach.push((inst2) => {
20422
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
20423
- if (def.minimum > curr)
20424
- inst2._zod.bag.minimum = def.minimum;
20425
- });
20426
20418
  inst._zod.check = (payload) => {
20427
20419
  const input = payload.value;
20428
20420
  const size = input.size;
@@ -20443,12 +20435,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
20443
20435
  var _a2;
20444
20436
  $ZodCheck.init(inst, def);
20445
20437
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasSize);
20446
- inst._zod.onattach.push((inst2) => {
20447
- const bag = inst2._zod.bag;
20448
- bag.minimum = def.size;
20449
- bag.maximum = def.size;
20450
- bag.size = def.size;
20451
- });
20452
20438
  inst._zod.check = (payload) => {
20453
20439
  const input = payload.value;
20454
20440
  const size = input.size;
@@ -20470,11 +20456,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
20470
20456
  var _a2;
20471
20457
  $ZodCheck.init(inst, def);
20472
20458
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20473
- inst._zod.onattach.push((inst2) => {
20474
- const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
20475
- if (def.maximum < curr)
20476
- inst2._zod.bag.maximum = def.maximum;
20477
- });
20478
20459
  inst._zod.check = (payload) => {
20479
20460
  const input = payload.value;
20480
20461
  const units = input.length;
@@ -20497,11 +20478,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
20497
20478
  var _a2;
20498
20479
  $ZodCheck.init(inst, def);
20499
20480
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20500
- inst._zod.onattach.push((inst2) => {
20501
- const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
20502
- if (def.minimum > curr)
20503
- inst2._zod.bag.minimum = def.minimum;
20504
- });
20505
20481
  inst._zod.check = (payload) => {
20506
20482
  const input = payload.value;
20507
20483
  const units = input.length;
@@ -20524,12 +20500,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
20524
20500
  var _a2;
20525
20501
  $ZodCheck.init(inst, def);
20526
20502
  (_a2 = inst._zod.def).when ?? (_a2.when = _whenHasLength);
20527
- inst._zod.onattach.push((inst2) => {
20528
- const bag = inst2._zod.bag;
20529
- bag.minimum = def.length;
20530
- bag.maximum = def.length;
20531
- bag.length = def.length;
20532
- });
20533
20503
  inst._zod.check = (payload) => {
20534
20504
  const input = payload.value;
20535
20505
  const units = input.length;
@@ -20552,14 +20522,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
20552
20522
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
20553
20523
  var _a2, _b;
20554
20524
  $ZodCheck.init(inst, def);
20555
- inst._zod.onattach.push((inst2) => {
20556
- const bag = inst2._zod.bag;
20557
- bag.format = def.format;
20558
- if (def.pattern) {
20559
- bag.patterns ?? (bag.patterns = new Set);
20560
- bag.patterns.add(def.pattern);
20561
- }
20562
- });
20563
20525
  if (def.pattern)
20564
20526
  (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
20565
20527
  def.pattern.lastIndex = 0;
@@ -20608,11 +20570,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
20608
20570
  const escapedRegex = escapeRegex(def.includes);
20609
20571
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
20610
20572
  def.pattern = pattern;
20611
- inst._zod.onattach.push((inst2) => {
20612
- const bag = inst2._zod.bag;
20613
- bag.patterns ?? (bag.patterns = new Set);
20614
- bag.patterns.add(pattern);
20615
- });
20616
20573
  inst._zod.check = (payload) => {
20617
20574
  if (payload.value.includes(def.includes, def.position))
20618
20575
  return;
@@ -20631,11 +20588,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
20631
20588
  $ZodCheck.init(inst, def);
20632
20589
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
20633
20590
  def.pattern ?? (def.pattern = pattern);
20634
- inst._zod.onattach.push((inst2) => {
20635
- const bag = inst2._zod.bag;
20636
- bag.patterns ?? (bag.patterns = new Set);
20637
- bag.patterns.add(pattern);
20638
- });
20639
20591
  inst._zod.check = (payload) => {
20640
20592
  if (payload.value.startsWith(def.prefix))
20641
20593
  return;
@@ -20654,11 +20606,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
20654
20606
  $ZodCheck.init(inst, def);
20655
20607
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
20656
20608
  def.pattern ?? (def.pattern = pattern);
20657
- inst._zod.onattach.push((inst2) => {
20658
- const bag = inst2._zod.bag;
20659
- bag.patterns ?? (bag.patterns = new Set);
20660
- bag.patterns.add(pattern);
20661
- });
20662
20609
  inst._zod.check = (payload) => {
20663
20610
  if (payload.value.endsWith(def.suffix))
20664
20611
  return;
@@ -20692,12 +20639,39 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
20692
20639
  return;
20693
20640
  };
20694
20641
  });
20642
+ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
20643
+ $ZodCheck.init(inst, def);
20644
+ hide(inst, Symbol.iterator, function* () {
20645
+ yield inst;
20646
+ });
20647
+ let entries;
20648
+ inst._zod.check = (payload) => {
20649
+ if (payload.value == null) {
20650
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
20651
+ return;
20652
+ }
20653
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
20654
+ const input = payload.value;
20655
+ let proms;
20656
+ for (const [key, schema] of entries) {
20657
+ const result = schema._zod.run({ value: input[key], issues: [] }, {});
20658
+ if (result instanceof Promise) {
20659
+ proms ?? (proms = []);
20660
+ proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
20661
+ } else {
20662
+ handleCheckPropertyResult(result, payload, key);
20663
+ }
20664
+ }
20665
+ if (proms)
20666
+ return Promise.all(proms).then(() => {
20667
+ return;
20668
+ });
20669
+ return;
20670
+ };
20671
+ });
20695
20672
  var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
20696
20673
  $ZodCheck.init(inst, def);
20697
20674
  const mimeSet = new Set(def.mime);
20698
- inst._zod.onattach.push((inst2) => {
20699
- inst2._zod.bag.mime = def.mime;
20700
- });
20701
20675
  inst._zod.check = (payload) => {
20702
20676
  if (mimeSet.has(payload.value.type))
20703
20677
  return;
@@ -20727,8 +20701,11 @@ class Doc {
20727
20701
  }
20728
20702
  indented(fn) {
20729
20703
  this.indent += 1;
20730
- fn(this);
20731
- this.indent -= 1;
20704
+ try {
20705
+ fn(this);
20706
+ } finally {
20707
+ this.indent -= 1;
20708
+ }
20732
20709
  }
20733
20710
  write(arg) {
20734
20711
  if (typeof arg === "function") {
@@ -20759,8 +20736,8 @@ ${content.join(`
20759
20736
  // node_modules/zod/v4/core/versions.js
20760
20737
  var version = {
20761
20738
  major: 4,
20762
- minor: 5,
20763
- patch: 4
20739
+ minor: 6,
20740
+ patch: 5
20764
20741
  };
20765
20742
 
20766
20743
  // node_modules/zod/v4/core/schemas.js
@@ -20872,15 +20849,21 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
20872
20849
  own(this, "~standard", value);
20873
20850
  }
20874
20851
  });
20875
- var toStandardResult = (r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues };
20852
+ var toStandardResult = (r2, ctx) => r2.issues.length ? { issues: r2.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r2.value };
20853
+ async function validateAsync2(inst, value) {
20854
+ const ctx = { async: true };
20855
+ return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
20856
+ }
20876
20857
  function standardProps(inst) {
20877
20858
  return {
20878
20859
  validate: (value) => {
20860
+ const ctx = { async: false };
20879
20861
  try {
20880
- return toStandardResult(safeParse(inst, value));
20881
- } catch (_) {
20882
- return safeParseAsync(inst, value).then(toStandardResult);
20883
- }
20862
+ const r2 = inst._zod.run({ value, issues: [] }, ctx);
20863
+ if (!(r2 instanceof Promise))
20864
+ return toStandardResult(r2, ctx);
20865
+ } catch (_) {}
20866
+ return validateAsync2(inst, value);
20884
20867
  },
20885
20868
  vendor: "zod",
20886
20869
  version: 1
@@ -20888,7 +20871,7 @@ function standardProps(inst) {
20888
20871
  }
20889
20872
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
20890
20873
  $ZodType.init(inst, def);
20891
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
20874
+ inst._zod.pattern = def.pattern ?? anyString;
20892
20875
  inst._zod.parse = (payload, _) => {
20893
20876
  if (def.coerce)
20894
20877
  try {
@@ -20939,11 +20922,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
20939
20922
  });
20940
20923
  var URL_BAD_FORMAT = 1;
20941
20924
  var URL_UNPARSEABLE = 2;
20925
+ function canParseURL(input) {
20926
+ try {
20927
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function")
20928
+ return URL.canParse(input);
20929
+ new URL(input);
20930
+ return true;
20931
+ } catch {
20932
+ return false;
20933
+ }
20934
+ }
20935
+ function validateURL(trimmed, def) {
20936
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
20937
+ return canParseURL(trimmed) || URL_UNPARSEABLE;
20938
+ }
20939
+ return parseURLObject(trimmed, def);
20940
+ }
20942
20941
  function parseURLObject(trimmed, def) {
20943
20942
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
20944
20943
  return URL_BAD_FORMAT;
20945
20944
  }
20946
20945
  try {
20946
+ if (typeof URL !== "undefined") {
20947
+ const URLStatic = URL;
20948
+ if (typeof URLStatic.parse === "function")
20949
+ return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
20950
+ }
20947
20951
  return new URL(trimmed);
20948
20952
  } catch {
20949
20953
  return URL_UNPARSEABLE;
@@ -20966,7 +20970,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
20966
20970
  inst._zod.check = (payload) => {
20967
20971
  try {
20968
20972
  const trimmed = payload.value.trim();
20969
- const url = parseURLObject(trimmed, def);
20973
+ const url = validateURL(trimmed, def);
20970
20974
  if (url === URL_BAD_FORMAT) {
20971
20975
  payload.issues.push({
20972
20976
  code: "invalid_format",
@@ -20988,6 +20992,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
20988
20992
  });
20989
20993
  return;
20990
20994
  }
20995
+ if (url === true) {
20996
+ payload.value = stripTabAndNewline(trimmed);
20997
+ return;
20998
+ }
20991
20999
  if (def.hostname && !urlHostnameOk(url, def.hostname)) {
20992
21000
  payload.issues.push({
20993
21001
  code: "invalid_format",
@@ -21056,12 +21064,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
21056
21064
  var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
21057
21065
  def.pattern ?? (def.pattern = datetime(def));
21058
21066
  $ZodStringFormat.init(inst, def);
21059
- if (def.local || def.precision === -1) {
21060
- inst._zod.bag.laxFormat = true;
21061
- inst._zod.onattach.push((s) => {
21062
- s._zod.bag.laxFormat = true;
21063
- });
21064
- }
21065
21067
  });
21066
21068
  var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
21067
21069
  def.pattern ?? (def.pattern = date);
@@ -21078,23 +21080,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
21078
21080
  var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
21079
21081
  def.pattern ?? (def.pattern = ipv4);
21080
21082
  $ZodStringFormat.init(inst, def);
21081
- inst._zod.bag.format = `ipv4`;
21082
21083
  });
21083
21084
  var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
21084
21085
  function isValidIPv6(value) {
21085
21086
  if (!ipv6Alphabet.test(value))
21086
21087
  return false;
21087
- try {
21088
- new URL(`http://[${value}]`);
21089
- return true;
21090
- } catch {
21091
- return false;
21092
- }
21088
+ return canParseURL(`http://[${value}]`);
21093
21089
  }
21094
21090
  var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
21095
21091
  def.pattern ?? (def.pattern = ipv6);
21096
21092
  $ZodStringFormat.init(inst, def);
21097
- inst._zod.bag.format = `ipv6`;
21098
21093
  inst._zod.check = (payload) => {
21099
21094
  if (!isValidIPv6(payload.value)) {
21100
21095
  payload.issues.push({
@@ -21110,7 +21105,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
21110
21105
  var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
21111
21106
  def.pattern ?? (def.pattern = mac(def.delimiter));
21112
21107
  $ZodStringFormat.init(inst, def);
21113
- inst._zod.bag.format = `mac`;
21114
21108
  });
21115
21109
  var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
21116
21110
  def.pattern ?? (def.pattern = cidrv4);
@@ -21159,10 +21153,10 @@ function isValidBase64(data) {
21159
21153
  return false;
21160
21154
  }
21161
21155
  }
21156
+ var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
21162
21157
  var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
21163
- def.pattern ?? (def.pattern = base64);
21158
+ def.pattern ?? (def.pattern = base64Charset);
21164
21159
  $ZodStringFormat.init(inst, def);
21165
- inst._zod.bag.contentEncoding = "base64";
21166
21160
  inst._zod.check = (payload) => {
21167
21161
  if (isValidBase64(payload.value))
21168
21162
  return;
@@ -21175,17 +21169,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
21175
21169
  });
21176
21170
  };
21177
21171
  });
21172
+ var base64urlCharset = /^[A-Za-z0-9_-]*$/;
21178
21173
  function isValidBase64URL(data) {
21179
- if (!base64url.test(data))
21174
+ if (!base64urlCharset.test(data))
21180
21175
  return false;
21181
21176
  const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
21182
21177
  const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
21183
21178
  return isValidBase64(padded);
21184
21179
  }
21185
21180
  var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
21186
- def.pattern ?? (def.pattern = base64url);
21181
+ def.pattern ?? (def.pattern = base64urlCharset);
21187
21182
  $ZodStringFormat.init(inst, def);
21188
- inst._zod.bag.contentEncoding = "base64url";
21189
21183
  inst._zod.check = (payload) => {
21190
21184
  if (isValidBase64URL(payload.value))
21191
21185
  return;
@@ -21208,7 +21202,7 @@ function isLuhnAlgo(digits) {
21208
21202
  let bit = 1;
21209
21203
  let sum = 0;
21210
21204
  while (length) {
21211
- const value = +digits[--length];
21205
+ const value = digits.charCodeAt(--length) - 48;
21212
21206
  bit ^= 1;
21213
21207
  sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
21214
21208
  }
@@ -21234,6 +21228,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
21234
21228
  });
21235
21229
  };
21236
21230
  });
21231
+ function isIso7064Mod97(iban2) {
21232
+ let remainder = 0;
21233
+ const len = iban2.length;
21234
+ for (let i = 4;i < len; i++) {
21235
+ const code = iban2.charCodeAt(i);
21236
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
21237
+ }
21238
+ for (let i = 0;i < 4; i++) {
21239
+ const code = iban2.charCodeAt(i);
21240
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
21241
+ }
21242
+ return remainder === 1;
21243
+ }
21244
+ function isValidIBAN(input) {
21245
+ if (!iban.test(input))
21246
+ return false;
21247
+ return isIso7064Mod97(input);
21248
+ }
21249
+ var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
21250
+ def.pattern ?? (def.pattern = iban);
21251
+ $ZodStringFormat.init(inst, def);
21252
+ inst._zod.check = (payload) => {
21253
+ if (isValidIBAN(payload.value))
21254
+ return;
21255
+ payload.issues.push({
21256
+ code: "invalid_format",
21257
+ format: "iban",
21258
+ input: payload.value,
21259
+ inst,
21260
+ continue: !def.abort
21261
+ });
21262
+ };
21263
+ });
21237
21264
  function isValidJWT(token, algorithm = null) {
21238
21265
  try {
21239
21266
  const tokensParts = token.split(".");
@@ -21284,7 +21311,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
21284
21311
  });
21285
21312
  var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
21286
21313
  $ZodType.init(inst, def);
21287
- inst._zod.pattern = inst._zod.bag.pattern ?? number;
21314
+ inst._zod.pattern = number;
21288
21315
  inst._zod.parse = (payload, _ctx) => {
21289
21316
  if (def.coerce)
21290
21317
  try {
@@ -21482,6 +21509,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
21482
21509
  }
21483
21510
  payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
21484
21511
  const proms = [];
21512
+ const abortEarly = ctx?.abortEarly;
21485
21513
  for (let i = 0;i < input.length; i++) {
21486
21514
  const item = input[i];
21487
21515
  const result = def.element._zod.run({
@@ -21492,6 +21520,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
21492
21520
  proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
21493
21521
  } else {
21494
21522
  handleArrayResult(result, payload, i);
21523
+ if (abortEarly && result.issues.length !== 0 && aborted(result))
21524
+ break;
21495
21525
  }
21496
21526
  }
21497
21527
  if (proms.length) {
@@ -21524,7 +21554,7 @@ function handlePropertyResult(result, final, key, input, optin, optout) {
21524
21554
  return;
21525
21555
  }
21526
21556
  if (result.value === undefined) {
21527
- if (isPresent) {
21557
+ if (isPresent || optin === "defaulted" && !isOptionalOut) {
21528
21558
  final.value[key] = undefined;
21529
21559
  }
21530
21560
  } else {
@@ -21552,14 +21582,20 @@ function normalizeDef(def) {
21552
21582
  optionalKeys: new Set(okeys)
21553
21583
  };
21554
21584
  }
21555
- function handleCatchall(proms, input, payload, ctx, def, inst) {
21585
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
21556
21586
  const unrecognized = [];
21557
21587
  const keySet = def.keySet;
21558
21588
  const _catchall = def.catchall._zod;
21559
21589
  const t2 = _catchall.def.type;
21560
21590
  const optin = _catchall.optin;
21561
21591
  const optout = _catchall.optout;
21592
+ let seen = 0;
21562
21593
  for (const key in input) {
21594
+ if (abortEarly && payload.issues.length !== seen) {
21595
+ if (aborted(payload, seen))
21596
+ break;
21597
+ seen = payload.issues.length;
21598
+ }
21563
21599
  if (keySet.has(key))
21564
21600
  continue;
21565
21601
  if (key === "__proto__") {
@@ -21593,23 +21629,19 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
21593
21629
  return payload;
21594
21630
  });
21595
21631
  }
21596
- var propShapes = new WeakMap;
21597
21632
  var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21598
21633
  $ZodType.init(inst, def);
21599
21634
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
21600
- if (!desc?.get) {
21601
- const sh = def.shape;
21602
- propShapes.set(def, sh);
21603
- Object.defineProperty(def, "shape", {
21604
- get: () => {
21605
- const newSh = { ...sh };
21606
- Object.defineProperty(def, "shape", {
21607
- value: newSh
21608
- });
21609
- propShapes.set(def, newSh);
21610
- return newSh;
21611
- }
21612
- });
21635
+ const sh = desc?.get ? desc.get.raw : def.shape ?? {};
21636
+ if (sh) {
21637
+ const get = () => {
21638
+ const newSh = { ...sh };
21639
+ Object.defineProperty(def, "shape", { value: newSh });
21640
+ get.raw = newSh;
21641
+ return newSh;
21642
+ };
21643
+ get.raw = sh;
21644
+ Object.defineProperty(def, "shape", { get });
21613
21645
  }
21614
21646
  const _normalized = cached(() => normalizeDef(def));
21615
21647
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -21649,7 +21681,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21649
21681
  payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
21650
21682
  const proms = [];
21651
21683
  const shape = value.shape;
21684
+ const abortEarly = ctx?.abortEarly;
21685
+ let seen = payload.issues.length;
21652
21686
  for (const key of value.allKeys) {
21687
+ if (abortEarly && payload.issues.length !== seen) {
21688
+ if (aborted(payload, seen))
21689
+ break;
21690
+ seen = payload.issues.length;
21691
+ }
21653
21692
  if (key === "__proto__")
21654
21693
  continue;
21655
21694
  const el = shape[key];
@@ -21665,7 +21704,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
21665
21704
  if (!catchall) {
21666
21705
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
21667
21706
  }
21668
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
21707
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
21669
21708
  };
21670
21709
  });
21671
21710
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -21679,10 +21718,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21679
21718
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
21680
21719
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
21681
21720
  const prefixStr = (id, k) => `
21721
+ let ${id}_ab = false;
21682
21722
  for (let i = 0; i < ${id}.issues.length; i++) {
21683
21723
  const iss = ${id}.issues[i];
21684
21724
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
21685
21725
  payload.issues.push(iss);
21726
+ if (iss.continue !== true) ${id}_ab = true;
21727
+ }
21728
+ if (${id}_ab && ctx && ctx.abortEarly) {
21729
+ payload.value = newResult;
21730
+ return payload;
21686
21731
  }`;
21687
21732
  doc.write(`const input = payload.value;`);
21688
21733
  const ids = Object.create(null);
@@ -21728,6 +21773,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21728
21773
  input: undefined,
21729
21774
  path: [${k}]
21730
21775
  });
21776
+ if (ctx && ctx.abortEarly) {
21777
+ payload.value = newResult;
21778
+ return payload;
21779
+ }
21731
21780
  }
21732
21781
 
21733
21782
  if (${id}_present) {
@@ -21739,16 +21788,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21739
21788
  doc.write(`
21740
21789
  if (${id}.issues.length) {${prefixStr(id, k)}
21741
21790
  }
21742
-
21743
- if (${id}.value === undefined) {
21744
- if (${isPresent}) {
21745
- newResult[${k}] = undefined;
21746
- }
21791
+ `);
21792
+ if (optin === "defaulted") {
21793
+ doc.write(`newResult[${k}] = ${id}.value;`);
21747
21794
  } else {
21795
+ doc.write(`
21796
+ if (${id}.value !== undefined || ${isPresent}) {
21748
21797
  newResult[${k}] = ${id}.value;
21749
21798
  }
21750
-
21751
21799
  `);
21800
+ }
21752
21801
  }
21753
21802
  }
21754
21803
  doc.write(`payload.value = newResult;`);
@@ -21780,7 +21829,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
21780
21829
  payload = fastpass(payload, ctx);
21781
21830
  if (!catchall)
21782
21831
  return payload;
21783
- return handleCatchall([], input, payload, ctx, value, inst);
21832
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
21784
21833
  }
21785
21834
  return superParse(payload, ctx);
21786
21835
  };
@@ -21912,16 +21961,31 @@ function getDiscriminatedOption(union, value) {
21912
21961
  const internals = union._zod;
21913
21962
  let map = internals.bag.optionsMap;
21914
21963
  if (!map) {
21915
- map = new Map;
21916
- const { options, discriminator } = internals.def;
21917
- for (const option of options) {
21918
- for (const v of option._zod.propValues?.[discriminator] ?? [])
21919
- if (!map.has(v))
21920
- map.set(v, option);
21921
- }
21964
+ map = discriminatorMap(internals.def);
21922
21965
  internals.bag.optionsMap = map;
21923
21966
  }
21924
- return map.get(value);
21967
+ const option = map.get(value);
21968
+ if (option === null)
21969
+ throw new Error(`Ambiguous discriminator value "${String(value)}"`);
21970
+ return option;
21971
+ }
21972
+ function discriminatorMap(def) {
21973
+ const map = new Map;
21974
+ for (const option of def.options) {
21975
+ const values = option._zod.propValues?.[def.discriminator];
21976
+ if (!values || values.size === 0)
21977
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
21978
+ for (const value of values) {
21979
+ if (map.has(value)) {
21980
+ if (value !== undefined)
21981
+ throw new Error(`Duplicate discriminator value "${String(value)}"`);
21982
+ map.set(value, null);
21983
+ } else {
21984
+ map.set(value, option);
21985
+ }
21986
+ }
21987
+ }
21988
+ return map;
21925
21989
  }
21926
21990
  var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
21927
21991
  def.inclusive = false;
@@ -21929,10 +21993,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
21929
21993
  const _super = inst._zod.parse;
21930
21994
  defineLazyInternal(inst, "propValues", (zod) => {
21931
21995
  const propValues = {};
21996
+ let undefinedCount = 0;
21932
21997
  for (const option of zod.def.options) {
21933
21998
  const pv = option._zod.propValues;
21934
21999
  if (!pv || Object.keys(pv).length === 0)
21935
22000
  throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
22001
+ if (pv[zod.def.discriminator]?.has(undefined))
22002
+ undefinedCount++;
21936
22003
  for (const [k, v] of Object.entries(pv)) {
21937
22004
  if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
21938
22005
  assignProp(propValues, k, new Set);
@@ -21942,30 +22009,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
21942
22009
  }
21943
22010
  }
21944
22011
  }
22012
+ if (!zod.def.unionFallback && undefinedCount > 1)
22013
+ propValues[zod.def.discriminator]?.delete(undefined);
21945
22014
  return propValues;
21946
22015
  });
21947
22016
  def.options.forEach((option, i) => {
21948
- const propShape = propShapes.get(option._zod.def);
22017
+ const propShape = rawShape(option._zod.def);
21949
22018
  if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
21950
22019
  throw new Error(`Invalid discriminated union option at index "${i}"`);
21951
22020
  }
21952
22021
  });
21953
- const disc = cached(() => {
21954
- const opts = def.options;
21955
- const map = new Map;
21956
- for (const o2 of opts) {
21957
- const values = o2._zod.propValues?.[def.discriminator];
21958
- if (!values || values.size === 0)
21959
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o2)}"`);
21960
- for (const v of values) {
21961
- if (map.has(v)) {
21962
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
21963
- }
21964
- map.set(v, o2);
21965
- }
21966
- }
21967
- return map;
21968
- });
22022
+ const disc = cached(() => discriminatorMap(def));
21969
22023
  inst._zod.parse = (payload, ctx) => {
21970
22024
  const input = payload.value;
21971
22025
  if (!isObject(input)) {
@@ -21977,8 +22031,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
21977
22031
  });
21978
22032
  return payload;
21979
22033
  }
21980
- const opt = disc.value.get(input?.[def.discriminator]);
21981
- if (opt) {
22034
+ const value = input?.[def.discriminator];
22035
+ const opt = disc.value.get(value);
22036
+ if (opt && (value !== undefined || ctx.direction !== "backward")) {
21982
22037
  return opt._zod.run(payload, ctx);
21983
22038
  }
21984
22039
  if (def.unionFallback || ctx.direction === "backward") {
@@ -21989,7 +22044,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
21989
22044
  errors: [],
21990
22045
  note: "No matching discriminator",
21991
22046
  discriminator: def.discriminator,
21992
- options: Array.from(disc.value.keys()),
22047
+ options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
21993
22048
  input,
21994
22049
  path: [def.discriminator],
21995
22050
  inst
@@ -22155,6 +22210,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
22155
22210
  }
22156
22211
  }
22157
22212
  const itemResults = new Array(items.length);
22213
+ const abortEarly = def.rest ? ctx?.abortEarly : undefined;
22214
+ let itemAborted = false;
22158
22215
  for (let i = 0;i < items.length; i++) {
22159
22216
  const r2 = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
22160
22217
  if (r2 instanceof Promise) {
@@ -22163,12 +22220,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
22163
22220
  }));
22164
22221
  } else {
22165
22222
  itemResults[i] = r2;
22223
+ if (abortEarly && !itemAborted && r2.issues.length)
22224
+ itemAborted = aborted(r2);
22166
22225
  }
22167
22226
  }
22168
- if (def.rest) {
22227
+ if (def.rest && !itemAborted) {
22169
22228
  let i = items.length - 1;
22170
22229
  const rest = input.slice(items.length);
22230
+ let seen = payload.issues.length;
22171
22231
  for (const el of rest) {
22232
+ if (abortEarly && payload.issues.length !== seen) {
22233
+ if (aborted(payload, seen))
22234
+ break;
22235
+ seen = payload.issues.length;
22236
+ }
22172
22237
  i++;
22173
22238
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
22174
22239
  if (result instanceof Promise) {
@@ -22396,7 +22461,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
22396
22461
  }
22397
22462
  const proms = [];
22398
22463
  payload.value = memo ? memo.alloc(inst, payload, new Map, ctx) : new Map;
22464
+ const abortEarly = ctx?.abortEarly;
22465
+ let seen = payload.issues.length;
22399
22466
  for (const [key, value] of input) {
22467
+ if (abortEarly && payload.issues.length !== seen) {
22468
+ if (aborted(payload, seen))
22469
+ break;
22470
+ seen = payload.issues.length;
22471
+ }
22400
22472
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
22401
22473
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
22402
22474
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -22459,7 +22531,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
22459
22531
  }
22460
22532
  const proms = [];
22461
22533
  payload.value = memo ? memo.alloc(inst, payload, new Set, ctx) : new Set;
22534
+ const abortEarly = ctx?.abortEarly;
22535
+ let seen = payload.issues.length;
22462
22536
  for (const item of input) {
22537
+ if (abortEarly && payload.issues.length !== seen) {
22538
+ if (aborted(payload, seen))
22539
+ break;
22540
+ seen = payload.issues.length;
22541
+ }
22463
22542
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
22464
22543
  if (result instanceof Promise) {
22465
22544
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -22482,8 +22561,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
22482
22561
  const values = getEnumValues(def.entries);
22483
22562
  const valuesSet = new Set(values);
22484
22563
  inst._zod.values = valuesSet;
22485
- const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
22486
- inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o2) => escapeRegex(o2.toString())).join("|")})$` : "^[^\\s\\S]$");
22564
+ defineLazyInternal(inst, "pattern", (zod) => {
22565
+ const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
22566
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o2) => escapeRegex(o2.toString())).join("|")})$` : "^[^\\s\\S]$");
22567
+ });
22487
22568
  inst._zod.parse = (payload, _ctx) => {
22488
22569
  const input = payload.value;
22489
22570
  if (valuesSet.has(input)) {
@@ -22502,7 +22583,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
22502
22583
  $ZodType.init(inst, def);
22503
22584
  const values = new Set(def.values);
22504
22585
  inst._zod.values = values;
22505
- inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$` : "^[^\\s\\S]$");
22586
+ defineLazyInternal(inst, "pattern", (zod) => {
22587
+ const vals = zod.def.values;
22588
+ return new RegExp(vals.length ? `^(${vals.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$` : "^[^\\s\\S]$");
22589
+ });
22506
22590
  inst._zod.parse = (payload, _ctx) => {
22507
22591
  const input = payload.value;
22508
22592
  if (values.has(input)) {
@@ -22840,20 +22924,62 @@ function handleReadonlyResult(payload) {
22840
22924
  payload.value = Object.freeze(payload.value);
22841
22925
  return payload;
22842
22926
  }
22927
+ function leafPattern(schema) {
22928
+ const def = schema._zod.def;
22929
+ let pattern = def.pattern;
22930
+ let isInt = !!def.format?.includes("int");
22931
+ let minimum;
22932
+ let maximum;
22933
+ for (const ch of def.checks ?? []) {
22934
+ const d = ch._zod.def;
22935
+ if (d.pattern)
22936
+ pattern = d.pattern;
22937
+ isInt || (isInt = !!d.format?.includes("int"));
22938
+ const lo = d.minimum ?? d.length;
22939
+ const hi = d.maximum ?? d.length;
22940
+ if (lo !== undefined && (minimum === undefined || lo > minimum))
22941
+ minimum = lo;
22942
+ if (hi !== undefined && (maximum === undefined || hi < maximum))
22943
+ maximum = hi;
22944
+ }
22945
+ if (pattern)
22946
+ return pattern.source;
22947
+ if (minimum !== undefined && maximum !== undefined && minimum > maximum)
22948
+ return "(?!)";
22949
+ if (minimum !== undefined || maximum !== undefined)
22950
+ return string({ minimum, maximum }).source;
22951
+ const own2 = schema._zod.pattern;
22952
+ return (isInt && own2 === number ? integer : own2)?.source;
22953
+ }
22954
+ function partPattern(schema) {
22955
+ const def = schema._zod.def;
22956
+ const own2 = schema._zod.pattern?.source;
22957
+ const inner = def.innerType ?? schema._zod.innerType;
22958
+ if (inner) {
22959
+ const before = inner._zod.pattern?.source;
22960
+ const after = partPattern(inner);
22961
+ if (own2 && before && after && after !== before) {
22962
+ return own2.replace(cleanRegex(before), () => cleanRegex(after));
22963
+ }
22964
+ return own2;
22965
+ }
22966
+ if (def.options) {
22967
+ const sources = def.options.map(partPattern);
22968
+ if (sources.every(Boolean))
22969
+ return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
22970
+ }
22971
+ return leafPattern(schema);
22972
+ }
22843
22973
  var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
22844
22974
  $ZodType.init(inst, def);
22845
22975
  const regexParts = [];
22846
22976
  for (const part of def.parts) {
22847
22977
  if (typeof part === "object" && part !== null) {
22848
- if (!part._zod.pattern) {
22978
+ const source = partPattern(part);
22979
+ if (!source) {
22849
22980
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
22850
22981
  }
22851
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
22852
- if (!source)
22853
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
22854
- const start = source.startsWith("^") ? 1 : 0;
22855
- const end = source.endsWith("$") ? source.length - 1 : source.length;
22856
- regexParts.push(source.slice(start, end));
22982
+ regexParts.push(cleanRegex(source));
22857
22983
  } else if (part === null || primitiveTypes.has(typeof part)) {
22858
22984
  regexParts.push(escapeRegex(`${part}`));
22859
22985
  } else {
@@ -23024,28 +23150,53 @@ class $ZodCyclicError extends Error {
23024
23150
  }
23025
23151
  var STATE = "~memo";
23026
23152
  var NO_ISSUES = [];
23153
+ function isRef(value) {
23154
+ return value !== null && typeof value === "object";
23155
+ }
23027
23156
  function cloneIssues(issues) {
23028
23157
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
23029
23158
  }
23030
23159
  var recursive = /* @__PURE__ */ new WeakMap;
23031
- function isRecursive(inst, stack) {
23160
+ var NONE = 0;
23161
+ var ASSUMED = 1;
23162
+ var PROVEN = 2;
23163
+ function isRecursive(inst, stack, resolve17) {
23032
23164
  const cached2 = recursive.get(inst);
23033
23165
  if (cached2 !== undefined)
23034
- return cached2;
23166
+ return cached2 ? PROVEN : NONE;
23035
23167
  if (stack.has(inst))
23036
- return true;
23168
+ return PROVEN;
23037
23169
  stack.add(inst);
23038
- let result = false;
23170
+ let result = NONE;
23039
23171
  const check = (child) => {
23040
- if (!result && child?._zod && isRecursive(child, stack))
23041
- result = true;
23172
+ if (result !== PROVEN && child?._zod) {
23173
+ const answer = isRecursive(child, stack, resolve17);
23174
+ if (answer > result)
23175
+ result = answer;
23176
+ }
23177
+ };
23178
+ const shape = (sh, spread) => {
23179
+ let answer = NONE;
23180
+ for (const key of Reflect.ownKeys(sh)) {
23181
+ const desc = Object.getOwnPropertyDescriptor(sh, key);
23182
+ if (spread && !desc.enumerable)
23183
+ continue;
23184
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve17) : NONE;
23185
+ if (child > answer)
23186
+ answer = child;
23187
+ }
23188
+ return answer;
23189
+ };
23190
+ const merge2 = (answer) => {
23191
+ if (answer > result)
23192
+ result = answer;
23042
23193
  };
23043
23194
  const def = inst._zod.def;
23044
23195
  const kind = def.type;
23045
23196
  switch (kind) {
23046
23197
  case "object": {
23047
- for (const key of Reflect.ownKeys(def.shape))
23048
- check(def.shape[key]);
23198
+ const raw = rawShape(def);
23199
+ merge2(raw ? shape(raw, true) : ASSUMED);
23049
23200
  check(def.catchall);
23050
23201
  break;
23051
23202
  }
@@ -23092,9 +23243,11 @@ function isRecursive(inst, stack) {
23092
23243
  check(def.input);
23093
23244
  check(def.output);
23094
23245
  break;
23095
- case "lazy":
23096
- check(inst._zod.innerType);
23246
+ case "lazy": {
23247
+ const inner = def._cachedInner ?? (resolve17 ? inst._zod.innerType : undefined);
23248
+ merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
23097
23249
  break;
23250
+ }
23098
23251
  case "template_literal":
23099
23252
  case "string":
23100
23253
  case "number":
@@ -23133,16 +23286,20 @@ function isRecursive(inst, stack) {
23133
23286
  }
23134
23287
  }
23135
23288
  stack.delete(inst);
23136
- recursive.set(inst, result);
23137
- return result;
23289
+ return settle(inst, result);
23290
+ }
23291
+ function settle(inst, answer) {
23292
+ if (answer !== ASSUMED)
23293
+ recursive.set(inst, answer === PROVEN);
23294
+ return answer;
23138
23295
  }
23139
23296
  function isRecursiveSchema(inst) {
23140
- return isRecursive(inst, new Set);
23297
+ return isRecursive(inst, new Set, true) !== NONE;
23141
23298
  }
23142
23299
  function bucketFor(state, inst) {
23143
23300
  let bucket = state.buckets.get(inst);
23144
23301
  if (!bucket) {
23145
- bucket = new Map;
23302
+ bucket = new WeakMap;
23146
23303
  state.buckets.set(inst, bucket);
23147
23304
  }
23148
23305
  return bucket;
@@ -23178,6 +23335,7 @@ var memo = {
23178
23335
  attach(inst) {
23179
23336
  var _a2;
23180
23337
  let isRecursiveInst;
23338
+ let rechecked = false;
23181
23339
  let lastCtx;
23182
23340
  let lastBucket;
23183
23341
  (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
@@ -23185,20 +23343,24 @@ var memo = {
23185
23343
  const base = inst._zod.parse;
23186
23344
  const wrapped = (payload, ctx) => {
23187
23345
  if (isRecursiveInst === undefined) {
23188
- isRecursiveInst = isRecursive(inst, new Set);
23189
- if (!isRecursiveInst) {
23346
+ const walked = isRecursive(inst, new Set, false);
23347
+ if (walked === NONE) {
23190
23348
  inst._zod.parse = base;
23191
23349
  if (inst._zod.run === wrapped)
23192
23350
  inst._zod.run = base;
23193
23351
  return base(payload, ctx);
23194
23352
  }
23353
+ if (walked === PROVEN || rechecked)
23354
+ isRecursiveInst = true;
23355
+ else
23356
+ rechecked = true;
23195
23357
  }
23196
23358
  const input = payload.value;
23197
- if (input === null || typeof input !== "object")
23359
+ if (!isRef(input))
23198
23360
  return base(payload, ctx);
23199
23361
  let state = ctx[STATE];
23200
23362
  if (!state) {
23201
- state = { buckets: new Map, backEdges: undefined };
23363
+ state = { buckets: new WeakMap, backEdges: undefined };
23202
23364
  ctx[STATE] = state;
23203
23365
  }
23204
23366
  let bucket;
@@ -23217,7 +23379,7 @@ var memo = {
23217
23379
  payload.issues.push(...cloneIssues(hit.issues));
23218
23380
  } else {
23219
23381
  payload.memo = true;
23220
- state.backEdges ?? (state.backEdges = new Set);
23382
+ state.backEdges ?? (state.backEdges = new WeakSet);
23221
23383
  state.backEdges.add(hit.value);
23222
23384
  }
23223
23385
  return payload;
@@ -23249,7 +23411,7 @@ function memoizer() {
23249
23411
  }
23250
23412
  function isBackEdge(ctx, value) {
23251
23413
  const backEdges = ctx[STATE]?.backEdges;
23252
- return backEdges !== undefined && value !== null && typeof value === "object" && backEdges.has(value);
23414
+ return backEdges !== undefined && isRef(value) && backEdges.has(value);
23253
23415
  }
23254
23416
  // node_modules/zod/v4/locales/index.js
23255
23417
  var exports_locales = {};
@@ -23265,6 +23427,7 @@ __export(exports_locales, {
23265
23427
  tr: () => tr_default,
23266
23428
  tk: () => tk_default,
23267
23429
  th: () => th_default,
23430
+ tg: () => tg_default,
23268
23431
  ta: () => ta_default,
23269
23432
  sv: () => sv_default,
23270
23433
  sl: () => sl_default,
@@ -23359,6 +23522,8 @@ var error = () => {
23359
23522
  json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
23360
23523
  e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
23361
23524
  credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
23525
+ currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
23526
+ iban: "IBAN",
23362
23527
  jwt: "JWT",
23363
23528
  template_literal: "\u0645\u062F\u062E\u0644"
23364
23529
  };
@@ -23468,6 +23633,8 @@ var error2 = () => {
23468
23633
  json_string: "JSON string",
23469
23634
  e164: "E.164 number",
23470
23635
  credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
23636
+ currency_code: "valyuta kodu",
23637
+ iban: "IBAN",
23471
23638
  jwt: "JWT",
23472
23639
  template_literal: "input"
23473
23640
  };
@@ -23626,6 +23793,8 @@ var error3 = () => {
23626
23793
  json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
23627
23794
  e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
23628
23795
  credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
23796
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
23797
+ iban: "IBAN",
23629
23798
  jwt: "JWT",
23630
23799
  template_literal: "\u0443\u0432\u043E\u0434"
23631
23800
  };
@@ -23742,6 +23911,8 @@ var error4 = () => {
23742
23911
  json_string: "JSON \u043D\u0438\u0437",
23743
23912
  e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
23744
23913
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
23914
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
23915
+ iban: "IBAN",
23745
23916
  jwt: "JWT",
23746
23917
  template_literal: "\u0432\u0445\u043E\u0434"
23747
23918
  };
@@ -23865,6 +24036,8 @@ var error5 = () => {
23865
24036
  json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
23866
24037
  e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
23867
24038
  credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
24039
+ currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
24040
+ iban: "IBAN",
23868
24041
  jwt: "JWT",
23869
24042
  template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
23870
24043
  };
@@ -23976,6 +24149,8 @@ var error6 = () => {
23976
24149
  json_string: "cadena JSON",
23977
24150
  e164: "n\xFAmero E.164",
23978
24151
  credit_card: "n\xFAmero de targeta de cr\xE8dit",
24152
+ currency_code: "codi de moneda",
24153
+ iban: "IBAN",
23979
24154
  jwt: "JWT",
23980
24155
  template_literal: "entrada"
23981
24156
  };
@@ -24086,6 +24261,8 @@ var error7 = () => {
24086
24261
  json_string: "\u062F\u06D5\u0642\u06CC JSON",
24087
24262
  e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
24088
24263
  credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
24264
+ currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
24265
+ iban: "IBAN",
24089
24266
  jwt: "JWT",
24090
24267
  template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
24091
24268
  };
@@ -24216,6 +24393,8 @@ var error8 = () => {
24216
24393
  json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
24217
24394
  e164: "\u010D\xEDslo E.164",
24218
24395
  credit_card: "\u010D\xEDslo kreditn\xED karty",
24396
+ currency_code: "k\xF3d m\u011Bny",
24397
+ iban: "IBAN",
24219
24398
  jwt: "JWT",
24220
24399
  template_literal: "vstup"
24221
24400
  };
@@ -24330,6 +24509,8 @@ var error9 = () => {
24330
24509
  json_string: "JSON-streng",
24331
24510
  e164: "E.164-nummer",
24332
24511
  credit_card: "kreditkortnummer",
24512
+ currency_code: "valutakode",
24513
+ iban: "IBAN",
24333
24514
  jwt: "JWT",
24334
24515
  template_literal: "input"
24335
24516
  };
@@ -24448,6 +24629,8 @@ var error10 = () => {
24448
24629
  json_string: "JSON-String",
24449
24630
  e164: "E.164-Nummer",
24450
24631
  credit_card: "Kreditkartennummer",
24632
+ currency_code: "W\xE4hrungscode",
24633
+ iban: "IBAN",
24451
24634
  jwt: "JWT",
24452
24635
  template_literal: "Eingabe"
24453
24636
  };
@@ -24559,6 +24742,8 @@ var error11 = () => {
24559
24742
  json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
24560
24743
  e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
24561
24744
  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",
24745
+ currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
24746
+ iban: "IBAN",
24562
24747
  jwt: "JWT",
24563
24748
  template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
24564
24749
  };
@@ -24668,7 +24853,9 @@ var error12 = () => {
24668
24853
  base64url: "base64url-encoded string",
24669
24854
  json_string: "JSON string",
24670
24855
  e164: "E.164 number",
24856
+ currency_code: "currency code",
24671
24857
  credit_card: "credit card number",
24858
+ iban: "IBAN",
24672
24859
  jwt: "JWT",
24673
24860
  template_literal: "input"
24674
24861
  };
@@ -24789,6 +24976,8 @@ var error13 = () => {
24789
24976
  json_string: "JSON-karaktraro",
24790
24977
  e164: "E.164-nombro",
24791
24978
  credit_card: "kreditkarta numero",
24979
+ currency_code: "valuta kodo",
24980
+ iban: "IBAN",
24792
24981
  jwt: "JWT",
24793
24982
  template_literal: "enigo"
24794
24983
  };
@@ -24900,6 +25089,8 @@ var error14 = () => {
24900
25089
  json_string: "cadena JSON",
24901
25090
  e164: "n\xFAmero E.164",
24902
25091
  credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
25092
+ currency_code: "c\xF3digo de moneda",
25093
+ iban: "IBAN",
24903
25094
  jwt: "JWT",
24904
25095
  template_literal: "entrada"
24905
25096
  };
@@ -25035,6 +25226,8 @@ var error15 = () => {
25035
25226
  json_string: "JSON \u0631\u0634\u062A\u0647",
25036
25227
  e164: "E.164 \u0639\u062F\u062F",
25037
25228
  credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
25229
+ currency_code: "\u06A9\u062F \u0627\u0631\u0632",
25230
+ iban: "IBAN",
25038
25231
  jwt: "JWT",
25039
25232
  template_literal: "\u0648\u0631\u0648\u062F\u06CC"
25040
25233
  };
@@ -25156,6 +25349,8 @@ var error16 = () => {
25156
25349
  json_string: "JSON-merkkijono",
25157
25350
  e164: "E.164-luku",
25158
25351
  credit_card: "luottokortin numero",
25352
+ currency_code: "valuuttakoodi",
25353
+ iban: "IBAN",
25159
25354
  jwt: "JWT",
25160
25355
  template_literal: "templaattimerkkijono"
25161
25356
  };
@@ -25266,6 +25461,8 @@ var error17 = () => {
25266
25461
  json_string: "cha\xEEne de caract\xE8res JSON",
25267
25462
  e164: "num\xE9ro au format E.164",
25268
25463
  credit_card: "num\xE9ro de carte de cr\xE9dit",
25464
+ currency_code: "code de devise",
25465
+ iban: "IBAN",
25269
25466
  jwt: "JWT",
25270
25467
  template_literal: "entr\xE9e"
25271
25468
  };
@@ -25394,6 +25591,8 @@ var error18 = () => {
25394
25591
  json_string: "cha\xEEne JSON",
25395
25592
  e164: "num\xE9ro E.164",
25396
25593
  credit_card: "num\xE9ro de carte de cr\xE9dit",
25594
+ currency_code: "code de devise",
25595
+ iban: "IBAN",
25397
25596
  jwt: "JWT",
25398
25597
  template_literal: "entr\xE9e"
25399
25598
  };
@@ -25504,6 +25703,8 @@ var error19 = () => {
25504
25703
  json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
25505
25704
  e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
25506
25705
  credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
25706
+ currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
25707
+ iban: "IBAN",
25507
25708
  jwt: "JWT",
25508
25709
  template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
25509
25710
  };
@@ -25650,6 +25851,8 @@ var error20 = () => {
25650
25851
  json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
25651
25852
  e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
25652
25853
  credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
25854
+ currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
25855
+ iban: { label: "IBAN", gender: "m" },
25653
25856
  jwt: { label: "JWT", gender: "m" },
25654
25857
  template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
25655
25858
  ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
@@ -25813,6 +26016,8 @@ var error21 = () => {
25813
26016
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
25814
26017
  e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
25815
26018
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
26019
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
26020
+ iban: "IBAN",
25816
26021
  jwt: "JWT",
25817
26022
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
25818
26023
  };
@@ -25921,6 +26126,8 @@ var error22 = () => {
25921
26126
  json_string: "JSON tekst",
25922
26127
  e164: "E.164 broj",
25923
26128
  credit_card: "broj kreditne kartice",
26129
+ currency_code: "kod valute",
26130
+ iban: "IBAN",
25924
26131
  jwt: "JWT",
25925
26132
  template_literal: "unos"
25926
26133
  };
@@ -26046,6 +26253,8 @@ var error23 = () => {
26046
26253
  json_string: "JSON string",
26047
26254
  e164: "E.164 sz\xE1m",
26048
26255
  credit_card: "hitelk\xE1rtyasz\xE1m",
26256
+ currency_code: "p\xE9nznemk\xF3d",
26257
+ iban: "IBAN",
26049
26258
  jwt: "JWT",
26050
26259
  template_literal: "bemenet"
26051
26260
  };
@@ -26197,6 +26406,8 @@ var error24 = () => {
26197
26406
  json_string: "JSON \u057F\u0578\u0572",
26198
26407
  e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
26199
26408
  credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
26409
+ currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
26410
+ iban: "IBAN",
26200
26411
  jwt: "JWT",
26201
26412
  template_literal: "\u0574\u0578\u0582\u057F\u0584"
26202
26413
  };
@@ -26313,6 +26524,8 @@ var error25 = () => {
26313
26524
  json_string: "string JSON",
26314
26525
  e164: "angka E.164",
26315
26526
  credit_card: "nomor kartu kredit",
26527
+ currency_code: "kode mata uang",
26528
+ iban: "IBAN",
26316
26529
  jwt: "JWT",
26317
26530
  template_literal: "input"
26318
26531
  };
@@ -26422,6 +26635,8 @@ var error26 = () => {
26422
26635
  json_string: "JSON strengur",
26423
26636
  e164: "E.164 t\xF6lugildi",
26424
26637
  credit_card: "kreditkortan\xFAmer",
26638
+ currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
26639
+ iban: "IBAN",
26425
26640
  jwt: "JWT",
26426
26641
  template_literal: "gildi"
26427
26642
  };
@@ -26534,6 +26749,8 @@ var error27 = () => {
26534
26749
  json_string: "stringa JSON",
26535
26750
  e164: "numero E.164",
26536
26751
  credit_card: "numero di carta di credito",
26752
+ currency_code: "codice valuta",
26753
+ iban: "IBAN",
26537
26754
  jwt: "JWT",
26538
26755
  template_literal: "input"
26539
26756
  };
@@ -26645,6 +26862,8 @@ var error28 = () => {
26645
26862
  json_string: "JSON\u6587\u5B57\u5217",
26646
26863
  e164: "E.164\u756A\u53F7",
26647
26864
  credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
26865
+ currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
26866
+ iban: "IBAN",
26648
26867
  jwt: "JWT",
26649
26868
  template_literal: "\u5165\u529B\u5024"
26650
26869
  };
@@ -26755,6 +26974,8 @@ var error29 = () => {
26755
26974
  json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
26756
26975
  e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
26757
26976
  credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
26977
+ currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
26978
+ iban: "IBAN",
26758
26979
  jwt: "JWT",
26759
26980
  template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
26760
26981
  };
@@ -26870,6 +27091,8 @@ var error30 = () => {
26870
27091
  json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
26871
27092
  e164: "\u179B\u17C1\u1781 E.164",
26872
27093
  credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
27094
+ currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
27095
+ iban: "IBAN",
26873
27096
  jwt: "JWT",
26874
27097
  template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
26875
27098
  };
@@ -26988,6 +27211,8 @@ var error31 = () => {
26988
27211
  json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
26989
27212
  e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
26990
27213
  credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
27214
+ currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
27215
+ iban: "IBAN",
26991
27216
  jwt: "JWT",
26992
27217
  template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
26993
27218
  };
@@ -27099,6 +27324,8 @@ var error32 = () => {
27099
27324
  json_string: "JSON \uBB38\uC790\uC5F4",
27100
27325
  e164: "E.164 \uBC88\uD638",
27101
27326
  credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
27327
+ currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
27328
+ iban: "IBAN",
27102
27329
  jwt: "JWT",
27103
27330
  template_literal: "\uC785\uB825"
27104
27331
  };
@@ -27295,6 +27522,8 @@ var error33 = () => {
27295
27522
  json_string: "JSON eilut\u0117",
27296
27523
  e164: "E.164 numeris",
27297
27524
  credit_card: "kredito kortel\u0117s numeris",
27525
+ currency_code: "valiutos kodas",
27526
+ iban: "IBAN",
27298
27527
  jwt: "JWT",
27299
27528
  template_literal: "\u012Fvestis"
27300
27529
  };
@@ -27418,6 +27647,8 @@ var error34 = () => {
27418
27647
  json_string: "JSON \u043D\u0438\u0437\u0430",
27419
27648
  e164: "E.164 \u0431\u0440\u043E\u0458",
27420
27649
  credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
27650
+ currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
27651
+ iban: "IBAN",
27421
27652
  jwt: "JWT",
27422
27653
  template_literal: "\u0432\u043D\u0435\u0441"
27423
27654
  };
@@ -27530,6 +27761,8 @@ var error35 = () => {
27530
27761
  json_string: "string JSON",
27531
27762
  e164: "nombor E.164",
27532
27763
  credit_card: "nombor kad kredit",
27764
+ currency_code: "kod mata wang",
27765
+ iban: "IBAN",
27533
27766
  jwt: "JWT",
27534
27767
  template_literal: "input"
27535
27768
  };
@@ -27640,6 +27873,8 @@ var error36 = () => {
27640
27873
  json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
27641
27874
  e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
27642
27875
  credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
27876
+ currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
27877
+ iban: "IBAN",
27643
27878
  jwt: "JWT",
27644
27879
  template_literal: "\u0907\u0928\u092A\u0941\u091F"
27645
27880
  };
@@ -27749,6 +27984,8 @@ var error37 = () => {
27749
27984
  json_string: "JSON string",
27750
27985
  e164: "E.164-nummer",
27751
27986
  credit_card: "creditcardnummer",
27987
+ currency_code: "valutacode",
27988
+ iban: "IBAN",
27752
27989
  jwt: "JWT",
27753
27990
  template_literal: "invoer"
27754
27991
  };
@@ -27862,6 +28099,8 @@ var error38 = () => {
27862
28099
  json_string: "JSON-streng",
27863
28100
  e164: "E.164-nummer",
27864
28101
  credit_card: "kredittkortnummer",
28102
+ currency_code: "valutakode",
28103
+ iban: "IBAN",
27865
28104
  jwt: "JWT",
27866
28105
  template_literal: "input"
27867
28106
  };
@@ -27973,6 +28212,8 @@ var error39 = () => {
27973
28212
  json_string: "JSON-streng",
27974
28213
  e164: "E.164-nummer",
27975
28214
  credit_card: "kredittkortnummer",
28215
+ currency_code: "valutakode",
28216
+ iban: "IBAN",
27976
28217
  jwt: "JWT",
27977
28218
  template_literal: "input"
27978
28219
  };
@@ -28084,6 +28325,8 @@ var error40 = () => {
28084
28325
  json_string: "JSON metin",
28085
28326
  e164: "E.164 say\u0131s\u0131",
28086
28327
  credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
28328
+ currency_code: "para birimi kodu",
28329
+ iban: "IBAN",
28087
28330
  jwt: "JWT",
28088
28331
  template_literal: "giren"
28089
28332
  };
@@ -28196,6 +28439,8 @@ var error41 = () => {
28196
28439
  json_string: "JSON \u0645\u062A\u0646",
28197
28440
  e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
28198
28441
  credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
28442
+ currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
28443
+ iban: "IBAN",
28199
28444
  jwt: "JWT",
28200
28445
  template_literal: "\u0648\u0631\u0648\u062F\u064A"
28201
28446
  };
@@ -28313,6 +28558,8 @@ var error42 = () => {
28313
28558
  json_string: "ci\u0105g znak\xF3w w formacie JSON",
28314
28559
  e164: "liczba E.164",
28315
28560
  credit_card: "numer karty kredytowej",
28561
+ currency_code: "kod waluty",
28562
+ iban: "IBAN",
28316
28563
  jwt: "JWT",
28317
28564
  template_literal: "wej\u015Bcie"
28318
28565
  };
@@ -28425,6 +28672,8 @@ var error43 = () => {
28425
28672
  json_string: "o texto JSON",
28426
28673
  e164: "o n\xFAmero E.164",
28427
28674
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
28675
+ currency_code: "o c\xF3digo de moeda",
28676
+ iban: "o IBAN",
28428
28677
  jwt: "o JWT",
28429
28678
  template_literal: "a entrada"
28430
28679
  };
@@ -28565,6 +28814,8 @@ var error44 = () => {
28565
28814
  json_string: "o texto JSON",
28566
28815
  e164: "o n\xFAmero E.164",
28567
28816
  credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
28817
+ currency_code: "o c\xF3digo de moeda",
28818
+ iban: "o IBAN",
28568
28819
  jwt: "o JWT",
28569
28820
  template_literal: "a entrada"
28570
28821
  };
@@ -28706,6 +28957,8 @@ var error45 = () => {
28706
28957
  json_string: "\u0219ir JSON",
28707
28958
  e164: "num\u0103r E.164",
28708
28959
  credit_card: "num\u0103r de card de credit",
28960
+ currency_code: "cod valutar",
28961
+ iban: "IBAN",
28709
28962
  jwt: "JWT",
28710
28963
  template_literal: "intrare"
28711
28964
  };
@@ -28876,6 +29129,8 @@ var error46 = () => {
28876
29129
  json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
28877
29130
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
28878
29131
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
29132
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
29133
+ iban: "IBAN",
28879
29134
  jwt: "JWT",
28880
29135
  template_literal: "\u0432\u0432\u043E\u0434"
28881
29136
  };
@@ -28992,6 +29247,8 @@ var error47 = () => {
28992
29247
  json_string: "re\u0165azec vo form\xE1te JSON",
28993
29248
  e164: "\u010D\xEDslo E.164",
28994
29249
  credit_card: "\u010D\xEDslo kreditnej karty",
29250
+ currency_code: "k\xF3d meny",
29251
+ iban: "IBAN",
28995
29252
  jwt: "JWT",
28996
29253
  template_literal: "vstup"
28997
29254
  };
@@ -29106,6 +29363,8 @@ var error48 = () => {
29106
29363
  json_string: "JSON niz",
29107
29364
  e164: "E.164 \u0161tevilka",
29108
29365
  credit_card: "\u0161tevilka kreditne kartice",
29366
+ currency_code: "koda valute",
29367
+ iban: "IBAN",
29109
29368
  jwt: "JWT",
29110
29369
  template_literal: "vnos"
29111
29370
  };
@@ -29218,6 +29477,8 @@ var error49 = () => {
29218
29477
  json_string: "JSON-str\xE4ng",
29219
29478
  e164: "E.164-nummer",
29220
29479
  credit_card: "kreditkortsnummer",
29480
+ currency_code: "valutakod",
29481
+ iban: "IBAN",
29221
29482
  jwt: "JWT",
29222
29483
  template_literal: "mall-literal"
29223
29484
  };
@@ -29331,6 +29592,8 @@ var error50 = () => {
29331
29592
  json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
29332
29593
  e164: "E.164 \u0B8E\u0BA3\u0BCD",
29333
29594
  credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
29595
+ currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
29596
+ iban: "IBAN",
29334
29597
  jwt: "JWT",
29335
29598
  template_literal: "input"
29336
29599
  };
@@ -29403,8 +29666,124 @@ function ta_default() {
29403
29666
  localeError: error50()
29404
29667
  };
29405
29668
  }
29406
- // node_modules/zod/v4/locales/th.js
29669
+ // node_modules/zod/v4/locales/tg.js
29407
29670
  var error51 = () => {
29671
+ const Sizable = {
29672
+ string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29673
+ file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29674
+ array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29675
+ set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
29676
+ map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
29677
+ };
29678
+ function getSizing(origin) {
29679
+ return Sizable[origin] ?? null;
29680
+ }
29681
+ const FormatDictionary = {
29682
+ regex: "\u0432\u0443\u0440\u0443\u0434",
29683
+ email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
29684
+ url: "URL",
29685
+ emoji: "\u044D\u043C\u043E\u04B7\u0438",
29686
+ uuid: "UUID",
29687
+ uuidv4: "UUIDv4",
29688
+ uuidv6: "UUIDv6",
29689
+ nanoid: "nanoid",
29690
+ guid: "GUID",
29691
+ cuid: "cuid",
29692
+ cuid2: "cuid2",
29693
+ ulid: "ULID",
29694
+ xid: "XID",
29695
+ ksuid: "KSUID",
29696
+ datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
29697
+ date: "\u0441\u0430\u043D\u0430\u0438 ISO",
29698
+ time: "\u0432\u0430\u049B\u0442\u0438 ISO",
29699
+ duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
29700
+ ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
29701
+ ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
29702
+ mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
29703
+ cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
29704
+ cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
29705
+ base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
29706
+ base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
29707
+ json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
29708
+ e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
29709
+ credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
29710
+ currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
29711
+ iban: "IBAN",
29712
+ jwt: "JWT",
29713
+ template_literal: "\u0432\u0443\u0440\u0443\u0434"
29714
+ };
29715
+ const TypeDictionary = {
29716
+ nan: "NaN",
29717
+ number: "\u0440\u0430\u049B\u0430\u043C",
29718
+ string: "\u0441\u0430\u0442\u0440",
29719
+ array: "\u043C\u0430\u0441\u0441\u0438\u0432",
29720
+ object: "\u043E\u0431\u044A\u0435\u043A\u0442",
29721
+ date: "\u0441\u0430\u043D\u0430"
29722
+ };
29723
+ return (issue2) => {
29724
+ switch (issue2.code) {
29725
+ case "invalid_type": {
29726
+ const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
29727
+ const receivedType = parsedType(issue2.input);
29728
+ const received = TypeDictionary[receivedType] ?? receivedType;
29729
+ 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`;
29730
+ }
29731
+ case "invalid_value":
29732
+ if (issue2.values.length === 1)
29733
+ 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`;
29734
+ 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`;
29735
+ case "too_big": {
29736
+ const adj = issue2.inclusive ? "<=" : "<";
29737
+ const sizing = getSizing(issue2.origin);
29738
+ if (sizing)
29739
+ 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}`;
29740
+ 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`;
29741
+ }
29742
+ case "too_small": {
29743
+ const adj = issue2.inclusive ? ">=" : ">";
29744
+ const sizing = getSizing(issue2.origin);
29745
+ if (sizing)
29746
+ return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
29747
+ return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
29748
+ }
29749
+ case "invalid_format": {
29750
+ const _issue = issue2;
29751
+ if (_issue.format === "starts_with")
29752
+ 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`;
29753
+ if (_issue.format === "ends_with")
29754
+ 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`;
29755
+ if (_issue.format === "includes")
29756
+ 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`;
29757
+ if (_issue.format === "regex")
29758
+ 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`;
29759
+ return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
29760
+ }
29761
+ case "not_multiple_of":
29762
+ 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`;
29763
+ case "unrecognized_keys":
29764
+ 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, ", ")}`;
29765
+ case "invalid_key":
29766
+ return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
29767
+ case "invalid_union":
29768
+ if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
29769
+ const opts = issue2.options.map((o2) => `'${o2}'`).join(" | ");
29770
+ 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`;
29771
+ }
29772
+ return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
29773
+ case "invalid_element":
29774
+ return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
29775
+ default:
29776
+ return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
29777
+ }
29778
+ };
29779
+ };
29780
+ function tg_default() {
29781
+ return {
29782
+ localeError: error51()
29783
+ };
29784
+ }
29785
+ // node_modules/zod/v4/locales/th.js
29786
+ var error52 = () => {
29408
29787
  const Sizable = {
29409
29788
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
29410
29789
  file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -29444,6 +29823,8 @@ var error51 = () => {
29444
29823
  json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
29445
29824
  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)",
29446
29825
  credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
29826
+ currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
29827
+ iban: "IBAN",
29447
29828
  jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
29448
29829
  template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
29449
29830
  };
@@ -29513,11 +29894,11 @@ var error51 = () => {
29513
29894
  };
29514
29895
  function th_default() {
29515
29896
  return {
29516
- localeError: error51()
29897
+ localeError: error52()
29517
29898
  };
29518
29899
  }
29519
29900
  // node_modules/zod/v4/locales/tk.js
29520
- var error52 = () => {
29901
+ var error53 = () => {
29521
29902
  const Sizable = {
29522
29903
  string: { unit: "simwol", verb: "bolmaly" },
29523
29904
  file: { unit: "ba\xFDt", verb: "bolmaly" },
@@ -29557,6 +29938,8 @@ var error52 = () => {
29557
29938
  json_string: "JSON setiri",
29558
29939
  e164: "E.164 nomeri",
29559
29940
  credit_card: "kredit kartyny\u0148 nomeri",
29941
+ currency_code: "wal\xFDuta kody",
29942
+ iban: "IBAN",
29560
29943
  jwt: "JWT",
29561
29944
  template_literal: "\u015Fablon"
29562
29945
  };
@@ -29618,11 +30001,11 @@ var error52 = () => {
29618
30001
  };
29619
30002
  function tk_default() {
29620
30003
  return {
29621
- localeError: error52()
30004
+ localeError: error53()
29622
30005
  };
29623
30006
  }
29624
30007
  // node_modules/zod/v4/locales/tr.js
29625
- var error53 = () => {
30008
+ var error54 = () => {
29626
30009
  const Sizable = {
29627
30010
  string: { unit: "karakter", verb: "olmal\u0131" },
29628
30011
  file: { unit: "bayt", verb: "olmal\u0131" },
@@ -29662,6 +30045,8 @@ var error53 = () => {
29662
30045
  json_string: "JSON dizesi",
29663
30046
  e164: "E.164 say\u0131s\u0131",
29664
30047
  credit_card: "kredi kart\u0131 numaras\u0131",
30048
+ currency_code: "para birimi kodu",
30049
+ iban: "IBAN",
29665
30050
  jwt: "JWT",
29666
30051
  template_literal: "\u015Eablon dizesi"
29667
30052
  };
@@ -29726,11 +30111,11 @@ var error53 = () => {
29726
30111
  };
29727
30112
  function tr_default() {
29728
30113
  return {
29729
- localeError: error53()
30114
+ localeError: error54()
29730
30115
  };
29731
30116
  }
29732
30117
  // node_modules/zod/v4/locales/uk.js
29733
- var error54 = () => {
30118
+ var error55 = () => {
29734
30119
  const Sizable = {
29735
30120
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
29736
30121
  file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -29770,6 +30155,8 @@ var error54 = () => {
29770
30155
  json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
29771
30156
  e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
29772
30157
  credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
30158
+ currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
30159
+ iban: "IBAN",
29773
30160
  jwt: "JWT",
29774
30161
  template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
29775
30162
  };
@@ -29837,7 +30224,7 @@ var error54 = () => {
29837
30224
  };
29838
30225
  function uk_default() {
29839
30226
  return {
29840
- localeError: error54()
30227
+ localeError: error55()
29841
30228
  };
29842
30229
  }
29843
30230
 
@@ -29846,7 +30233,7 @@ function ua_default() {
29846
30233
  return uk_default();
29847
30234
  }
29848
30235
  // node_modules/zod/v4/locales/ur.js
29849
- var error55 = () => {
30236
+ var error56 = () => {
29850
30237
  const Sizable = {
29851
30238
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
29852
30239
  file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
@@ -29886,6 +30273,8 @@ var error55 = () => {
29886
30273
  json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
29887
30274
  e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
29888
30275
  credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
30276
+ currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
30277
+ iban: "IBAN",
29889
30278
  jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
29890
30279
  template_literal: "\u0627\u0646 \u067E\u0679"
29891
30280
  };
@@ -29955,11 +30344,11 @@ var error55 = () => {
29955
30344
  };
29956
30345
  function ur_default() {
29957
30346
  return {
29958
- localeError: error55()
30347
+ localeError: error56()
29959
30348
  };
29960
30349
  }
29961
30350
  // node_modules/zod/v4/locales/uz.js
29962
- var error56 = () => {
30351
+ var error57 = () => {
29963
30352
  const Sizable = {
29964
30353
  string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
29965
30354
  file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
@@ -29999,6 +30388,8 @@ var error56 = () => {
29999
30388
  json_string: "JSON satr",
30000
30389
  e164: "E.164 raqam",
30001
30390
  credit_card: "kredit karta raqami",
30391
+ currency_code: "valyuta kodi",
30392
+ iban: "IBAN",
30002
30393
  jwt: "JWT",
30003
30394
  template_literal: "kirish"
30004
30395
  };
@@ -30066,11 +30457,11 @@ var error56 = () => {
30066
30457
  };
30067
30458
  function uz_default() {
30068
30459
  return {
30069
- localeError: error56()
30460
+ localeError: error57()
30070
30461
  };
30071
30462
  }
30072
30463
  // node_modules/zod/v4/locales/vi.js
30073
- var error57 = () => {
30464
+ var error58 = () => {
30074
30465
  const Sizable = {
30075
30466
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
30076
30467
  file: { unit: "byte", verb: "c\xF3" },
@@ -30110,6 +30501,8 @@ var error57 = () => {
30110
30501
  json_string: "chu\u1ED7i JSON",
30111
30502
  e164: "s\u1ED1 E.164",
30112
30503
  credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
30504
+ currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
30505
+ iban: "IBAN",
30113
30506
  jwt: "JWT",
30114
30507
  template_literal: "\u0111\u1EA7u v\xE0o"
30115
30508
  };
@@ -30177,11 +30570,11 @@ var error57 = () => {
30177
30570
  };
30178
30571
  function vi_default() {
30179
30572
  return {
30180
- localeError: error57()
30573
+ localeError: error58()
30181
30574
  };
30182
30575
  }
30183
30576
  // node_modules/zod/v4/locales/zh-CN.js
30184
- var error58 = () => {
30577
+ var error59 = () => {
30185
30578
  const Sizable = {
30186
30579
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
30187
30580
  file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
@@ -30221,6 +30614,8 @@ var error58 = () => {
30221
30614
  json_string: "JSON\u5B57\u7B26\u4E32",
30222
30615
  e164: "E.164\u53F7\u7801",
30223
30616
  credit_card: "\u4FE1\u7528\u5361\u53F7",
30617
+ currency_code: "\u8D27\u5E01\u4EE3\u7801",
30618
+ iban: "IBAN",
30224
30619
  jwt: "JWT",
30225
30620
  template_literal: "\u8F93\u5165"
30226
30621
  };
@@ -30289,11 +30684,11 @@ var error58 = () => {
30289
30684
  };
30290
30685
  function zh_CN_default() {
30291
30686
  return {
30292
- localeError: error58()
30687
+ localeError: error59()
30293
30688
  };
30294
30689
  }
30295
30690
  // node_modules/zod/v4/locales/zh-TW.js
30296
- var error59 = () => {
30691
+ var error60 = () => {
30297
30692
  const Sizable = {
30298
30693
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
30299
30694
  file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
@@ -30333,6 +30728,8 @@ var error59 = () => {
30333
30728
  json_string: "JSON \u5B57\u4E32",
30334
30729
  e164: "E.164 \u6578\u503C",
30335
30730
  credit_card: "\u4FE1\u7528\u5361\u865F",
30731
+ currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
30732
+ iban: "IBAN",
30336
30733
  jwt: "JWT",
30337
30734
  template_literal: "\u8F38\u5165"
30338
30735
  };
@@ -30399,11 +30796,11 @@ var error59 = () => {
30399
30796
  };
30400
30797
  function zh_TW_default() {
30401
30798
  return {
30402
- localeError: error59()
30799
+ localeError: error60()
30403
30800
  };
30404
30801
  }
30405
30802
  // node_modules/zod/v4/locales/yo.js
30406
- var error60 = () => {
30803
+ var error61 = () => {
30407
30804
  const Sizable = {
30408
30805
  string: { unit: "\xE0mi", verb: "n\xED" },
30409
30806
  file: { unit: "bytes", verb: "n\xED" },
@@ -30443,6 +30840,8 @@ var error60 = () => {
30443
30840
  json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
30444
30841
  e164: "n\u1ECD\u0301mb\xE0 E.164",
30445
30842
  credit_card: "n\u1ECDmba kaadi gbese",
30843
+ currency_code: "koodu ow\xF3",
30844
+ iban: "IBAN",
30446
30845
  jwt: "JWT",
30447
30846
  template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
30448
30847
  };
@@ -30509,7 +30908,7 @@ var error60 = () => {
30509
30908
  };
30510
30909
  function yo_default() {
30511
30910
  return {
30512
- localeError: error60()
30911
+ localeError: error61()
30513
30912
  };
30514
30913
  }
30515
30914
  // node_modules/zod/v4/core/registries.js
@@ -30590,31 +30989,8 @@ function compileValidator(schema, parser2) {
30590
30989
  function compile(schema, options) {
30591
30990
  try {
30592
30991
  const parser2 = compileFn(schema);
30593
- const clone2 = clone(schema);
30594
- const liveRun = schema._zod.run;
30595
- const originalRun = liveRun.__originalRun ?? liveRun;
30596
- const wrapped = (payload, ctx) => {
30597
- if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
30598
- return originalRun(payload, ctx);
30599
- }
30600
- if (ctx && isBackEdge(ctx, payload.value)) {
30601
- return originalRun(payload, ctx);
30602
- }
30603
- const out = parser2(payload.value);
30604
- if (out !== INVALID) {
30605
- payload.value = out;
30606
- return payload;
30607
- }
30608
- if (ctx)
30609
- ctx[FALLBACK_FLAG] = true;
30610
- return originalRun(payload, ctx);
30611
- };
30612
- wrapped.__originalRun = originalRun;
30613
- clone2._zod.bag.fallbackRun = originalRun;
30992
+ const clone2 = withParser(schema, parser2);
30614
30993
  clone2._zod.bag.validator = compileValidator(schema, parser2);
30615
- clone2._zod.run = wrapped;
30616
- if (!liveRun.__originalRun)
30617
- installCompiledUserMethods(clone2, schema, parser2);
30618
30994
  return clone2;
30619
30995
  } catch (err) {
30620
30996
  if (options?.strict)
@@ -30622,6 +30998,37 @@ function compile(schema, options) {
30622
30998
  return schema;
30623
30999
  }
30624
31000
  }
31001
+ function withParser(schema, parser2) {
31002
+ if (isRecursiveSchema(schema)) {
31003
+ throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
31004
+ }
31005
+ const clone2 = clone(schema);
31006
+ const liveRun = schema._zod.run;
31007
+ const originalRun = liveRun.__originalRun ?? liveRun;
31008
+ const wrapped = (payload, ctx) => {
31009
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
31010
+ return originalRun(payload, ctx);
31011
+ }
31012
+ if (ctx && isBackEdge(ctx, payload.value)) {
31013
+ return originalRun(payload, ctx);
31014
+ }
31015
+ const out = parser2(payload.value);
31016
+ if (out !== INVALID) {
31017
+ payload.value = out;
31018
+ return payload;
31019
+ }
31020
+ if (ctx)
31021
+ ctx[FALLBACK_FLAG] = true;
31022
+ return originalRun(payload, ctx);
31023
+ };
31024
+ wrapped.__originalRun = originalRun;
31025
+ clone2._zod.bag.fallbackRun = originalRun;
31026
+ clone2._zod.bag.validator = parser2;
31027
+ clone2._zod.run = wrapped;
31028
+ if (!liveRun.__originalRun)
31029
+ installCompiledUserMethods(clone2, schema, parser2);
31030
+ return clone2;
31031
+ }
30625
31032
  function installCompiledUserMethods(target, source, parser2) {
30626
31033
  const targetAny = target;
30627
31034
  const sourceAny = source;
@@ -30657,7 +31064,8 @@ function compileFn(schema, options) {
30657
31064
  const ctx = {
30658
31065
  constants: new Map,
30659
31066
  constantCounter: 0,
30660
- varCounter: 0
31067
+ varCounter: 0,
31068
+ definite: true
30661
31069
  };
30662
31070
  const doc = new Doc(["input"]);
30663
31071
  const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
@@ -30682,6 +31090,7 @@ ${code}
30682
31090
  if (options?.debug) {
30683
31091
  fn.code = fullCode;
30684
31092
  }
31093
+ fn.definite = ctx.definite;
30685
31094
  return fn;
30686
31095
  }
30687
31096
  function addConstant(ctx, value) {
@@ -30693,6 +31102,10 @@ function addConstant(ctx, value) {
30693
31102
  ctx.constants.set(name, value);
30694
31103
  return name;
30695
31104
  }
31105
+ function addUserConstant(ctx, fn) {
31106
+ ctx.definite = false;
31107
+ return addConstant(ctx, fn);
31108
+ }
30696
31109
  function newVar(ctx) {
30697
31110
  return `v${ctx.varCounter++}`;
30698
31111
  }
@@ -30725,6 +31138,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
30725
31138
  }
30726
31139
  }
30727
31140
  function emitRuntimeIsland(doc, ctx, schema, accessor) {
31141
+ ctx.definite = false;
30728
31142
  const schemaConst = addConstant(ctx, schema);
30729
31143
  const runConst = addConstant(ctx, runtimeRun);
30730
31144
  const outVar = newVar(ctx);
@@ -30805,6 +31219,9 @@ function generateChecks(doc, ctx, schema, accessor) {
30805
31219
  case "property":
30806
31220
  generatePropertyCheck(doc, ctx, def, currentAccessor);
30807
31221
  break;
31222
+ case "properties":
31223
+ generatePropertiesChecks(doc, ctx, def, currentAccessor);
31224
+ break;
30808
31225
  case "overwrite": {
30809
31226
  const newAccessor = newVar(ctx);
30810
31227
  generateOverwriteCheck(doc, ctx, check, currentAccessor, newAccessor);
@@ -30910,6 +31327,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
30910
31327
  doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
30911
31328
  }
30912
31329
  }
31330
+ function generatePropertiesChecks(doc, ctx, def, accessor) {
31331
+ if (def.when) {
31332
+ throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
31333
+ }
31334
+ doc.write(`if (${accessor} == null) return INVALID;`);
31335
+ const shape = def.shape;
31336
+ for (const key of Reflect.ownKeys(shape)) {
31337
+ const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
31338
+ const inputVar = newVar(ctx);
31339
+ doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
31340
+ compileChild(doc, ctx, shape[key], inputVar, false);
31341
+ }
31342
+ }
30913
31343
  function generatePropertyCheck(doc, ctx, def, accessor) {
30914
31344
  const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
30915
31345
  generateCheck(doc, ctx, def.schema, propAccessor);
@@ -30937,7 +31367,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
30937
31367
  if (isAsyncFunction(def.fn)) {
30938
31368
  throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
30939
31369
  }
30940
- const fnConst = addConstant(ctx, def.fn);
31370
+ const fnConst = addUserConstant(ctx, def.fn);
30941
31371
  const throwAsyncConst = addConstant(ctx, throwAsync);
30942
31372
  const resVar = newVar(ctx);
30943
31373
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -30957,7 +31387,7 @@ function generateCustomRefineCheck(doc, ctx, check, accessor) {
30957
31387
  throwAsync();
30958
31388
  return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
30959
31389
  };
30960
- const helperConst = addConstant(ctx, helperFn);
31390
+ const helperConst = addUserConstant(ctx, helperFn);
30961
31391
  const outVar = newVar(ctx);
30962
31392
  doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
30963
31393
  doc.write(`if (${outVar} === INVALID) return INVALID;`);
@@ -30991,7 +31421,7 @@ var PATTERN_IS_COMPLETE = new Set([
30991
31421
  "uuid",
30992
31422
  "xid"
30993
31423
  ]);
30994
- function generateStringFormatCheck(doc, ctx, def, accessor) {
31424
+ function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
30995
31425
  const fmt = def.format;
30996
31426
  if (fmt === "base64") {
30997
31427
  const validator = addConstant(ctx, isValidBase64);
@@ -31024,9 +31454,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
31024
31454
  doc.write(`if (!${validator}(${accessor})) return INVALID;`);
31025
31455
  return accessor;
31026
31456
  }
31457
+ if (fmt === "iban") {
31458
+ const validator = addConstant(ctx, isValidIBAN);
31459
+ doc.write(`if (!${validator}(${accessor})) return INVALID;`);
31460
+ return accessor;
31461
+ }
31027
31462
  const formatDef = def;
31028
31463
  if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== undefined || formatDef.protocol !== undefined) {
31029
- const parseConst = addConstant(ctx, parseURLObject);
31464
+ const parseConst = addConstant(ctx, validateURL);
31030
31465
  const defConst = addConstant(ctx, def);
31031
31466
  const trimVar = newVar(ctx);
31032
31467
  const urlVar = newVar(ctx);
@@ -31041,6 +31476,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
31041
31476
  const protocolConst = addConstant(ctx, urlProtocolOk);
31042
31477
  doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
31043
31478
  }
31479
+ if (!needsValue)
31480
+ return null;
31044
31481
  const outputVar = newVar(ctx);
31045
31482
  const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
31046
31483
  doc.write(`const ${outputVar} = ${outputExpr};`);
@@ -31099,7 +31536,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
31099
31536
  let typeAccessor;
31100
31537
  switch (type) {
31101
31538
  case "string":
31102
- typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
31539
+ typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
31103
31540
  break;
31104
31541
  case "number":
31105
31542
  typeAccessor = generateNumberCheck(doc, schema, accessor);
@@ -31219,12 +31656,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
31219
31656
  return null;
31220
31657
  return generateChecks(doc, ctx, schema, typeAccessor);
31221
31658
  }
31222
- function generateStringCheck(doc, ctx, schema, accessor) {
31659
+ function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
31223
31660
  doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
31224
31661
  const def = schema._zod.def;
31225
31662
  if (def.format === undefined)
31226
31663
  return accessor;
31227
- return generateStringFormatCheck(doc, ctx, def, accessor);
31664
+ return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
31228
31665
  }
31229
31666
  function generateNumberCheck(doc, schema, accessor) {
31230
31667
  doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
@@ -31342,7 +31779,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
31342
31779
  }
31343
31780
  }
31344
31781
  const outputVar = newVar(ctx);
31345
- const hasConditionalKeys = allKeys.some((k) => mayOutputUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
31782
+ const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
31346
31783
  if (!buildsValue) {
31347
31784
  if (unknownKeysMode === "schema") {
31348
31785
  const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
@@ -31369,7 +31806,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
31369
31806
  const out = propOutputs.get(k);
31370
31807
  if (dropsWhenAbsent(propShape[k])) {
31371
31808
  doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
31372
- } else if (mayOutputUndefined(propShape[k])) {
31809
+ } else if (mayOmitUndefined(propShape[k])) {
31373
31810
  doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
31374
31811
  } else {
31375
31812
  doc.write(`${outputVar}[${kx}] = ${out};`);
@@ -31502,6 +31939,9 @@ function fastPathAcceptsAbsence(schema) {
31502
31939
  function dropsWhenAbsent(schema) {
31503
31940
  return schema._zod.optin === "optional" && schema._zod.optout === "optional";
31504
31941
  }
31942
+ function mayOmitUndefined(schema) {
31943
+ return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
31944
+ }
31505
31945
  function mayOutputUndefined(schema) {
31506
31946
  const def = schema._zod.def;
31507
31947
  switch (def.type) {
@@ -31844,6 +32284,7 @@ function literalEquality(ctx, accessor, value) {
31844
32284
  }
31845
32285
  function generateIntersectionCheck(doc, ctx, schema, accessor) {
31846
32286
  const def = schema._zod.def;
32287
+ ctx.definite = false;
31847
32288
  const leftOutput = compileChild(doc, ctx, def.left, accessor);
31848
32289
  const rightOutput = compileChild(doc, ctx, def.right, accessor);
31849
32290
  const mergeConst = addConstant(ctx, mergeValues);
@@ -31897,14 +32338,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
31897
32338
  const keyIsBareString = keyDef.type === "string" && keyDef.format === undefined && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
31898
32339
  if (!keyIsBareString) {
31899
32340
  const isLoose = def.mode === "loose";
31900
- const keyFast = addConstant(ctx, compileFn(def.keyType));
32341
+ const keyFn = compileFn(def.keyType);
32342
+ if (keyFn.definite === false)
32343
+ ctx.definite = false;
32344
+ const keyFast = addConstant(ctx, keyFn);
31901
32345
  const numericConst = addConstant(ctx, number);
31902
- const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
31903
32346
  const outKeyVar = newVar(ctx);
31904
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
31905
- doc.indented((d) => {
31906
- d.write(`if (${kVar} === "__proto__") continue;`);
31907
- d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32347
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
31908
32348
  d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
31909
32349
  d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
31910
32350
  if (isLoose) {
@@ -31918,21 +32358,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
31918
32358
  const valOutput = compileChild(d, ctx, def.valueType, valueVar);
31919
32359
  d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
31920
32360
  });
31921
- doc.write(`}`);
31922
32361
  return outputVar;
31923
32362
  }
31924
- const propIsEnumerable = addConstant(ctx, Object.prototype.propertyIsEnumerable);
31925
- doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
31926
- doc.indented((d) => {
31927
- d.write(`if (${kVar} === "__proto__") continue;`);
31928
- d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
31929
- d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
32363
+ emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
31930
32364
  d.write(`const ${valVar} = ${accessor}[${kVar}];`);
31931
32365
  const valOutput = compileChild(d, ctx, def.valueType, valVar);
31932
32366
  d.write(`${outputVar}[${kVar}] = ${valOutput};`);
32367
+ }, `return INVALID;`);
32368
+ return outputVar;
32369
+ }
32370
+ function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
32371
+ const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
32372
+ const symsVar = newVar(ctx);
32373
+ const keysVar = newVar(ctx);
32374
+ const iVar = newVar(ctx);
32375
+ doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
32376
+ doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
32377
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
32378
+ doc.indented((d) => {
32379
+ d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
32380
+ d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32381
+ body(d);
32382
+ });
32383
+ doc.write(`}`);
32384
+ doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
32385
+ doc.indented((d) => {
32386
+ d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
32387
+ d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
32388
+ if (onSymbol)
32389
+ d.write(onSymbol);
32390
+ else
32391
+ body(d);
31933
32392
  });
31934
32393
  doc.write(`}`);
31935
- return outputVar;
31936
32394
  }
31937
32395
  function literalPropertyKey(ctx, key) {
31938
32396
  if (typeof key === "string")
@@ -31985,7 +32443,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
31985
32443
  }
31986
32444
  function generateLazyCheck(doc, ctx, schema, accessor) {
31987
32445
  const def = schema._zod.def;
31988
- const getterConst = addConstant(ctx, def.getter);
32446
+ const getterConst = addUserConstant(ctx, def.getter);
31989
32447
  const cacheConst = addConstant(ctx, { parser: null });
31990
32448
  doc.write(`if (!${cacheConst}.parser) {`);
31991
32449
  doc.indented((d) => {
@@ -32018,7 +32476,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
32018
32476
  return INVALID;
32019
32477
  return fakePayload.issues.length === 0 ? result : INVALID;
32020
32478
  };
32021
- const helperConst = addConstant(ctx, helperFn);
32479
+ const helperConst = addUserConstant(ctx, helperFn);
32022
32480
  const transformedVar = newVar(ctx);
32023
32481
  doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
32024
32482
  doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
@@ -32036,7 +32494,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
32036
32494
  if (isAsyncFunction(def.fn)) {
32037
32495
  throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
32038
32496
  }
32039
- const fnConst = addConstant(ctx, def.fn);
32497
+ const fnConst = addUserConstant(ctx, def.fn);
32040
32498
  const throwAsyncConst = addConstant(ctx, throwAsync);
32041
32499
  const resVar = newVar(ctx);
32042
32500
  doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
@@ -32069,7 +32527,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
32069
32527
  });
32070
32528
  doc.write(`})();`);
32071
32529
  const innerConst = addConstant(ctx, def.innerType);
32072
- const catchConst = addConstant(ctx, def.catchValue);
32530
+ const catchConst = addUserConstant(ctx, def.catchValue);
32073
32531
  const catchHelperConst = addConstant(ctx, runtimeCatch);
32074
32532
  doc.write(`if (${outputVar} === INVALID) {`);
32075
32533
  doc.indented((d) => {
@@ -32093,7 +32551,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
32093
32551
  return INVALID;
32094
32552
  return fakePayload.issues.length === 0 ? result : INVALID;
32095
32553
  };
32096
- const helperConst = addConstant(ctx, helperFn);
32554
+ const helperConst = addUserConstant(ctx, helperFn);
32097
32555
  const outputVar = newVar(ctx);
32098
32556
  doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
32099
32557
  doc.write(`if (${outputVar} === INVALID) return INVALID;`);
@@ -32102,18 +32560,16 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
32102
32560
  return accessor;
32103
32561
  }
32104
32562
  // node_modules/zod/v4/core/api.js
32563
+ function snapshotChecks(def) {
32564
+ if (def.checks)
32565
+ def.checks = [...def.checks];
32566
+ return def;
32567
+ }
32105
32568
  function _string(Class2, params) {
32106
- return new Class2({
32107
- type: "string",
32108
- ...normalizeParams(params)
32109
- });
32569
+ return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
32110
32570
  }
32111
32571
  function _coercedString(Class2, params) {
32112
- return new Class2({
32113
- type: "string",
32114
- coerce: true,
32115
- ...normalizeParams(params)
32116
- });
32572
+ return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
32117
32573
  }
32118
32574
  function _email(Class2, params) {
32119
32575
  return new Class2({
@@ -32325,6 +32781,15 @@ function _creditCard(Class2, params) {
32325
32781
  ...normalizeParams(params)
32326
32782
  });
32327
32783
  }
32784
+ function _iban(Class2, params) {
32785
+ return new Class2({
32786
+ type: "string",
32787
+ format: "iban",
32788
+ check: "string_format",
32789
+ abort: false,
32790
+ ...normalizeParams(params)
32791
+ });
32792
+ }
32328
32793
  function _jwt(Class2, params) {
32329
32794
  return new Class2({
32330
32795
  type: "string",
@@ -32378,19 +32843,10 @@ function _isoDuration(Class2, params) {
32378
32843
  });
32379
32844
  }
32380
32845
  function _number(Class2, params) {
32381
- return new Class2({
32382
- type: "number",
32383
- checks: [],
32384
- ...normalizeParams(params)
32385
- });
32846
+ return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
32386
32847
  }
32387
32848
  function _coercedNumber(Class2, params) {
32388
- return new Class2({
32389
- type: "number",
32390
- coerce: true,
32391
- checks: [],
32392
- ...normalizeParams(params)
32393
- });
32849
+ return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
32394
32850
  }
32395
32851
  function _int(Class2, params) {
32396
32852
  return new Class2({
@@ -32688,8 +33144,12 @@ function _property(property, schema, params) {
32688
33144
  ...normalizeParams(params)
32689
33145
  });
32690
33146
  }
32691
- function _properties(shape) {
32692
- return Object.entries(shape).map(([property, schema]) => new $ZodCheckProperty({ check: "property", property, schema }));
33147
+ function _properties(shape, params) {
33148
+ return new $ZodCheckProperties({
33149
+ check: "properties",
33150
+ shape,
33151
+ ...normalizeParams(params)
33152
+ });
32693
33153
  }
32694
33154
  function _mime(types, params) {
32695
33155
  return new $ZodCheckMimeType({
@@ -33080,7 +33540,7 @@ function handleUnrepresentable(schema, ctx, json, params, message) {
33080
33540
  Object.assign(json, result);
33081
33541
  return true;
33082
33542
  }
33083
- function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
33543
+ function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
33084
33544
  var _a3;
33085
33545
  const def = schema._zod.def;
33086
33546
  const seen = ctx.seen.get(schema);
@@ -33119,7 +33579,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
33119
33579
  if (parent) {
33120
33580
  if (!result.ref)
33121
33581
  result.ref = parent;
33122
- process2(parent, ctx, params);
33582
+ processSchema(parent, ctx, params);
33123
33583
  ctx.seen.get(parent).isParent = true;
33124
33584
  }
33125
33585
  }
@@ -33224,7 +33684,6 @@ function extractDefs(ctx, schema) {
33224
33684
  if (seen.count > 1) {
33225
33685
  if (ctx.reused === "ref") {
33226
33686
  extractToDef(entry);
33227
- continue;
33228
33687
  }
33229
33688
  }
33230
33689
  }
@@ -33549,18 +34008,106 @@ function isTransforming(_schema, _ctx) {
33549
34008
  }
33550
34009
  var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
33551
34010
  const ctx = initializeContext({ ...params, processors });
33552
- process2(schema, ctx);
34011
+ processSchema(schema, ctx);
33553
34012
  extractDefs(ctx, schema);
33554
34013
  return finalize(ctx, schema);
33555
34014
  };
33556
34015
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
33557
34016
  const { libraryOptions, target } = params ?? {};
33558
34017
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
33559
- process2(schema, ctx);
34018
+ processSchema(schema, ctx);
33560
34019
  extractDefs(ctx, schema);
33561
34020
  return finalize(ctx, schema);
33562
34021
  };
33563
34022
  // node_modules/zod/v4/core/json-schema-processors.js
34023
+ var narrowMin = (agg, key, value) => {
34024
+ if (agg[key] === undefined || value > agg[key])
34025
+ agg[key] = value;
34026
+ };
34027
+ var narrowMax = (agg, key, value) => {
34028
+ if (agg[key] === undefined || value < agg[key])
34029
+ agg[key] = value;
34030
+ };
34031
+ var narrowBoth = (agg, value) => {
34032
+ narrowMin(agg, "minimum", value);
34033
+ narrowMax(agg, "maximum", value);
34034
+ };
34035
+ var addDivisor = (agg, value) => {
34036
+ agg.multipleOf ?? (agg.multipleOf = []);
34037
+ if (!agg.multipleOf.includes(value))
34038
+ agg.multipleOf.push(value);
34039
+ };
34040
+ var addPattern = (agg, pattern) => {
34041
+ agg.patterns ?? (agg.patterns = new Set);
34042
+ agg.patterns.add(pattern);
34043
+ };
34044
+ var intersectMime = (agg, mime) => {
34045
+ agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
34046
+ };
34047
+ var setFormat = (agg, format) => {
34048
+ agg.format = format;
34049
+ if (format.includes("int"))
34050
+ agg.isInt = true;
34051
+ };
34052
+ var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
34053
+ var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
34054
+ var formatContributor = (ranges) => (agg, def) => {
34055
+ setFormat(agg, def.format);
34056
+ const [minimum, maximum] = ranges[def.format];
34057
+ narrowMin(agg, "minimum", minimum);
34058
+ narrowMax(agg, "maximum", maximum);
34059
+ };
34060
+ var contributors = {
34061
+ greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
34062
+ less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
34063
+ multiple_of: (agg, def) => addDivisor(agg, def.value),
34064
+ number_format: formatContributor(NUMBER_FORMAT_RANGES),
34065
+ bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
34066
+ min_length: minContributor,
34067
+ max_length: maxContributor,
34068
+ length_equals: (agg, def) => narrowBoth(agg, def.length),
34069
+ min_size: minContributor,
34070
+ max_size: maxContributor,
34071
+ size_equals: (agg, def) => narrowBoth(agg, def.size),
34072
+ string_format: (agg, def) => {
34073
+ setFormat(agg, def.format);
34074
+ if (def.pattern)
34075
+ addPattern(agg, def.pattern);
34076
+ if (def.format === "base64" || def.format === "base64url")
34077
+ agg.contentEncoding = def.format;
34078
+ if (def.local || def.precision === -1)
34079
+ agg.laxFormat = true;
34080
+ },
34081
+ mime_type: (agg, def) => intersectMime(agg, def.mime)
34082
+ };
34083
+ function aggregateChecks(schema) {
34084
+ const agg = {};
34085
+ const def = schema._zod.def;
34086
+ const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
34087
+ for (const ch of list)
34088
+ contributors[ch._zod.def.check]?.(agg, ch._zod.def);
34089
+ const bag = schema._zod.bag;
34090
+ if (bag.minimum !== undefined)
34091
+ narrowMin(agg, "minimum", bag.minimum);
34092
+ if (bag.exclusiveMinimum !== undefined)
34093
+ narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
34094
+ if (bag.maximum !== undefined)
34095
+ narrowMax(agg, "maximum", bag.maximum);
34096
+ if (bag.exclusiveMaximum !== undefined)
34097
+ narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
34098
+ if (bag.multipleOf !== undefined)
34099
+ addDivisor(agg, bag.multipleOf);
34100
+ if (bag.format !== undefined) {
34101
+ agg.format ?? (agg.format = bag.format);
34102
+ if (bag.format.includes("int"))
34103
+ agg.isInt = true;
34104
+ }
34105
+ if (bag.mime)
34106
+ intersectMime(agg, bag.mime);
34107
+ for (const pattern of bag.patterns ?? [])
34108
+ addPattern(agg, pattern);
34109
+ return agg;
34110
+ }
33564
34111
  var formatMap = {
33565
34112
  guid: "uuid",
33566
34113
  url: "uri",
@@ -33568,10 +34115,15 @@ var formatMap = {
33568
34115
  json_string: "json-string",
33569
34116
  regex: ""
33570
34117
  };
34118
+ var exactPatterns = new Map([
34119
+ [base64Charset, base64],
34120
+ [base64urlCharset, base64url]
34121
+ ]);
34122
+ var exactPattern = (p) => exactPatterns.get(p) ?? p;
33571
34123
  var stringProcessor = (schema, ctx, _json, _params) => {
33572
34124
  const json = _json;
33573
34125
  json.type = "string";
33574
- const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
34126
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
33575
34127
  if (typeof minimum === "number")
33576
34128
  json.minLength = minimum;
33577
34129
  if (typeof maximum === "number")
@@ -33587,7 +34139,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
33587
34139
  if (contentEncoding)
33588
34140
  json.contentEncoding = contentEncoding;
33589
34141
  if (patterns && patterns.size > 0) {
33590
- const patternList = [...patterns];
34142
+ const patternList = [...patterns].map(exactPattern);
33591
34143
  if (patternList.length === 1)
33592
34144
  json.pattern = patternList[0].source;
33593
34145
  else if (patternList.length > 1) {
@@ -33602,11 +34154,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
33602
34154
  };
33603
34155
  var numberProcessor = (schema, ctx, _json, params) => {
33604
34156
  const json = _json;
33605
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
33606
- if (typeof format === "string" && format.includes("int"))
33607
- json.type = "integer";
33608
- else
33609
- json.type = "number";
34157
+ const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
34158
+ json.type = isInt ? "integer" : "number";
33610
34159
  const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
33611
34160
  const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
33612
34161
  const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
@@ -33630,11 +34179,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
33630
34179
  } else if (typeof maximum === "number") {
33631
34180
  json.maximum = maximum;
33632
34181
  }
33633
- if (typeof multipleOf === "number") {
33634
- if (Number.isFinite(multipleOf) && multipleOf !== 0)
33635
- json.multipleOf = Math.abs(multipleOf);
33636
- else
33637
- handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
34182
+ if (multipleOf) {
34183
+ const divisors = new Set;
34184
+ for (const divisor of multipleOf) {
34185
+ if (Number.isFinite(divisor) && divisor !== 0)
34186
+ divisors.add(Math.abs(divisor));
34187
+ else
34188
+ handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
34189
+ }
34190
+ const [first, ...rest] = divisors;
34191
+ if (first !== undefined)
34192
+ json.multipleOf = first;
34193
+ if (rest.length)
34194
+ json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
33638
34195
  }
33639
34196
  };
33640
34197
  var booleanProcessor = (_schema, _ctx, json, _params) => {
@@ -33734,27 +34291,22 @@ var templateLiteralProcessor = (schema, _ctx, json, _params) => {
33734
34291
  };
33735
34292
  var fileProcessor = (schema, _ctx, json, _params) => {
33736
34293
  const _json = json;
33737
- const file = {
33738
- type: "string",
33739
- format: "binary",
33740
- contentEncoding: "binary"
33741
- };
33742
- const { minimum, maximum, mime } = schema._zod.bag;
34294
+ _json.type = "string";
34295
+ _json.format = "binary";
34296
+ _json.contentEncoding = "binary";
34297
+ const { minimum, maximum, mime } = aggregateChecks(schema);
33743
34298
  if (minimum !== undefined)
33744
- file.minLength = minimum;
34299
+ _json.minLength = minimum;
33745
34300
  if (maximum !== undefined)
33746
- file.maxLength = maximum;
33747
- if (mime) {
33748
- if (mime.length === 1) {
33749
- file.contentMediaType = mime[0];
33750
- Object.assign(_json, file);
33751
- } else {
33752
- Object.assign(_json, file);
33753
- _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
33754
- }
33755
- } else {
33756
- Object.assign(_json, file);
33757
- }
34301
+ _json.maxLength = maximum;
34302
+ if (!mime)
34303
+ return;
34304
+ if (mime.length === 0)
34305
+ _json.not = {};
34306
+ else if (mime.length === 1)
34307
+ _json.contentMediaType = mime[0];
34308
+ else
34309
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
33758
34310
  };
33759
34311
  var successProcessor = (_schema, _ctx, json, _params) => {
33760
34312
  json.type = "boolean";
@@ -33777,13 +34329,13 @@ var setProcessor = (schema, ctx, json, params) => {
33777
34329
  var arrayProcessor = (schema, ctx, _json, params) => {
33778
34330
  const json = _json;
33779
34331
  const def = schema._zod.def;
33780
- const { minimum, maximum } = schema._zod.bag;
34332
+ const { minimum, maximum } = aggregateChecks(schema);
33781
34333
  if (typeof minimum === "number")
33782
34334
  json.minItems = minimum;
33783
34335
  if (typeof maximum === "number")
33784
34336
  json.maxItems = maximum;
33785
34337
  json.type = "array";
33786
- json.items = process2(def.element, ctx, {
34338
+ json.items = processSchema(def.element, ctx, {
33787
34339
  ...params,
33788
34340
  path: [...params.path, "items"]
33789
34341
  });
@@ -33809,22 +34361,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
33809
34361
  json.type = "object";
33810
34362
  json.properties = {};
33811
34363
  for (const key in shape) {
33812
- assignProp(json.properties, key, process2(shape[key], ctx, {
34364
+ assignProp(json.properties, key, processSchema(shape[key], ctx, {
33813
34365
  ...params,
33814
34366
  path: [...params.path, "properties", key]
33815
34367
  }));
33816
34368
  }
33817
- const allKeys = new Set(Object.keys(shape));
33818
- const requiredKeys = new Set([...allKeys].filter((key) => {
34369
+ const requiredKeys = [];
34370
+ for (const key of Object.keys(shape)) {
33819
34371
  const field2 = def.shape[key];
33820
- if (ctx.io === "input") {
33821
- return inputOptin(field2) === undefined;
33822
- } else {
33823
- return field2._zod.optout === undefined;
34372
+ if (ctx.io === "input" ? inputOptin(field2) === undefined : field2._zod.optout === undefined) {
34373
+ requiredKeys.push(key);
33824
34374
  }
33825
- }));
33826
- if (requiredKeys.size > 0) {
33827
- json.required = Array.from(requiredKeys);
34375
+ }
34376
+ if (requiredKeys.length > 0) {
34377
+ json.required = requiredKeys;
33828
34378
  }
33829
34379
  if (def.catchall?._zod.def.type === "never") {
33830
34380
  json.additionalProperties = false;
@@ -33832,7 +34382,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
33832
34382
  if (ctx.io === "output")
33833
34383
  json.additionalProperties = false;
33834
34384
  } else if (def.catchall) {
33835
- json.additionalProperties = process2(def.catchall, ctx, {
34385
+ json.additionalProperties = processSchema(def.catchall, ctx, {
33836
34386
  ...params,
33837
34387
  path: [...params.path, "additionalProperties"]
33838
34388
  });
@@ -33841,7 +34391,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
33841
34391
  var unionProcessor = (schema, ctx, json, params) => {
33842
34392
  const def = schema._zod.def;
33843
34393
  const isExclusive = def.inclusive === false;
33844
- const options = def.options.map((x, i) => process2(x, ctx, {
34394
+ const options = def.options.map((x, i) => processSchema(x, ctx, {
33845
34395
  ...params,
33846
34396
  path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
33847
34397
  }));
@@ -33853,11 +34403,11 @@ var unionProcessor = (schema, ctx, json, params) => {
33853
34403
  };
33854
34404
  var intersectionProcessor = (schema, ctx, json, params) => {
33855
34405
  const def = schema._zod.def;
33856
- const a = process2(def.left, ctx, {
34406
+ const a = processSchema(def.left, ctx, {
33857
34407
  ...params,
33858
34408
  path: [...params.path, "allOf", 0]
33859
34409
  });
33860
- const b = process2(def.right, ctx, {
34410
+ const b = processSchema(def.right, ctx, {
33861
34411
  ...params,
33862
34412
  path: [...params.path, "allOf", 1]
33863
34413
  });
@@ -33875,11 +34425,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
33875
34425
  json.type = "array";
33876
34426
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
33877
34427
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
33878
- const prefixItems = def.items.map((x, i) => process2(x, ctx, {
34428
+ const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
33879
34429
  ...params,
33880
34430
  path: [...params.path, prefixPath, i]
33881
34431
  }));
33882
- const rest = def.rest ? process2(def.rest, ctx, {
34432
+ const rest = def.rest ? processSchema(def.rest, ctx, {
33883
34433
  ...params,
33884
34434
  path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
33885
34435
  }) : null;
@@ -33927,7 +34477,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
33927
34477
  if (isClosed)
33928
34478
  json.maxItems = maxItems;
33929
34479
  }
33930
- const { minimum, maximum } = schema._zod.bag;
34480
+ const { minimum, maximum } = aggregateChecks(schema);
33931
34481
  if (typeof minimum === "number")
33932
34482
  json.minItems = minimum;
33933
34483
  if (typeof maximum === "number")
@@ -34001,20 +34551,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
34001
34551
  const def = schema._zod.def;
34002
34552
  json.type = "object";
34003
34553
  const keyType = def.keyType;
34004
- const keyBag = keyType._zod.bag;
34005
- const patterns = keyBag?.patterns;
34554
+ const patterns = aggregateChecks(keyType).patterns;
34006
34555
  if (def.mode === "loose" && patterns && patterns.size > 0) {
34007
- const valueSchema = process2(def.valueType, ctx, {
34556
+ const valueSchema = processSchema(def.valueType, ctx, {
34008
34557
  ...params,
34009
34558
  path: [...params.path, "patternProperties", "*"]
34010
34559
  });
34011
34560
  json.patternProperties = {};
34012
34561
  for (const pattern of patterns) {
34013
- assignProp(json.patternProperties, pattern.source, valueSchema);
34562
+ assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
34014
34563
  }
34015
34564
  } else {
34016
34565
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
34017
- json.propertyNames = process2(def.keyType, ctx, {
34566
+ json.propertyNames = processSchema(def.keyType, ctx, {
34018
34567
  ...params,
34019
34568
  path: [...params.path, "propertyNames"]
34020
34569
  });
@@ -34026,7 +34575,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
34026
34575
  }
34027
34576
  pending.push(schema);
34028
34577
  }
34029
- json.additionalProperties = process2(def.valueType, ctx, {
34578
+ json.additionalProperties = processSchema(def.valueType, ctx, {
34030
34579
  ...params,
34031
34580
  path: [...params.path, "additionalProperties"]
34032
34581
  });
@@ -34042,7 +34591,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
34042
34591
  };
34043
34592
  var nullableProcessor = (schema, ctx, json, params) => {
34044
34593
  const def = schema._zod.def;
34045
- const inner = process2(def.innerType, ctx, params);
34594
+ const inner = processSchema(def.innerType, ctx, params);
34046
34595
  const seen = ctx.seen.get(schema);
34047
34596
  if (ctx.target === "openapi-3.0") {
34048
34597
  seen.ref = def.innerType;
@@ -34053,7 +34602,7 @@ var nullableProcessor = (schema, ctx, json, params) => {
34053
34602
  };
34054
34603
  var nonoptionalProcessor = (schema, ctx, _json, params) => {
34055
34604
  const def = schema._zod.def;
34056
- process2(def.innerType, ctx, params);
34605
+ processSchema(def.innerType, ctx, params);
34057
34606
  const seen = ctx.seen.get(schema);
34058
34607
  seen.ref = def.innerType;
34059
34608
  };
@@ -34073,7 +34622,7 @@ function serializeDefaultValue(value, schema, ctx, json, params) {
34073
34622
  }
34074
34623
  var defaultProcessor = (schema, ctx, json, params) => {
34075
34624
  const def = schema._zod.def;
34076
- process2(def.innerType, ctx, params);
34625
+ processSchema(def.innerType, ctx, params);
34077
34626
  const seen = ctx.seen.get(schema);
34078
34627
  seen.ref = def.innerType;
34079
34628
  const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
@@ -34082,7 +34631,7 @@ var defaultProcessor = (schema, ctx, json, params) => {
34082
34631
  };
34083
34632
  var prefaultProcessor = (schema, ctx, json, params) => {
34084
34633
  const def = schema._zod.def;
34085
- process2(def.innerType, ctx, params);
34634
+ processSchema(def.innerType, ctx, params);
34086
34635
  const seen = ctx.seen.get(schema);
34087
34636
  seen.ref = def.innerType;
34088
34637
  if (ctx.io !== "input")
@@ -34093,7 +34642,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
34093
34642
  };
34094
34643
  var catchProcessor = (schema, ctx, json, params) => {
34095
34644
  const def = schema._zod.def;
34096
- process2(def.innerType, ctx, params);
34645
+ processSchema(def.innerType, ctx, params);
34097
34646
  const seen = ctx.seen.get(schema);
34098
34647
  seen.ref = def.innerType;
34099
34648
  let catchValue;
@@ -34109,32 +34658,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
34109
34658
  const def = schema._zod.def;
34110
34659
  const inIsTransform = def.in._zod.traits.has("$ZodTransform");
34111
34660
  const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
34112
- process2(innerType, ctx, params);
34661
+ processSchema(innerType, ctx, params);
34113
34662
  const seen = ctx.seen.get(schema);
34114
34663
  seen.ref = innerType;
34115
34664
  };
34116
34665
  var readonlyProcessor = (schema, ctx, json, params) => {
34117
34666
  const def = schema._zod.def;
34118
- process2(def.innerType, ctx, params);
34667
+ processSchema(def.innerType, ctx, params);
34119
34668
  const seen = ctx.seen.get(schema);
34120
34669
  seen.ref = def.innerType;
34121
34670
  json.readOnly = true;
34122
34671
  };
34123
34672
  var promiseProcessor = (schema, ctx, _json, params) => {
34124
34673
  const def = schema._zod.def;
34125
- process2(def.innerType, ctx, params);
34674
+ processSchema(def.innerType, ctx, params);
34126
34675
  const seen = ctx.seen.get(schema);
34127
34676
  seen.ref = def.innerType;
34128
34677
  };
34129
34678
  var optionalProcessor = (schema, ctx, _json, params) => {
34130
34679
  const def = schema._zod.def;
34131
- process2(def.innerType, ctx, params);
34680
+ processSchema(def.innerType, ctx, params);
34132
34681
  const seen = ctx.seen.get(schema);
34133
34682
  seen.ref = def.innerType;
34134
34683
  };
34135
34684
  var lazyProcessor = (schema, ctx, _json, params) => {
34136
34685
  const innerType = schema._zod.innerType;
34137
- process2(innerType, ctx, params);
34686
+ processSchema(innerType, ctx, params);
34138
34687
  const seen = ctx.seen.get(schema);
34139
34688
  seen.ref = innerType;
34140
34689
  };
@@ -34186,7 +34735,7 @@ function toJSONSchema(input, params) {
34186
34735
  const defs = {};
34187
34736
  for (const entry of registry2._idmap.entries()) {
34188
34737
  const [_, schema] = entry;
34189
- process2(schema, ctx2);
34738
+ processSchema(schema, ctx2);
34190
34739
  }
34191
34740
  const schemas = {};
34192
34741
  const external = {
@@ -34209,7 +34758,7 @@ function toJSONSchema(input, params) {
34209
34758
  return { schemas };
34210
34759
  }
34211
34760
  const ctx = initializeContext({ ...params, processors: allProcessors });
34212
- process2(input, ctx);
34761
+ processSchema(input, ctx);
34213
34762
  extractDefs(ctx, input);
34214
34763
  return finalize(ctx, input);
34215
34764
  }
@@ -34255,7 +34804,7 @@ class JSONSchemaGenerator {
34255
34804
  });
34256
34805
  }
34257
34806
  process(schema, _params = { path: [], schemaPath: [] }) {
34258
- return process2(schema, this.ctx, _params);
34807
+ return processSchema(schema, this.ctx, _params);
34259
34808
  }
34260
34809
  emit(schema, _params) {
34261
34810
  if (_params) {
@@ -34342,6 +34891,7 @@ __export(exports_schemas2, {
34342
34891
  int32: () => int32,
34343
34892
  int: () => int,
34344
34893
  instanceof: () => _instanceof,
34894
+ iban: () => iban2,
34345
34895
  httpUrl: () => httpUrl,
34346
34896
  hostname: () => hostname3,
34347
34897
  hex: () => hex2,
@@ -34360,6 +34910,7 @@ __export(exports_schemas2, {
34360
34910
  describe: () => describe2,
34361
34911
  date: () => date2,
34362
34912
  custom: () => custom,
34913
+ currencyCode: () => currencyCode2,
34363
34914
  cuid2: () => cuid22,
34364
34915
  cuid: () => cuid3,
34365
34916
  creditCard: () => creditCard2,
@@ -34418,12 +34969,14 @@ __export(exports_schemas2, {
34418
34969
  ZodKSUID: () => ZodKSUID,
34419
34970
  ZodJWT: () => ZodJWT,
34420
34971
  ZodIntersection: () => ZodIntersection,
34972
+ ZodInstanceOf: () => ZodInstanceOf,
34421
34973
  ZodISOTime: () => ZodISOTime,
34422
34974
  ZodISODuration: () => ZodISODuration,
34423
34975
  ZodISODateTime: () => ZodISODateTime,
34424
34976
  ZodISODate: () => ZodISODate,
34425
34977
  ZodIPv6: () => ZodIPv6,
34426
34978
  ZodIPv4: () => ZodIPv4,
34979
+ ZodIBAN: () => ZodIBAN,
34427
34980
  ZodGUID: () => ZodGUID,
34428
34981
  ZodFunction: () => ZodFunction,
34429
34982
  ZodFile: () => ZodFile,
@@ -34688,6 +35241,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
34688
35241
  set spa(value) {
34689
35242
  exports_util.own(this, "spa", value);
34690
35243
  },
35244
+ validate(data, params) {
35245
+ return validate(this, data, params);
35246
+ },
35247
+ validateAsync(data, params) {
35248
+ return validateAsync(this, data, params);
35249
+ },
34691
35250
  encode: function _encode2(data, params) {
34692
35251
  return encode2(this, data, params, { callee: _encode2 });
34693
35252
  },
@@ -34726,10 +35285,10 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
34726
35285
  $ZodString.init(inst, def);
34727
35286
  ZodType.init(inst, def);
34728
35287
  inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
34729
- const bag = inst._zod.bag;
34730
- inst.format = bag.format ?? null;
34731
- inst.minLength = bag.minimum ?? null;
34732
- inst.maxLength = bag.maximum ?? null;
35288
+ }, /* @__PURE__ */ exports_util.derived({
35289
+ format: (inst) => aggregateChecks(inst).format ?? null,
35290
+ minLength: (inst) => aggregateChecks(inst).minimum ?? null,
35291
+ maxLength: (inst) => aggregateChecks(inst).maximum ?? null
34733
35292
  }, {
34734
35293
  regex(...args) {
34735
35294
  return this.check(_regex(...args));
@@ -34776,7 +35335,7 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
34776
35335
  slugify() {
34777
35336
  return this.check(_slugify());
34778
35337
  }
34779
- });
35338
+ }));
34780
35339
  var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
34781
35340
  $ZodString.init(inst, def);
34782
35341
  _ZodString.init(inst, def);
@@ -34922,8 +35481,8 @@ function url(params) {
34922
35481
  }
34923
35482
  function httpUrl(params) {
34924
35483
  return _url(ZodURL, {
34925
- protocol: exports_regexes.httpProtocol,
34926
- hostname: exports_regexes.domain,
35484
+ protocol: httpProtocol,
35485
+ hostname: domain,
34927
35486
  ...exports_util.normalizeParams(params)
34928
35487
  });
34929
35488
  }
@@ -35039,6 +35598,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
35039
35598
  function creditCard2(params) {
35040
35599
  return _creditCard(ZodCreditCard, params);
35041
35600
  }
35601
+ var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
35602
+ $ZodIBAN.init(inst, def);
35603
+ ZodStringFormat.init(inst, def);
35604
+ });
35605
+ function iban2(params) {
35606
+ return _iban(ZodIBAN, params);
35607
+ }
35042
35608
  var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
35043
35609
  $ZodJWT.init(inst, def);
35044
35610
  ZodStringFormat.init(inst, def);
@@ -35054,10 +35620,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
35054
35620
  return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
35055
35621
  }
35056
35622
  function hostname3(_params) {
35057
- return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
35623
+ return _stringFormat(ZodCustomStringFormat, "hostname", hostname2, _params);
35058
35624
  }
35059
35625
  function hex2(_params) {
35060
- return _stringFormat(ZodCustomStringFormat, "hex", exports_regexes.hex, _params);
35626
+ return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
35627
+ }
35628
+ function currencyCode2(_params) {
35629
+ return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
35061
35630
  }
35062
35631
  function hash2(alg, params) {
35063
35632
  const enc = params?.enc ?? "hex";
@@ -35071,12 +35640,21 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
35071
35640
  $ZodNumber.init(inst, def);
35072
35641
  ZodType.init(inst, def);
35073
35642
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
35074
- const bag = inst._zod.bag;
35075
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
35076
- inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
35077
- inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
35078
35643
  inst.isFinite = true;
35079
- inst.format = bag.format ?? null;
35644
+ }, /* @__PURE__ */ exports_util.derived({
35645
+ minValue: (inst) => {
35646
+ const { minimum, exclusiveMinimum } = aggregateChecks(inst);
35647
+ return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
35648
+ },
35649
+ maxValue: (inst) => {
35650
+ const { maximum, exclusiveMaximum } = aggregateChecks(inst);
35651
+ return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
35652
+ },
35653
+ isInt: (inst) => {
35654
+ const { isInt, multipleOf } = aggregateChecks(inst);
35655
+ return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
35656
+ },
35657
+ format: (inst) => aggregateChecks(inst).format ?? null
35080
35658
  }, {
35081
35659
  gt(value, params) {
35082
35660
  return this.check(_gt(value, params));
@@ -35123,7 +35701,7 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
35123
35701
  finite() {
35124
35702
  return this;
35125
35703
  }
35126
- });
35704
+ }));
35127
35705
  function number2(params) {
35128
35706
  return _number(ZodNumber, params);
35129
35707
  }
@@ -35158,10 +35736,10 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
35158
35736
  $ZodBigInt.init(inst, def);
35159
35737
  ZodType.init(inst, def);
35160
35738
  inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
35161
- const bag = inst._zod.bag;
35162
- inst.minValue = bag.minimum ?? null;
35163
- inst.maxValue = bag.maximum ?? null;
35164
- inst.format = bag.format ?? null;
35739
+ }, /* @__PURE__ */ exports_util.derived({
35740
+ minValue: (inst) => aggregateChecks(inst).minimum ?? null,
35741
+ maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
35742
+ format: (inst) => aggregateChecks(inst).format ?? null
35165
35743
  }, {
35166
35744
  gte(value, params) {
35167
35745
  return this.check(_gte(value, params));
@@ -35196,7 +35774,7 @@ var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
35196
35774
  multipleOf(value, params) {
35197
35775
  return this.check(_multipleOf(value, params));
35198
35776
  }
35199
- });
35777
+ }));
35200
35778
  function bigint2(params) {
35201
35779
  return _bigint(ZodBigInt, params);
35202
35780
  }
@@ -35272,10 +35850,16 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
35272
35850
  inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
35273
35851
  inst.min = (value, params) => inst.check(_gte(value, params));
35274
35852
  inst.max = (value, params) => inst.check(_lte(value, params));
35275
- const c = inst._zod.bag;
35276
- inst.minDate = c.minimum ? new Date(c.minimum) : null;
35277
- inst.maxDate = c.maximum ? new Date(c.maximum) : null;
35278
- });
35853
+ }, /* @__PURE__ */ exports_util.derived({
35854
+ minDate: (inst) => {
35855
+ const { minimum } = aggregateChecks(inst);
35856
+ return minimum ? new Date(minimum) : null;
35857
+ },
35858
+ maxDate: (inst) => {
35859
+ const { maximum } = aggregateChecks(inst);
35860
+ return maximum ? new Date(maximum) : null;
35861
+ }
35862
+ }, {}));
35279
35863
  function date2(params) {
35280
35864
  return _date(ZodDate, params);
35281
35865
  }
@@ -35320,19 +35904,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
35320
35904
  return _enum2(Object.keys(this._zod.def.shape));
35321
35905
  },
35322
35906
  catchall(catchall) {
35323
- return this.clone({ ...this._zod.def, catchall });
35907
+ return this.clone(exports_util.mergeDefs(this._zod.def, { catchall }));
35324
35908
  },
35325
35909
  passthrough() {
35326
- return this.clone({ ...this._zod.def, catchall: unknown() });
35910
+ return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
35327
35911
  },
35328
35912
  loose() {
35329
- return this.clone({ ...this._zod.def, catchall: unknown() });
35913
+ return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: unknown() }));
35330
35914
  },
35331
35915
  strict() {
35332
- return this.clone({ ...this._zod.def, catchall: never() });
35916
+ return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: never() }));
35333
35917
  },
35334
35918
  strip() {
35335
- return this.clone({ ...this._zod.def, catchall: undefined });
35919
+ return this.clone(exports_util.mergeDefs(this._zod.def, { catchall: undefined }));
35336
35920
  },
35337
35921
  extend(incoming) {
35338
35922
  return exports_util.extend(this, incoming);
@@ -35551,7 +36135,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
35551
36135
  ZodType.init(inst, def);
35552
36136
  inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
35553
36137
  inst.enum = def.entries;
35554
- inst.options = Object.values(def.entries);
36138
+ inst.options = [...inst._zod.values];
35555
36139
  const keys = new Set(Object.keys(def.entries));
35556
36140
  inst.extract = (values, params) => {
35557
36141
  const newEntries = {};
@@ -35912,8 +36496,15 @@ function superRefine(fn, params) {
35912
36496
  }
35913
36497
  var describe2 = describe;
35914
36498
  var meta2 = meta;
36499
+ var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
36500
+ ZodCustom.init(inst, def);
36501
+ }, {
36502
+ properties(shape, params) {
36503
+ return this.check(_properties(shape, params));
36504
+ }
36505
+ });
35915
36506
  function _instanceof(cls, params = {}) {
35916
- const inst = new ZodCustom({
36507
+ const inst = new ZodInstanceOf({
35917
36508
  type: "custom",
35918
36509
  check: "custom",
35919
36510
  fn: (data) => data instanceof cls,
@@ -36103,27 +36694,188 @@ function resolveRef(ref, ctx) {
36103
36694
  }
36104
36695
  throw new Error(`Reference not found: ${ref}`);
36105
36696
  }
36106
- function checkPropertyNames(objectSchema, keySchema) {
36697
+ function checkObjectGuards(objectSchema, guards) {
36107
36698
  const guard = z.transform((value) => value).check((payload) => {
36108
36699
  const value = payload.value;
36109
36700
  if (typeof value !== "object" || value === null || Array.isArray(value))
36110
36701
  return;
36111
- for (const key of Object.getOwnPropertyNames(value)) {
36112
- const result = keySchema.safeParse(key);
36113
- if (result.success)
36114
- continue;
36702
+ const keys = Object.getOwnPropertyNames(value);
36703
+ if (guards.minProperties !== undefined && keys.length < guards.minProperties) {
36115
36704
  payload.issues.push({
36116
- code: "invalid_key",
36117
- origin: "record",
36118
- issues: result.error.issues,
36119
- input: key,
36120
- path: [key],
36705
+ origin: "object",
36706
+ code: "too_small",
36707
+ minimum: guards.minProperties,
36708
+ inclusive: true,
36709
+ message: `Too small: expected object to have >=${guards.minProperties} properties`,
36710
+ input: value,
36711
+ inst: objectSchema,
36121
36712
  continue: true
36122
36713
  });
36123
36714
  }
36715
+ if (guards.maxProperties !== undefined && keys.length > guards.maxProperties) {
36716
+ payload.issues.push({
36717
+ origin: "object",
36718
+ code: "too_big",
36719
+ maximum: guards.maxProperties,
36720
+ inclusive: true,
36721
+ message: `Too big: expected object to have <=${guards.maxProperties} properties`,
36722
+ input: value,
36723
+ inst: objectSchema,
36724
+ continue: true
36725
+ });
36726
+ }
36727
+ if (guards.keySchema) {
36728
+ for (const key of keys) {
36729
+ const result = guards.keySchema.safeParse(key);
36730
+ if (result.success)
36731
+ continue;
36732
+ payload.issues.push({
36733
+ code: "invalid_key",
36734
+ origin: "record",
36735
+ issues: result.error.issues,
36736
+ input: key,
36737
+ path: [key],
36738
+ continue: true
36739
+ });
36740
+ }
36741
+ }
36124
36742
  });
36125
36743
  return guard.pipe(objectSchema);
36126
36744
  }
36745
+ function canonicalKey(value, seen) {
36746
+ if (value === null)
36747
+ return "z";
36748
+ const type = typeof value;
36749
+ if (type !== "object") {
36750
+ if (type === "number" && Number.isNaN(value))
36751
+ return null;
36752
+ const raw = String(value);
36753
+ return `${type[0]}${raw.length}:${raw}`;
36754
+ }
36755
+ if (seen.has(value))
36756
+ return null;
36757
+ seen.add(value);
36758
+ try {
36759
+ if (Array.isArray(value)) {
36760
+ const parts2 = [];
36761
+ for (const item of value) {
36762
+ const key = canonicalKey(item, seen);
36763
+ if (key === null)
36764
+ return null;
36765
+ parts2.push(key);
36766
+ }
36767
+ return `a${parts2.length}:[${parts2.join(",")}]`;
36768
+ }
36769
+ const keys = Object.keys(value).sort();
36770
+ const parts = [];
36771
+ for (const k of keys) {
36772
+ const key = canonicalKey(value[k], seen);
36773
+ if (key === null)
36774
+ return null;
36775
+ parts.push(`${k.length}:${k}=${key}`);
36776
+ }
36777
+ return `o${parts.length}:{${parts.join(",")}}`;
36778
+ } finally {
36779
+ seen.delete(value);
36780
+ }
36781
+ }
36782
+ var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
36783
+ "items",
36784
+ "prefixItems",
36785
+ "additionalItems",
36786
+ "additionalProperties",
36787
+ "contains",
36788
+ "propertyNames",
36789
+ "not",
36790
+ "if",
36791
+ "then",
36792
+ "else",
36793
+ "allOf",
36794
+ "anyOf",
36795
+ "oneOf",
36796
+ "unevaluatedItems",
36797
+ "unevaluatedProperties",
36798
+ "contentSchema"
36799
+ ]);
36800
+ var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
36801
+ "properties",
36802
+ "patternProperties",
36803
+ "dependentSchemas",
36804
+ "dependencies",
36805
+ "$defs",
36806
+ "definitions"
36807
+ ]);
36808
+ function containsRef(value) {
36809
+ if (typeof value !== "object" || value === null)
36810
+ return false;
36811
+ if (Array.isArray(value))
36812
+ return value.some(containsRef);
36813
+ if (typeof value.$ref === "string")
36814
+ return true;
36815
+ return Object.entries(value).some(([key, sub]) => {
36816
+ if (SCHEMA_KEYWORDS.has(key))
36817
+ return containsRef(sub);
36818
+ if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
36819
+ return false;
36820
+ return Object.values(sub).some(containsRef);
36821
+ });
36822
+ }
36823
+ function plural(n2) {
36824
+ return n2 === 1 ? "element" : "elements";
36825
+ }
36826
+ function checkArrayGuards(arraySchema, guards) {
36827
+ const guard = z.transform((value) => value).check((payload) => {
36828
+ const items = payload.value;
36829
+ if (!Array.isArray(items))
36830
+ return;
36831
+ if (guards.uniqueItems === true) {
36832
+ const firstSeen = new Map;
36833
+ for (let i = 0;i < items.length; i++) {
36834
+ const key = canonicalKey(items[i], new Set);
36835
+ if (key === null)
36836
+ continue;
36837
+ const first = firstSeen.get(key);
36838
+ if (first === undefined) {
36839
+ firstSeen.set(key, i);
36840
+ continue;
36841
+ }
36842
+ payload.issues.push({
36843
+ code: "custom",
36844
+ message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
36845
+ input: items,
36846
+ path: [i],
36847
+ continue: true
36848
+ });
36849
+ }
36850
+ }
36851
+ if (guards.containsSchema) {
36852
+ const minContains = guards.minContains ?? 1;
36853
+ const ceiling = guards.maxContains !== undefined ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
36854
+ let matches = 0;
36855
+ for (const item of items) {
36856
+ if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
36857
+ break;
36858
+ }
36859
+ if (matches < minContains) {
36860
+ payload.issues.push({
36861
+ code: "custom",
36862
+ message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
36863
+ input: items,
36864
+ continue: true
36865
+ });
36866
+ }
36867
+ if (guards.maxContains !== undefined && matches > guards.maxContains) {
36868
+ payload.issues.push({
36869
+ code: "custom",
36870
+ message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
36871
+ input: items,
36872
+ continue: true
36873
+ });
36874
+ }
36875
+ }
36876
+ });
36877
+ return guard.pipe(arraySchema);
36878
+ }
36127
36879
  function getTupleRest(restSchema, ctx) {
36128
36880
  if (restSchema === false) {
36129
36881
  return;
@@ -36253,6 +37005,8 @@ function convertBaseSchema(schema, ctx) {
36253
37005
  stringSchema = stringSchema.check(z.e164());
36254
37006
  } else if (format === "credit_card") {
36255
37007
  stringSchema = stringSchema.check(z.creditCard());
37008
+ } else if (format === "iban") {
37009
+ stringSchema = stringSchema.check(z.iban());
36256
37010
  } else if (format === "jwt") {
36257
37011
  stringSchema = stringSchema.check(z.jwt());
36258
37012
  } else if (format === "emoji") {
@@ -36385,9 +37139,16 @@ function convertBaseSchema(schema, ctx) {
36385
37139
  zodSchema = objectSchema.passthrough();
36386
37140
  }
36387
37141
  }
36388
- if (schema.propertyNames !== undefined && schema.propertyNames !== true) {
36389
- const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
36390
- zodSchema = checkPropertyNames(zodSchema, convertSchema(keyJSONSchema, ctx));
37142
+ const hasKeyGuard = schema.propertyNames !== undefined && schema.propertyNames !== true;
37143
+ const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : undefined;
37144
+ const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : undefined;
37145
+ if (hasKeyGuard || minProperties !== undefined || maxProperties !== undefined) {
37146
+ let keySchema;
37147
+ if (hasKeyGuard) {
37148
+ const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === undefined ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
37149
+ keySchema = convertSchema(keyJSONSchema, ctx);
37150
+ }
37151
+ zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
36391
37152
  }
36392
37153
  break;
36393
37154
  }
@@ -36433,6 +37194,14 @@ function convertBaseSchema(schema, ctx) {
36433
37194
  } else {
36434
37195
  zodSchema = z.array(z.any());
36435
37196
  }
37197
+ if (schema.uniqueItems === true || schema.contains !== undefined) {
37198
+ zodSchema = checkArrayGuards(zodSchema, {
37199
+ uniqueItems: schema.uniqueItems === true,
37200
+ containsSchema: schema.contains !== undefined ? convertSchema(schema.contains, ctx) : undefined,
37201
+ minContains: typeof schema.minContains === "number" ? schema.minContains : undefined,
37202
+ maxContains: typeof schema.maxContains === "number" ? schema.maxContains : undefined
37203
+ });
37204
+ }
36436
37205
  break;
36437
37206
  }
36438
37207
  default:
@@ -36490,8 +37259,23 @@ function convertSchema(schema, ctx) {
36490
37259
  extraMeta[key] = schema[key];
36491
37260
  }
36492
37261
  }
36493
- if (schema.propertyNames !== undefined && schema.type === "object" && schema.$ref === undefined) {
36494
- extraMeta.propertyNames = schema.propertyNames;
37262
+ if (schema.type === "object" && schema.$ref === undefined) {
37263
+ if (schema.propertyNames !== undefined && !containsRef(schema.propertyNames)) {
37264
+ extraMeta.propertyNames = schema.propertyNames;
37265
+ }
37266
+ for (const key of ["minProperties", "maxProperties"]) {
37267
+ if (schema[key] !== undefined)
37268
+ extraMeta[key] = schema[key];
37269
+ }
37270
+ }
37271
+ if (schema.type === "array" && schema.$ref === undefined) {
37272
+ if (schema.contains !== undefined && !containsRef(schema.contains)) {
37273
+ extraMeta.contains = schema.contains;
37274
+ }
37275
+ for (const key of ["uniqueItems", "minContains", "maxContains"]) {
37276
+ if (schema[key] !== undefined)
37277
+ extraMeta[key] = schema[key];
37278
+ }
36495
37279
  }
36496
37280
  for (const key of Object.keys(schema)) {
36497
37281
  if (!RECOGNIZED_KEYS.has(key)) {
@@ -36951,10 +37735,10 @@ function parseRemoteSkillPayload(payload) {
36951
37735
  function parseRemoteContract(schema, payload, message) {
36952
37736
  try {
36953
37737
  return schema.parse(payload);
36954
- } catch (error61) {
36955
- if (error61 instanceof exports_external.ZodError)
36956
- throw new Error(message, { cause: error61 });
36957
- throw error61;
37738
+ } catch (error62) {
37739
+ if (error62 instanceof exports_external.ZodError)
37740
+ throw new Error(message, { cause: error62 });
37741
+ throw error62;
36958
37742
  }
36959
37743
  }
36960
37744
  async function remoteRequestHeaders(options) {
@@ -39203,8 +39987,8 @@ class RemoteSkillsClient {
39203
39987
  throw new RemoteCreditCheckoutError("CREDIT_CHECKOUT_UNCONFIRMED", response.status, requestIdempotencyKey);
39204
39988
  }
39205
39989
  if (!response.ok) {
39206
- const failure = creditCheckoutFailure(value, response.status, requestIdempotencyKey);
39207
- throw new RemoteCreditCheckoutError(failure.code, response.status, requestIdempotencyKey, failure.retryAfterSeconds);
39990
+ const failure2 = creditCheckoutFailure(value, response.status, requestIdempotencyKey);
39991
+ throw new RemoteCreditCheckoutError(failure2.code, response.status, requestIdempotencyKey, failure2.retryAfterSeconds);
39208
39992
  }
39209
39993
  try {
39210
39994
  const checkout = parseRemoteCheckout(value);
@@ -39362,9 +40146,9 @@ class RemoteSkillsClient {
39362
40146
  async publishSkill(manifest, bundle2, ifMatch) {
39363
40147
  try {
39364
40148
  assertSkillsPermission(await this.getCapabilities({ refresh: true }), "publish");
39365
- } catch (error61) {
39366
- if (!(error61 instanceof RemoteRouteUnsupportedError))
39367
- throw error61;
40149
+ } catch (error62) {
40150
+ if (!(error62 instanceof RemoteRouteUnsupportedError))
40151
+ throw error62;
39368
40152
  }
39369
40153
  const form = new FormData;
39370
40154
  form.set("manifest", JSON.stringify(manifest));
@@ -39756,9 +40540,9 @@ function getNextRun(cron, from = new Date) {
39756
40540
  return null;
39757
40541
  }
39758
40542
  function addSchedule(skill, cron, options = {}) {
39759
- const { valid, error: error61 } = validateCron(cron);
40543
+ const { valid, error: error62 } = validateCron(cron);
39760
40544
  if (!valid)
39761
- return { schedule: null, error: error61 };
40545
+ return { schedule: null, error: error62 };
39762
40546
  const data = loadSchedules(options.targetDir);
39763
40547
  const id = `${skill}-${Date.now()}`;
39764
40548
  const now = new Date;
@@ -39915,8 +40699,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
39915
40699
  let slug2;
39916
40700
  try {
39917
40701
  slug2 = normalizePortableSkillName(bareName);
39918
- } catch (error61) {
39919
- return { name: rawName, success: false, error: error61.message };
40702
+ } catch (error62) {
40703
+ return { name: rawName, success: false, error: error62.message };
39920
40704
  }
39921
40705
  if (requestedVersion !== undefined && !isValidSkillVersion(requestedVersion)) {
39922
40706
  return { name: rawName, success: false, error: `'${requestedVersion}' is not a valid skill version (${SKILL_VERSION_RULE}).` };
@@ -39925,8 +40709,8 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
39925
40709
  let bundleResponse;
39926
40710
  try {
39927
40711
  bundleResponse = await client2.getBundle(slug2, requestedVersion);
39928
- } catch (error61) {
39929
- return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error61.message}` };
40712
+ } catch (error62) {
40713
+ return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
39930
40714
  }
39931
40715
  if (requestedVersion && (!bundleResponse || bundleResponse.status === 404)) {
39932
40716
  return {
@@ -39962,18 +40746,18 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
39962
40746
  expectedSha256 = typeof recorded.bundleSha256 === "string" ? recorded.bundleSha256 : undefined;
39963
40747
  }
39964
40748
  return await installVerifiedBundle(slug2, bundleResponse, meta3, corpusOptions, verify, requestedVersion ? { version: requestedVersion, expectedSha256 } : undefined);
39965
- } catch (error61) {
39966
- if (error61 instanceof PullSkillError) {
39967
- return { name: slug2, success: false, error: error61.message };
40749
+ } catch (error62) {
40750
+ if (error62 instanceof PullSkillError) {
40751
+ return { name: slug2, success: false, error: error62.message };
39968
40752
  }
39969
- throw error61;
40753
+ throw error62;
39970
40754
  }
39971
40755
  }
39972
40756
  let skillMd;
39973
40757
  try {
39974
40758
  skillMd = await client2.getSkillMd(slug2);
39975
- } catch (error61) {
39976
- return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error61.message}` };
40759
+ } catch (error62) {
40760
+ return { name: slug2, success: false, error: `Failed to fetch '${slug2}': ${error62.message}` };
39977
40761
  }
39978
40762
  if (skillMd === null) {
39979
40763
  return { name: slug2, success: false, error: `Skill '${slug2}' was not found on the configured Skills instance.` };
@@ -39987,11 +40771,11 @@ async function pullOne(client2, rawName, corpusOptions, verify) {
39987
40771
  let provenRevisionId;
39988
40772
  try {
39989
40773
  provenRevisionId = meta3?.revisionId ? provenRevision({ ...meta3, skillMd }, slug2, {}) : undefined;
39990
- } catch (error61) {
39991
- if (error61 instanceof PullSkillError) {
39992
- return { name: slug2, success: false, error: error61.message };
40774
+ } catch (error62) {
40775
+ if (error62 instanceof PullSkillError) {
40776
+ return { name: slug2, success: false, error: error62.message };
39993
40777
  }
39994
- throw error61;
40778
+ throw error62;
39995
40779
  }
39996
40780
  const written = installCorpusSkillAtomically({ name: slug2, skillMd, meta: meta3 }, corpusOptions);
39997
40781
  writePullMarker(written.path, {
@@ -40070,8 +40854,8 @@ function installVerifiedBundle(slug2, response, meta3, corpusOptions, verify, ex
40070
40854
  let entries;
40071
40855
  try {
40072
40856
  entries = unpackSkillBundle(verified.bytes);
40073
- } catch (error61) {
40074
- throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${error61.message}`);
40857
+ } catch (error62) {
40858
+ throw new PullSkillError(`Bundle for '${slug2}' could not be unpacked: ${error62.message}`);
40075
40859
  }
40076
40860
  const version2 = exact?.version ?? served ?? str(meta3?.version) ?? versionFromEntries(entries) ?? "unknown";
40077
40861
  const sourceCommit = sourceCommitFromEntries(entries);
@@ -40207,14 +40991,14 @@ function installBundleAtomically(name, entries, options = {}, marker = {}) {
40207
40991
  renameSync6(staging, target);
40208
40992
  if (moved && backup)
40209
40993
  rmSync5(backup, { recursive: true, force: true });
40210
- } catch (error61) {
40994
+ } catch (error62) {
40211
40995
  rmSync5(staging, { recursive: true, force: true });
40212
40996
  if (moved && backup && existsSync17(join32(backup, name))) {
40213
40997
  try {
40214
40998
  renameSync6(join32(backup, name), target);
40215
40999
  } catch {}
40216
41000
  }
40217
- throw error61;
41001
+ throw error62;
40218
41002
  }
40219
41003
  return { path: target, created };
40220
41004
  }
@@ -40372,9 +41156,9 @@ async function requestInvitationEmail(origin, action, input2) {
40372
41156
  if (action === "accept" && response.status === 200 && uuid11(parsed.organizationId) && uuid11(parsed.membershipId) && parsed.accepted === true && parsed.changed === true && parsed.signInRequired === true) {
40373
41157
  return { organizationId: parsed.organizationId, membershipId: parsed.membershipId, accepted: true, changed: true, signInRequired: true };
40374
41158
  }
40375
- } catch (error61) {
40376
- if (error61 instanceof RemoteInvitationEmailError)
40377
- throw error61;
41159
+ } catch (error62) {
41160
+ if (error62 instanceof RemoteInvitationEmailError)
41161
+ throw error62;
40378
41162
  }
40379
41163
  throw new RemoteInvitationEmailUnconfirmedError(action);
40380
41164
  }
@@ -40505,11 +41289,11 @@ async function boundedJson(url2, init, token, mutation, budget2 = 15000, signal)
40505
41289
  timer = setTimeout(abort, Math.max(1, Math.min(15000, budget2)));
40506
41290
  signal?.addEventListener("abort", abort, { once: true });
40507
41291
  })]);
40508
- } catch (error61) {
40509
- if (error61 instanceof PrivatePublicationError) {
40510
- if (mutation && error61.code === "INVALID_PUBLICATION_RESPONSE")
41292
+ } catch (error62) {
41293
+ if (error62 instanceof PrivatePublicationError) {
41294
+ if (mutation && error62.code === "INVALID_PUBLICATION_RESPONSE")
40511
41295
  throw timeout;
40512
- throw error61;
41296
+ throw error62;
40513
41297
  }
40514
41298
  throw timeout;
40515
41299
  } finally {
@@ -40566,10 +41350,10 @@ class RemotePrivatePublicationsClient {
40566
41350
  if (!record8(value) || !Object.keys(value).every((k) => k === "upload" || k === "changed") || value.changed !== undefined && typeof value.changed !== "boolean")
40567
41351
  return invalid4();
40568
41352
  return checkedPublicationView(value.upload, skillId, intentId, declaration);
40569
- } catch (error61) {
41353
+ } catch (error62) {
40570
41354
  if (method !== "GET")
40571
41355
  throw new PrivatePublicationError("PUBLICATION_UNCONFIRMED", "The publication result could not be confirmed. Reconcile the saved intent before another action.", true);
40572
- throw error61;
41356
+ throw error62;
40573
41357
  }
40574
41358
  }
40575
41359
  async begin(skillId, input2) {
@@ -40664,10 +41448,10 @@ class RemotePrivatePublicationsClient {
40664
41448
  let view;
40665
41449
  try {
40666
41450
  view = await this.get(skillId, intentId, { timeoutMs: timeout === 0 ? 15000 : Math.max(1, Math.min(15000, until - Date.now())), signal: options.signal });
40667
- } catch (error61) {
41451
+ } catch (error62) {
40668
41452
  if (previous && Date.now() >= until && !options.signal?.aborted)
40669
41453
  return previous;
40670
- throw error61;
41454
+ throw error62;
40671
41455
  }
40672
41456
  previous = view;
40673
41457
  if (!["queued", "verifying"].includes(view.state) || Date.now() >= until)
@@ -40728,9 +41512,9 @@ async function requestAuthApi(instance, path, options) {
40728
41512
  if (!res.ok) {
40729
41513
  const record9 = isRecord5(body) ? body : {};
40730
41514
  const detail = typeof record9.detail === "string" ? record9.detail : undefined;
40731
- const error61 = typeof record9.error === "string" ? record9.error : undefined;
41515
+ const error62 = typeof record9.error === "string" ? record9.error : undefined;
40732
41516
  const code = typeof record9.code === "string" ? record9.code : undefined;
40733
- throw new HostedApiError(detail || error61 || `${res.status} ${res.statusText}`, {
41517
+ throw new HostedApiError(detail || error62 || `${res.status} ${res.statusText}`, {
40734
41518
  status: res.status,
40735
41519
  code,
40736
41520
  detail,
@@ -43229,8 +44013,8 @@ function readSnapshotManifest(repoRoot, stationId) {
43229
44013
  let manifest;
43230
44014
  try {
43231
44015
  manifest = JSON.parse(readFileSync26(manifestPath, "utf8"));
43232
- } catch (error61) {
43233
- fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${error61.message}`);
44016
+ } catch (error62) {
44017
+ fail("MANIFEST_UNREADABLE", `cannot read snapshot manifest: ${manifestPath}: ${error62.message}`);
43234
44018
  }
43235
44019
  const sourceSnapshotSha = sha256File(manifestPath);
43236
44020
  return { manifest, manifestPath, sourceSnapshotSha };
@@ -43701,12 +44485,12 @@ async function continueLocked(client2, directory2, options) {
43701
44485
  save(directory2, receipt);
43702
44486
  try {
43703
44487
  await client2.upload(receipt.skillId, receipt.intent, bytes);
43704
- } catch (error61) {
43705
- if (error61 instanceof PrivatePublicationError && !error61.uncertain) {
44488
+ } catch (error62) {
44489
+ if (error62 instanceof PrivatePublicationError && !error62.uncertain) {
43706
44490
  receipt.phase = "awaiting_upload";
43707
44491
  save(directory2, receipt);
43708
44492
  }
43709
- throw error61;
44493
+ throw error62;
43710
44494
  }
43711
44495
  receipt.phase = "uploaded";
43712
44496
  save(directory2, receipt);