@basemaps/cli-raster 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.
Files changed (2) hide show
  1. package/dist/index.cjs +480 -134
  2. package/package.json +4 -4
package/dist/index.cjs 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
  }
@@ -72934,9 +72934,9 @@ var ulid2 = __toESM(require_index_umd(), 1);
72934
72934
  var CliInfo = {
72935
72935
  // Detect unlinked packages looks for this string since its a package name, slightly work around it
72936
72936
  package: "@basemaps/cli",
72937
- version: "v8.1.0",
72938
- hash: "14a4364d39e226b7ed0396fee9c3adc534d1142b",
72939
- buildId: "15100600846-1"
72937
+ version: "v8.2.0",
72938
+ hash: "69195be692efa914369fa854d3bae16355dc0dc8",
72939
+ buildId: "15601557572-1"
72940
72940
  };
72941
72941
  var CliDate = (/* @__PURE__ */ new Date()).toISOString();
72942
72942
  var CliId = ulid2.ulid();
@@ -73239,7 +73239,10 @@ var quotelessJson = (obj) => {
73239
73239
  const json = JSON.stringify(obj, null, 2);
73240
73240
  return json.replace(/"([^"]+)":/g, "$1:");
73241
73241
  };
73242
- var ZodError = class extends Error {
73242
+ var ZodError = class _ZodError extends Error {
73243
+ get errors() {
73244
+ return this.issues;
73245
+ }
73243
73246
  constructor(issues) {
73244
73247
  super();
73245
73248
  this.issues = [];
@@ -73258,9 +73261,6 @@ var ZodError = class extends Error {
73258
73261
  this.name = "ZodError";
73259
73262
  this.issues = issues;
73260
73263
  }
73261
- get errors() {
73262
- return this.issues;
73263
- }
73264
73264
  format(_mapper) {
73265
73265
  const mapper = _mapper || function(issue) {
73266
73266
  return issue.message;
@@ -73297,6 +73297,11 @@ var ZodError = class extends Error {
73297
73297
  processError(this);
73298
73298
  return fieldErrors;
73299
73299
  }
73300
+ static assert(value) {
73301
+ if (!(value instanceof _ZodError)) {
73302
+ throw new Error(`Not a ZodError: ${value}`);
73303
+ }
73304
+ }
73300
73305
  toString() {
73301
73306
  return this.message;
73302
73307
  }
@@ -73439,6 +73444,13 @@ var makeIssue = (params) => {
73439
73444
  ...issueData,
73440
73445
  path: fullPath
73441
73446
  };
73447
+ if (issueData.message !== void 0) {
73448
+ return {
73449
+ ...issueData,
73450
+ path: fullPath,
73451
+ message: issueData.message
73452
+ };
73453
+ }
73442
73454
  let errorMessage = "";
73443
73455
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
73444
73456
  for (const map of maps) {
@@ -73447,20 +73459,24 @@ var makeIssue = (params) => {
73447
73459
  return {
73448
73460
  ...issueData,
73449
73461
  path: fullPath,
73450
- message: issueData.message || errorMessage
73462
+ message: errorMessage
73451
73463
  };
73452
73464
  };
73453
73465
  var EMPTY_PATH = [];
73454
73466
  function addIssueToContext(ctx, issueData) {
73467
+ const overrideMap = getErrorMap();
73455
73468
  const issue = makeIssue({
73456
73469
  issueData,
73457
73470
  data: ctx.data,
73458
73471
  path: ctx.path,
73459
73472
  errorMaps: [
73460
73473
  ctx.common.contextualErrorMap,
73474
+ // contextual error map is first priority
73461
73475
  ctx.schemaErrorMap,
73462
- getErrorMap(),
73463
- errorMap
73476
+ // then schema-bound map if available
73477
+ overrideMap,
73478
+ // then global override map
73479
+ overrideMap === errorMap ? void 0 : errorMap
73464
73480
  // then global default map
73465
73481
  ].filter((x) => !!x)
73466
73482
  });
@@ -73492,9 +73508,11 @@ var ParseStatus = class _ParseStatus {
73492
73508
  static async mergeObjectAsync(status, pairs) {
73493
73509
  const syncPairs = [];
73494
73510
  for (const pair of pairs) {
73511
+ const key = await pair.key;
73512
+ const value = await pair.value;
73495
73513
  syncPairs.push({
73496
- key: await pair.key,
73497
- value: await pair.value
73514
+ key,
73515
+ value
73498
73516
  });
73499
73517
  }
73500
73518
  return _ParseStatus.mergeObjectSync(status, syncPairs);
@@ -73527,11 +73545,29 @@ var isAborted = (x) => x.status === "aborted";
73527
73545
  var isDirty = (x) => x.status === "dirty";
73528
73546
  var isValid = (x) => x.status === "valid";
73529
73547
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
73548
+ function __classPrivateFieldGet(receiver, state, kind, f) {
73549
+ if (kind === "a" && !f)
73550
+ throw new TypeError("Private accessor was defined without a getter");
73551
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
73552
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
73553
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
73554
+ }
73555
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
73556
+ if (kind === "m")
73557
+ throw new TypeError("Private method is not writable");
73558
+ if (kind === "a" && !f)
73559
+ throw new TypeError("Private accessor was defined without a setter");
73560
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
73561
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
73562
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
73563
+ }
73530
73564
  var errorUtil;
73531
73565
  (function(errorUtil2) {
73532
73566
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
73533
73567
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
73534
73568
  })(errorUtil || (errorUtil = {}));
73569
+ var _ZodEnum_cache;
73570
+ var _ZodNativeEnum_cache;
73535
73571
  var ParseInputLazyPath = class {
73536
73572
  constructor(parent, value, path3, key) {
73537
73573
  this._cachedPath = [];
@@ -73580,44 +73616,21 @@ function processCreateParams(params) {
73580
73616
  if (errorMap2)
73581
73617
  return { errorMap: errorMap2, description };
73582
73618
  const customMap = (iss, ctx) => {
73583
- if (iss.code !== "invalid_type")
73584
- return { message: ctx.defaultError };
73619
+ var _a2, _b;
73620
+ const { message } = params;
73621
+ if (iss.code === "invalid_enum_value") {
73622
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
73623
+ }
73585
73624
  if (typeof ctx.data === "undefined") {
73586
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
73625
+ return { message: (_a2 = message !== null && message !== void 0 ? message : required_error) !== null && _a2 !== void 0 ? _a2 : ctx.defaultError };
73587
73626
  }
73588
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
73627
+ if (iss.code !== "invalid_type")
73628
+ return { message: ctx.defaultError };
73629
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
73589
73630
  };
73590
73631
  return { errorMap: customMap, description };
73591
73632
  }
73592
73633
  var ZodType = class {
73593
- constructor(def) {
73594
- this.spa = this.safeParseAsync;
73595
- this._def = def;
73596
- this.parse = this.parse.bind(this);
73597
- this.safeParse = this.safeParse.bind(this);
73598
- this.parseAsync = this.parseAsync.bind(this);
73599
- this.safeParseAsync = this.safeParseAsync.bind(this);
73600
- this.spa = this.spa.bind(this);
73601
- this.refine = this.refine.bind(this);
73602
- this.refinement = this.refinement.bind(this);
73603
- this.superRefine = this.superRefine.bind(this);
73604
- this.optional = this.optional.bind(this);
73605
- this.nullable = this.nullable.bind(this);
73606
- this.nullish = this.nullish.bind(this);
73607
- this.array = this.array.bind(this);
73608
- this.promise = this.promise.bind(this);
73609
- this.or = this.or.bind(this);
73610
- this.and = this.and.bind(this);
73611
- this.transform = this.transform.bind(this);
73612
- this.brand = this.brand.bind(this);
73613
- this.default = this.default.bind(this);
73614
- this.catch = this.catch.bind(this);
73615
- this.describe = this.describe.bind(this);
73616
- this.pipe = this.pipe.bind(this);
73617
- this.readonly = this.readonly.bind(this);
73618
- this.isNullable = this.isNullable.bind(this);
73619
- this.isOptional = this.isOptional.bind(this);
73620
- }
73621
73634
  get description() {
73622
73635
  return this._def.description;
73623
73636
  }
@@ -73681,6 +73694,43 @@ var ZodType = class {
73681
73694
  const result = this._parseSync({ data, path: ctx.path, parent: ctx });
73682
73695
  return handleResult(ctx, result);
73683
73696
  }
73697
+ "~validate"(data) {
73698
+ var _a2, _b;
73699
+ const ctx = {
73700
+ common: {
73701
+ issues: [],
73702
+ async: !!this["~standard"].async
73703
+ },
73704
+ path: [],
73705
+ schemaErrorMap: this._def.errorMap,
73706
+ parent: null,
73707
+ data,
73708
+ parsedType: getParsedType(data)
73709
+ };
73710
+ if (!this["~standard"].async) {
73711
+ try {
73712
+ const result = this._parseSync({ data, path: [], parent: ctx });
73713
+ return isValid(result) ? {
73714
+ value: result.value
73715
+ } : {
73716
+ issues: ctx.common.issues
73717
+ };
73718
+ } catch (err) {
73719
+ 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")) {
73720
+ this["~standard"].async = true;
73721
+ }
73722
+ ctx.common = {
73723
+ issues: [],
73724
+ async: true
73725
+ };
73726
+ }
73727
+ }
73728
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
73729
+ value: result.value
73730
+ } : {
73731
+ issues: ctx.common.issues
73732
+ });
73733
+ }
73684
73734
  async parseAsync(data, params) {
73685
73735
  const result = await this.safeParseAsync(data, params);
73686
73736
  if (result.success)
@@ -73758,6 +73808,39 @@ var ZodType = class {
73758
73808
  superRefine(refinement) {
73759
73809
  return this._refinement(refinement);
73760
73810
  }
73811
+ constructor(def) {
73812
+ this.spa = this.safeParseAsync;
73813
+ this._def = def;
73814
+ this.parse = this.parse.bind(this);
73815
+ this.safeParse = this.safeParse.bind(this);
73816
+ this.parseAsync = this.parseAsync.bind(this);
73817
+ this.safeParseAsync = this.safeParseAsync.bind(this);
73818
+ this.spa = this.spa.bind(this);
73819
+ this.refine = this.refine.bind(this);
73820
+ this.refinement = this.refinement.bind(this);
73821
+ this.superRefine = this.superRefine.bind(this);
73822
+ this.optional = this.optional.bind(this);
73823
+ this.nullable = this.nullable.bind(this);
73824
+ this.nullish = this.nullish.bind(this);
73825
+ this.array = this.array.bind(this);
73826
+ this.promise = this.promise.bind(this);
73827
+ this.or = this.or.bind(this);
73828
+ this.and = this.and.bind(this);
73829
+ this.transform = this.transform.bind(this);
73830
+ this.brand = this.brand.bind(this);
73831
+ this.default = this.default.bind(this);
73832
+ this.catch = this.catch.bind(this);
73833
+ this.describe = this.describe.bind(this);
73834
+ this.pipe = this.pipe.bind(this);
73835
+ this.readonly = this.readonly.bind(this);
73836
+ this.isNullable = this.isNullable.bind(this);
73837
+ this.isOptional = this.isOptional.bind(this);
73838
+ this["~standard"] = {
73839
+ version: 1,
73840
+ vendor: "zod",
73841
+ validate: (data) => this["~validate"](data)
73842
+ };
73843
+ }
73761
73844
  optional() {
73762
73845
  return ZodOptional.create(this, this._def);
73763
73846
  }
@@ -73768,7 +73851,7 @@ var ZodType = class {
73768
73851
  return this.nullable().optional();
73769
73852
  }
73770
73853
  array() {
73771
- return ZodArray.create(this, this._def);
73854
+ return ZodArray.create(this);
73772
73855
  }
73773
73856
  promise() {
73774
73857
  return ZodPromise.create(this, this._def);
@@ -73833,35 +73916,45 @@ var ZodType = class {
73833
73916
  }
73834
73917
  };
73835
73918
  var cuidRegex = /^c[^\s-]{8,}$/i;
73836
- var cuid2Regex = /^[a-z][a-z0-9]*$/;
73837
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
73919
+ var cuid2Regex = /^[0-9a-z]+$/;
73920
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
73838
73921
  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;
73839
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
73922
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
73923
+ var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
73924
+ 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)?)??$/;
73925
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
73840
73926
  var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
73841
73927
  var emojiRegex;
73842
- 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}))$/;
73843
- 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})))$/;
73844
- var datetimeRegex = (args) => {
73928
+ 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])$/;
73929
+ 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])$/;
73930
+ 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]))$/;
73931
+ 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])$/;
73932
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
73933
+ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
73934
+ 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])))`;
73935
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
73936
+ function timeRegexSource(args) {
73937
+ let secondsRegexSource = `[0-5]\\d`;
73845
73938
  if (args.precision) {
73846
- if (args.offset) {
73847
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
73848
- } else {
73849
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
73850
- }
73851
- } else if (args.precision === 0) {
73852
- if (args.offset) {
73853
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
73854
- } else {
73855
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
73856
- }
73857
- } else {
73858
- if (args.offset) {
73859
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`);
73860
- } else {
73861
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
73862
- }
73939
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
73940
+ } else if (args.precision == null) {
73941
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
73863
73942
  }
73864
- };
73943
+ const secondsQuantifier = args.precision ? "+" : "?";
73944
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
73945
+ }
73946
+ function timeRegex(args) {
73947
+ return new RegExp(`^${timeRegexSource(args)}$`);
73948
+ }
73949
+ function datetimeRegex(args) {
73950
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
73951
+ const opts = [];
73952
+ opts.push(args.local ? `Z?` : `Z`);
73953
+ if (args.offset)
73954
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
73955
+ regex = `${regex}(${opts.join("|")})`;
73956
+ return new RegExp(`^${regex}$`);
73957
+ }
73865
73958
  function isValidIP(ip, version2) {
73866
73959
  if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
73867
73960
  return true;
@@ -73871,6 +73964,33 @@ function isValidIP(ip, version2) {
73871
73964
  }
73872
73965
  return false;
73873
73966
  }
73967
+ function isValidJWT(jwt, alg) {
73968
+ if (!jwtRegex.test(jwt))
73969
+ return false;
73970
+ try {
73971
+ const [header] = jwt.split(".");
73972
+ const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
73973
+ const decoded = JSON.parse(atob(base64));
73974
+ if (typeof decoded !== "object" || decoded === null)
73975
+ return false;
73976
+ if (!decoded.typ || !decoded.alg)
73977
+ return false;
73978
+ if (alg && decoded.alg !== alg)
73979
+ return false;
73980
+ return true;
73981
+ } catch (_a2) {
73982
+ return false;
73983
+ }
73984
+ }
73985
+ function isValidCidr(ip, version2) {
73986
+ if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
73987
+ return true;
73988
+ }
73989
+ if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
73990
+ return true;
73991
+ }
73992
+ return false;
73993
+ }
73874
73994
  var ZodString = class _ZodString extends ZodType {
73875
73995
  _parse(input) {
73876
73996
  if (this._def.coerce) {
@@ -73879,15 +73999,11 @@ var ZodString = class _ZodString extends ZodType {
73879
73999
  const parsedType = this._getType(input);
73880
74000
  if (parsedType !== ZodParsedType.string) {
73881
74001
  const ctx2 = this._getOrReturnCtx(input);
73882
- addIssueToContext(
73883
- ctx2,
73884
- {
73885
- code: ZodIssueCode.invalid_type,
73886
- expected: ZodParsedType.string,
73887
- received: ctx2.parsedType
73888
- }
73889
- //
73890
- );
74002
+ addIssueToContext(ctx2, {
74003
+ code: ZodIssueCode.invalid_type,
74004
+ expected: ZodParsedType.string,
74005
+ received: ctx2.parsedType
74006
+ });
73891
74007
  return INVALID;
73892
74008
  }
73893
74009
  const status = new ParseStatus();
@@ -73978,6 +74094,16 @@ var ZodString = class _ZodString extends ZodType {
73978
74094
  });
73979
74095
  status.dirty();
73980
74096
  }
74097
+ } else if (check.kind === "nanoid") {
74098
+ if (!nanoidRegex.test(input.data)) {
74099
+ ctx = this._getOrReturnCtx(input, ctx);
74100
+ addIssueToContext(ctx, {
74101
+ validation: "nanoid",
74102
+ code: ZodIssueCode.invalid_string,
74103
+ message: check.message
74104
+ });
74105
+ status.dirty();
74106
+ }
73981
74107
  } else if (check.kind === "cuid") {
73982
74108
  if (!cuidRegex.test(input.data)) {
73983
74109
  ctx = this._getOrReturnCtx(input, ctx);
@@ -74079,6 +74205,38 @@ var ZodString = class _ZodString extends ZodType {
74079
74205
  });
74080
74206
  status.dirty();
74081
74207
  }
74208
+ } else if (check.kind === "date") {
74209
+ const regex = dateRegex;
74210
+ if (!regex.test(input.data)) {
74211
+ ctx = this._getOrReturnCtx(input, ctx);
74212
+ addIssueToContext(ctx, {
74213
+ code: ZodIssueCode.invalid_string,
74214
+ validation: "date",
74215
+ message: check.message
74216
+ });
74217
+ status.dirty();
74218
+ }
74219
+ } else if (check.kind === "time") {
74220
+ const regex = timeRegex(check);
74221
+ if (!regex.test(input.data)) {
74222
+ ctx = this._getOrReturnCtx(input, ctx);
74223
+ addIssueToContext(ctx, {
74224
+ code: ZodIssueCode.invalid_string,
74225
+ validation: "time",
74226
+ message: check.message
74227
+ });
74228
+ status.dirty();
74229
+ }
74230
+ } else if (check.kind === "duration") {
74231
+ if (!durationRegex.test(input.data)) {
74232
+ ctx = this._getOrReturnCtx(input, ctx);
74233
+ addIssueToContext(ctx, {
74234
+ validation: "duration",
74235
+ code: ZodIssueCode.invalid_string,
74236
+ message: check.message
74237
+ });
74238
+ status.dirty();
74239
+ }
74082
74240
  } else if (check.kind === "ip") {
74083
74241
  if (!isValidIP(input.data, check.version)) {
74084
74242
  ctx = this._getOrReturnCtx(input, ctx);
@@ -74089,6 +74247,46 @@ var ZodString = class _ZodString extends ZodType {
74089
74247
  });
74090
74248
  status.dirty();
74091
74249
  }
74250
+ } else if (check.kind === "jwt") {
74251
+ if (!isValidJWT(input.data, check.alg)) {
74252
+ ctx = this._getOrReturnCtx(input, ctx);
74253
+ addIssueToContext(ctx, {
74254
+ validation: "jwt",
74255
+ code: ZodIssueCode.invalid_string,
74256
+ message: check.message
74257
+ });
74258
+ status.dirty();
74259
+ }
74260
+ } else if (check.kind === "cidr") {
74261
+ if (!isValidCidr(input.data, check.version)) {
74262
+ ctx = this._getOrReturnCtx(input, ctx);
74263
+ addIssueToContext(ctx, {
74264
+ validation: "cidr",
74265
+ code: ZodIssueCode.invalid_string,
74266
+ message: check.message
74267
+ });
74268
+ status.dirty();
74269
+ }
74270
+ } else if (check.kind === "base64") {
74271
+ if (!base64Regex.test(input.data)) {
74272
+ ctx = this._getOrReturnCtx(input, ctx);
74273
+ addIssueToContext(ctx, {
74274
+ validation: "base64",
74275
+ code: ZodIssueCode.invalid_string,
74276
+ message: check.message
74277
+ });
74278
+ status.dirty();
74279
+ }
74280
+ } else if (check.kind === "base64url") {
74281
+ if (!base64urlRegex.test(input.data)) {
74282
+ ctx = this._getOrReturnCtx(input, ctx);
74283
+ addIssueToContext(ctx, {
74284
+ validation: "base64url",
74285
+ code: ZodIssueCode.invalid_string,
74286
+ message: check.message
74287
+ });
74288
+ status.dirty();
74289
+ }
74092
74290
  } else {
74093
74291
  util.assertNever(check);
74094
74292
  }
@@ -74120,6 +74318,9 @@ var ZodString = class _ZodString extends ZodType {
74120
74318
  uuid(message) {
74121
74319
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
74122
74320
  }
74321
+ nanoid(message) {
74322
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
74323
+ }
74123
74324
  cuid(message) {
74124
74325
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
74125
74326
  }
@@ -74129,16 +74330,32 @@ var ZodString = class _ZodString extends ZodType {
74129
74330
  ulid(message) {
74130
74331
  return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
74131
74332
  }
74333
+ base64(message) {
74334
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
74335
+ }
74336
+ base64url(message) {
74337
+ return this._addCheck({
74338
+ kind: "base64url",
74339
+ ...errorUtil.errToObj(message)
74340
+ });
74341
+ }
74342
+ jwt(options) {
74343
+ return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
74344
+ }
74132
74345
  ip(options) {
74133
74346
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
74134
74347
  }
74348
+ cidr(options) {
74349
+ return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
74350
+ }
74135
74351
  datetime(options) {
74136
- var _a2;
74352
+ var _a2, _b;
74137
74353
  if (typeof options === "string") {
74138
74354
  return this._addCheck({
74139
74355
  kind: "datetime",
74140
74356
  precision: null,
74141
74357
  offset: false,
74358
+ local: false,
74142
74359
  message: options
74143
74360
  });
74144
74361
  }
@@ -74146,9 +74363,30 @@ var ZodString = class _ZodString extends ZodType {
74146
74363
  kind: "datetime",
74147
74364
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
74148
74365
  offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
74366
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
74367
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
74368
+ });
74369
+ }
74370
+ date(message) {
74371
+ return this._addCheck({ kind: "date", message });
74372
+ }
74373
+ time(options) {
74374
+ if (typeof options === "string") {
74375
+ return this._addCheck({
74376
+ kind: "time",
74377
+ precision: null,
74378
+ message: options
74379
+ });
74380
+ }
74381
+ return this._addCheck({
74382
+ kind: "time",
74383
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
74149
74384
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
74150
74385
  });
74151
74386
  }
74387
+ duration(message) {
74388
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
74389
+ }
74152
74390
  regex(regex, message) {
74153
74391
  return this._addCheck({
74154
74392
  kind: "regex",
@@ -74200,8 +74438,7 @@ var ZodString = class _ZodString extends ZodType {
74200
74438
  });
74201
74439
  }
74202
74440
  /**
74203
- * @deprecated Use z.string().min(1) instead.
74204
- * @see {@link ZodString.min}
74441
+ * Equivalent to `.min(1)`
74205
74442
  */
74206
74443
  nonempty(message) {
74207
74444
  return this.min(1, errorUtil.errToObj(message));
@@ -74227,6 +74464,15 @@ var ZodString = class _ZodString extends ZodType {
74227
74464
  get isDatetime() {
74228
74465
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
74229
74466
  }
74467
+ get isDate() {
74468
+ return !!this._def.checks.find((ch) => ch.kind === "date");
74469
+ }
74470
+ get isTime() {
74471
+ return !!this._def.checks.find((ch) => ch.kind === "time");
74472
+ }
74473
+ get isDuration() {
74474
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
74475
+ }
74230
74476
  get isEmail() {
74231
74477
  return !!this._def.checks.find((ch) => ch.kind === "email");
74232
74478
  }
@@ -74239,6 +74485,9 @@ var ZodString = class _ZodString extends ZodType {
74239
74485
  get isUUID() {
74240
74486
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
74241
74487
  }
74488
+ get isNANOID() {
74489
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
74490
+ }
74242
74491
  get isCUID() {
74243
74492
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
74244
74493
  }
@@ -74251,6 +74500,15 @@ var ZodString = class _ZodString extends ZodType {
74251
74500
  get isIP() {
74252
74501
  return !!this._def.checks.find((ch) => ch.kind === "ip");
74253
74502
  }
74503
+ get isCIDR() {
74504
+ return !!this._def.checks.find((ch) => ch.kind === "cidr");
74505
+ }
74506
+ get isBase64() {
74507
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
74508
+ }
74509
+ get isBase64url() {
74510
+ return !!this._def.checks.find((ch) => ch.kind === "base64url");
74511
+ }
74254
74512
  get minLength() {
74255
74513
  let min = null;
74256
74514
  for (const ch of this._def.checks) {
@@ -74528,17 +74786,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
74528
74786
  }
74529
74787
  _parse(input) {
74530
74788
  if (this._def.coerce) {
74531
- input.data = BigInt(input.data);
74789
+ try {
74790
+ input.data = BigInt(input.data);
74791
+ } catch (_a2) {
74792
+ return this._getInvalidInput(input);
74793
+ }
74532
74794
  }
74533
74795
  const parsedType = this._getType(input);
74534
74796
  if (parsedType !== ZodParsedType.bigint) {
74535
- const ctx2 = this._getOrReturnCtx(input);
74536
- addIssueToContext(ctx2, {
74537
- code: ZodIssueCode.invalid_type,
74538
- expected: ZodParsedType.bigint,
74539
- received: ctx2.parsedType
74540
- });
74541
- return INVALID;
74797
+ return this._getInvalidInput(input);
74542
74798
  }
74543
74799
  let ctx = void 0;
74544
74800
  const status = new ParseStatus();
@@ -74585,6 +74841,15 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
74585
74841
  }
74586
74842
  return { status: status.value, value: input.data };
74587
74843
  }
74844
+ _getInvalidInput(input) {
74845
+ const ctx = this._getOrReturnCtx(input);
74846
+ addIssueToContext(ctx, {
74847
+ code: ZodIssueCode.invalid_type,
74848
+ expected: ZodParsedType.bigint,
74849
+ received: ctx.parsedType
74850
+ });
74851
+ return INVALID;
74852
+ }
74588
74853
  gte(value, message) {
74589
74854
  return this.setLimit("min", value, true, errorUtil.toString(message));
74590
74855
  }
@@ -75164,9 +75429,10 @@ var ZodObject = class _ZodObject extends ZodType {
75164
75429
  const syncPairs = [];
75165
75430
  for (const pair of pairs) {
75166
75431
  const key = await pair.key;
75432
+ const value = await pair.value;
75167
75433
  syncPairs.push({
75168
75434
  key,
75169
- value: await pair.value,
75435
+ value,
75170
75436
  alwaysSet: pair.alwaysSet
75171
75437
  });
75172
75438
  }
@@ -75517,15 +75783,25 @@ var getDiscriminator = (type) => {
75517
75783
  } else if (type instanceof ZodEnum) {
75518
75784
  return type.options;
75519
75785
  } else if (type instanceof ZodNativeEnum) {
75520
- return Object.keys(type.enum);
75786
+ return util.objectValues(type.enum);
75521
75787
  } else if (type instanceof ZodDefault) {
75522
75788
  return getDiscriminator(type._def.innerType);
75523
75789
  } else if (type instanceof ZodUndefined) {
75524
75790
  return [void 0];
75525
75791
  } else if (type instanceof ZodNull) {
75526
75792
  return [null];
75793
+ } else if (type instanceof ZodOptional) {
75794
+ return [void 0, ...getDiscriminator(type.unwrap())];
75795
+ } else if (type instanceof ZodNullable) {
75796
+ return [null, ...getDiscriminator(type.unwrap())];
75797
+ } else if (type instanceof ZodBranded) {
75798
+ return getDiscriminator(type.unwrap());
75799
+ } else if (type instanceof ZodReadonly) {
75800
+ return getDiscriminator(type.unwrap());
75801
+ } else if (type instanceof ZodCatch) {
75802
+ return getDiscriminator(type._def.innerType);
75527
75803
  } else {
75528
- return null;
75804
+ return [];
75529
75805
  }
75530
75806
  };
75531
75807
  var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
@@ -75585,7 +75861,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
75585
75861
  const optionsMap = /* @__PURE__ */ new Map();
75586
75862
  for (const type of options) {
75587
75863
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
75588
- if (!discriminatorValues) {
75864
+ if (!discriminatorValues.length) {
75589
75865
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
75590
75866
  }
75591
75867
  for (const value of discriminatorValues) {
@@ -75785,7 +76061,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
75785
76061
  for (const key in ctx.data) {
75786
76062
  pairs.push({
75787
76063
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
75788
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
76064
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
76065
+ alwaysSet: key in ctx.data
75789
76066
  });
75790
76067
  }
75791
76068
  if (ctx.common.async) {
@@ -76129,6 +76406,10 @@ function createZodEnum(values, params) {
76129
76406
  });
76130
76407
  }
76131
76408
  var ZodEnum = class _ZodEnum extends ZodType {
76409
+ constructor() {
76410
+ super(...arguments);
76411
+ _ZodEnum_cache.set(this, void 0);
76412
+ }
76132
76413
  _parse(input) {
76133
76414
  if (typeof input.data !== "string") {
76134
76415
  const ctx = this._getOrReturnCtx(input);
@@ -76140,7 +76421,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
76140
76421
  });
76141
76422
  return INVALID;
76142
76423
  }
76143
- if (this._def.values.indexOf(input.data) === -1) {
76424
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
76425
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
76426
+ }
76427
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
76144
76428
  const ctx = this._getOrReturnCtx(input);
76145
76429
  const expectedValues = this._def.values;
76146
76430
  addIssueToContext(ctx, {
@@ -76176,15 +76460,26 @@ var ZodEnum = class _ZodEnum extends ZodType {
76176
76460
  }
76177
76461
  return enumValues;
76178
76462
  }
76179
- extract(values) {
76180
- return _ZodEnum.create(values);
76463
+ extract(values, newDef = this._def) {
76464
+ return _ZodEnum.create(values, {
76465
+ ...this._def,
76466
+ ...newDef
76467
+ });
76181
76468
  }
76182
- exclude(values) {
76183
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));
76469
+ exclude(values, newDef = this._def) {
76470
+ return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
76471
+ ...this._def,
76472
+ ...newDef
76473
+ });
76184
76474
  }
76185
76475
  };
76476
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
76186
76477
  ZodEnum.create = createZodEnum;
76187
76478
  var ZodNativeEnum = class extends ZodType {
76479
+ constructor() {
76480
+ super(...arguments);
76481
+ _ZodNativeEnum_cache.set(this, void 0);
76482
+ }
76188
76483
  _parse(input) {
76189
76484
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
76190
76485
  const ctx = this._getOrReturnCtx(input);
@@ -76197,7 +76492,10 @@ var ZodNativeEnum = class extends ZodType {
76197
76492
  });
76198
76493
  return INVALID;
76199
76494
  }
76200
- if (nativeEnumValues.indexOf(input.data) === -1) {
76495
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
76496
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
76497
+ }
76498
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
76201
76499
  const expectedValues = util.objectValues(nativeEnumValues);
76202
76500
  addIssueToContext(ctx, {
76203
76501
  received: ctx.data,
@@ -76212,6 +76510,7 @@ var ZodNativeEnum = class extends ZodType {
76212
76510
  return this._def.values;
76213
76511
  }
76214
76512
  };
76513
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
76215
76514
  ZodNativeEnum.create = (values, params) => {
76216
76515
  return new ZodNativeEnum({
76217
76516
  values,
@@ -76275,26 +76574,38 @@ var ZodEffects = class extends ZodType {
76275
76574
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
76276
76575
  if (effect.type === "preprocess") {
76277
76576
  const processed = effect.transform(ctx.data, checkCtx);
76278
- if (ctx.common.issues.length) {
76279
- return {
76280
- status: "dirty",
76281
- value: ctx.data
76282
- };
76283
- }
76284
76577
  if (ctx.common.async) {
76285
- return Promise.resolve(processed).then((processed2) => {
76286
- return this._def.schema._parseAsync({
76578
+ return Promise.resolve(processed).then(async (processed2) => {
76579
+ if (status.value === "aborted")
76580
+ return INVALID;
76581
+ const result = await this._def.schema._parseAsync({
76287
76582
  data: processed2,
76288
76583
  path: ctx.path,
76289
76584
  parent: ctx
76290
76585
  });
76586
+ if (result.status === "aborted")
76587
+ return INVALID;
76588
+ if (result.status === "dirty")
76589
+ return DIRTY(result.value);
76590
+ if (status.value === "dirty")
76591
+ return DIRTY(result.value);
76592
+ return result;
76291
76593
  });
76292
76594
  } else {
76293
- return this._def.schema._parseSync({
76595
+ if (status.value === "aborted")
76596
+ return INVALID;
76597
+ const result = this._def.schema._parseSync({
76294
76598
  data: processed,
76295
76599
  path: ctx.path,
76296
76600
  parent: ctx
76297
76601
  });
76602
+ if (result.status === "aborted")
76603
+ return INVALID;
76604
+ if (result.status === "dirty")
76605
+ return DIRTY(result.value);
76606
+ if (status.value === "dirty")
76607
+ return DIRTY(result.value);
76608
+ return result;
76298
76609
  }
76299
76610
  }
76300
76611
  if (effect.type === "refinement") {
@@ -76583,10 +76894,16 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
76583
76894
  var ZodReadonly = class extends ZodType {
76584
76895
  _parse(input) {
76585
76896
  const result = this._def.innerType._parse(input);
76586
- if (isValid(result)) {
76587
- result.value = Object.freeze(result.value);
76588
- }
76589
- return result;
76897
+ const freeze = (data) => {
76898
+ if (isValid(data)) {
76899
+ data.value = Object.freeze(data.value);
76900
+ }
76901
+ return data;
76902
+ };
76903
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
76904
+ }
76905
+ unwrap() {
76906
+ return this._def.innerType;
76590
76907
  }
76591
76908
  };
76592
76909
  ZodReadonly.create = (type, params) => {
@@ -76596,19 +76913,35 @@ ZodReadonly.create = (type, params) => {
76596
76913
  ...processCreateParams(params)
76597
76914
  });
76598
76915
  };
76599
- var custom = (check, params = {}, fatal) => {
76916
+ function cleanParams(params, data) {
76917
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
76918
+ const p2 = typeof p === "string" ? { message: p } : p;
76919
+ return p2;
76920
+ }
76921
+ function custom(check, _params = {}, fatal) {
76600
76922
  if (check)
76601
76923
  return ZodAny.create().superRefine((data, ctx) => {
76602
76924
  var _a2, _b;
76603
- if (!check(data)) {
76604
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
76605
- const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
76606
- const p2 = typeof p === "string" ? { message: p } : p;
76607
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
76925
+ const r = check(data);
76926
+ if (r instanceof Promise) {
76927
+ return r.then((r2) => {
76928
+ var _a3, _b2;
76929
+ if (!r2) {
76930
+ const params = cleanParams(_params, data);
76931
+ const _fatal = (_b2 = (_a3 = params.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
76932
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
76933
+ }
76934
+ });
76608
76935
  }
76936
+ if (!r) {
76937
+ const params = cleanParams(_params, data);
76938
+ const _fatal = (_b = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
76939
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
76940
+ }
76941
+ return;
76609
76942
  });
76610
76943
  return ZodAny.create();
76611
- };
76944
+ }
76612
76945
  var late = {
76613
76946
  object: ZodObject.lazycreate
76614
76947
  };
@@ -76727,6 +77060,7 @@ var z = /* @__PURE__ */ Object.freeze({
76727
77060
  ZodParsedType,
76728
77061
  getParsedType,
76729
77062
  ZodType,
77063
+ datetimeRegex,
76730
77064
  ZodString,
76731
77065
  ZodNumber,
76732
77066
  ZodBigInt,
@@ -78717,6 +79051,7 @@ fsa.register("https://", new FsHttp());
78717
79051
  fsa.register("s3://", s3Fs);
78718
79052
  fsa.register("s3://nz-imagery", s3FsPublic);
78719
79053
  fsa.register("s3://nz-elevation", s3FsPublic);
79054
+ fsa.register("s3://nz-coastal", s3FsPublic);
78720
79055
  var Fsa = fsa;
78721
79056
  var FsaChunk = new SourceChunk({ size: 128 * 1024 });
78722
79057
  fsa.middleware.push(FsaChunk);
@@ -83256,6 +83591,12 @@ var Queue = class {
83256
83591
  __privateWrapper(this, _size)._--;
83257
83592
  return current.value;
83258
83593
  }
83594
+ peek() {
83595
+ if (!__privateGet(this, _head)) {
83596
+ return;
83597
+ }
83598
+ return __privateGet(this, _head).value;
83599
+ }
83259
83600
  clear() {
83260
83601
  __privateSet(this, _head, void 0);
83261
83602
  __privateSet(this, _tail, void 0);
@@ -83271,6 +83612,11 @@ var Queue = class {
83271
83612
  current = current.next;
83272
83613
  }
83273
83614
  }
83615
+ *drain() {
83616
+ while (__privateGet(this, _head)) {
83617
+ yield this.dequeue();
83618
+ }
83619
+ }
83274
83620
  };
83275
83621
  _head = new WeakMap();
83276
83622
  _tail = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/cli-raster",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@basemaps/config": "^8.1.0",
44
- "@basemaps/config-loader": "^8.1.0",
44
+ "@basemaps/config-loader": "^8.2.0",
45
45
  "@basemaps/geo": "^8.0.0",
46
- "@basemaps/shared": "^8.1.0",
46
+ "@basemaps/shared": "^8.2.0",
47
47
  "@linzjs/geojson": "^8.0.0",
48
48
  "@linzjs/metrics": "^8.0.0",
49
49
  "cmd-ts": "^0.12.1",
@@ -57,5 +57,5 @@
57
57
  "build/",
58
58
  "dist/"
59
59
  ],
60
- "gitHead": "14a4364d39e226b7ed0396fee9c3adc534d1142b"
60
+ "gitHead": "69195be692efa914369fa854d3bae16355dc0dc8"
61
61
  }