@basemaps/lambda-tiler 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9303,9 +9303,9 @@ __export(tslib_es6_exports, {
9303
9303
  __asyncValues: () => __asyncValues,
9304
9304
  __await: () => __await,
9305
9305
  __awaiter: () => __awaiter,
9306
- __classPrivateFieldGet: () => __classPrivateFieldGet,
9306
+ __classPrivateFieldGet: () => __classPrivateFieldGet2,
9307
9307
  __classPrivateFieldIn: () => __classPrivateFieldIn,
9308
- __classPrivateFieldSet: () => __classPrivateFieldSet,
9308
+ __classPrivateFieldSet: () => __classPrivateFieldSet2,
9309
9309
  __createBinding: () => __createBinding,
9310
9310
  __decorate: () => __decorate,
9311
9311
  __disposeResources: () => __disposeResources,
@@ -9699,14 +9699,14 @@ function __importStar(mod) {
9699
9699
  function __importDefault(mod) {
9700
9700
  return mod && mod.__esModule ? mod : { default: mod };
9701
9701
  }
9702
- function __classPrivateFieldGet(receiver, state, kind, f) {
9702
+ function __classPrivateFieldGet2(receiver, state, kind, f) {
9703
9703
  if (kind === "a" && !f)
9704
9704
  throw new TypeError("Private accessor was defined without a getter");
9705
9705
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
9706
9706
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
9707
9707
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
9708
9708
  }
9709
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
9709
+ function __classPrivateFieldSet2(receiver, state, value, kind, f) {
9710
9710
  if (kind === "m")
9711
9711
  throw new TypeError("Private method is not writable");
9712
9712
  if (kind === "a" && !f)
@@ -9878,8 +9878,8 @@ var init_tslib_es6 = __esm({
9878
9878
  __makeTemplateObject,
9879
9879
  __importStar,
9880
9880
  __importDefault,
9881
- __classPrivateFieldGet,
9882
- __classPrivateFieldSet,
9881
+ __classPrivateFieldGet: __classPrivateFieldGet2,
9882
+ __classPrivateFieldSet: __classPrivateFieldSet2,
9883
9883
  __classPrivateFieldIn,
9884
9884
  __addDisposableResource,
9885
9885
  __disposeResources,
@@ -13639,8 +13639,8 @@ __export(tslib_es6_exports2, {
13639
13639
  __asyncValues: () => __asyncValues2,
13640
13640
  __await: () => __await2,
13641
13641
  __awaiter: () => __awaiter2,
13642
- __classPrivateFieldGet: () => __classPrivateFieldGet2,
13643
- __classPrivateFieldSet: () => __classPrivateFieldSet2,
13642
+ __classPrivateFieldGet: () => __classPrivateFieldGet3,
13643
+ __classPrivateFieldSet: () => __classPrivateFieldSet3,
13644
13644
  __createBinding: () => __createBinding2,
13645
13645
  __decorate: () => __decorate2,
13646
13646
  __exportStar: () => __exportStar2,
@@ -13951,13 +13951,13 @@ function __importStar2(mod) {
13951
13951
  function __importDefault2(mod) {
13952
13952
  return mod && mod.__esModule ? mod : { default: mod };
13953
13953
  }
13954
- function __classPrivateFieldGet2(receiver, privateMap) {
13954
+ function __classPrivateFieldGet3(receiver, privateMap) {
13955
13955
  if (!privateMap.has(receiver)) {
13956
13956
  throw new TypeError("attempted to get private field on non-instance");
13957
13957
  }
13958
13958
  return privateMap.get(receiver);
13959
13959
  }
13960
- function __classPrivateFieldSet2(receiver, privateMap, value) {
13960
+ function __classPrivateFieldSet3(receiver, privateMap, value) {
13961
13961
  if (!privateMap.has(receiver)) {
13962
13962
  throw new TypeError("attempted to set private field on non-instance");
13963
13963
  }
@@ -42129,8 +42129,8 @@ __export(tslib_es6_exports3, {
42129
42129
  __asyncValues: () => __asyncValues3,
42130
42130
  __await: () => __await3,
42131
42131
  __awaiter: () => __awaiter3,
42132
- __classPrivateFieldGet: () => __classPrivateFieldGet3,
42133
- __classPrivateFieldSet: () => __classPrivateFieldSet3,
42132
+ __classPrivateFieldGet: () => __classPrivateFieldGet4,
42133
+ __classPrivateFieldSet: () => __classPrivateFieldSet4,
42134
42134
  __createBinding: () => __createBinding3,
42135
42135
  __decorate: () => __decorate3,
42136
42136
  __exportStar: () => __exportStar3,
@@ -42441,13 +42441,13 @@ function __importStar3(mod) {
42441
42441
  function __importDefault3(mod) {
42442
42442
  return mod && mod.__esModule ? mod : { default: mod };
42443
42443
  }
42444
- function __classPrivateFieldGet3(receiver, privateMap) {
42444
+ function __classPrivateFieldGet4(receiver, privateMap) {
42445
42445
  if (!privateMap.has(receiver)) {
42446
42446
  throw new TypeError("attempted to get private field on non-instance");
42447
42447
  }
42448
42448
  return privateMap.get(receiver);
42449
42449
  }
42450
- function __classPrivateFieldSet3(receiver, privateMap, value) {
42450
+ function __classPrivateFieldSet4(receiver, privateMap, value) {
42451
42451
  if (!privateMap.has(receiver)) {
42452
42452
  throw new TypeError("attempted to set private field on non-instance");
42453
42453
  }
@@ -76192,7 +76192,10 @@ var quotelessJson = (obj) => {
76192
76192
  const json = JSON.stringify(obj, null, 2);
76193
76193
  return json.replace(/"([^"]+)":/g, "$1:");
76194
76194
  };
76195
- var ZodError = class extends Error {
76195
+ var ZodError = class _ZodError extends Error {
76196
+ get errors() {
76197
+ return this.issues;
76198
+ }
76196
76199
  constructor(issues) {
76197
76200
  super();
76198
76201
  this.issues = [];
@@ -76211,9 +76214,6 @@ var ZodError = class extends Error {
76211
76214
  this.name = "ZodError";
76212
76215
  this.issues = issues;
76213
76216
  }
76214
- get errors() {
76215
- return this.issues;
76216
- }
76217
76217
  format(_mapper) {
76218
76218
  const mapper = _mapper || function(issue) {
76219
76219
  return issue.message;
@@ -76250,6 +76250,11 @@ var ZodError = class extends Error {
76250
76250
  processError(this);
76251
76251
  return fieldErrors;
76252
76252
  }
76253
+ static assert(value) {
76254
+ if (!(value instanceof _ZodError)) {
76255
+ throw new Error(`Not a ZodError: ${value}`);
76256
+ }
76257
+ }
76253
76258
  toString() {
76254
76259
  return this.message;
76255
76260
  }
@@ -76392,6 +76397,13 @@ var makeIssue = (params) => {
76392
76397
  ...issueData,
76393
76398
  path: fullPath
76394
76399
  };
76400
+ if (issueData.message !== void 0) {
76401
+ return {
76402
+ ...issueData,
76403
+ path: fullPath,
76404
+ message: issueData.message
76405
+ };
76406
+ }
76395
76407
  let errorMessage = "";
76396
76408
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
76397
76409
  for (const map of maps) {
@@ -76400,20 +76412,24 @@ var makeIssue = (params) => {
76400
76412
  return {
76401
76413
  ...issueData,
76402
76414
  path: fullPath,
76403
- message: issueData.message || errorMessage
76415
+ message: errorMessage
76404
76416
  };
76405
76417
  };
76406
76418
  var EMPTY_PATH = [];
76407
76419
  function addIssueToContext(ctx, issueData) {
76420
+ const overrideMap = getErrorMap();
76408
76421
  const issue = makeIssue({
76409
76422
  issueData,
76410
76423
  data: ctx.data,
76411
76424
  path: ctx.path,
76412
76425
  errorMaps: [
76413
76426
  ctx.common.contextualErrorMap,
76427
+ // contextual error map is first priority
76414
76428
  ctx.schemaErrorMap,
76415
- getErrorMap(),
76416
- errorMap
76429
+ // then schema-bound map if available
76430
+ overrideMap,
76431
+ // then global override map
76432
+ overrideMap === errorMap ? void 0 : errorMap
76417
76433
  // then global default map
76418
76434
  ].filter((x) => !!x)
76419
76435
  });
@@ -76445,9 +76461,11 @@ var ParseStatus = class _ParseStatus {
76445
76461
  static async mergeObjectAsync(status, pairs) {
76446
76462
  const syncPairs = [];
76447
76463
  for (const pair of pairs) {
76464
+ const key = await pair.key;
76465
+ const value = await pair.value;
76448
76466
  syncPairs.push({
76449
- key: await pair.key,
76450
- value: await pair.value
76467
+ key,
76468
+ value
76451
76469
  });
76452
76470
  }
76453
76471
  return _ParseStatus.mergeObjectSync(status, syncPairs);
@@ -76480,11 +76498,29 @@ var isAborted = (x) => x.status === "aborted";
76480
76498
  var isDirty = (x) => x.status === "dirty";
76481
76499
  var isValid = (x) => x.status === "valid";
76482
76500
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
76501
+ function __classPrivateFieldGet(receiver, state, kind, f) {
76502
+ if (kind === "a" && !f)
76503
+ throw new TypeError("Private accessor was defined without a getter");
76504
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
76505
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
76506
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
76507
+ }
76508
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
76509
+ if (kind === "m")
76510
+ throw new TypeError("Private method is not writable");
76511
+ if (kind === "a" && !f)
76512
+ throw new TypeError("Private accessor was defined without a setter");
76513
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
76514
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
76515
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
76516
+ }
76483
76517
  var errorUtil;
76484
76518
  (function(errorUtil2) {
76485
76519
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
76486
76520
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
76487
76521
  })(errorUtil || (errorUtil = {}));
76522
+ var _ZodEnum_cache;
76523
+ var _ZodNativeEnum_cache;
76488
76524
  var ParseInputLazyPath = class {
76489
76525
  constructor(parent, value, path2, key) {
76490
76526
  this._cachedPath = [];
@@ -76533,44 +76569,21 @@ function processCreateParams(params) {
76533
76569
  if (errorMap2)
76534
76570
  return { errorMap: errorMap2, description };
76535
76571
  const customMap = (iss, ctx) => {
76536
- if (iss.code !== "invalid_type")
76537
- return { message: ctx.defaultError };
76572
+ var _a2, _b;
76573
+ const { message } = params;
76574
+ if (iss.code === "invalid_enum_value") {
76575
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
76576
+ }
76538
76577
  if (typeof ctx.data === "undefined") {
76539
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
76578
+ return { message: (_a2 = message !== null && message !== void 0 ? message : required_error) !== null && _a2 !== void 0 ? _a2 : ctx.defaultError };
76540
76579
  }
76541
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
76580
+ if (iss.code !== "invalid_type")
76581
+ return { message: ctx.defaultError };
76582
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
76542
76583
  };
76543
76584
  return { errorMap: customMap, description };
76544
76585
  }
76545
76586
  var ZodType = class {
76546
- constructor(def) {
76547
- this.spa = this.safeParseAsync;
76548
- this._def = def;
76549
- this.parse = this.parse.bind(this);
76550
- this.safeParse = this.safeParse.bind(this);
76551
- this.parseAsync = this.parseAsync.bind(this);
76552
- this.safeParseAsync = this.safeParseAsync.bind(this);
76553
- this.spa = this.spa.bind(this);
76554
- this.refine = this.refine.bind(this);
76555
- this.refinement = this.refinement.bind(this);
76556
- this.superRefine = this.superRefine.bind(this);
76557
- this.optional = this.optional.bind(this);
76558
- this.nullable = this.nullable.bind(this);
76559
- this.nullish = this.nullish.bind(this);
76560
- this.array = this.array.bind(this);
76561
- this.promise = this.promise.bind(this);
76562
- this.or = this.or.bind(this);
76563
- this.and = this.and.bind(this);
76564
- this.transform = this.transform.bind(this);
76565
- this.brand = this.brand.bind(this);
76566
- this.default = this.default.bind(this);
76567
- this.catch = this.catch.bind(this);
76568
- this.describe = this.describe.bind(this);
76569
- this.pipe = this.pipe.bind(this);
76570
- this.readonly = this.readonly.bind(this);
76571
- this.isNullable = this.isNullable.bind(this);
76572
- this.isOptional = this.isOptional.bind(this);
76573
- }
76574
76587
  get description() {
76575
76588
  return this._def.description;
76576
76589
  }
@@ -76634,6 +76647,43 @@ var ZodType = class {
76634
76647
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
76635
76648
  return handleResult(ctx, result);
76636
76649
  }
76650
+ "~validate"(data) {
76651
+ var _a2, _b;
76652
+ const ctx = {
76653
+ common: {
76654
+ issues: [],
76655
+ async: !!this["~standard"].async
76656
+ },
76657
+ path: [],
76658
+ schemaErrorMap: this._def.errorMap,
76659
+ parent: null,
76660
+ data,
76661
+ parsedType: getParsedType(data)
76662
+ };
76663
+ if (!this["~standard"].async) {
76664
+ try {
76665
+ const result = this._parseSync({ data, path: [], parent: ctx });
76666
+ return isValid(result) ? {
76667
+ value: result.value
76668
+ } : {
76669
+ issues: ctx.common.issues
76670
+ };
76671
+ } catch (err) {
76672
+ if ((_b = (_a2 = err === null || err === void 0 ? void 0 : err.message) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
76673
+ this["~standard"].async = true;
76674
+ }
76675
+ ctx.common = {
76676
+ issues: [],
76677
+ async: true
76678
+ };
76679
+ }
76680
+ }
76681
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
76682
+ value: result.value
76683
+ } : {
76684
+ issues: ctx.common.issues
76685
+ });
76686
+ }
76637
76687
  async parseAsync(data, params) {
76638
76688
  const result = await this.safeParseAsync(data, params);
76639
76689
  if (result.success)
@@ -76711,6 +76761,39 @@ var ZodType = class {
76711
76761
  superRefine(refinement) {
76712
76762
  return this._refinement(refinement);
76713
76763
  }
76764
+ constructor(def) {
76765
+ this.spa = this.safeParseAsync;
76766
+ this._def = def;
76767
+ this.parse = this.parse.bind(this);
76768
+ this.safeParse = this.safeParse.bind(this);
76769
+ this.parseAsync = this.parseAsync.bind(this);
76770
+ this.safeParseAsync = this.safeParseAsync.bind(this);
76771
+ this.spa = this.spa.bind(this);
76772
+ this.refine = this.refine.bind(this);
76773
+ this.refinement = this.refinement.bind(this);
76774
+ this.superRefine = this.superRefine.bind(this);
76775
+ this.optional = this.optional.bind(this);
76776
+ this.nullable = this.nullable.bind(this);
76777
+ this.nullish = this.nullish.bind(this);
76778
+ this.array = this.array.bind(this);
76779
+ this.promise = this.promise.bind(this);
76780
+ this.or = this.or.bind(this);
76781
+ this.and = this.and.bind(this);
76782
+ this.transform = this.transform.bind(this);
76783
+ this.brand = this.brand.bind(this);
76784
+ this.default = this.default.bind(this);
76785
+ this.catch = this.catch.bind(this);
76786
+ this.describe = this.describe.bind(this);
76787
+ this.pipe = this.pipe.bind(this);
76788
+ this.readonly = this.readonly.bind(this);
76789
+ this.isNullable = this.isNullable.bind(this);
76790
+ this.isOptional = this.isOptional.bind(this);
76791
+ this["~standard"] = {
76792
+ version: 1,
76793
+ vendor: "zod",
76794
+ validate: (data) => this["~validate"](data)
76795
+ };
76796
+ }
76714
76797
  optional() {
76715
76798
  return ZodOptional.create(this, this._def);
76716
76799
  }
@@ -76721,7 +76804,7 @@ var ZodType = class {
76721
76804
  return this.nullable().optional();
76722
76805
  }
76723
76806
  array() {
76724
- return ZodArray.create(this, this._def);
76807
+ return ZodArray.create(this);
76725
76808
  }
76726
76809
  promise() {
76727
76810
  return ZodPromise.create(this, this._def);
@@ -76786,35 +76869,45 @@ var ZodType = class {
76786
76869
  }
76787
76870
  };
76788
76871
  var cuidRegex = /^c[^\s-]{8,}$/i;
76789
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
76790
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
76872
+ var cuid2Regex = /^[0-9a-z]+$/;
76873
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
76791
76874
  var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
76792
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
76875
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
76876
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
76877
+ var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
76878
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
76793
76879
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
76794
76880
  var emojiRegex;
76795
- var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
76796
- var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
76797
- var datetimeRegex = (args) => {
76881
+ var ipv4Regex = /^(?:(?: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])$/;
76882
+ var ipv4CidrRegex = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/;
76883
+ var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
76884
+ var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
76885
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
76886
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
76887
+ var dateRegexSource = `((\\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])))`;
76888
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
76889
+ function timeRegexSource(args) {
76890
+ let secondsRegexSource = `[0-5]\\d`;
76798
76891
  if (args.precision) {
76799
- if (args.offset) {
76800
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
76801
- } else {
76802
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
76803
- }
76804
- } else if (args.precision === 0) {
76805
- if (args.offset) {
76806
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
76807
- } else {
76808
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
76809
- }
76810
- } else {
76811
- if (args.offset) {
76812
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
76813
- } else {
76814
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
76815
- }
76892
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
76893
+ } else if (args.precision == null) {
76894
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
76816
76895
  }
76817
- };
76896
+ const secondsQuantifier = args.precision ? "+" : "?";
76897
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
76898
+ }
76899
+ function timeRegex(args) {
76900
+ return new RegExp(`^${timeRegexSource(args)}$`);
76901
+ }
76902
+ function datetimeRegex(args) {
76903
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
76904
+ const opts = [];
76905
+ opts.push(args.local ? `Z?` : `Z`);
76906
+ if (args.offset)
76907
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
76908
+ regex = `${regex}(${opts.join("|")})`;
76909
+ return new RegExp(`^${regex}$`);
76910
+ }
76818
76911
  function isValidIP(ip, version3) {
76819
76912
  if ((version3 === "v4" || !version3) && ipv4Regex.test(ip)) {
76820
76913
  return true;
@@ -76824,6 +76917,33 @@ function isValidIP(ip, version3) {
76824
76917
  }
76825
76918
  return false;
76826
76919
  }
76920
+ function isValidJWT(jwt, alg) {
76921
+ if (!jwtRegex.test(jwt))
76922
+ return false;
76923
+ try {
76924
+ const [header] = jwt.split(".");
76925
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
76926
+ const decoded = JSON.parse(atob(base64));
76927
+ if (typeof decoded !== "object" || decoded === null)
76928
+ return false;
76929
+ if (!decoded.typ || !decoded.alg)
76930
+ return false;
76931
+ if (alg && decoded.alg !== alg)
76932
+ return false;
76933
+ return true;
76934
+ } catch (_a2) {
76935
+ return false;
76936
+ }
76937
+ }
76938
+ function isValidCidr(ip, version3) {
76939
+ if ((version3 === "v4" || !version3) && ipv4CidrRegex.test(ip)) {
76940
+ return true;
76941
+ }
76942
+ if ((version3 === "v6" || !version3) && ipv6CidrRegex.test(ip)) {
76943
+ return true;
76944
+ }
76945
+ return false;
76946
+ }
76827
76947
  var ZodString = class _ZodString extends ZodType {
76828
76948
  _parse(input) {
76829
76949
  if (this._def.coerce) {
@@ -76832,15 +76952,11 @@ var ZodString = class _ZodString extends ZodType {
76832
76952
  const parsedType = this._getType(input);
76833
76953
  if (parsedType !== ZodParsedType.string) {
76834
76954
  const ctx2 = this._getOrReturnCtx(input);
76835
- addIssueToContext(
76836
- ctx2,
76837
- {
76838
- code: ZodIssueCode.invalid_type,
76839
- expected: ZodParsedType.string,
76840
- received: ctx2.parsedType
76841
- }
76842
- //
76843
- );
76955
+ addIssueToContext(ctx2, {
76956
+ code: ZodIssueCode.invalid_type,
76957
+ expected: ZodParsedType.string,
76958
+ received: ctx2.parsedType
76959
+ });
76844
76960
  return INVALID;
76845
76961
  }
76846
76962
  const status = new ParseStatus();
@@ -76931,6 +77047,16 @@ var ZodString = class _ZodString extends ZodType {
76931
77047
  });
76932
77048
  status.dirty();
76933
77049
  }
77050
+ } else if (check.kind === "nanoid") {
77051
+ if (!nanoidRegex.test(input.data)) {
77052
+ ctx = this._getOrReturnCtx(input, ctx);
77053
+ addIssueToContext(ctx, {
77054
+ validation: "nanoid",
77055
+ code: ZodIssueCode.invalid_string,
77056
+ message: check.message
77057
+ });
77058
+ status.dirty();
77059
+ }
76934
77060
  } else if (check.kind === "cuid") {
76935
77061
  if (!cuidRegex.test(input.data)) {
76936
77062
  ctx = this._getOrReturnCtx(input, ctx);
@@ -77032,6 +77158,38 @@ var ZodString = class _ZodString extends ZodType {
77032
77158
  });
77033
77159
  status.dirty();
77034
77160
  }
77161
+ } else if (check.kind === "date") {
77162
+ const regex = dateRegex;
77163
+ if (!regex.test(input.data)) {
77164
+ ctx = this._getOrReturnCtx(input, ctx);
77165
+ addIssueToContext(ctx, {
77166
+ code: ZodIssueCode.invalid_string,
77167
+ validation: "date",
77168
+ message: check.message
77169
+ });
77170
+ status.dirty();
77171
+ }
77172
+ } else if (check.kind === "time") {
77173
+ const regex = timeRegex(check);
77174
+ if (!regex.test(input.data)) {
77175
+ ctx = this._getOrReturnCtx(input, ctx);
77176
+ addIssueToContext(ctx, {
77177
+ code: ZodIssueCode.invalid_string,
77178
+ validation: "time",
77179
+ message: check.message
77180
+ });
77181
+ status.dirty();
77182
+ }
77183
+ } else if (check.kind === "duration") {
77184
+ if (!durationRegex.test(input.data)) {
77185
+ ctx = this._getOrReturnCtx(input, ctx);
77186
+ addIssueToContext(ctx, {
77187
+ validation: "duration",
77188
+ code: ZodIssueCode.invalid_string,
77189
+ message: check.message
77190
+ });
77191
+ status.dirty();
77192
+ }
77035
77193
  } else if (check.kind === "ip") {
77036
77194
  if (!isValidIP(input.data, check.version)) {
77037
77195
  ctx = this._getOrReturnCtx(input, ctx);
@@ -77042,6 +77200,46 @@ var ZodString = class _ZodString extends ZodType {
77042
77200
  });
77043
77201
  status.dirty();
77044
77202
  }
77203
+ } else if (check.kind === "jwt") {
77204
+ if (!isValidJWT(input.data, check.alg)) {
77205
+ ctx = this._getOrReturnCtx(input, ctx);
77206
+ addIssueToContext(ctx, {
77207
+ validation: "jwt",
77208
+ code: ZodIssueCode.invalid_string,
77209
+ message: check.message
77210
+ });
77211
+ status.dirty();
77212
+ }
77213
+ } else if (check.kind === "cidr") {
77214
+ if (!isValidCidr(input.data, check.version)) {
77215
+ ctx = this._getOrReturnCtx(input, ctx);
77216
+ addIssueToContext(ctx, {
77217
+ validation: "cidr",
77218
+ code: ZodIssueCode.invalid_string,
77219
+ message: check.message
77220
+ });
77221
+ status.dirty();
77222
+ }
77223
+ } else if (check.kind === "base64") {
77224
+ if (!base64Regex.test(input.data)) {
77225
+ ctx = this._getOrReturnCtx(input, ctx);
77226
+ addIssueToContext(ctx, {
77227
+ validation: "base64",
77228
+ code: ZodIssueCode.invalid_string,
77229
+ message: check.message
77230
+ });
77231
+ status.dirty();
77232
+ }
77233
+ } else if (check.kind === "base64url") {
77234
+ if (!base64urlRegex.test(input.data)) {
77235
+ ctx = this._getOrReturnCtx(input, ctx);
77236
+ addIssueToContext(ctx, {
77237
+ validation: "base64url",
77238
+ code: ZodIssueCode.invalid_string,
77239
+ message: check.message
77240
+ });
77241
+ status.dirty();
77242
+ }
77045
77243
  } else {
77046
77244
  util.assertNever(check);
77047
77245
  }
@@ -77073,6 +77271,9 @@ var ZodString = class _ZodString extends ZodType {
77073
77271
  uuid(message) {
77074
77272
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
77075
77273
  }
77274
+ nanoid(message) {
77275
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
77276
+ }
77076
77277
  cuid(message) {
77077
77278
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
77078
77279
  }
@@ -77082,16 +77283,32 @@ var ZodString = class _ZodString extends ZodType {
77082
77283
  ulid(message) {
77083
77284
  return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
77084
77285
  }
77286
+ base64(message) {
77287
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
77288
+ }
77289
+ base64url(message) {
77290
+ return this._addCheck({
77291
+ kind: "base64url",
77292
+ ...errorUtil.errToObj(message)
77293
+ });
77294
+ }
77295
+ jwt(options) {
77296
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
77297
+ }
77085
77298
  ip(options) {
77086
77299
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
77087
77300
  }
77301
+ cidr(options) {
77302
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
77303
+ }
77088
77304
  datetime(options) {
77089
- var _a2;
77305
+ var _a2, _b;
77090
77306
  if (typeof options === "string") {
77091
77307
  return this._addCheck({
77092
77308
  kind: "datetime",
77093
77309
  precision: null,
77094
77310
  offset: false,
77311
+ local: false,
77095
77312
  message: options
77096
77313
  });
77097
77314
  }
@@ -77099,9 +77316,30 @@ var ZodString = class _ZodString extends ZodType {
77099
77316
  kind: "datetime",
77100
77317
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
77101
77318
  offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
77319
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
77320
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
77321
+ });
77322
+ }
77323
+ date(message) {
77324
+ return this._addCheck({ kind: "date", message });
77325
+ }
77326
+ time(options) {
77327
+ if (typeof options === "string") {
77328
+ return this._addCheck({
77329
+ kind: "time",
77330
+ precision: null,
77331
+ message: options
77332
+ });
77333
+ }
77334
+ return this._addCheck({
77335
+ kind: "time",
77336
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
77102
77337
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
77103
77338
  });
77104
77339
  }
77340
+ duration(message) {
77341
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
77342
+ }
77105
77343
  regex(regex, message) {
77106
77344
  return this._addCheck({
77107
77345
  kind: "regex",
@@ -77153,8 +77391,7 @@ var ZodString = class _ZodString extends ZodType {
77153
77391
  });
77154
77392
  }
77155
77393
  /**
77156
- * @deprecated Use z.string().min(1) instead.
77157
- * @see {@link ZodString.min}
77394
+ * Equivalent to `.min(1)`
77158
77395
  */
77159
77396
  nonempty(message) {
77160
77397
  return this.min(1, errorUtil.errToObj(message));
@@ -77180,6 +77417,15 @@ var ZodString = class _ZodString extends ZodType {
77180
77417
  get isDatetime() {
77181
77418
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
77182
77419
  }
77420
+ get isDate() {
77421
+ return !!this._def.checks.find((ch) => ch.kind === "date");
77422
+ }
77423
+ get isTime() {
77424
+ return !!this._def.checks.find((ch) => ch.kind === "time");
77425
+ }
77426
+ get isDuration() {
77427
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
77428
+ }
77183
77429
  get isEmail() {
77184
77430
  return !!this._def.checks.find((ch) => ch.kind === "email");
77185
77431
  }
@@ -77192,6 +77438,9 @@ var ZodString = class _ZodString extends ZodType {
77192
77438
  get isUUID() {
77193
77439
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
77194
77440
  }
77441
+ get isNANOID() {
77442
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
77443
+ }
77195
77444
  get isCUID() {
77196
77445
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
77197
77446
  }
@@ -77204,6 +77453,15 @@ var ZodString = class _ZodString extends ZodType {
77204
77453
  get isIP() {
77205
77454
  return !!this._def.checks.find((ch) => ch.kind === "ip");
77206
77455
  }
77456
+ get isCIDR() {
77457
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
77458
+ }
77459
+ get isBase64() {
77460
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
77461
+ }
77462
+ get isBase64url() {
77463
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
77464
+ }
77207
77465
  get minLength() {
77208
77466
  let min = null;
77209
77467
  for (const ch of this._def.checks) {
@@ -77481,17 +77739,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
77481
77739
  }
77482
77740
  _parse(input) {
77483
77741
  if (this._def.coerce) {
77484
- input.data = BigInt(input.data);
77742
+ try {
77743
+ input.data = BigInt(input.data);
77744
+ } catch (_a2) {
77745
+ return this._getInvalidInput(input);
77746
+ }
77485
77747
  }
77486
77748
  const parsedType = this._getType(input);
77487
77749
  if (parsedType !== ZodParsedType.bigint) {
77488
- const ctx2 = this._getOrReturnCtx(input);
77489
- addIssueToContext(ctx2, {
77490
- code: ZodIssueCode.invalid_type,
77491
- expected: ZodParsedType.bigint,
77492
- received: ctx2.parsedType
77493
- });
77494
- return INVALID;
77750
+ return this._getInvalidInput(input);
77495
77751
  }
77496
77752
  let ctx = void 0;
77497
77753
  const status = new ParseStatus();
@@ -77538,6 +77794,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
77538
77794
  }
77539
77795
  return { status: status.value, value: input.data };
77540
77796
  }
77797
+ _getInvalidInput(input) {
77798
+ const ctx = this._getOrReturnCtx(input);
77799
+ addIssueToContext(ctx, {
77800
+ code: ZodIssueCode.invalid_type,
77801
+ expected: ZodParsedType.bigint,
77802
+ received: ctx.parsedType
77803
+ });
77804
+ return INVALID;
77805
+ }
77541
77806
  gte(value, message) {
77542
77807
  return this.setLimit("min", value, true, errorUtil.toString(message));
77543
77808
  }
@@ -78117,9 +78382,10 @@ var ZodObject = class _ZodObject extends ZodType {
78117
78382
  const syncPairs = [];
78118
78383
  for (const pair of pairs) {
78119
78384
  const key = await pair.key;
78385
+ const value = await pair.value;
78120
78386
  syncPairs.push({
78121
78387
  key,
78122
- value: await pair.value,
78388
+ value,
78123
78389
  alwaysSet: pair.alwaysSet
78124
78390
  });
78125
78391
  }
@@ -78470,15 +78736,25 @@ var getDiscriminator = (type) => {
78470
78736
  } else if (type instanceof ZodEnum) {
78471
78737
  return type.options;
78472
78738
  } else if (type instanceof ZodNativeEnum) {
78473
- return Object.keys(type.enum);
78739
+ return util.objectValues(type.enum);
78474
78740
  } else if (type instanceof ZodDefault) {
78475
78741
  return getDiscriminator(type._def.innerType);
78476
78742
  } else if (type instanceof ZodUndefined) {
78477
78743
  return [void 0];
78478
78744
  } else if (type instanceof ZodNull) {
78479
78745
  return [null];
78746
+ } else if (type instanceof ZodOptional) {
78747
+ return [void 0, ...getDiscriminator(type.unwrap())];
78748
+ } else if (type instanceof ZodNullable) {
78749
+ return [null, ...getDiscriminator(type.unwrap())];
78750
+ } else if (type instanceof ZodBranded) {
78751
+ return getDiscriminator(type.unwrap());
78752
+ } else if (type instanceof ZodReadonly) {
78753
+ return getDiscriminator(type.unwrap());
78754
+ } else if (type instanceof ZodCatch) {
78755
+ return getDiscriminator(type._def.innerType);
78480
78756
  } else {
78481
- return null;
78757
+ return [];
78482
78758
  }
78483
78759
  };
78484
78760
  var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
@@ -78538,7 +78814,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
78538
78814
  const optionsMap = /* @__PURE__ */ new Map();
78539
78815
  for (const type of options) {
78540
78816
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
78541
- if (!discriminatorValues) {
78817
+ if (!discriminatorValues.length) {
78542
78818
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
78543
78819
  }
78544
78820
  for (const value of discriminatorValues) {
@@ -78738,7 +79014,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
78738
79014
  for (const key in ctx.data) {
78739
79015
  pairs.push({
78740
79016
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
78741
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
79017
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
79018
+ alwaysSet: key in ctx.data
78742
79019
  });
78743
79020
  }
78744
79021
  if (ctx.common.async) {
@@ -79082,6 +79359,10 @@ function createZodEnum(values, params) {
79082
79359
  });
79083
79360
  }
79084
79361
  var ZodEnum = class _ZodEnum extends ZodType {
79362
+ constructor() {
79363
+ super(...arguments);
79364
+ _ZodEnum_cache.set(this, void 0);
79365
+ }
79085
79366
  _parse(input) {
79086
79367
  if (typeof input.data !== "string") {
79087
79368
  const ctx = this._getOrReturnCtx(input);
@@ -79093,7 +79374,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
79093
79374
  });
79094
79375
  return INVALID;
79095
79376
  }
79096
- if (this._def.values.indexOf(input.data) === -1) {
79377
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
79378
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
79379
+ }
79380
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
79097
79381
  const ctx = this._getOrReturnCtx(input);
79098
79382
  const expectedValues = this._def.values;
79099
79383
  addIssueToContext(ctx, {
@@ -79129,15 +79413,26 @@ var ZodEnum = class _ZodEnum extends ZodType {
79129
79413
  }
79130
79414
  return enumValues;
79131
79415
  }
79132
- extract(values) {
79133
- return _ZodEnum.create(values);
79416
+ extract(values, newDef = this._def) {
79417
+ return _ZodEnum.create(values, {
79418
+ ...this._def,
79419
+ ...newDef
79420
+ });
79134
79421
  }
79135
- exclude(values) {
79136
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
79422
+ exclude(values, newDef = this._def) {
79423
+ return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
79424
+ ...this._def,
79425
+ ...newDef
79426
+ });
79137
79427
  }
79138
79428
  };
79429
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
79139
79430
  ZodEnum.create = createZodEnum;
79140
79431
  var ZodNativeEnum = class extends ZodType {
79432
+ constructor() {
79433
+ super(...arguments);
79434
+ _ZodNativeEnum_cache.set(this, void 0);
79435
+ }
79141
79436
  _parse(input) {
79142
79437
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
79143
79438
  const ctx = this._getOrReturnCtx(input);
@@ -79150,7 +79445,10 @@ var ZodNativeEnum = class extends ZodType {
79150
79445
  });
79151
79446
  return INVALID;
79152
79447
  }
79153
- if (nativeEnumValues.indexOf(input.data) === -1) {
79448
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
79449
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
79450
+ }
79451
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
79154
79452
  const expectedValues = util.objectValues(nativeEnumValues);
79155
79453
  addIssueToContext(ctx, {
79156
79454
  received: ctx.data,
@@ -79165,6 +79463,7 @@ var ZodNativeEnum = class extends ZodType {
79165
79463
  return this._def.values;
79166
79464
  }
79167
79465
  };
79466
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
79168
79467
  ZodNativeEnum.create = (values, params) => {
79169
79468
  return new ZodNativeEnum({
79170
79469
  values,
@@ -79228,26 +79527,38 @@ var ZodEffects = class extends ZodType {
79228
79527
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
79229
79528
  if (effect.type === "preprocess") {
79230
79529
  const processed = effect.transform(ctx.data, checkCtx);
79231
- if (ctx.common.issues.length) {
79232
- return {
79233
- status: "dirty",
79234
- value: ctx.data
79235
- };
79236
- }
79237
79530
  if (ctx.common.async) {
79238
- return Promise.resolve(processed).then((processed2) => {
79239
- return this._def.schema._parseAsync({
79531
+ return Promise.resolve(processed).then(async (processed2) => {
79532
+ if (status.value === "aborted")
79533
+ return INVALID;
79534
+ const result = await this._def.schema._parseAsync({
79240
79535
  data: processed2,
79241
79536
  path: ctx.path,
79242
79537
  parent: ctx
79243
79538
  });
79539
+ if (result.status === "aborted")
79540
+ return INVALID;
79541
+ if (result.status === "dirty")
79542
+ return DIRTY(result.value);
79543
+ if (status.value === "dirty")
79544
+ return DIRTY(result.value);
79545
+ return result;
79244
79546
  });
79245
79547
  } else {
79246
- return this._def.schema._parseSync({
79548
+ if (status.value === "aborted")
79549
+ return INVALID;
79550
+ const result = this._def.schema._parseSync({
79247
79551
  data: processed,
79248
79552
  path: ctx.path,
79249
79553
  parent: ctx
79250
79554
  });
79555
+ if (result.status === "aborted")
79556
+ return INVALID;
79557
+ if (result.status === "dirty")
79558
+ return DIRTY(result.value);
79559
+ if (status.value === "dirty")
79560
+ return DIRTY(result.value);
79561
+ return result;
79251
79562
  }
79252
79563
  }
79253
79564
  if (effect.type === "refinement") {
@@ -79536,10 +79847,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
79536
79847
  var ZodReadonly = class extends ZodType {
79537
79848
  _parse(input) {
79538
79849
  const result = this._def.innerType._parse(input);
79539
- if (isValid(result)) {
79540
- result.value = Object.freeze(result.value);
79541
- }
79542
- return result;
79850
+ const freeze = (data) => {
79851
+ if (isValid(data)) {
79852
+ data.value = Object.freeze(data.value);
79853
+ }
79854
+ return data;
79855
+ };
79856
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
79857
+ }
79858
+ unwrap() {
79859
+ return this._def.innerType;
79543
79860
  }
79544
79861
  };
79545
79862
  ZodReadonly.create = (type, params) => {
@@ -79549,19 +79866,35 @@ ZodReadonly.create = (type, params) => {
79549
79866
  ...processCreateParams(params)
79550
79867
  });
79551
79868
  };
79552
- var custom = (check, params = {}, fatal) => {
79869
+ function cleanParams(params, data) {
79870
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
79871
+ const p2 = typeof p === "string" ? { message: p } : p;
79872
+ return p2;
79873
+ }
79874
+ function custom(check, _params = {}, fatal) {
79553
79875
  if (check)
79554
79876
  return ZodAny.create().superRefine((data, ctx) => {
79555
79877
  var _a2, _b;
79556
- if (!check(data)) {
79557
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
79558
- const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
79559
- const p2 = typeof p === "string" ? { message: p } : p;
79560
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
79878
+ const r = check(data);
79879
+ if (r instanceof Promise) {
79880
+ return r.then((r2) => {
79881
+ var _a3, _b2;
79882
+ if (!r2) {
79883
+ const params = cleanParams(_params, data);
79884
+ const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
79885
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
79886
+ }
79887
+ });
79561
79888
  }
79889
+ if (!r) {
79890
+ const params = cleanParams(_params, data);
79891
+ const _fatal = (_b = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
79892
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
79893
+ }
79894
+ return;
79562
79895
  });
79563
79896
  return ZodAny.create();
79564
- };
79897
+ }
79565
79898
  var late = {
79566
79899
  object: ZodObject.lazycreate
79567
79900
  };
@@ -79680,6 +80013,7 @@ var z = /* @__PURE__ */ Object.freeze({
79680
80013
  ZodParsedType,
79681
80014
  getParsedType,
79682
80015
  ZodType,
80016
+ datetimeRegex,
79683
80017
  ZodString,
79684
80018
  ZodNumber,
79685
80019
  ZodBigInt,
@@ -81712,6 +82046,7 @@ fsa.register("https://", new FsHttp());
81712
82046
  fsa.register("s3://", s3Fs);
81713
82047
  fsa.register("s3://nz-imagery", s3FsPublic);
81714
82048
  fsa.register("s3://nz-elevation", s3FsPublic);
82049
+ fsa.register("s3://nz-coastal", s3FsPublic);
81715
82050
  var Fsa = fsa;
81716
82051
  var FsaChunk = new SourceChunk({ size: 128 * 1024 });
81717
82052
  fsa.middleware.push(FsaChunk);
@@ -86993,9 +87328,9 @@ var Router = class {
86993
87328
  };
86994
87329
 
86995
87330
  // ../../node_modules/@linzjs/lambda/build/src/function.js
86996
- var version2 = "v8.0.0-4-g14a4364d";
86997
- var hash = "14a4364d39e226b7ed0396fee9c3adc534d1142b";
86998
- var buildId = "15100600846-1";
87331
+ var version2 = "v8.1.0-6-g69195be6";
87332
+ var hash = "69195be692efa914369fa854d3bae16355dc0dc8";
87333
+ var buildId = "15601557572-1";
86999
87334
  var versionInfo = { version: version2, hash, buildId };
87000
87335
  async function runFunction(req, fn) {
87001
87336
  if (!req.timer.timers.has("lambda"))
@@ -89972,6 +90307,12 @@ var Queue = class {
89972
90307
  __privateWrapper(this, _size)._--;
89973
90308
  return current.value;
89974
90309
  }
90310
+ peek() {
90311
+ if (!__privateGet(this, _head)) {
90312
+ return;
90313
+ }
90314
+ return __privateGet(this, _head).value;
90315
+ }
89975
90316
  clear() {
89976
90317
  __privateSet(this, _head, void 0);
89977
90318
  __privateSet(this, _tail, void 0);
@@ -89987,6 +90328,11 @@ var Queue = class {
89987
90328
  current = current.next;
89988
90329
  }
89989
90330
  }
90331
+ *drain() {
90332
+ while (__privateGet(this, _head)) {
90333
+ yield this.dequeue();
90334
+ }
90335
+ }
89990
90336
  };
89991
90337
  _head = new WeakMap();
89992
90338
  _tail = new WeakMap();
@@ -91334,18 +91680,18 @@ async function versionGet(req) {
91334
91680
  * last git version tag
91335
91681
  * @example "v6.42.1"
91336
91682
  */
91337
- version: "v8.0.0-4-g14a4364d",
91683
+ version: "v8.1.0-6-g69195be6",
91338
91684
  /**
91339
91685
  * Full git commit hash
91340
91686
  * @example "e4231b1ee62c276c8657c56677ced02681dfe5d6"
91341
91687
  */
91342
- hash: "14a4364d39e226b7ed0396fee9c3adc534d1142b",
91688
+ hash: "69195be692efa914369fa854d3bae16355dc0dc8",
91343
91689
  /**
91344
91690
  *
91345
91691
  * The exact build that this release was run from
91346
91692
  * @example "1658821493-3"
91347
91693
  */
91348
- buildId: "15100600846-1",
91694
+ buildId: "15601557572-1",
91349
91695
  /**
91350
91696
  * Configuration id that was used to power this config
91351
91697
  * @example { "id": "cb_01JTQ7ZK49F8EY4N5DRJ3XFT73", hash: "HcByZ8WS2zpaTxFJp6wSKg2eUpwahLqAGEQdcDxKxqp6" }