@idetik/core 0.11.1 → 0.11.2

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
@@ -2961,7 +2961,7 @@ class tQ {
2961
2961
  this.resizeObserver_?.disconnect(), this.mediaQuery_ && this.onMediaQueryChange_ && this.mediaQuery_.removeEventListener("change", this.onMediaQueryChange_);
2962
2962
  }
2963
2963
  }
2964
- class wo {
2964
+ class Fo {
2965
2965
  chunkManager_;
2966
2966
  context_;
2967
2967
  renderer_;
@@ -3349,7 +3349,7 @@ class YB extends TA {
3349
3349
  }
3350
3350
  }
3351
3351
  const dB = 1.77, jg = 128, zg = 128 / dB;
3352
- class Fo extends YB {
3352
+ class ro extends YB {
3353
3353
  // width_ and height_ should always be defined by constructor (see setFrame)
3354
3354
  width_ = jg;
3355
3355
  height_ = zg;
@@ -3405,7 +3405,7 @@ class Fo extends YB {
3405
3405
  }
3406
3406
  }
3407
3407
  const wQ = 60, FQ = 1.77, nI = 0.1, zI = 180 - nI;
3408
- class ro extends YB {
3408
+ class So extends YB {
3409
3409
  fov_;
3410
3410
  aspectRatio_;
3411
3411
  constructor(A = {}) {
@@ -3447,7 +3447,7 @@ class ro extends YB {
3447
3447
  }
3448
3448
  }
3449
3449
  const _g = 0;
3450
- class So {
3450
+ class Ro {
3451
3451
  camera_;
3452
3452
  dragActive_ = !1;
3453
3453
  dragStart_ = f();
@@ -3681,7 +3681,7 @@ class yg extends TA {
3681
3681
  };
3682
3682
  }
3683
3683
  }
3684
- class Ro extends FA {
3684
+ class No extends FA {
3685
3685
  type = "AxesLayer";
3686
3686
  constructor(A) {
3687
3687
  super();
@@ -3717,7 +3717,7 @@ function _I(g) {
3717
3717
  width: I
3718
3718
  });
3719
3719
  }
3720
- class No extends FA {
3720
+ class co extends FA {
3721
3721
  type = "ProjectedLineLayer";
3722
3722
  paths_ = [];
3723
3723
  constructor(A = []) {
@@ -3745,7 +3745,7 @@ function rQ(g) {
3745
3745
  const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
3746
3746
  return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
3747
3747
  }
3748
- class co extends FA {
3748
+ class Uo extends FA {
3749
3749
  type = "TracksLayer";
3750
3750
  tracks_ = [];
3751
3751
  constructor(A = []) {
@@ -4478,8 +4478,16 @@ class wg extends eg {
4478
4478
  return B.unpackAlignment = A.rowAlignmentBytes, B;
4479
4479
  }
4480
4480
  }
4481
- const KQ = 2;
4482
- class Uo extends FA {
4481
+ function KQ(g, A) {
4482
+ const I = A.position, B = f(), C = f();
4483
+ return g.sort((Q, E) => {
4484
+ SI(B, Q.boundingBox.max, Q.boundingBox.min), RI(B, B, 0.5), SI(C, E.boundingBox.max, E.boundingBox.min), RI(C, C, 0.5);
4485
+ const i = Pg(I, B), o = Pg(I, C);
4486
+ return i - o;
4487
+ }), g;
4488
+ }
4489
+ const HQ = 2;
4490
+ class ko extends FA {
4483
4491
  type = "VolumeLayer";
4484
4492
  source_;
4485
4493
  sliceCoords_;
@@ -4607,20 +4615,12 @@ class Uo extends FA {
4607
4615
  throw new Error(
4608
4616
  "RenderContext is required for the VolumeLayer update as camera information is used to reorder the chunks."
4609
4617
  );
4610
- this.reorderObjects(A.viewport.camera), this.chunkStoreView_.updateChunksForVolume(
4618
+ this.chunkStoreView_.updateChunksForVolume(
4611
4619
  this.sliceCoords_,
4612
4620
  A.viewport
4613
4621
  );
4614
4622
  const I = A.viewport.cameraControls?.isMoving ?? !1;
4615
- this.interactiveStepSizeScale_ = I ? KQ : 1, this.updateChunks();
4616
- }
4617
- reorderObjects(A) {
4618
- const I = A.position, B = f(), C = f();
4619
- this.objects.sort((Q, E) => {
4620
- SI(B, Q.boundingBox.max, Q.boundingBox.min), RI(B, B, 0.5), SI(C, E.boundingBox.max, E.boundingBox.min), RI(C, C, 0.5);
4621
- const i = Pg(I, B), a = Pg(I, C) - i;
4622
- return Math.abs(a) < p ? 0 : a;
4623
- });
4623
+ this.interactiveStepSizeScale_ = I ? HQ : 1, this.updateChunks(), KQ(this.objects, A.viewport.camera);
4624
4624
  }
4625
4625
  getUniforms() {
4626
4626
  return {
@@ -4638,7 +4638,7 @@ function gB(g) {
4638
4638
  `align${g.rowAlignmentBytes}`
4639
4639
  ].join(":");
4640
4640
  }
4641
- class ko extends FA {
4641
+ class Lo extends FA {
4642
4642
  type = "ImageLayer";
4643
4643
  source_;
4644
4644
  region_;
@@ -4785,7 +4785,7 @@ class zA extends eg {
4785
4785
  return C.unpackAlignment = A.rowAlignmentBytes, C;
4786
4786
  }
4787
4787
  }
4788
- const HQ = [
4788
+ const qQ = [
4789
4789
  [1, 0.5, 0.5],
4790
4790
  [0.5, 1, 0.5],
4791
4791
  [0.5, 0.5, 1],
@@ -4793,7 +4793,7 @@ const HQ = [
4793
4793
  [1, 0.5, 1],
4794
4794
  [1, 1, 0.5]
4795
4795
  ];
4796
- function qQ(g) {
4796
+ function lQ(g) {
4797
4797
  return g = g ?? /* @__PURE__ */ new Map(), new Map(
4798
4798
  Array.from(g.entries()).map(([A, I]) => [
4799
4799
  A,
@@ -4801,37 +4801,37 @@ function qQ(g) {
4801
4801
  ])
4802
4802
  );
4803
4803
  }
4804
- function lQ(g) {
4805
- return g = g ?? HQ, g.map(l.from);
4804
+ function fQ(g) {
4805
+ return g = g ?? qQ, g.map(l.from);
4806
4806
  }
4807
4807
  class BB {
4808
4808
  lookupTable;
4809
4809
  cycle;
4810
4810
  constructor(A = {}) {
4811
- this.lookupTable = qQ(A.lookupTable), this.cycle = lQ(A.cycle);
4811
+ this.lookupTable = lQ(A.lookupTable), this.cycle = fQ(A.cycle);
4812
4812
  }
4813
4813
  }
4814
- const fQ = /* @__PURE__ */ new Set([
4814
+ const pQ = /* @__PURE__ */ new Set([
4815
4815
  "unsigned_byte",
4816
4816
  "unsigned_short",
4817
4817
  "unsigned_int"
4818
4818
  ]);
4819
- function pQ(g) {
4819
+ function mQ(g) {
4820
4820
  if (g.dataFormat !== "scalar")
4821
4821
  throw new Error(
4822
4822
  `Image data format must be scalar, instead found: ${g.dataFormat}`
4823
4823
  );
4824
- if (!fQ.has(g.dataType))
4824
+ if (!pQ.has(g.dataType))
4825
4825
  throw new Error(
4826
4826
  `Image data type must be unsigned, instead found: ${g.dataType}`
4827
4827
  );
4828
4828
  return g;
4829
4829
  }
4830
- class mQ extends TA {
4830
+ class uQ extends TA {
4831
4831
  outlineSelected_;
4832
4832
  selectedValue_;
4833
4833
  constructor(A) {
4834
- super(), this.geometry = new MB(A.width, A.height, 1, 1), this.setTexture(0, pQ(A.imageData));
4834
+ super(), this.geometry = new MB(A.width, A.height, 1, 1), this.setTexture(0, mQ(A.imageData));
4835
4835
  const I = this.makeColorCycleTexture(A.colorMap.cycle);
4836
4836
  this.setTexture(1, I);
4837
4837
  const B = this.makeColorLookupTableTexture(
@@ -4869,7 +4869,7 @@ class mQ extends TA {
4869
4869
  return Q.set(I, 0), Q.set(B, C), new zA(Q, C, 2);
4870
4870
  }
4871
4871
  }
4872
- class Lo extends FA {
4872
+ class Jo extends FA {
4873
4873
  type = "LabelImageLayer";
4874
4874
  source_;
4875
4875
  region_;
@@ -4934,7 +4934,7 @@ class Lo extends FA {
4934
4934
  }
4935
4935
  createImage(A) {
4936
4936
  this.imageChunk_ = A;
4937
- const I = new mQ({
4937
+ const I = new uQ({
4938
4938
  width: A.shape.x,
4939
4939
  height: A.shape.y,
4940
4940
  imageData: zA.createWithChunk(A),
@@ -4963,7 +4963,7 @@ class mI extends Error {
4963
4963
  super(A), this.name = "AbortError", Object.setPrototypeOf(this, mI.prototype);
4964
4964
  }
4965
4965
  }
4966
- class uQ {
4966
+ class TQ {
4967
4967
  maxConcurrent_;
4968
4968
  pending_ = [];
4969
4969
  abortController_ = new AbortController();
@@ -5007,12 +5007,12 @@ class uQ {
5007
5007
  return this.pending_.length;
5008
5008
  }
5009
5009
  }
5010
- class TQ {
5010
+ class WQ {
5011
5011
  source_;
5012
5012
  region_;
5013
5013
  seriesDimensionName_;
5014
5014
  seriesIndex_;
5015
- scheduler_ = new uQ(16);
5015
+ scheduler_ = new TQ(16);
5016
5016
  lod_;
5017
5017
  loader_ = null;
5018
5018
  seriesAttributes_;
@@ -5125,7 +5125,7 @@ class TQ {
5125
5125
  return this.loader_ ??= await this.source_.open(), this.loader_;
5126
5126
  }
5127
5127
  }
5128
- class Jo extends FA {
5128
+ class Yo extends FA {
5129
5129
  type = "ImageSeriesLayer";
5130
5130
  seriesLoader_;
5131
5131
  initialChannelProps_;
@@ -5142,7 +5142,7 @@ class Jo extends FA {
5142
5142
  lod: Q,
5143
5143
  ...E
5144
5144
  }) {
5145
- super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new TQ({
5145
+ super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new WQ({
5146
5146
  source: A,
5147
5147
  region: I,
5148
5148
  seriesDimensionName: B,
@@ -5217,7 +5217,7 @@ function qB(g, A, I, B = {}) {
5217
5217
  }
5218
5218
  }), fetch(g, B);
5219
5219
  }
5220
- function WQ(g, A) {
5220
+ function xQ(g, A) {
5221
5221
  return {
5222
5222
  ...g,
5223
5223
  ...A,
@@ -5240,7 +5240,7 @@ async function QB(g) {
5240
5240
  throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
5241
5241
  }
5242
5242
  }
5243
- async function xQ(g, A, I, B) {
5243
+ async function bQ(g, A, I, B) {
5244
5244
  if (B)
5245
5245
  return fetch(g, {
5246
5246
  ...I,
@@ -5260,7 +5260,7 @@ class WA {
5260
5260
  this.url = A, this.#A = I.overrides ?? {}, this.#I = I.useSuffixRequest ?? !1;
5261
5261
  }
5262
5262
  #g(A) {
5263
- return WQ(this.#A, A);
5263
+ return xQ(this.#A, A);
5264
5264
  }
5265
5265
  async get(A, I = {}) {
5266
5266
  let B = CB(this.url, A).href, C = await fetch(B, this.#g(I));
@@ -5268,7 +5268,7 @@ class WA {
5268
5268
  }
5269
5269
  async getRange(A, I, B = {}) {
5270
5270
  let C = CB(this.url, A), Q = this.#g(B), E;
5271
- return "suffixLength" in I ? E = await xQ(C, I.suffixLength, Q, this.#I) : E = await qB(C, I.offset, I.length, Q), QB(E);
5271
+ return "suffixLength" in I ? E = await bQ(C, I.suffixLength, Q, this.#I) : E = await qB(C, I.offset, I.length, Q), QB(E);
5272
5272
  }
5273
5273
  }
5274
5274
  class lB {
@@ -5453,7 +5453,7 @@ function cA(g, A) {
5453
5453
  C[A[Q]] = B, B *= g[A[Q]];
5454
5454
  return C;
5455
5455
  }
5456
- function bQ({ name: g, configuration: A }) {
5456
+ function ZQ({ name: g, configuration: A }) {
5457
5457
  if (g === "default") {
5458
5458
  const I = A?.separator ?? "/";
5459
5459
  return (B) => ["c", ...B].join(I);
@@ -5464,7 +5464,7 @@ function bQ({ name: g, configuration: A }) {
5464
5464
  }
5465
5465
  throw new Error(`Unknown chunk key encoding: ${g}`);
5466
5466
  }
5467
- function ZQ(g) {
5467
+ function PQ(g) {
5468
5468
  if (g === "|O")
5469
5469
  return { data_type: "v2:object" };
5470
5470
  let A = g.match(/^([<|>])(.*)$/);
@@ -5485,8 +5485,8 @@ function ZQ(g) {
5485
5485
  }[B] ?? (B.startsWith("S") || B.startsWith("U") ? `v2:${B}` : void 0);
5486
5486
  return W(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
5487
5487
  }
5488
- function PQ(g, A = {}) {
5489
- let I = [], B = ZQ(g.dtype);
5488
+ function OQ(g, A = {}) {
5489
+ let I = [], B = PQ(g.dtype);
5490
5490
  g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } }), "endian" in B && B.endian === "big" && I.push({ name: "bytes", configuration: { endian: "big" } });
5491
5491
  for (let { id: C, ...Q } of g.filters ?? [])
5492
5492
  I.push({ name: C, configuration: Q });
@@ -5516,14 +5516,14 @@ function PQ(g, A = {}) {
5516
5516
  attributes: A
5517
5517
  };
5518
5518
  }
5519
- function OQ(g, A = {}) {
5519
+ function VQ(g, A = {}) {
5520
5520
  return {
5521
5521
  zarr_format: 3,
5522
5522
  node_type: "group",
5523
5523
  attributes: A
5524
5524
  };
5525
5525
  }
5526
- function VQ(g, A) {
5526
+ function vQ(g, A) {
5527
5527
  if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
5528
5528
  return g === A;
5529
5529
  let I = g === "bool";
@@ -5538,7 +5538,7 @@ function VQ(g, A) {
5538
5538
  let Q = g === "v2:object";
5539
5539
  return A === "object" ? Q : !B && !C && !I && !Q;
5540
5540
  }
5541
- function vQ(g) {
5541
+ function XQ(g) {
5542
5542
  return g?.name === "sharding_indexed";
5543
5543
  }
5544
5544
  function pB(g) {
@@ -5585,8 +5585,8 @@ class rg {
5585
5585
  return A;
5586
5586
  }
5587
5587
  }
5588
- const iB = XQ();
5589
- function XQ() {
5588
+ const iB = jQ();
5589
+ function jQ() {
5590
5590
  const g = new Uint32Array([305419896]);
5591
5591
  return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
5592
5592
  }
@@ -5645,10 +5645,10 @@ class Rg {
5645
5645
  return new Uint8Array(I);
5646
5646
  }
5647
5647
  }
5648
- function jQ(g, A) {
5648
+ function zQ(g, A) {
5649
5649
  return W(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), W(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), W(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
5650
5650
  }
5651
- function zQ(g, A) {
5651
+ function _Q(g, A) {
5652
5652
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
5653
5653
  }
5654
5654
  class Ng {
@@ -5678,7 +5678,7 @@ class Ng {
5678
5678
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
5679
5679
  W(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
5680
5680
  const o = [];
5681
- W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(jQ), i && o.push(zQ);
5681
+ W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(zQ), i && o.push(_Q);
5682
5682
  const a = Array.from(A.data);
5683
5683
  a.push("|O"), a.push(A.shape);
5684
5684
  let D;
@@ -5713,7 +5713,7 @@ function aB(g) {
5713
5713
  }
5714
5714
  }) : g;
5715
5715
  }
5716
- function _Q(g, A) {
5716
+ function $Q(g, A) {
5717
5717
  let I;
5718
5718
  return g.data instanceof Fg || g.data instanceof hI ? I = new g.constructor(
5719
5719
  // @ts-expect-error
@@ -5725,8 +5725,8 @@ function _Q(g, A) {
5725
5725
  stride: cA(g.shape, A)
5726
5726
  };
5727
5727
  }
5728
- function $Q(g, A) {
5729
- let I = _Q(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = aB(g.data), i = aB(I.data);
5728
+ function AE(g, A) {
5729
+ let I = $Q(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = aB(g.data), i = aB(I.data);
5730
5730
  for (let o = 0; o < C; o++) {
5731
5731
  let a = 0;
5732
5732
  for (let D = 0; D < B; D++)
@@ -5741,12 +5741,12 @@ function $Q(g, A) {
5741
5741
  }
5742
5742
  return I;
5743
5743
  }
5744
- function AE(g) {
5744
+ function IE(g) {
5745
5745
  let A = g.shape.length;
5746
5746
  return W(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
5747
5747
  }
5748
- function IE(g, A) {
5749
- let I = AE(g);
5748
+ function gE(g, A) {
5749
+ let I = IE(g);
5750
5750
  return W(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
5751
5751
  }
5752
5752
  class cg {
@@ -5771,7 +5771,7 @@ class cg {
5771
5771
  return new cg(A, I);
5772
5772
  }
5773
5773
  encode(A) {
5774
- return IE(A, this.#I) ? A : $Q(A, this.#I);
5774
+ return gE(A, this.#I) ? A : AE(A, this.#I);
5775
5775
  }
5776
5776
  decode(A) {
5777
5777
  return {
@@ -5816,10 +5816,10 @@ class kg {
5816
5816
  return new Uint8Array(I);
5817
5817
  }
5818
5818
  }
5819
- function gE() {
5819
+ function BE() {
5820
5820
  return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Rg).set("zlib", () => kg).set("transpose", () => cg).set("bytes", () => uI).set("crc32c", () => Sg).set("vlen-utf8", () => Ug).set("json2", () => Ng).set("bitround", () => rg);
5821
5821
  }
5822
- const BE = gE();
5822
+ const CE = BE();
5823
5823
  function Qg(g) {
5824
5824
  let A;
5825
5825
  return {
@@ -5845,7 +5845,7 @@ function Qg(g) {
5845
5845
  }
5846
5846
  async function DB(g) {
5847
5847
  let A = g.codecs.map(async (Q) => {
5848
- let E = await BE.get(Q.name)?.();
5848
+ let E = await CE.get(Q.name)?.();
5849
5849
  return W(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
5850
5850
  }), I = [], B, C = [];
5851
5851
  for await (let { Codec: Q, meta: E } of A) {
@@ -5861,9 +5861,9 @@ async function DB(g) {
5861
5861
  C.push(i);
5862
5862
  }
5863
5863
  }
5864
- return B || (W(CE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = uI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5864
+ return B || (W(QE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = uI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
5865
5865
  }
5866
- function CE(g) {
5866
+ function QE(g) {
5867
5867
  return g.data_type !== "v2:object";
5868
5868
  }
5869
5869
  class yI extends Error {
@@ -5877,7 +5877,7 @@ class Lg extends Error {
5877
5877
  }
5878
5878
  }
5879
5879
  const sB = 18446744073709551615n;
5880
- function QE(g, A, I, B) {
5880
+ function EE(g, A, I, B) {
5881
5881
  W(g.store.getRange, "Store does not support range requests");
5882
5882
  let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = Qg({
5883
5883
  data_type: "uint64",
@@ -5929,12 +5929,12 @@ function hB(g) {
5929
5929
  return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
5930
5930
  }
5931
5931
  const xA = Symbol("zarrita.context");
5932
- function EE(g) {
5932
+ function iE(g) {
5933
5933
  return g[xA];
5934
5934
  }
5935
- function iE(g, A) {
5936
- let { configuration: I } = A.codecs.find(vQ) ?? {}, B = {
5937
- encode_chunk_key: bQ(A.chunk_key_encoding),
5935
+ function oE(g, A) {
5936
+ let { configuration: I } = A.codecs.find(XQ) ?? {}, B = {
5937
+ encode_chunk_key: ZQ(A.chunk_key_encoding),
5938
5938
  TypedArray: fB(A.data_type),
5939
5939
  fill_value: A.fill_value
5940
5940
  };
@@ -5952,7 +5952,7 @@ function iE(g, A) {
5952
5952
  get_strides(E) {
5953
5953
  return cA(E, Q);
5954
5954
  },
5955
- get_chunk_bytes: QE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
5955
+ get_chunk_bytes: EE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
5956
5956
  };
5957
5957
  }
5958
5958
  let C = hB(A.codecs);
@@ -5982,7 +5982,7 @@ let kI = class extends z {
5982
5982
  super(A, I), this.#A = {
5983
5983
  ...B,
5984
5984
  fill_value: pB(B)
5985
- }, this[xA] = iE(this, B);
5985
+ }, this[xA] = oE(this, B);
5986
5986
  }
5987
5987
  get attrs() {
5988
5988
  return this.#A.attributes;
@@ -6026,15 +6026,15 @@ let kI = class extends z {
6026
6026
  * ```
6027
6027
  */
6028
6028
  is(A) {
6029
- return VQ(this.dtype, A);
6029
+ return vQ(this.dtype, A);
6030
6030
  }
6031
6031
  };
6032
- function* oE(g, A, I = 1) {
6032
+ function* aE(g, A, I = 1) {
6033
6033
  A === void 0 && (A = g, g = 0);
6034
6034
  for (let B = g; B < A; B += I)
6035
6035
  yield B;
6036
6036
  }
6037
- function* aE(...g) {
6037
+ function* DE(...g) {
6038
6038
  if (g.length === 0)
6039
6039
  return;
6040
6040
  const A = g.map((B) => B[Symbol.iterator]()), I = A.map((B) => B.next());
@@ -6049,7 +6049,7 @@ function* aE(...g) {
6049
6049
  I[B] = A[B].next();
6050
6050
  }
6051
6051
  }
6052
- function DE({ start: g, stop: A, step: I }, B) {
6052
+ function sE({ start: g, stop: A, step: I }, B) {
6053
6053
  if (I === 0)
6054
6054
  throw new Error("slice step cannot be zero");
6055
6055
  I = I ?? 1;
@@ -6063,7 +6063,7 @@ function LI(g, A, I = null) {
6063
6063
  step: I
6064
6064
  };
6065
6065
  }
6066
- function sE() {
6066
+ function hE() {
6067
6067
  const g = [];
6068
6068
  return {
6069
6069
  add: (A) => g.push(A()),
@@ -6075,28 +6075,28 @@ class Yg extends Error {
6075
6075
  super(A), this.name = "IndexError";
6076
6076
  }
6077
6077
  }
6078
- function hE(g, A) {
6078
+ function tE(g, A) {
6079
6079
  throw new Yg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
6080
6080
  }
6081
- function tE(g) {
6081
+ function yE(g) {
6082
6082
  throw new Yg(`index out of bounds for dimension with length ${g}`);
6083
6083
  }
6084
- function yE() {
6084
+ function eE() {
6085
6085
  throw new Yg("only slices with step >= 1 are supported");
6086
6086
  }
6087
- function eE(g, A) {
6088
- g.length > A.length && hE(g, A);
6089
- }
6090
6087
  function GE(g, A) {
6091
- return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && tE(A), g;
6088
+ g.length > A.length && tE(g, A);
6089
+ }
6090
+ function nE(g, A) {
6091
+ return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && yE(A), g;
6092
6092
  }
6093
- class nE {
6093
+ class wE {
6094
6094
  dim_sel;
6095
6095
  dim_len;
6096
6096
  dim_chunk_len;
6097
6097
  nitems;
6098
6098
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6099
- A = GE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6099
+ A = nE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
6100
6100
  }
6101
6101
  *[Symbol.iterator]() {
6102
6102
  const A = Math.floor(this.dim_sel / this.dim_chunk_len), I = A * this.dim_chunk_len, B = this.dim_sel - I;
@@ -6112,12 +6112,12 @@ class tB {
6112
6112
  nitems;
6113
6113
  nchunks;
6114
6114
  constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
6115
- const [C, Q, E] = DE(A, I);
6116
- this.start = C, this.stop = Q, this.step = E, this.step < 1 && yE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6115
+ const [C, Q, E] = sE(A, I);
6116
+ this.start = C, this.stop = Q, this.step = E, this.step < 1 && eE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
6117
6117
  }
6118
6118
  *[Symbol.iterator]() {
6119
6119
  const A = Math.floor(this.start / this.dim_chunk_len), I = Math.ceil(this.stop / this.dim_chunk_len);
6120
- for (const B of oE(A, I)) {
6120
+ for (const B of aE(A, I)) {
6121
6121
  const C = B * this.dim_chunk_len, Q = Math.min(this.dim_len, (B + 1) * this.dim_chunk_len), E = Q - C;
6122
6122
  let i = 0, o = 0;
6123
6123
  if (this.start < C) {
@@ -6138,15 +6138,15 @@ class tB {
6138
6138
  }
6139
6139
  }
6140
6140
  }
6141
- function wE(g, A) {
6141
+ function FE(g, A) {
6142
6142
  let I = [];
6143
- return g === null ? I = A.map((B) => LI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? LI(null))), eE(I, A), I;
6143
+ return g === null ? I = A.map((B) => LI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? LI(null))), GE(I, A), I;
6144
6144
  }
6145
- class FE {
6145
+ class rE {
6146
6146
  dim_indexers;
6147
6147
  shape;
6148
6148
  constructor({ selection: A, shape: I, chunk_shape: B }) {
6149
- this.dim_indexers = wE(A, I).map((C, Q) => new (typeof C == "number" ? nE : tB)({
6149
+ this.dim_indexers = FE(A, I).map((C, Q) => new (typeof C == "number" ? wE : tB)({
6150
6150
  // @ts-expect-error ts inference not strong enough to know correct chunk
6151
6151
  dim_sel: C,
6152
6152
  dim_len: I[Q],
@@ -6154,27 +6154,27 @@ class FE {
6154
6154
  })), this.shape = this.dim_indexers.filter((C) => C instanceof tB).map((C) => C.nitems);
6155
6155
  }
6156
6156
  *[Symbol.iterator]() {
6157
- for (const A of aE(...this.dim_indexers)) {
6157
+ for (const A of DE(...this.dim_indexers)) {
6158
6158
  const I = A.map((C) => C.dim_chunk_ix), B = A.map((C) => "dim_out_sel" in C ? { from: C.dim_chunk_sel, to: C.dim_out_sel } : { from: C.dim_chunk_sel, to: null });
6159
6159
  yield { chunk_coords: I, mapping: B };
6160
6160
  }
6161
6161
  }
6162
6162
  }
6163
- function rE(g, A) {
6163
+ function SE(g, A) {
6164
6164
  return "get" in g ? g.get(A) : g[A];
6165
6165
  }
6166
- async function SE(g, A, I, B) {
6167
- let C = EE(g), Q = new FE({
6166
+ async function RE(g, A, I, B) {
6167
+ let C = iE(g), Q = new rE({
6168
6168
  selection: A,
6169
6169
  shape: g.shape,
6170
6170
  chunk_shape: g.chunks
6171
- }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? sE();
6171
+ }), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? hE();
6172
6172
  for (const { chunk_coords: o, mapping: a } of Q)
6173
6173
  i.add(async () => {
6174
6174
  let { data: D, shape: h, stride: t } = await g.getChunk(o, I.opts), y = B.prepare(D, h, t);
6175
6175
  B.set_from_chunk(E, y, a);
6176
6176
  });
6177
- return await i.onIdle(), Q.shape.length === 0 ? rE(E.data, 0) : E;
6177
+ return await i.onIdle(), Q.shape.length === 0 ? SE(E.data, 0) : E;
6178
6178
  }
6179
6179
  function dg(g, A = 0, I) {
6180
6180
  let B = I ?? g.length - A;
@@ -6204,30 +6204,30 @@ function $I(g) {
6204
6204
  bytes_per_element: g.data.BYTES_PER_ELEMENT
6205
6205
  };
6206
6206
  }
6207
- function RE(g) {
6207
+ function NE(g) {
6208
6208
  return "chars" in g ? g.constructor.bind(null, g.chars) : g.constructor;
6209
6209
  }
6210
- function NE(g, A) {
6210
+ function cE(g, A) {
6211
6211
  if (globalThis.Array.isArray(g.data))
6212
6212
  return dg([A]);
6213
- let I = RE(g.data), B = new I([A]);
6213
+ let I = NE(g.data), B = new I([A]);
6214
6214
  return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
6215
6215
  }
6216
- const cE = {
6216
+ const UE = {
6217
6217
  prepare(g, A, I) {
6218
6218
  return { data: g, shape: A, stride: I };
6219
6219
  },
6220
6220
  set_scalar(g, A, I) {
6221
6221
  let B = $I(g);
6222
- Eg(B, A, NE(g, I), B.bytes_per_element);
6222
+ Eg(B, A, cE(g, I), B.bytes_per_element);
6223
6223
  },
6224
6224
  set_from_chunk(g, A, I) {
6225
6225
  let B = $I(g);
6226
6226
  wI(B, $I(A), B.bytes_per_element, I);
6227
6227
  }
6228
6228
  };
6229
- async function UE(g, A = null, I = {}) {
6230
- return SE(g, A, I, cE);
6229
+ async function kE(g, A = null, I = {}) {
6230
+ return RE(g, A, I, UE);
6231
6231
  }
6232
6232
  function TB(g, A, I) {
6233
6233
  return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
@@ -6301,8 +6301,8 @@ function wI(g, A, I, B) {
6301
6301
  stride: a
6302
6302
  }, I, Q);
6303
6303
  }
6304
- let TI = kE();
6305
- function kE() {
6304
+ let TI = LE();
6305
+ function LE() {
6306
6306
  let g = /* @__PURE__ */ new WeakMap();
6307
6307
  function A(I) {
6308
6308
  let B = g.get(I) ?? { v2: 0, v3: 0 };
@@ -6318,13 +6318,13 @@ function kE() {
6318
6318
  }
6319
6319
  };
6320
6320
  }
6321
- async function LE(g) {
6321
+ async function JE(g) {
6322
6322
  let A = await g.store.get(g.resolve(".zattrs").path);
6323
6323
  return A ? tI(A) : {};
6324
6324
  }
6325
- async function JE(g, A = {}) {
6325
+ async function YE(g, A = {}) {
6326
6326
  let I = "store" in g ? g : new z(g), B = {};
6327
- return (A.attrs ?? !0) && (B = await LE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C, yI), eB(I, B)));
6327
+ return (A.attrs ?? !0) && (B = await JE(I)), A.kind === "array" ? yB(I, B) : A.kind === "group" ? eB(I, B) : yB(I, B).catch((C) => (mB(C, yI), eB(I, B)));
6328
6328
  }
6329
6329
  async function yB(g, A) {
6330
6330
  let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
@@ -6332,7 +6332,7 @@ async function yB(g, A) {
6332
6332
  throw new yI("v2 array", {
6333
6333
  cause: new Lg(I)
6334
6334
  });
6335
- return TI.increment(g.store, "v2"), new kI(g.store, g.path, PQ(tI(B), A));
6335
+ return TI.increment(g.store, "v2"), new kI(g.store, g.path, OQ(tI(B), A));
6336
6336
  }
6337
6337
  async function eB(g, A) {
6338
6338
  let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
@@ -6340,9 +6340,9 @@ async function eB(g, A) {
6340
6340
  throw new yI("v2 group", {
6341
6341
  cause: new Lg(I)
6342
6342
  });
6343
- return TI.increment(g.store, "v2"), new Jg(g.store, g.path, OQ(tI(B), A));
6343
+ return TI.increment(g.store, "v2"), new Jg(g.store, g.path, VQ(tI(B), A));
6344
6344
  }
6345
- async function YE(g) {
6345
+ async function dE(g) {
6346
6346
  let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
6347
6347
  if (!B)
6348
6348
  throw new yI("v3 array or group", {
@@ -6351,8 +6351,8 @@ async function YE(g) {
6351
6351
  let C = tI(B);
6352
6352
  return C.node_type === "array" && (C.fill_value = pB(C)), C.node_type === "array" ? new kI(A, g.path, C) : new Jg(A, g.path, C);
6353
6353
  }
6354
- async function dE(g, A = {}) {
6355
- let I = "store" in g ? g : new z(g), B = await YE(I);
6354
+ async function ME(g, A = {}) {
6355
+ let I = "store" in g ? g : new z(g), B = await dE(I);
6356
6356
  if (TI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof kI || A.kind === "group" && B instanceof Jg)
6357
6357
  return B;
6358
6358
  let C = B instanceof kI ? "array" : "group";
@@ -6362,9 +6362,9 @@ async function IA(g, A = {}) {
6362
6362
  let I = "store" in g ? g.store : g, B = TI.version_max(I), C = B === "v2" ? IA.v2 : IA.v3, Q = B === "v2" ? IA.v3 : IA.v2;
6363
6363
  return C(g, A).catch((E) => (mB(E, yI), Q(g, A)));
6364
6364
  }
6365
- IA.v2 = JE;
6366
- IA.v3 = dE;
6367
- async function ME(g, A) {
6365
+ IA.v2 = YE;
6366
+ IA.v3 = ME;
6367
+ async function KE(g, A) {
6368
6368
  const I = A.split("/"), B = I.pop();
6369
6369
  if (!B)
6370
6370
  throw new Error("Invalid path");
@@ -6381,7 +6381,7 @@ class Mg {
6381
6381
  return this.#A;
6382
6382
  }
6383
6383
  async get(A) {
6384
- const I = await ME(this.#A, A.slice(1)).catch(
6384
+ const I = await KE(this.#A, A.slice(1)).catch(
6385
6385
  () => {
6386
6386
  }
6387
6387
  );
@@ -6391,7 +6391,7 @@ class Mg {
6391
6391
  return new Uint8Array(C);
6392
6392
  }
6393
6393
  }
6394
- function KE() {
6394
+ function HE() {
6395
6395
  if (typeof window > "u")
6396
6396
  return;
6397
6397
  const g = window.location.hostname;
@@ -6408,7 +6408,7 @@ class Kg extends WA {
6408
6408
  overrides;
6409
6409
  useSuffixRequest;
6410
6410
  constructor(A) {
6411
- KE(), super(A.url, {
6411
+ HE(), super(A.url, {
6412
6412
  overrides: A.overrides,
6413
6413
  useSuffixRequest: A.useSuffixRequest
6414
6414
  }), this.credentials = A.credentials, this.region = A.region, this.overrides = A.overrides, this.useSuffixRequest = A.useSuffixRequest;
@@ -6546,7 +6546,7 @@ async function eI(g, A) {
6546
6546
  throw new Error(`Failed to open Zarr group at ${g}`);
6547
6547
  }
6548
6548
  }
6549
- async function HE(g, A) {
6549
+ async function qE(g, A) {
6550
6550
  if (A === "v2")
6551
6551
  try {
6552
6552
  return IA.v2(g, { kind: "array", attrs: !1 });
@@ -6565,7 +6565,7 @@ async function HE(g, A) {
6565
6565
  throw new Error(`Failed to open Zarr array at ${g}`);
6566
6566
  }
6567
6567
  }
6568
- async function qE(g) {
6568
+ async function lE(g) {
6569
6569
  let A;
6570
6570
  switch (g.type) {
6571
6571
  case "fetch": {
@@ -6591,9 +6591,9 @@ async function qE(g) {
6591
6591
  }
6592
6592
  }
6593
6593
  const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
6594
- return HE(I, g.zarrVersion);
6594
+ return qE(I, g.zarrVersion);
6595
6595
  }
6596
- function lE(g, A, I) {
6596
+ function fE(g, A, I) {
6597
6597
  if (g.store instanceof Kg)
6598
6598
  return {
6599
6599
  type: "s3",
@@ -9768,7 +9768,7 @@ return ret;
9768
9768
  });
9769
9769
  //# sourceMappingURL=worker_kernel-uaRPnPAm.js.map
9770
9770
  `, GB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", WB], { type: "text/javascript;charset=utf-8" });
9771
- function fE(g) {
9771
+ function pE(g) {
9772
9772
  let A;
9773
9773
  try {
9774
9774
  if (A = GB && (self.URL || self.webkitURL).createObjectURL(GB), !A) throw "";
@@ -9789,8 +9789,8 @@ function fE(g) {
9789
9789
  );
9790
9790
  }
9791
9791
  }
9792
- const pE = Math.min(navigator.hardwareConcurrency, 8);
9793
- let CA = [], mE = 0, xB = 0;
9792
+ const mE = Math.min(navigator.hardwareConcurrency, 8);
9793
+ let CA = [], uE = 0, xB = 0;
9794
9794
  const UA = /* @__PURE__ */ new Map(), JI = /* @__PURE__ */ new Set();
9795
9795
  function bB(g) {
9796
9796
  const A = CA.find((I) => I.worker === g);
@@ -9799,7 +9799,7 @@ function bB(g) {
9799
9799
  "Worker not found in pool - this should not happen"
9800
9800
  ), A;
9801
9801
  }
9802
- function uE(g, A) {
9802
+ function TE(g, A) {
9803
9803
  const { id: I, success: B } = g.data, C = UA.get(I);
9804
9804
  if (!C) {
9805
9805
  JI.has(I) ? JI.delete(I) : U.warn(
@@ -9850,20 +9850,20 @@ function nB(g, A) {
9850
9850
  }
9851
9851
  }
9852
9852
  function ZB() {
9853
- const g = new fE();
9854
- return g.addEventListener("message", (A) => uE(A, g)), g.addEventListener("error", (A) => nB(A, g)), g.addEventListener(
9853
+ const g = new pE();
9854
+ return g.addEventListener("message", (A) => TE(A, g)), g.addEventListener("error", (A) => nB(A, g)), g.addEventListener(
9855
9855
  "messageerror",
9856
9856
  (A) => nB(A, g)
9857
9857
  ), g;
9858
9858
  }
9859
- function TE() {
9859
+ function WE() {
9860
9860
  if (CA.length === 0)
9861
9861
  throw new Error("Worker pool is not initialized");
9862
9862
  return CA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
9863
9863
  }
9864
- async function WE(g, A, I) {
9864
+ async function xE(g, A, I) {
9865
9865
  return new Promise((B, C) => {
9866
- const Q = TE(), E = mE++, i = {
9866
+ const Q = WE(), E = uE++, i = {
9867
9867
  resolve: B,
9868
9868
  reject: C,
9869
9869
  workerId: Q.workerId
@@ -9889,10 +9889,10 @@ async function WE(g, A, I) {
9889
9889
  });
9890
9890
  });
9891
9891
  }
9892
- function xE() {
9892
+ function bE() {
9893
9893
  if (!(CA.length > 0))
9894
9894
  try {
9895
- for (let g = 0; g < pE; g++) {
9895
+ for (let g = 0; g < mE; g++) {
9896
9896
  const A = ZB();
9897
9897
  CA.push({
9898
9898
  worker: A,
@@ -9905,26 +9905,26 @@ function xE() {
9905
9905
  `Initialized worker pool with ${CA.length} workers`
9906
9906
  );
9907
9907
  } catch {
9908
- U.warn("ZarrWorker", "Failed to create workers - clearing pool"), ZE();
9908
+ U.warn("ZarrWorker", "Failed to create workers - clearing pool"), PE();
9909
9909
  return;
9910
9910
  }
9911
9911
  }
9912
- async function bE(g, A, I, B) {
9913
- xE();
9912
+ async function ZE(g, A, I, B) {
9913
+ bE();
9914
9914
  try {
9915
- return await WE(A, I, B);
9915
+ return await xE(A, I, B);
9916
9916
  } catch (C) {
9917
9917
  if (C instanceof DOMException && C.name === "AbortError")
9918
9918
  throw C;
9919
9919
  return U.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
9920
9920
  }
9921
9921
  }
9922
- function ZE() {
9922
+ function PE() {
9923
9923
  for (const g of CA)
9924
9924
  g.worker.terminate();
9925
9925
  CA = [], UA.clear();
9926
9926
  }
9927
- class PE {
9927
+ class OE {
9928
9928
  promises_ = [];
9929
9929
  scheduler_;
9930
9930
  constructor(A) {
@@ -9937,13 +9937,13 @@ class PE {
9937
9937
  return Promise.all(this.promises_.map((A) => this.scheduler_.submit(A)));
9938
9938
  }
9939
9939
  }
9940
- class OE {
9940
+ class VE {
9941
9941
  metadata_;
9942
9942
  arrays_;
9943
9943
  arrayParams_;
9944
9944
  dimensions_;
9945
9945
  constructor(A) {
9946
- this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = VE(this.metadata_, this.arrays_);
9946
+ this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = vE(this.metadata_, this.arrays_);
9947
9947
  }
9948
9948
  getSourceDimensionMap() {
9949
9949
  return this.dimensions_;
@@ -9951,7 +9951,7 @@ class OE {
9951
9951
  async loadChunkData(A, I) {
9952
9952
  const B = [];
9953
9953
  B[this.dimensions_.x.index] = A.chunkIndex.x, B[this.dimensions_.y.index] = A.chunkIndex.y, this.dimensions_.z && (B[this.dimensions_.z.index] = A.chunkIndex.z), this.dimensions_.c && (B[this.dimensions_.c.index] = A.chunkIndex.c), this.dimensions_.t && (B[this.dimensions_.t.index] = A.chunkIndex.t);
9954
- const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await bE(C, Q, B, {
9954
+ const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await ZE(C, Q, B, {
9955
9955
  signal: I
9956
9956
  });
9957
9957
  if (!Xg(E.data))
@@ -10001,10 +10001,10 @@ class OE {
10001
10001
  const C = this.regionToIndices(A, I), Q = this.arrays_[I];
10002
10002
  let E = {};
10003
10003
  B !== void 0 && (E = {
10004
- create_queue: () => new PE(B),
10004
+ create_queue: () => new OE(B),
10005
10005
  opts: { signal: B.abortSignal }
10006
10006
  });
10007
- const i = await UE(Q, C, E);
10007
+ const i = await kE(Q, C, E);
10008
10008
  if (!Xg(i.data))
10009
10009
  throw new Error(
10010
10010
  `Subarray has an unsupported data type, data=${i.data.constructor.name}`
@@ -10066,7 +10066,7 @@ class OE {
10066
10066
  return C;
10067
10067
  }
10068
10068
  }
10069
- function VE(g, A) {
10069
+ function vE(g, A) {
10070
10070
  const I = g.axes.map((h) => h.name), B = g.axes.length, C = wB(I, "x"), Q = wB(I, "y"), E = (h, t) => {
10071
10071
  const y = [];
10072
10072
  for (let n = 0; n < g.datasets.length; n++) {
@@ -10222,7 +10222,7 @@ const S = H.arrayToEnum([
10222
10222
  "invalid_intersection_types",
10223
10223
  "not_multiple_of",
10224
10224
  "not_finite"
10225
- ]), vE = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10225
+ ]), XE = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
10226
10226
  class $ extends Error {
10227
10227
  get errors() {
10228
10228
  return this.issues;
@@ -10340,7 +10340,7 @@ const lA = (g, A) => {
10340
10340
  return { message: I };
10341
10341
  };
10342
10342
  let OB = lA;
10343
- function XE(g) {
10343
+ function jE(g) {
10344
10344
  OB = g;
10345
10345
  }
10346
10346
  function YI() {
@@ -10366,7 +10366,7 @@ const dI = (g) => {
10366
10366
  path: Q,
10367
10367
  message: i
10368
10368
  };
10369
- }, jE = [];
10369
+ }, zE = [];
10370
10370
  function F(g, A) {
10371
10371
  const I = YI(), B = dI({
10372
10372
  issueData: A,
@@ -10697,14 +10697,14 @@ class K {
10697
10697
  return this.safeParse(null).success;
10698
10698
  }
10699
10699
  }
10700
- const zE = /^c[^\s-]{8,}$/i, _E = /^[0-9a-z]+$/, $E = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ai = /^[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, Ii = /^[a-z0-9_-]{21}$/i, gi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Bi = /^[-+]?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)?)??$/, Ci = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Qi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10700
+ const _E = /^c[^\s-]{8,}$/i, $E = /^[0-9a-z]+$/, Ai = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ii = /^[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, gi = /^[a-z0-9_-]{21}$/i, Bi = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ci = /^[-+]?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)?)??$/, Qi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ei = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
10701
10701
  let Ag;
10702
- const Ei = /^(?:(?: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])$/, ii = /^(?:(?: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])$/, oi = /^(([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]))$/, ai = /^(([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])$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, si = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vB = "((\\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])))", hi = new RegExp(`^${vB}$`);
10702
+ const ii = /^(?:(?: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])$/, oi = /^(?:(?: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])$/, ai = /^(([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]))$/, Di = /^(([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])$/, si = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, hi = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, vB = "((\\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])))", ti = new RegExp(`^${vB}$`);
10703
10703
  function XB(g) {
10704
10704
  let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
10705
10705
  return g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`), A;
10706
10706
  }
10707
- function ti(g) {
10707
+ function yi(g) {
10708
10708
  return new RegExp(`^${XB(g)}$`);
10709
10709
  }
10710
10710
  function jB(g) {
@@ -10712,11 +10712,11 @@ function jB(g) {
10712
10712
  const I = [];
10713
10713
  return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
10714
10714
  }
10715
- function yi(g, A) {
10716
- return !!((A === "v4" || !A) && Ei.test(g) || (A === "v6" || !A) && oi.test(g));
10717
- }
10718
10715
  function ei(g, A) {
10719
- if (!gi.test(g))
10716
+ return !!((A === "v4" || !A) && ii.test(g) || (A === "v6" || !A) && ai.test(g));
10717
+ }
10718
+ function Gi(g, A) {
10719
+ if (!Bi.test(g))
10720
10720
  return !1;
10721
10721
  try {
10722
10722
  const [I] = g.split("."), B = I.replace(/-/g, "+").replace(/_/g, "/").padEnd(I.length + (4 - I.length % 4) % 4, "="), C = JSON.parse(atob(B));
@@ -10725,8 +10725,8 @@ function ei(g, A) {
10725
10725
  return !1;
10726
10726
  }
10727
10727
  }
10728
- function Gi(g, A) {
10729
- return !!((A === "v4" || !A) && ii.test(g) || (A === "v6" || !A) && ai.test(g));
10728
+ function ni(g, A) {
10729
+ return !!((A === "v4" || !A) && oi.test(g) || (A === "v6" || !A) && Di.test(g));
10730
10730
  }
10731
10731
  class gA extends K {
10732
10732
  _parse(A) {
@@ -10777,43 +10777,43 @@ class gA extends K {
10777
10777
  message: Q.message
10778
10778
  }), B.dirty());
10779
10779
  } else if (Q.kind === "email")
10780
- Ci.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10780
+ Qi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10781
10781
  validation: "email",
10782
10782
  code: e.invalid_string,
10783
10783
  message: Q.message
10784
10784
  }), B.dirty());
10785
10785
  else if (Q.kind === "emoji")
10786
- Ag || (Ag = new RegExp(Qi, "u")), Ag.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10786
+ Ag || (Ag = new RegExp(Ei, "u")), Ag.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10787
10787
  validation: "emoji",
10788
10788
  code: e.invalid_string,
10789
10789
  message: Q.message
10790
10790
  }), B.dirty());
10791
10791
  else if (Q.kind === "uuid")
10792
- Ai.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10792
+ Ii.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10793
10793
  validation: "uuid",
10794
10794
  code: e.invalid_string,
10795
10795
  message: Q.message
10796
10796
  }), B.dirty());
10797
10797
  else if (Q.kind === "nanoid")
10798
- Ii.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10798
+ gi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10799
10799
  validation: "nanoid",
10800
10800
  code: e.invalid_string,
10801
10801
  message: Q.message
10802
10802
  }), B.dirty());
10803
10803
  else if (Q.kind === "cuid")
10804
- zE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10804
+ _E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10805
10805
  validation: "cuid",
10806
10806
  code: e.invalid_string,
10807
10807
  message: Q.message
10808
10808
  }), B.dirty());
10809
10809
  else if (Q.kind === "cuid2")
10810
- _E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10810
+ $E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10811
10811
  validation: "cuid2",
10812
10812
  code: e.invalid_string,
10813
10813
  message: Q.message
10814
10814
  }), B.dirty());
10815
10815
  else if (Q.kind === "ulid")
10816
- $E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10816
+ Ai.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10817
10817
  validation: "ulid",
10818
10818
  code: e.invalid_string,
10819
10819
  message: Q.message
@@ -10848,35 +10848,35 @@ class gA extends K {
10848
10848
  code: e.invalid_string,
10849
10849
  validation: "datetime",
10850
10850
  message: Q.message
10851
- }), B.dirty()) : Q.kind === "date" ? hi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10851
+ }), B.dirty()) : Q.kind === "date" ? ti.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10852
10852
  code: e.invalid_string,
10853
10853
  validation: "date",
10854
10854
  message: Q.message
10855
- }), B.dirty()) : Q.kind === "time" ? ti(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10855
+ }), B.dirty()) : Q.kind === "time" ? yi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10856
10856
  code: e.invalid_string,
10857
10857
  validation: "time",
10858
10858
  message: Q.message
10859
- }), B.dirty()) : Q.kind === "duration" ? Bi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10859
+ }), B.dirty()) : Q.kind === "duration" ? Ci.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10860
10860
  validation: "duration",
10861
10861
  code: e.invalid_string,
10862
10862
  message: Q.message
10863
- }), B.dirty()) : Q.kind === "ip" ? yi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10863
+ }), B.dirty()) : Q.kind === "ip" ? ei(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10864
10864
  validation: "ip",
10865
10865
  code: e.invalid_string,
10866
10866
  message: Q.message
10867
- }), B.dirty()) : Q.kind === "jwt" ? ei(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10867
+ }), B.dirty()) : Q.kind === "jwt" ? Gi(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10868
10868
  validation: "jwt",
10869
10869
  code: e.invalid_string,
10870
10870
  message: Q.message
10871
- }), B.dirty()) : Q.kind === "cidr" ? Gi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10871
+ }), B.dirty()) : Q.kind === "cidr" ? ni(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10872
10872
  validation: "cidr",
10873
10873
  code: e.invalid_string,
10874
10874
  message: Q.message
10875
- }), B.dirty()) : Q.kind === "base64" ? Di.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10875
+ }), B.dirty()) : Q.kind === "base64" ? si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10876
10876
  validation: "base64",
10877
10877
  code: e.invalid_string,
10878
10878
  message: Q.message
10879
- }), B.dirty()) : Q.kind === "base64url" ? si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10879
+ }), B.dirty()) : Q.kind === "base64url" ? hi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10880
10880
  validation: "base64url",
10881
10881
  code: e.invalid_string,
10882
10882
  message: Q.message
@@ -11115,7 +11115,7 @@ gA.create = (g) => {
11115
11115
  ...M(g)
11116
11116
  });
11117
11117
  };
11118
- function ni(g, A) {
11118
+ function wi(g, A) {
11119
11119
  const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
11120
11120
  return Q % E / Math.pow(10, C);
11121
11121
  }
@@ -11154,7 +11154,7 @@ class eA extends K {
11154
11154
  inclusive: Q.inclusive,
11155
11155
  exact: !1,
11156
11156
  message: Q.message
11157
- }), C.dirty()) : Q.kind === "multipleOf" ? ni(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11157
+ }), C.dirty()) : Q.kind === "multipleOf" ? wi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11158
11158
  code: e.not_multiple_of,
11159
11159
  multipleOf: Q.value,
11160
11160
  message: Q.message
@@ -12863,7 +12863,7 @@ lI.create = (g) => new lI({
12863
12863
  typeName: J.ZodNaN,
12864
12864
  ...M(g)
12865
12865
  });
12866
- const wi = Symbol("zod_brand");
12866
+ const Fi = Symbol("zod_brand");
12867
12867
  class Hg extends K {
12868
12868
  _parse(A) {
12869
12869
  const { ctx: I } = this._processInputParams(A), B = I.data;
@@ -12953,16 +12953,16 @@ function _B(g, A = {}, I) {
12953
12953
  }
12954
12954
  }) : fA.create();
12955
12955
  }
12956
- const Fi = {
12956
+ const ri = {
12957
12957
  object: m.lazycreate
12958
12958
  };
12959
12959
  var J;
12960
12960
  (function(g) {
12961
12961
  g.ZodString = "ZodString", g.ZodNumber = "ZodNumber", g.ZodNaN = "ZodNaN", g.ZodBigInt = "ZodBigInt", g.ZodBoolean = "ZodBoolean", g.ZodDate = "ZodDate", g.ZodSymbol = "ZodSymbol", g.ZodUndefined = "ZodUndefined", g.ZodNull = "ZodNull", g.ZodAny = "ZodAny", g.ZodUnknown = "ZodUnknown", g.ZodNever = "ZodNever", g.ZodVoid = "ZodVoid", g.ZodArray = "ZodArray", g.ZodObject = "ZodObject", g.ZodUnion = "ZodUnion", g.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", g.ZodIntersection = "ZodIntersection", g.ZodTuple = "ZodTuple", g.ZodRecord = "ZodRecord", g.ZodMap = "ZodMap", g.ZodSet = "ZodSet", g.ZodFunction = "ZodFunction", g.ZodLazy = "ZodLazy", g.ZodLiteral = "ZodLiteral", g.ZodEnum = "ZodEnum", g.ZodEffects = "ZodEffects", g.ZodNativeEnum = "ZodNativeEnum", g.ZodOptional = "ZodOptional", g.ZodNullable = "ZodNullable", g.ZodDefault = "ZodDefault", g.ZodCatch = "ZodCatch", g.ZodPromise = "ZodPromise", g.ZodBranded = "ZodBranded", g.ZodPipeline = "ZodPipeline", g.ZodReadonly = "ZodReadonly";
12962
12962
  })(J || (J = {}));
12963
- const ri = (g, A = {
12963
+ const Si = (g, A = {
12964
12964
  message: `Input not instance of ${g.name}`
12965
- }) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, Si = lI.create, Ri = GA.create, IC = $A.create, Ni = LA.create, ci = KI.create, Ui = AI.create, ki = II.create, Li = fA.create, Ji = NA.create, Yi = yA.create, di = HI.create, Mi = QA.create, Ki = m.create, Hi = m.strictCreate, qi = gI.create, li = WI.create, fi = BI.create, pi = sA.create, mi = CI.create, ui = qI.create, Ti = JA.create, Wi = KA.create, xi = QI.create, bi = EI.create, Zi = nA.create, Pi = iI.create, Oi = pA.create, RB = EA.create, Vi = aA.create, vi = wA.create, Xi = EA.createWithPreprocess, ji = GI.create, zi = () => $B().optional(), _i = () => AC().optional(), $i = () => IC().optional(), Ao = {
12965
+ }) => _B((I) => I instanceof g, A), $B = gA.create, AC = eA.create, Ri = lI.create, Ni = GA.create, IC = $A.create, ci = LA.create, Ui = KI.create, ki = AI.create, Li = II.create, Ji = fA.create, Yi = NA.create, di = yA.create, Mi = HI.create, Ki = QA.create, Hi = m.create, qi = m.strictCreate, li = gI.create, fi = WI.create, pi = BI.create, mi = sA.create, ui = CI.create, Ti = qI.create, Wi = JA.create, xi = KA.create, bi = QI.create, Zi = EI.create, Pi = nA.create, Oi = iI.create, Vi = pA.create, RB = EA.create, vi = aA.create, Xi = wA.create, ji = EA.createWithPreprocess, zi = GI.create, _i = () => $B().optional(), $i = () => AC().optional(), Ao = () => IC().optional(), Io = {
12966
12966
  string: (g) => gA.create({ ...g, coerce: !0 }),
12967
12967
  number: (g) => eA.create({ ...g, coerce: !0 }),
12968
12968
  boolean: (g) => $A.create({
@@ -12971,14 +12971,14 @@ const ri = (g, A = {
12971
12971
  }),
12972
12972
  bigint: (g) => GA.create({ ...g, coerce: !0 }),
12973
12973
  date: (g) => LA.create({ ...g, coerce: !0 })
12974
- }, Io = Y;
12974
+ }, go = Y;
12975
12975
  var s = /* @__PURE__ */ Object.freeze({
12976
12976
  __proto__: null,
12977
12977
  defaultErrorMap: lA,
12978
- setErrorMap: XE,
12978
+ setErrorMap: jE,
12979
12979
  getErrorMap: YI,
12980
12980
  makeIssue: dI,
12981
- EMPTY_PATH: jE,
12981
+ EMPTY_PATH: zE,
12982
12982
  addIssueToContext: F,
12983
12983
  ParseStatus: X,
12984
12984
  INVALID: Y,
@@ -13032,63 +13032,63 @@ var s = /* @__PURE__ */ Object.freeze({
13032
13032
  ZodDefault: oI,
13033
13033
  ZodCatch: aI,
13034
13034
  ZodNaN: lI,
13035
- BRAND: wi,
13035
+ BRAND: Fi,
13036
13036
  ZodBranded: Hg,
13037
13037
  ZodPipeline: GI,
13038
13038
  ZodReadonly: DI,
13039
13039
  custom: _B,
13040
13040
  Schema: K,
13041
13041
  ZodSchema: K,
13042
- late: Fi,
13042
+ late: ri,
13043
13043
  get ZodFirstPartyTypeKind() {
13044
13044
  return J;
13045
13045
  },
13046
- coerce: Ao,
13047
- any: Li,
13048
- array: Mi,
13049
- bigint: Ri,
13046
+ coerce: Io,
13047
+ any: Ji,
13048
+ array: Ki,
13049
+ bigint: Ni,
13050
13050
  boolean: IC,
13051
- date: Ni,
13052
- discriminatedUnion: li,
13051
+ date: ci,
13052
+ discriminatedUnion: fi,
13053
13053
  effect: RB,
13054
- enum: Zi,
13055
- function: Wi,
13056
- instanceof: ri,
13057
- intersection: fi,
13058
- lazy: xi,
13059
- literal: bi,
13060
- map: ui,
13061
- nan: Si,
13062
- nativeEnum: Pi,
13063
- never: Yi,
13064
- null: ki,
13065
- nullable: vi,
13054
+ enum: Pi,
13055
+ function: xi,
13056
+ instanceof: Si,
13057
+ intersection: pi,
13058
+ lazy: bi,
13059
+ literal: Zi,
13060
+ map: Ti,
13061
+ nan: Ri,
13062
+ nativeEnum: Oi,
13063
+ never: di,
13064
+ null: Li,
13065
+ nullable: Xi,
13066
13066
  number: AC,
13067
- object: Ki,
13068
- oboolean: $i,
13069
- onumber: _i,
13070
- optional: Vi,
13071
- ostring: zi,
13072
- pipeline: ji,
13073
- preprocess: Xi,
13074
- promise: Oi,
13075
- record: mi,
13076
- set: Ti,
13077
- strictObject: Hi,
13067
+ object: Hi,
13068
+ oboolean: Ao,
13069
+ onumber: $i,
13070
+ optional: vi,
13071
+ ostring: _i,
13072
+ pipeline: zi,
13073
+ preprocess: ji,
13074
+ promise: Vi,
13075
+ record: ui,
13076
+ set: Wi,
13077
+ strictObject: qi,
13078
13078
  string: $B,
13079
- symbol: ci,
13079
+ symbol: Ui,
13080
13080
  transformer: RB,
13081
- tuple: pi,
13082
- undefined: Ui,
13083
- union: qi,
13084
- unknown: Ji,
13085
- void: di,
13086
- NEVER: Io,
13081
+ tuple: mi,
13082
+ undefined: ki,
13083
+ union: li,
13084
+ unknown: Yi,
13085
+ void: Mi,
13086
+ NEVER: go,
13087
13087
  ZodIssueCode: e,
13088
- quotelessJson: vE,
13088
+ quotelessJson: XE,
13089
13089
  ZodError: $
13090
13090
  });
13091
- const go = s.object({
13091
+ const Bo = s.object({
13092
13092
  /**The multiscale datasets for this image*/
13093
13093
  multiscales: s.array(
13094
13094
  s.object({
@@ -13216,7 +13216,7 @@ const go = s.object({
13216
13216
  projection: s.string().optional()
13217
13217
  }).optional()
13218
13218
  }).optional()
13219
- }).describe("JSON from OME-NGFF .zattrs"), Bo = s.object({
13219
+ }).describe("JSON from OME-NGFF .zattrs"), Co = s.object({
13220
13220
  plate: s.object({
13221
13221
  /**The acquisitions for this plate*/
13222
13222
  acquisitions: s.array(
@@ -13275,7 +13275,7 @@ const go = s.object({
13275
13275
  })
13276
13276
  ).min(1).describe("The wells of the plate")
13277
13277
  }).optional()
13278
- }).describe("JSON from OME-NGFF .zattrs"), Co = s.object({
13278
+ }).describe("JSON from OME-NGFF .zattrs"), Qo = s.object({
13279
13279
  well: s.object({
13280
13280
  /**The fields of view for this well*/
13281
13281
  images: s.array(
@@ -13289,7 +13289,7 @@ const go = s.object({
13289
13289
  /**The version of the specification*/
13290
13290
  version: s.literal("0.4").describe("The version of the specification").optional()
13291
13291
  }).optional()
13292
- }).describe("JSON from OME-NGFF .zattrs"), Qo = s.object({
13292
+ }).describe("JSON from OME-NGFF .zattrs"), Eo = s.object({
13293
13293
  /**The versioned OME-Zarr Metadata namespace*/
13294
13294
  ome: s.object({
13295
13295
  /**The multiscale datasets for this image*/
@@ -13419,7 +13419,7 @@ const go = s.object({
13419
13419
  /**The version of the OME-Zarr Metadata*/
13420
13420
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13421
13421
  }).describe("The versioned OME-Zarr Metadata namespace")
13422
- }).describe("The zarr.json attributes key"), Eo = s.object({
13422
+ }).describe("The zarr.json attributes key"), io = s.object({
13423
13423
  /**The versioned OME-Zarr Metadata namespace*/
13424
13424
  ome: s.object({
13425
13425
  plate: s.object({
@@ -13481,7 +13481,7 @@ const go = s.object({
13481
13481
  /**The version of the OME-Zarr Metadata*/
13482
13482
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13483
13483
  }).describe("The versioned OME-Zarr Metadata namespace")
13484
- }).describe("The zarr.json attributes key"), io = s.object({
13484
+ }).describe("The zarr.json attributes key"), oo = s.object({
13485
13485
  /**The versioned OME-Zarr Metadata namespace*/
13486
13486
  ome: s.object({
13487
13487
  well: s.object({
@@ -13500,15 +13500,15 @@ const go = s.object({
13500
13500
  /**The version of the OME-Zarr Metadata*/
13501
13501
  version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
13502
13502
  }).describe("The versioned OME-Zarr Metadata namespace")
13503
- }).describe("JSON from OME-Zarr zarr.json"), oo = ["0.4", "0.5"], ao = new Set(oo);
13504
- function Do(g) {
13503
+ }).describe("JSON from OME-Zarr zarr.json"), ao = ["0.4", "0.5"], Do = new Set(ao);
13504
+ function so(g) {
13505
13505
  if (!("ome" in g) || !(g.ome instanceof Object)) return;
13506
13506
  const A = g.ome;
13507
- if ("version" in A && typeof A.version == "string" && ao.has(A.version))
13507
+ if ("version" in A && typeof A.version == "string" && Do.has(A.version))
13508
13508
  return A.version;
13509
13509
  }
13510
13510
  function qg(g) {
13511
- const A = Do(g);
13511
+ const A = so(g);
13512
13512
  return A === void 0 ? "0.4" : A;
13513
13513
  }
13514
13514
  function mA(g) {
@@ -13524,10 +13524,10 @@ function gC(g, A) {
13524
13524
  const I = { ...g };
13525
13525
  return delete I[A], I;
13526
13526
  }
13527
- async function Mo(g, A) {
13527
+ async function Ko(g, A) {
13528
13528
  const I = new WA(g), B = new z(I), C = mA(A), Q = await eI(B, C);
13529
13529
  try {
13530
- return so(Q.attrs);
13530
+ return ho(Q.attrs);
13531
13531
  } catch {
13532
13532
  throw Error(
13533
13533
  `Failed to parse OME-Zarr plate:
@@ -13535,21 +13535,21 @@ ${JSON.stringify(Q.attrs)}`
13535
13535
  );
13536
13536
  }
13537
13537
  }
13538
- function so(g) {
13538
+ function ho(g) {
13539
13539
  switch (qg(g)) {
13540
13540
  case "0.5":
13541
13541
  return {
13542
- ...Eo.parse(g).ome,
13542
+ ...io.parse(g).ome,
13543
13543
  originalVersion: "0.5"
13544
13544
  };
13545
13545
  case "0.4":
13546
13546
  return {
13547
- ...ho(Bo.parse(g)).ome,
13547
+ ...to(Co.parse(g)).ome,
13548
13548
  originalVersion: "0.4"
13549
13549
  };
13550
13550
  }
13551
13551
  }
13552
- function ho(g) {
13552
+ function to(g) {
13553
13553
  if (g.plate === void 0)
13554
13554
  throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
13555
13555
  return {
@@ -13559,7 +13559,7 @@ function ho(g) {
13559
13559
  }
13560
13560
  };
13561
13561
  }
13562
- function to(g) {
13562
+ function yo(g) {
13563
13563
  if (g.well === void 0)
13564
13564
  throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
13565
13565
  return {
@@ -13569,24 +13569,24 @@ function to(g) {
13569
13569
  }
13570
13570
  };
13571
13571
  }
13572
- function yo(g) {
13572
+ function eo(g) {
13573
13573
  switch (qg(g)) {
13574
13574
  case "0.5":
13575
13575
  return {
13576
- ...io.parse(g).ome,
13576
+ ...oo.parse(g).ome,
13577
13577
  originalVersion: "0.5"
13578
13578
  };
13579
13579
  case "0.4":
13580
13580
  return {
13581
- ...to(Co.parse(g)).ome,
13581
+ ...yo(Qo.parse(g)).ome,
13582
13582
  originalVersion: "0.4"
13583
13583
  };
13584
13584
  }
13585
13585
  }
13586
- async function Ko(g, A, I) {
13586
+ async function Ho(g, A, I) {
13587
13587
  const B = g + "/" + A, C = new WA(B), Q = new z(C), E = mA(I), i = await eI(Q, E);
13588
13588
  try {
13589
- return yo(i.attrs);
13589
+ return eo(i.attrs);
13590
13590
  } catch {
13591
13591
  throw Error(
13592
13592
  `Failed to parse OME-Zarr well:
@@ -13594,15 +13594,15 @@ ${JSON.stringify(i.attrs)}`
13594
13594
  );
13595
13595
  }
13596
13596
  }
13597
- async function Ho(g) {
13597
+ async function qo(g) {
13598
13598
  const A = mA(g.version), I = await eI(g.location, A);
13599
13599
  return lg(I.attrs).omero?.channels ?? [];
13600
13600
  }
13601
- async function qo(g) {
13601
+ async function lo(g) {
13602
13602
  const A = mA(g.version), I = await eI(g.location, A);
13603
13603
  return lg(I.attrs).omero?.rdefs;
13604
13604
  }
13605
- function eo(g) {
13605
+ function Go(g) {
13606
13606
  return {
13607
13607
  ome: {
13608
13608
  multiscales: g.multiscales,
@@ -13611,23 +13611,23 @@ function eo(g) {
13611
13611
  }
13612
13612
  };
13613
13613
  }
13614
- function Go(g) {
13614
+ function no(g) {
13615
13615
  switch (qg(g)) {
13616
13616
  case "0.5":
13617
13617
  return {
13618
- ...Qo.parse(g).ome,
13618
+ ...Eo.parse(g).ome,
13619
13619
  originalVersion: "0.5"
13620
13620
  };
13621
13621
  case "0.4":
13622
13622
  return {
13623
- ...eo(go.parse(g)).ome,
13623
+ ...Go(Bo.parse(g)).ome,
13624
13624
  originalVersion: "0.4"
13625
13625
  };
13626
13626
  }
13627
13627
  }
13628
13628
  function lg(g) {
13629
13629
  try {
13630
- return Go(g);
13630
+ return no(g);
13631
13631
  } catch {
13632
13632
  throw Error(`Failed to parse OME-Zarr image:
13633
13633
  ${JSON.stringify(g)}`);
@@ -13651,15 +13651,15 @@ class rI {
13651
13651
  throw new Error("No datasets found in the multiscale image.");
13652
13652
  A || (A = mA(B.originalVersion));
13653
13653
  const E = Q.datasets.map(
13654
- (D) => lE(this.location, D.path, A)
13654
+ (D) => fE(this.location, D.path, A)
13655
13655
  ), i = await Promise.all(
13656
- E.map((D) => qE(D))
13656
+ E.map((D) => lE(D))
13657
13657
  ), o = i[0].shape, a = Q.axes;
13658
13658
  if (a.length !== o.length)
13659
13659
  throw new Error(
13660
13660
  `Mismatch between number of axes (${a.length}) and array shape (${o.length})`
13661
13661
  );
13662
- return new OE({
13662
+ return new VE({
13663
13663
  metadata: Q,
13664
13664
  arrays: i,
13665
13665
  arrayParams: E
@@ -13720,7 +13720,7 @@ const BC = [
13720
13720
  "prefetchSpace"
13721
13721
  ];
13722
13722
  function fg(g) {
13723
- no(g);
13723
+ wo(g);
13724
13724
  const A = {
13725
13725
  x: g.prefetch.x,
13726
13726
  y: g.prefetch.y,
@@ -13747,7 +13747,7 @@ function fg(g) {
13747
13747
  };
13748
13748
  return Object.freeze(C);
13749
13749
  }
13750
- function lo(g = {}) {
13750
+ function fo(g = {}) {
13751
13751
  return fg(pg({
13752
13752
  profile: "exploration",
13753
13753
  prefetch: { x: 1, y: 1, z: 1, t: 0 },
@@ -13760,7 +13760,7 @@ function lo(g = {}) {
13760
13760
  ]
13761
13761
  }, g));
13762
13762
  }
13763
- function fo(g = {}) {
13763
+ function po(g = {}) {
13764
13764
  return fg(pg({
13765
13765
  profile: "playback",
13766
13766
  prefetch: { x: 0, y: 0, z: 0, t: 20 },
@@ -13773,7 +13773,7 @@ function fo(g = {}) {
13773
13773
  ]
13774
13774
  }, g));
13775
13775
  }
13776
- function po(g = {}) {
13776
+ function mo(g = {}) {
13777
13777
  return fg(pg({
13778
13778
  profile: "no-prefetch",
13779
13779
  prefetch: { x: 0, y: 0, z: 0, t: 0 },
@@ -13786,7 +13786,7 @@ function po(g = {}) {
13786
13786
  ]
13787
13787
  }, g));
13788
13788
  }
13789
- function no(g) {
13789
+ function wo(g) {
13790
13790
  for (const [B, C] of Object.entries(g.prefetch))
13791
13791
  if (C !== void 0 && C < 0)
13792
13792
  throw new Error(`prefetch.${B} must be a non-negative number`);
@@ -13805,7 +13805,7 @@ function pg(g, A = {}) {
13805
13805
  priorityOrder: A.priorityOrder ?? g.priorityOrder
13806
13806
  };
13807
13807
  }
13808
- class mo {
13808
+ class uo {
13809
13809
  radius;
13810
13810
  phi;
13811
13811
  theta;
@@ -13821,7 +13821,7 @@ class mo {
13821
13821
  );
13822
13822
  }
13823
13823
  }
13824
- class uo extends TA {
13824
+ class To extends TA {
13825
13825
  atlas_;
13826
13826
  constructor(A, I) {
13827
13827
  super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
@@ -13865,40 +13865,40 @@ class uo extends TA {
13865
13865
  }
13866
13866
  }
13867
13867
  export {
13868
- Ro as AxesLayer,
13868
+ No as AxesLayer,
13869
13869
  AA as Box2,
13870
13870
  RA as Box3,
13871
13871
  HB as ChunkedImageLayer,
13872
13872
  l as Color,
13873
13873
  nQ as Frustum,
13874
- wo as Idetik,
13875
- ko as ImageLayer,
13876
- Jo as ImageSeriesLayer,
13877
- Lo as LabelImageLayer,
13874
+ Fo as Idetik,
13875
+ Lo as ImageLayer,
13876
+ Yo as ImageSeriesLayer,
13877
+ Jo as LabelImageLayer,
13878
13878
  FA as Layer,
13879
13879
  EQ as LayerManager,
13880
13880
  rI as OmeZarrImageSource,
13881
- Fo as OrthographicCamera,
13882
- So as PanZoomControls,
13883
- ro as PerspectiveCamera,
13881
+ ro as OrthographicCamera,
13882
+ Ro as PanZoomControls,
13883
+ So as PerspectiveCamera,
13884
13884
  YA as Plane,
13885
- uo as Points,
13886
- No as ProjectedLineLayer,
13887
- mo as Spherical,
13885
+ To as Points,
13886
+ co as ProjectedLineLayer,
13887
+ uo as Spherical,
13888
13888
  sI as Texture2DArray,
13889
13889
  wg as Texture3D,
13890
- co as TracksLayer,
13890
+ Uo as TracksLayer,
13891
13891
  DQ as Viewport,
13892
- Uo as VolumeLayer,
13892
+ ko as VolumeLayer,
13893
13893
  _C as WebGLRenderer,
13894
- lo as createExplorationPolicy,
13894
+ fo as createExplorationPolicy,
13895
13895
  fg as createImageSourcePolicy,
13896
- po as createNoPrefetchPolicy,
13897
- fo as createPlaybackPolicy,
13898
- Mo as loadOmeZarrPlate,
13899
- Ko as loadOmeZarrWell,
13900
- Ho as loadOmeroChannels,
13901
- qo as loadOmeroDefaults,
13896
+ mo as createNoPrefetchPolicy,
13897
+ po as createPlaybackPolicy,
13898
+ Ko as loadOmeZarrPlate,
13899
+ Ho as loadOmeZarrWell,
13900
+ qo as loadOmeroChannels,
13901
+ lo as loadOmeroDefaults,
13902
13902
  hQ as parseViewportConfigs
13903
13903
  };
13904
13904
  //# sourceMappingURL=index.js.map