@idetik/core 0.29.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -173,7 +173,7 @@ uniform float u_opacity;
173
173
 
174
174
  void main() {
175
175
  fragColor = vec4(u_lineColor, u_opacity);
176
- }`, VI = `#version 300 es
176
+ }`, XI = `#version 300 es
177
177
 
178
178
  layout (location = 0) in vec3 a_position;
179
179
  layout (location = 1) in vec3 a_normal;
@@ -187,7 +187,7 @@ out vec2 v_texCoords;
187
187
  void main() {
188
188
  v_texCoords = a_uv;
189
189
  gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
190
- }`, Yg = `#version 300 es
190
+ }`, Mg = `#version 300 es
191
191
  #pragma inject_defines
192
192
 
193
193
  precision mediump float;
@@ -275,7 +275,7 @@ uniform vec3 u_color;
275
275
 
276
276
  void main() {
277
277
  fragColor = vec4(u_color, u_opacity);
278
- }`, Mg = `#version 300 es
278
+ }`, ug = `#version 300 es
279
279
 
280
280
  precision highp float;
281
281
 
@@ -288,7 +288,7 @@ out highp vec3 v_positionModel;
288
288
  void main() {
289
289
  v_positionModel = a_position;
290
290
  gl_Position = u_projection * u_modelView * vec4(a_position, 1.0);
291
- }`, ug = `#version 300 es
291
+ }`, fg = `#version 300 es
292
292
  #pragma inject_defines
293
293
  precision highp float;
294
294
 
@@ -535,35 +535,35 @@ const uE = {
535
535
  fragment: YE
536
536
  },
537
537
  floatScalarImage: {
538
- vertex: VI,
539
- fragment: Yg
538
+ vertex: XI,
539
+ fragment: Mg
540
540
  },
541
541
  intScalarImage: {
542
- vertex: VI,
543
- fragment: Yg,
542
+ vertex: XI,
543
+ fragment: Mg,
544
544
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
545
545
  },
546
546
  uintScalarImage: {
547
- vertex: VI,
548
- fragment: Yg,
547
+ vertex: XI,
548
+ fragment: Mg,
549
549
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
550
550
  },
551
551
  labelImage: {
552
- vertex: VI,
552
+ vertex: XI,
553
553
  fragment: ME
554
554
  },
555
555
  floatVolume: {
556
- vertex: Mg,
557
- fragment: ug
556
+ vertex: ug,
557
+ fragment: fg
558
558
  },
559
559
  intVolume: {
560
- vertex: Mg,
561
- fragment: ug,
560
+ vertex: ug,
561
+ fragment: fg,
562
562
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
563
563
  },
564
564
  uintVolume: {
565
- vertex: Mg,
566
- fragment: ug,
565
+ vertex: ug,
566
+ fragment: fg,
567
567
  fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
568
568
  }
569
569
  }, EC = {
@@ -778,7 +778,7 @@ const qE = typeof window < "u" ? [
778
778
  WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
779
779
  ] : [], pE = new Set(
780
780
  qE
781
- ), fg = "#pragma inject_defines";
781
+ ), Kg = "#pragma inject_defines";
782
782
  class mE {
783
783
  gl_;
784
784
  programs_ = /* @__PURE__ */ new Map();
@@ -811,19 +811,19 @@ class mE {
811
811
  }
812
812
  function iC(C, A) {
813
813
  if (A === void 0 || A.size == 0) return C;
814
- if (!C.includes(fg))
814
+ if (!C.includes(Kg))
815
815
  throw new Error(
816
- `Shader source does not contain "${fg}" directive`
816
+ `Shader source does not contain "${Kg}" directive`
817
817
  );
818
818
  const I = Array.from(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
819
819
  `), B = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
820
820
  ${B}`;
821
- return C.replace(fg, Q);
821
+ return C.replace(Kg, Q);
822
822
  }
823
- const _I = {};
823
+ const jI = {};
824
824
  function SQ(C) {
825
825
  const A = C ?? "";
826
- return _I[A] = (_I[A] ?? 0) + 1, C ? `${C}-${_I[A]}` : String(_I[A]);
826
+ return jI[A] = (jI[A] ?? 0) + 1, C ? `${C}-${jI[A]}` : String(jI[A]);
827
827
  }
828
828
  class GB {
829
829
  id = SQ();
@@ -847,7 +847,7 @@ function WE(C, A, I, g, B, Q, E, i, o, s, t, e, n, D, F, U) {
847
847
  var S = new DA(16);
848
848
  return S[0] = C, S[1] = A, S[2] = I, S[3] = g, S[4] = B, S[5] = Q, S[6] = E, S[7] = i, S[8] = o, S[9] = s, S[10] = t, S[11] = e, S[12] = n, S[13] = D, S[14] = F, S[15] = U, S;
849
849
  }
850
- function kg(C, A) {
850
+ function Ug(C, A) {
851
851
  var I = A[0], g = A[1], B = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], s = A[7], t = A[8], e = A[9], n = A[10], D = A[11], F = A[12], U = A[13], S = A[14], l = A[15], f = I * i - g * E, k = I * o - B * E, R = I * s - Q * E, L = g * o - B * i, M = g * s - Q * i, W = B * s - Q * o, $ = t * U - e * F, BA = t * S - n * F, IA = t * l - D * F, iA = e * S - n * U, uA = e * l - D * U, fA = n * l - D * S, oA = f * fA - k * uA + R * iA + L * IA - M * BA + W * $;
852
852
  return oA ? (oA = 1 / oA, C[0] = (i * fA - o * uA + s * iA) * oA, C[1] = (B * uA - g * fA - Q * iA) * oA, C[2] = (U * W - S * M + l * L) * oA, C[3] = (n * M - e * W - D * L) * oA, C[4] = (o * IA - E * fA - s * BA) * oA, C[5] = (I * fA - B * IA + Q * BA) * oA, C[6] = (S * R - F * W - l * k) * oA, C[7] = (t * W - n * R + D * k) * oA, C[8] = (E * uA - i * IA + s * $) * oA, C[9] = (g * IA - I * uA - Q * $) * oA, C[10] = (F * M - U * R + l * f) * oA, C[11] = (e * R - t * M - D * f) * oA, C[12] = (i * BA - E * iA - o * $) * oA, C[13] = (I * iA - g * BA + B * $) * oA, C[14] = (U * k - F * L - S * f) * oA, C[15] = (t * L - e * k + n * f) * oA, C) : null;
853
853
  }
@@ -903,13 +903,13 @@ function P(C, A, I) {
903
903
  var g = new DA(3);
904
904
  return g[0] = C, g[1] = A, g[2] = I, g;
905
905
  }
906
- function zg(C, A) {
906
+ function $g(C, A) {
907
907
  return C[0] = A[0], C[1] = A[1], C[2] = A[2], C;
908
908
  }
909
909
  function $A(C, A, I, g) {
910
910
  return C[0] = A, C[1] = I, C[2] = g, C;
911
911
  }
912
- function KI(C, A, I) {
912
+ function HI(C, A, I) {
913
913
  return C[0] = A[0] + I[0], C[1] = A[1] + I[1], C[2] = A[2] + I[2], C;
914
914
  }
915
915
  function zE(C, A, I) {
@@ -918,7 +918,7 @@ function zE(C, A, I) {
918
918
  function $E(C, A, I) {
919
919
  return C[0] = A[0] * I[0], C[1] = A[1] * I[1], C[2] = A[2] * I[2], C;
920
920
  }
921
- function HI(C, A, I) {
921
+ function qI(C, A, I) {
922
922
  return C[0] = A[0] * I, C[1] = A[1] * I, C[2] = A[2] * I, C;
923
923
  }
924
924
  function oC(C, A, I, g) {
@@ -935,7 +935,7 @@ function Ai(C, A) {
935
935
  function RQ(C, A) {
936
936
  return C[0] * A[0] + C[1] * A[1] + C[2] * A[2];
937
937
  }
938
- function Kg(C, A, I) {
938
+ function Hg(C, A, I) {
939
939
  var g = A[0], B = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
940
940
  return C[0] = B * o - Q * i, C[1] = Q * E - g * o, C[2] = g * i - B * E, C;
941
941
  }
@@ -950,7 +950,7 @@ function NB(C, A) {
950
950
  var I = C[0], g = C[1], B = C[2], Q = A[0], E = A[1], i = A[2];
951
951
  return Math.abs(I - Q) <= AA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(g - E) <= AA * Math.max(1, Math.abs(g), Math.abs(E)) && Math.abs(B - i) <= AA * Math.max(1, Math.abs(B), Math.abs(i));
952
952
  }
953
- var $g = zE, gi = FB;
953
+ var AB = zE, gi = FB;
954
954
  (function() {
955
955
  var C = QA();
956
956
  return function(A, I, g, B, Q, E) {
@@ -968,7 +968,7 @@ function Bi(C) {
968
968
  var A = new DA(4);
969
969
  return A[0] = C[0], A[1] = C[1], A[2] = C[2], A[3] = C[3], A;
970
970
  }
971
- function Bg(C, A, I, g) {
971
+ function Qg(C, A, I, g) {
972
972
  var B = new DA(4);
973
973
  return B[0] = C, B[1] = A, B[2] = I, B[3] = g, B;
974
974
  }
@@ -982,7 +982,7 @@ function Ei(C, A) {
982
982
  var I = A[0], g = A[1], B = A[2], Q = A[3], E = I * I + g * g + B * B + Q * Q;
983
983
  return E > 0 && (E = 1 / Math.sqrt(E)), C[0] = I * E, C[1] = g * E, C[2] = B * E, C[3] = Q * E, C;
984
984
  }
985
- function qI(C, A, I) {
985
+ function pI(C, A, I) {
986
986
  var g = A[0], B = A[1], Q = A[2], E = A[3];
987
987
  return C[0] = I[0] * g + I[4] * B + I[8] * Q + I[12] * E, C[1] = I[1] * g + I[5] * B + I[9] * Q + I[13] * E, C[2] = I[2] * g + I[6] * B + I[10] * Q + I[14] * E, C[3] = I[3] * g + I[7] * B + I[11] * Q + I[15] * E, C;
988
988
  }
@@ -995,7 +995,7 @@ function qI(C, A, I) {
995
995
  return A;
996
996
  };
997
997
  })();
998
- function AB() {
998
+ function IB() {
999
999
  var C = new DA(4);
1000
1000
  return DA != Float32Array && (C[0] = 0, C[1] = 0, C[2] = 0), C[3] = 1, C;
1001
1001
  }
@@ -1008,7 +1008,7 @@ function oi(C, A, I) {
1008
1008
  var g = A[0], B = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], s = I[2], t = I[3];
1009
1009
  return C[0] = g * t + E * i + B * s - Q * o, C[1] = B * t + E * o + Q * i - g * s, C[2] = Q * t + E * s + g * o - B * i, C[3] = E * t - g * i - B * o - Q * s, C;
1010
1010
  }
1011
- function Hg(C, A, I, g) {
1011
+ function qg(C, A, I, g) {
1012
1012
  var B = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], s = I[1], t = I[2], e = I[3], n, D, F, U, S;
1013
1013
  return D = B * o + Q * s + E * t + i * e, D < 0 && (D = -D, o = -o, s = -s, t = -t, e = -e), 1 - D > AA ? (n = Math.acos(D), F = Math.sin(n), U = Math.sin((1 - g) * n) / F, S = Math.sin(g * n) / F) : (U = 1 - g, S = g), C[0] = U * B + S * o, C[1] = U * Q + S * s, C[2] = U * E + S * t, C[3] = U * i + S * e, C;
1014
1014
  }
@@ -1029,13 +1029,13 @@ var si = Bi, ti = Ci, RB = Ei;
1029
1029
  var C = QA(), A = P(1, 0, 0), I = P(0, 1, 0);
1030
1030
  return function(g, B, Q) {
1031
1031
  var E = RQ(B, Q);
1032
- return E < -0.999999 ? (Kg(C, A, B), gi(C) < 1e-6 && Kg(C, I, B), Ai(C, C), ii(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Kg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, RB(g, g));
1032
+ return E < -0.999999 ? (Hg(C, A, B), gi(C) < 1e-6 && Hg(C, I, B), Ai(C, C), ii(g, C, Math.PI), g) : E > 0.999999 ? (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 1, g) : (Hg(C, B, Q), g[0] = C[0], g[1] = C[1], g[2] = C[2], g[3] = 1 + E, RB(g, g));
1033
1033
  };
1034
1034
  })();
1035
1035
  (function() {
1036
- var C = AB(), A = AB();
1036
+ var C = IB(), A = IB();
1037
1037
  return function(I, g, B, Q, E, i) {
1038
- return Hg(C, g, E, i), Hg(A, B, Q, i), Hg(I, C, A, 2 * i * (1 - i)), I;
1038
+ return qg(C, g, E, i), qg(A, B, Q, i), qg(I, C, A, 2 * i * (1 - i)), I;
1039
1039
  };
1040
1040
  })();
1041
1041
  (function() {
@@ -1071,7 +1071,7 @@ function ni(C, A, I, g) {
1071
1071
  function eC(C, A) {
1072
1072
  return C[0] === A[0] && C[1] === A[1];
1073
1073
  }
1074
- function qg(C, A) {
1074
+ function pg(C, A) {
1075
1075
  var I = C[0], g = C[1], B = A[0], Q = A[1];
1076
1076
  return Math.abs(I - B) <= AA * Math.max(1, Math.abs(I), Math.abs(B)) && Math.abs(g - Q) <= AA * Math.max(1, Math.abs(g), Math.abs(Q));
1077
1077
  }
@@ -1288,7 +1288,7 @@ function LQ(C) {
1288
1288
  return 4;
1289
1289
  }
1290
1290
  }
1291
- function Cg(C) {
1291
+ function mI(C) {
1292
1292
  const A = lQ(C) * LQ(C), I = Math.max(1, C.mipmapLevels);
1293
1293
  let g = Math.max(1, C.width), B = Math.max(1, C.height), Q = Math.max(1, C.depth), E = 0;
1294
1294
  for (let i = 0; i < I; ++i)
@@ -1424,7 +1424,7 @@ class yi {
1424
1424
  const I = this.textures_.get(A);
1425
1425
  if (I) {
1426
1426
  this.gl_.deleteTexture(I), this.textures_.delete(A), A.readTexel = void 0, this.currentTexture_ === A && (this.currentTexture_ = null);
1427
- const g = Cg(A);
1427
+ const g = mI(A);
1428
1428
  this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
1429
1429
  }
1430
1430
  }
@@ -1458,7 +1458,7 @@ class yi {
1458
1458
  );
1459
1459
  else
1460
1460
  throw new Error(`Unknown texture type ${A.type}`);
1461
- this.gpuTextureBytes_ += Cg(A), this.textureCount_ += 1, this.textures_.set(A, B), this.gl_.bindTexture(g, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
1461
+ this.gpuTextureBytes_ += mI(A), this.textureCount_ += 1, this.textures_.set(A, B), this.gl_.bindTexture(g, null), A.readTexel = (Q, E, i) => Promise.resolve(this.readTexel(A, Q, E, i));
1462
1462
  }
1463
1463
  configureTextureParameters(A, I) {
1464
1464
  const g = this.gl_, B = this.getFilter(A.minFilter, A), Q = this.getFilter(A.maxFilter, A);
@@ -1871,7 +1871,7 @@ class aC extends FQ {
1871
1871
  );
1872
1872
  break;
1873
1873
  case "u_cameraPositionModel": {
1874
- const U = kg(SA(), E), S = Bg(0, 0, 0, 1), l = qI(
1874
+ const U = Ug(SA(), E), S = Qg(0, 0, 0, 1), l = pI(
1875
1875
  nI(),
1876
1876
  S,
1877
1877
  U
@@ -2106,7 +2106,7 @@ function di(C) {
2106
2106
  }), I += `${g.type},${g.offset},${g.itemSize}|`;
2107
2107
  return { attributes: A, attributesKey: I };
2108
2108
  }
2109
- class TI extends UB {
2109
+ class vI extends UB {
2110
2110
  width_;
2111
2111
  height_;
2112
2112
  depth_;
@@ -2131,7 +2131,7 @@ class TI extends UB {
2131
2131
  throw new Error(
2132
2132
  "Unable to create texture, chunk data is not initialized."
2133
2133
  );
2134
- const g = new TI(
2134
+ const g = new vI(
2135
2135
  I,
2136
2136
  A.shape.x,
2137
2137
  A.shape.y,
@@ -2156,11 +2156,11 @@ class li {
2156
2156
  if (!I) {
2157
2157
  const g = this.device_.createTexture({
2158
2158
  size: nC(A),
2159
- dimension: A instanceof TI ? "3d" : "2d",
2159
+ dimension: A instanceof vI ? "3d" : "2d",
2160
2160
  format: Ji(A),
2161
2161
  usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC
2162
2162
  }), B = { entry: A, texture: g };
2163
- I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ += Cg(A);
2163
+ I = B, this.textures_.push(B), this.textureCount_ += 1, this.gpuTextureBytes_ += mI(A);
2164
2164
  }
2165
2165
  return this.upload(A, I.texture), A.readTexel = (g, B, Q) => this.readTexel(I.texture, A.dataType, g, B, Q), I.texture;
2166
2166
  }
@@ -2200,7 +2200,7 @@ class li {
2200
2200
  const I = this.textures_.findIndex((B) => B.entry === A);
2201
2201
  if (I === -1) return;
2202
2202
  this.textures_[I].texture.destroy(), this.textures_.splice(I, 1), A.readTexel = void 0;
2203
- const g = Cg(A);
2203
+ const g = mI(A);
2204
2204
  this.gpuTextureBytes_ = Math.max(0, this.gpuTextureBytes_ - g), this.textureCount_ = Math.max(0, this.textureCount_ - 1);
2205
2205
  }
2206
2206
  disposeAll() {
@@ -2212,7 +2212,7 @@ function nC(C) {
2212
2212
  return {
2213
2213
  width: C.width,
2214
2214
  height: C.height,
2215
- depthOrArrayLayers: C instanceof TI ? C.depth : 1
2215
+ depthOrArrayLayers: C instanceof vI ? C.depth : 1
2216
2216
  };
2217
2217
  }
2218
2218
  function Li(C, A) {
@@ -2413,7 +2413,7 @@ function qi(C, A, I) {
2413
2413
  };
2414
2414
  return { views: Q(C, g), arrayBuffer: B };
2415
2415
  }
2416
- function IB(C, A) {
2416
+ function gB(C, A) {
2417
2417
  if (C !== void 0)
2418
2418
  if (rC(A)) {
2419
2419
  const I = A;
@@ -2430,13 +2430,13 @@ function IB(C, A) {
2430
2430
  } else if (Array.isArray(A)) {
2431
2431
  const I = A;
2432
2432
  C.forEach((g, B) => {
2433
- IB(g, I[B]);
2433
+ gB(g, I[B]);
2434
2434
  });
2435
2435
  } else {
2436
2436
  const I = A;
2437
2437
  for (const [g, B] of Object.entries(C)) {
2438
2438
  const Q = I[g];
2439
- Q && IB(B, Q);
2439
+ Q && gB(B, Q);
2440
2440
  }
2441
2441
  }
2442
2442
  }
@@ -2445,24 +2445,24 @@ function pi(C, A, I = 0) {
2445
2445
  return {
2446
2446
  ...Q,
2447
2447
  set(E) {
2448
- IB(E, Q.views);
2448
+ gB(E, Q.views);
2449
2449
  }
2450
2450
  };
2451
2451
  }
2452
- function gB(C) {
2452
+ function BB(C) {
2453
2453
  const I = C.elementType;
2454
2454
  if (I)
2455
- return gB(I);
2455
+ return BB(I);
2456
2456
  const B = C.fields;
2457
2457
  if (B)
2458
- return Object.values(B).reduce((i, { type: o }) => Math.max(i, gB(o)), 0);
2458
+ return Object.values(B).reduce((i, { type: o }) => Math.max(i, BB(o)), 0);
2459
2459
  const { type: Q } = C, { align: E } = SI[Q];
2460
2460
  return E;
2461
2461
  }
2462
2462
  function YQ(C) {
2463
2463
  const I = C.elementType;
2464
2464
  if (I) {
2465
- const Q = I.size, E = gB(I);
2465
+ const Q = I.size, E = BB(I);
2466
2466
  return {
2467
2467
  unalignedSize: Q,
2468
2468
  align: E,
@@ -2549,7 +2549,7 @@ class VA extends kA {
2549
2549
  return `array<${this.format.getTypeName()}, ${this.count}>`;
2550
2550
  }
2551
2551
  }
2552
- class BB extends kA {
2552
+ class CB extends kA {
2553
2553
  constructor(A, I, g) {
2554
2554
  super(A, g), this.format = I;
2555
2555
  }
@@ -2870,7 +2870,7 @@ function _(C, A, I, g, B) {
2870
2870
  }
2871
2871
  return B;
2872
2872
  }
2873
- const pg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
2873
+ const mg = { r8unorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8snorm: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8uint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r8sint: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg8unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8snorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg8sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "rgba8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8snorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba8sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, bgra8unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bgra8unorm-srgb": { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r16uint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16sint: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r16float: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg16uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg16float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba16uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba16float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, r32uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32sint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, r32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 1 }, rg32uint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32sint: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rg32float: { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 2 }, rgba32uint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32sint: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgba32float: { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2uint: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rgb10a2unorm: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, rg11b10ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, stencil8: { bytesPerBlock: 1, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !1, hasStencil: !0, channels: 1 }, depth16unorm: { bytesPerBlock: 2, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, depth24plus: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, depthOnlyFormat: "depth32float", channels: 1 }, "depth24plus-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, depthOnlyFormat: "depth32float", channels: 1 }, depth32float: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !1, channels: 1 }, "depth32float-stencil8": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !1, isDepthStencil: !0, hasDepth: !0, hasStencil: !0, stencilOnlyFormat: "depth32float", channels: 1 }, rgb9e5ufloat: { bytesPerBlock: 4, blockWidth: 1, blockHeight: 1, isCompressed: !1, channels: 4 }, "bc1-rgba-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc1-rgba-unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc2-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc3-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc4-r-unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc4-r-snorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 1 }, "bc5-rg-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc5-rg-snorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 2 }, "bc6h-rgb-ufloat": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc6h-rgb-float": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "bc7-rgba-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgb8a1unorm-srgb": { bytesPerBlock: 8, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "etc2-rgba8unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "eac-r11unorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-r11snorm": { bytesPerBlock: 8, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 1 }, "eac-rg11unorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "eac-rg11snorm": { bytesPerBlock: 16, blockWidth: 1, blockHeight: 1, isCompressed: !0, channels: 2 }, "astc-4x4-unorm": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-4x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 4, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x4-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 4, isCompressed: !0, channels: 4 }, "astc-5x5-unorm": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-5x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 5, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-6x6-unorm": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-6x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 6, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x5-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-8x6-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-8x8-unorm": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-8x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 8, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x5-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x5-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 5, isCompressed: !0, channels: 4 }, "astc-10x6-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x6-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 6, isCompressed: !0, channels: 4 }, "astc-10x8-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x8-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 8, isCompressed: !0, channels: 4 }, "astc-10x10-unorm": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-10x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 10, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x10-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 10, isCompressed: !0, channels: 4 }, "astc-12x12-unorm": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 }, "astc-12x12-unorm-srgb": { bytesPerBlock: 16, blockWidth: 12, blockHeight: 12, isCompressed: !0, channels: 4 } };
2874
2874
  class dA {
2875
2875
  constructor() {
2876
2876
  this.id = dA._id++, this.line = 0;
@@ -2886,9 +2886,9 @@ class dA {
2886
2886
  }
2887
2887
  searchBlock(A, I) {
2888
2888
  if (A) {
2889
- I(Qg.instance);
2890
- for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
2891
2889
  I(Eg.instance);
2890
+ for (const g of A) g instanceof Array ? this.searchBlock(g, I) : g.search(I);
2891
+ I(ig.instance);
2892
2892
  }
2893
2893
  }
2894
2894
  constEvaluate(A, I) {
@@ -2900,16 +2900,16 @@ class dA {
2900
2900
  }
2901
2901
  }
2902
2902
  dA._id = 0;
2903
- class Qg extends dA {
2904
- }
2905
- Qg.instance = new Qg();
2906
2903
  class Eg extends dA {
2907
2904
  }
2908
2905
  Eg.instance = new Eg();
2906
+ class ig extends dA {
2907
+ }
2908
+ ig.instance = new ig();
2909
2909
  const fQ = /* @__PURE__ */ new Set(["all", "any", "select", "arrayLength", "abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "clamp", "cos", "cosh", "countLeadingZeros", "countOneBits", "countTrailingZeros", "cross", "degrees", "determinant", "distance", "dot", "dot4U8Packed", "dot4I8Packed", "exp", "exp2", "extractBits", "faceForward", "firstLeadingBit", "firstTrailingBit", "floor", "fma", "fract", "frexp", "insertBits", "inverseSqrt", "ldexp", "length", "log", "log2", "max", "min", "mix", "modf", "normalize", "pow", "quantizeToF16", "radians", "reflect", "refract", "reverseBits", "round", "saturate", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", "tan", "tanh", "transpose", "trunc", "dpdx", "dpdxCoarse", "dpdxFine", "dpdy", "dpdyCoarse", "dpdyFine", "fwidth", "fwidthCoarse", "fwidthFine", "textureDimensions", "textureGather", "textureGatherCompare", "textureLoad", "textureNumLayers", "textureNumLevels", "textureNumSamples", "textureSample", "textureSampleBias", "textureSampleCompare", "textureSampleCompareLevel", "textureSampleGrad", "textureSampleLevel", "textureSampleBaseClampToEdge", "textureStore", "atomicLoad", "atomicStore", "atomicAdd", "atomicSub", "atomicMax", "atomicMin", "atomicAnd", "atomicOr", "atomicXor", "atomicExchange", "atomicCompareExchangeWeak", "pack4x8snorm", "pack4x8unorm", "pack4xI8", "pack4xU8", "pack4x8Clamp", "pack4xU8Clamp", "pack2x16snorm", "pack2x16unorm", "pack2x16float", "unpack4x8snorm", "unpack4x8unorm", "unpack4xI8", "unpack4xU8", "unpack2x16snorm", "unpack2x16unorm", "unpack2x16float", "storageBarrier", "textureBarrier", "workgroupBarrier", "workgroupUniformLoad", "subgroupAdd", "subgroupExclusiveAdd", "subgroupInclusiveAdd", "subgroupAll", "subgroupAnd", "subgroupAny", "subgroupBallot", "subgroupBroadcast", "subgroupBroadcastFirst", "subgroupElect", "subgroupMax", "subgroupMin", "subgroupMul", "subgroupExclusiveMul", "subgroupInclusiveMul", "subgroupOr", "subgroupShuffle", "subgroupShuffleDown", "subgroupShuffleUp", "subgroupShuffleXor", "subgroupXor", "quadBroadcast", "quadSwapDiagonal", "quadSwapX", "quadSwapY"]);
2910
2910
  class EA extends dA {
2911
2911
  }
2912
- class pI extends EA {
2912
+ class xI extends EA {
2913
2913
  constructor(A, I, g, B, Q, E) {
2914
2914
  super(), this.calls = /* @__PURE__ */ new Set(), this.name = A, this.args = I, this.returnType = g, this.body = B, this.startLine = Q, this.endLine = E;
2915
2915
  }
@@ -2945,7 +2945,7 @@ class KQ extends EA {
2945
2945
  this.condition.search(A), this.searchBlock(this.body, A);
2946
2946
  }
2947
2947
  }
2948
- class CB extends EA {
2948
+ class QB extends EA {
2949
2949
  constructor(A, I) {
2950
2950
  super(), this.body = A, this.loopId = I;
2951
2951
  }
@@ -2992,7 +2992,7 @@ class LB extends EA {
2992
2992
  (I = this.value) === null || I === void 0 || I.search(A);
2993
2993
  }
2994
2994
  }
2995
- class MI extends EA {
2995
+ class uI extends EA {
2996
2996
  constructor(A, I, g, B, Q) {
2997
2997
  super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
2998
2998
  }
@@ -3004,7 +3004,7 @@ class MI extends EA {
3004
3004
  A(this), (I = this.value) === null || I === void 0 || I.search(A);
3005
3005
  }
3006
3006
  }
3007
- class zI extends EA {
3007
+ class Ag extends EA {
3008
3008
  constructor(A, I, g, B, Q) {
3009
3009
  super(), this.attributes = null, this.name = A, this.type = I, this.storage = g, this.access = B, this.value = Q;
3010
3010
  }
@@ -3248,7 +3248,7 @@ class w extends N {
3248
3248
  }
3249
3249
  }
3250
3250
  w.vec2f = new w("vec2", N.f32, null), w.vec3f = new w("vec3", N.f32, null), w.vec4f = new w("vec4", N.f32, null), w.vec2i = new w("vec2", N.i32, null), w.vec3i = new w("vec3", N.i32, null), w.vec4i = new w("vec4", N.i32, null), w.vec2u = new w("vec2", N.u32, null), w.vec3u = new w("vec3", N.u32, null), w.vec4u = new w("vec4", N.u32, null), w.vec2h = new w("vec2", N.f16, null), w.vec3h = new w("vec3", N.f16, null), w.vec4h = new w("vec4", N.f16, null), w.vec2b = new w("vec2", N.bool, null), w.vec3b = new w("vec3", N.bool, null), w.vec4b = new w("vec4", N.bool, null), w.mat2x2f = new w("mat2x2", N.f32, null), w.mat2x3f = new w("mat2x3", N.f32, null), w.mat2x4f = new w("mat2x4", N.f32, null), w.mat3x2f = new w("mat3x2", N.f32, null), w.mat3x3f = new w("mat3x3", N.f32, null), w.mat3x4f = new w("mat3x4", N.f32, null), w.mat4x2f = new w("mat4x2", N.f32, null), w.mat4x3f = new w("mat4x3", N.f32, null), w.mat4x4f = new w("mat4x4", N.f32, null), w.mat2x2h = new w("mat2x2", N.f16, null), w.mat2x3h = new w("mat2x3", N.f16, null), w.mat2x4h = new w("mat2x4", N.f16, null), w.mat3x2h = new w("mat3x2", N.f16, null), w.mat3x3h = new w("mat3x3", N.f16, null), w.mat3x4h = new w("mat3x4", N.f16, null), w.mat4x2h = new w("mat4x2", N.f16, null), w.mat4x3h = new w("mat4x3", N.f16, null), w.mat4x4h = new w("mat4x4", N.f16, null), w.mat2x2i = new w("mat2x2", N.i32, null), w.mat2x3i = new w("mat2x3", N.i32, null), w.mat2x4i = new w("mat2x4", N.i32, null), w.mat3x2i = new w("mat3x2", N.i32, null), w.mat3x3i = new w("mat3x3", N.i32, null), w.mat3x4i = new w("mat3x4", N.i32, null), w.mat4x2i = new w("mat4x2", N.i32, null), w.mat4x3i = new w("mat4x3", N.i32, null), w.mat4x4i = new w("mat4x4", N.i32, null), w.mat2x2u = new w("mat2x2", N.u32, null), w.mat2x3u = new w("mat2x3", N.u32, null), w.mat2x4u = new w("mat2x4", N.u32, null), w.mat3x2u = new w("mat3x2", N.u32, null), w.mat3x3u = new w("mat3x3", N.u32, null), w.mat3x4u = new w("mat3x4", N.u32, null), w.mat4x2u = new w("mat4x2", N.u32, null), w.mat4x3u = new w("mat4x3", N.u32, null), w.mat4x4u = new w("mat4x4", N.u32, null);
3251
- class $I extends N {
3251
+ class Ig extends N {
3252
3252
  constructor(A, I, g, B) {
3253
3253
  super(A), this.storage = I, this.type = g, this.access = B;
3254
3254
  }
@@ -3256,7 +3256,7 @@ class $I extends N {
3256
3256
  return "pointer";
3257
3257
  }
3258
3258
  }
3259
- class uI extends N {
3259
+ class fI extends N {
3260
3260
  constructor(A, I, g, B) {
3261
3261
  super(A), this.attributes = I, this.format = g, this.count = B;
3262
3262
  }
@@ -3444,7 +3444,7 @@ class _Q extends dA {
3444
3444
  A(this), this.searchBlock(this.body, A);
3445
3445
  }
3446
3446
  }
3447
- class Ag extends YA {
3447
+ class gg extends YA {
3448
3448
  get astNodeType() {
3449
3449
  return "default";
3450
3450
  }
@@ -3532,7 +3532,7 @@ class NC extends MA {
3532
3532
  return this.typeInfo.name;
3533
3533
  }
3534
3534
  }
3535
- class QB extends MA {
3535
+ class EB extends MA {
3536
3536
  constructor() {
3537
3537
  super(new kA("void", null), null);
3538
3538
  }
@@ -3543,10 +3543,10 @@ class QB extends MA {
3543
3543
  return "void";
3544
3544
  }
3545
3545
  }
3546
- QB.void = new QB();
3546
+ EB.void = new EB();
3547
3547
  class iI extends MA {
3548
3548
  constructor(A) {
3549
- super(new BB("pointer", A.typeInfo, null), null), this.reference = A;
3549
+ super(new CB("pointer", A.typeInfo, null), null), this.reference = A;
3550
3550
  }
3551
3551
  clone() {
3552
3552
  return this;
@@ -4044,18 +4044,18 @@ class xA extends MA {
4044
4044
  return I;
4045
4045
  }
4046
4046
  get texelByteSize() {
4047
- const A = this.format, I = pg[A];
4047
+ const A = this.format, I = mg[A];
4048
4048
  return I ? I.isDepthStencil ? 4 : I.bytesPerBlock : 0;
4049
4049
  }
4050
4050
  get bytesPerRow() {
4051
4051
  return this.width * this.texelByteSize;
4052
4052
  }
4053
4053
  get isDepthStencil() {
4054
- const A = this.format, I = pg[A];
4054
+ const A = this.format, I = mg[A];
4055
4055
  return !!I && I.isDepthStencil;
4056
4056
  }
4057
4057
  getGpuSize() {
4058
- const A = this.format, I = pg[A], g = this.width;
4058
+ const A = this.format, I = mg[A], g = this.width;
4059
4059
  if (!A || g <= 0 || !I) return -1;
4060
4060
  const B = this.height, Q = this.depthOrArrayLayers, E = this.dimension;
4061
4061
  return g / I.blockWidth * (E === "1d" ? 1 : B / I.blockHeight) * I.bytesPerBlock * Q;
@@ -4174,7 +4174,7 @@ class RC {
4174
4174
  return this.isArrayType() || this.isTemplateType();
4175
4175
  }
4176
4176
  }
4177
- class Ug {
4177
+ class dg {
4178
4178
  constructor(A) {
4179
4179
  this._tokens = [], this._start = 0, this._current = 0, this._line = 1, this._source = A ?? "";
4180
4180
  }
@@ -4270,7 +4270,7 @@ class Ug {
4270
4270
  return this._current >= this._source.length;
4271
4271
  }
4272
4272
  _isAlpha(A) {
4273
- return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !Ug._operators.has(A);
4273
+ return !this._isNumeric(A) && !this._isWhitespace(A) && A !== "_" && !dg._operators.has(A);
4274
4274
  }
4275
4275
  _isNumeric(A) {
4276
4276
  return A >= "0" && A <= "9";
@@ -4296,20 +4296,20 @@ class Ug {
4296
4296
  function J(C) {
4297
4297
  return Array.isArray(C) || C?.buffer instanceof ArrayBuffer;
4298
4298
  }
4299
- Ug._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
4299
+ dg._operators = /* @__PURE__ */ new Set([".", "(", ")", "[", "]", "{", "}", ",", ";", ":", "=", "!", "<", ">", "+", "-", "*", "/", "%", "&", "|", "^", "~", "@", "#", "?", "'", "`", '"', "\\", `
4300
4300
  `, "\r", " ", "\0"]);
4301
- const ig = new Float32Array(1), Ao = new Uint32Array(ig.buffer), Io = new Uint32Array(ig.buffer), og = new Int32Array(1), go = new Float32Array(og.buffer), Bo = new Uint32Array(og.buffer), sg = new Uint32Array(1), Co = new Float32Array(sg.buffer), Qo = new Int32Array(sg.buffer);
4301
+ const og = new Float32Array(1), Ao = new Uint32Array(og.buffer), Io = new Uint32Array(og.buffer), sg = new Int32Array(1), go = new Float32Array(sg.buffer), Bo = new Uint32Array(sg.buffer), tg = new Uint32Array(1), Co = new Float32Array(tg.buffer), Qo = new Int32Array(tg.buffer);
4302
4302
  function kC(C, A, I) {
4303
4303
  if (A === I) return C;
4304
4304
  if (A === "f32") {
4305
- if (I === "i32" || I === "x32") return ig[0] = C, Ao[0];
4306
- if (I === "u32") return ig[0] = C, Io[0];
4305
+ if (I === "i32" || I === "x32") return og[0] = C, Ao[0];
4306
+ if (I === "u32") return og[0] = C, Io[0];
4307
4307
  } else if (A === "i32" || A === "x32") {
4308
- if (I === "f32") return og[0] = C, go[0];
4309
- if (I === "u32") return og[0] = C, Bo[0];
4308
+ if (I === "f32") return sg[0] = C, go[0];
4309
+ if (I === "u32") return sg[0] = C, Bo[0];
4310
4310
  } else if (A === "u32") {
4311
- if (I === "f32") return sg[0] = C, Co[0];
4312
- if (I === "i32" || I === "x32") return sg[0] = C, Qo[0];
4311
+ if (I === "f32") return tg[0] = C, Co[0];
4312
+ if (I === "i32" || I === "x32") return tg[0] = C, Qo[0];
4313
4313
  }
4314
4314
  return console.error(`Unsupported cast from ${A} to ${I}`), C;
4315
4315
  }
@@ -4318,7 +4318,7 @@ class Eo {
4318
4318
  this.resources = null, this.inUse = !1, this.info = null, this.node = A;
4319
4319
  }
4320
4320
  }
4321
- class XI {
4321
+ class zI {
4322
4322
  constructor(A, I) {
4323
4323
  this.align = A, this.size = I;
4324
4324
  }
@@ -4331,7 +4331,7 @@ class qA {
4331
4331
  return A.name == "texture_storage_1d" || A.name == "texture_storage_2d" || A.name == "texture_storage_2d_array" || A.name == "texture_storage_3d";
4332
4332
  }
4333
4333
  updateAST(A) {
4334
- for (const I of A) I instanceof pI && this._functions.set(I.name, new Eo(I));
4334
+ for (const I of A) I instanceof xI && this._functions.set(I.name, new Eo(I));
4335
4335
  for (const I of A) if (I instanceof mA) {
4336
4336
  const g = this.getTypeInfo(I, null);
4337
4337
  g instanceof ZA && this.structs.push(g);
@@ -4369,7 +4369,7 @@ class qA {
4369
4369
  continue;
4370
4370
  }
4371
4371
  }
4372
- for (const I of A) if (I instanceof pI) {
4372
+ for (const I of A) if (I instanceof xI) {
4373
4373
  const g = this._getAttribute(I, "vertex"), B = this._getAttribute(I, "fragment"), Q = this._getAttribute(I, "compute"), E = g || B || Q, i = new Wi(I.name, E?.name, I.attributes);
4374
4374
  i.attributes = I.attributes, i.startLine = I.startLine, i.endLine = I.endLine, this.functions.push(i), this._functions.get(I.name).info = i, E && (this._functions.get(I.name).inUse = !0, i.inUse = !0, i.inputs = this._getInputs(I.args), i.outputs = this._getOutputs(I.returnType), this.entry[E.name].push(i)), i.resources = this._findResources(I, !!E), i.arguments = I.args.map((o) => new Ti(o.name, this.getTypeInfo(o.type, o.attributes), o.attributes)), i.returnType = I.returnType ? this.getTypeInfo(I.returnType, I.attributes) : null;
4375
4375
  continue;
@@ -4446,15 +4446,15 @@ class qA {
4446
4446
  _findResources(A, I) {
4447
4447
  const g = [], B = this, Q = [];
4448
4448
  return A.search((E) => {
4449
- if (E instanceof Qg) Q.push({});
4450
- else if (E instanceof Eg) Q.pop();
4449
+ if (E instanceof Eg) Q.push({});
4450
+ else if (E instanceof ig) Q.pop();
4451
4451
  else if (E instanceof HA) {
4452
4452
  const i = E;
4453
4453
  I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
4454
4454
  } else if (E instanceof KA) {
4455
4455
  const i = E;
4456
4456
  I && i.type !== null && this._markStructsFromAST(i.type);
4457
- } else if (E instanceof MI) {
4457
+ } else if (E instanceof uI) {
4458
4458
  const i = E;
4459
4459
  I && i.type !== null && this._markStructsFromAST(i.type), Q.length > 0 && (Q[Q.length - 1][i.name] = i);
4460
4460
  } else if (E instanceof wA) {
@@ -4573,11 +4573,11 @@ class qA {
4573
4573
  }
4574
4574
  getTypeInfo(A, I = null) {
4575
4575
  if (this._types.has(A)) return this._types.get(A);
4576
- if (A instanceof $I) {
4577
- const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new BB(A.name, B, I);
4576
+ if (A instanceof Ig) {
4577
+ const B = A.type ? this.getTypeInfo(A.type, A.attributes) : null, Q = new CB(A.name, B, I);
4578
4578
  return this._types.set(A, Q), this._updateTypeInfo(Q), Q;
4579
4579
  }
4580
- if (A instanceof uI) {
4580
+ if (A instanceof fI) {
4581
4581
  const B = A, Q = B.format ? this.getTypeInfo(B.format, B.attributes) : null, E = new VA(B.name, I);
4582
4582
  return E.format = Q, E.count = B.count, this._types.set(A, E), this._updateTypeInfo(E), E;
4583
4583
  }
@@ -4608,7 +4608,7 @@ class qA {
4608
4608
  const E = this._getTypeSize(A.format);
4609
4609
  A.stride = Math.max((g = E?.size) !== null && g !== void 0 ? g : 0, (B = E?.align) !== null && B !== void 0 ? B : 0), this._updateTypeInfo(A.format);
4610
4610
  }
4611
- A instanceof BB && this._updateTypeInfo(A.format), A instanceof ZA && this._updateStructInfo(A);
4611
+ A instanceof CB && this._updateTypeInfo(A.format), A instanceof ZA && this._updateStructInfo(A);
4612
4612
  }
4613
4613
  _updateStructInfo(A) {
4614
4614
  var I;
@@ -4634,20 +4634,20 @@ class qA {
4634
4634
  const E = qA._typeInfo[A.name];
4635
4635
  if (E !== void 0) {
4636
4636
  const i = ((I = A.format) === null || I === void 0 ? void 0 : I.name) === "f16" ? 2 : 1;
4637
- return new XI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
4637
+ return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
4638
4638
  }
4639
4639
  }
4640
4640
  {
4641
4641
  const E = qA._typeInfo[A.name.substring(0, A.name.length - 1)];
4642
4642
  if (E) {
4643
4643
  const i = A.name[A.name.length - 1] === "h" ? 2 : 1;
4644
- return new XI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
4644
+ return new zI(Math.max(Q, E.align / i), Math.max(B, E.size / i));
4645
4645
  }
4646
4646
  }
4647
4647
  if (A instanceof VA) {
4648
4648
  let E = A, i = 8, o = 8;
4649
4649
  const s = this._getTypeSize(E.format);
4650
- return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new XI(Math.max(Q, i), Math.max(B, o));
4650
+ return s !== null && (o = s.size, i = s.align), o = E.count * this._getAttributeNum((g = A?.attributes) !== null && g !== void 0 ? g : null, "stride", this._roundUp(i, o)), B && (o = B), new zI(Math.max(Q, i), Math.max(B, o));
4651
4651
  }
4652
4652
  if (A instanceof ZA) {
4653
4653
  let E = 0, i = 0, o = 0, s = 0, t = 0;
@@ -4655,7 +4655,7 @@ class qA {
4655
4655
  const n = this._getTypeSize(e.type);
4656
4656
  n !== null && (E = Math.max(n.align, E), o = this._roundUp(n.align, o + s), s = n.size, t = o);
4657
4657
  }
4658
- return i = this._roundUp(E, t + s), new XI(Math.max(Q, E), Math.max(B, i));
4658
+ return i = this._roundUp(E, t + s), new zI(Math.max(Q, E), Math.max(B, i));
4659
4659
  }
4660
4660
  return null;
4661
4661
  }
@@ -5579,7 +5579,7 @@ class oo {
5579
5579
  return console.error("TODO: quadSwapY"), null;
5580
5580
  }
5581
5581
  }
5582
- const mg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
5582
+ const xg = { vec2: 2, vec2f: 2, vec2i: 2, vec2u: 2, vec2b: 2, vec2h: 2, vec3: 3, vec3f: 3, vec3i: 3, vec3u: 3, vec3b: 3, vec3h: 3, vec4: 4, vec4f: 4, vec4i: 4, vec4u: 4, vec4b: 4, vec4h: 4 }, cA = { mat2x2: [2, 2, 4], mat2x2f: [2, 2, 4], mat2x2h: [2, 2, 4], mat2x3: [2, 3, 6], mat2x3f: [2, 3, 6], mat2x3h: [2, 3, 6], mat2x4: [2, 4, 8], mat2x4f: [2, 4, 8], mat2x4h: [2, 4, 8], mat3x2: [3, 2, 6], mat3x2f: [3, 2, 6], mat3x2h: [3, 2, 6], mat3x3: [3, 3, 9], mat3x3f: [3, 3, 9], mat3x3h: [3, 3, 9], mat3x4: [3, 4, 12], mat3x4f: [3, 4, 12], mat3x4h: [3, 4, 12], mat4x2: [4, 2, 8], mat4x2f: [4, 2, 8], mat4x2h: [4, 2, 8], mat4x3: [4, 3, 12], mat4x3f: [4, 3, 12], mat4x3h: [4, 3, 12], mat4x4: [4, 4, 16], mat4x4f: [4, 4, 16], mat4x4h: [4, 4, 16] };
5583
5583
  class gA extends io {
5584
5584
  constructor(A, I) {
5585
5585
  var g;
@@ -5650,18 +5650,18 @@ class gA extends io {
5650
5650
  return gA._breakObj;
5651
5651
  }
5652
5652
  if (A instanceof ZQ) return gA._continueObj;
5653
- if (A instanceof MI) this._let(A, I);
5653
+ if (A instanceof uI) this._let(A, I);
5654
5654
  else if (A instanceof HA) this._var(A, I);
5655
- else if (A instanceof zI) this._const(A, I);
5655
+ else if (A instanceof Ag) this._const(A, I);
5656
5656
  else if (A instanceof LB) this._override(A, I);
5657
- else if (A instanceof pI) this._function(A, I);
5657
+ else if (A instanceof xI) this._function(A, I);
5658
5658
  else {
5659
5659
  if (A instanceof bQ) return this._if(A, I);
5660
5660
  if (A instanceof xQ) return this._switch(A, I);
5661
5661
  if (A instanceof HQ) return this._for(A, I);
5662
5662
  if (A instanceof KQ) return this._while(A, I);
5663
5663
  if (A instanceof mQ) return this._loop(A, I);
5664
- if (A instanceof CB) {
5664
+ if (A instanceof QB) {
5665
5665
  const g = I.clone();
5666
5666
  return g.currentFunctionName = I.currentFunctionName, this._execStatements(A.body, g);
5667
5667
  }
@@ -5975,7 +5975,7 @@ class gA extends io {
5975
5975
  } else {
5976
5976
  if (A.type === null) return void console.error(`Variable ${A.name} has no type. Line ${A.line}`);
5977
5977
  const B = A.type.name;
5978
- if (gA._defaultableTypes.has(B) || A.type instanceof uI || A.type instanceof mA || A.type instanceof w) {
5978
+ if (gA._defaultableTypes.has(B) || A.type instanceof fI || A.type instanceof mA || A.type instanceof w) {
5979
5979
  const Q = new KA(A.type, []);
5980
5980
  g = this._evalCreate(Q, I);
5981
5981
  }
@@ -5988,7 +5988,7 @@ class gA extends io {
5988
5988
  if (!(g instanceof c)) return console.error(`Invalid if condition. Line ${A.line}`), null;
5989
5989
  let B = null;
5990
5990
  for (const Q of A.cases) if (Q instanceof XQ) for (const E of Q.selectors) {
5991
- if (E instanceof Ag) {
5991
+ if (E instanceof gg) {
5992
5992
  B = Q;
5993
5993
  continue;
5994
5994
  }
@@ -6085,7 +6085,7 @@ class gA extends io {
6085
6085
  _evalCreate(A, I) {
6086
6086
  var g;
6087
6087
  if (A instanceof KA) {
6088
- if (A.type === null) return QB.void;
6088
+ if (A.type === null) return EB.void;
6089
6089
  switch (A.type.getTypeName()) {
6090
6090
  case "bool":
6091
6091
  case "i32":
@@ -6285,7 +6285,7 @@ class gA extends io {
6285
6285
  }
6286
6286
  if (this._isMatrixType(g) && this._isVectorType(B)) {
6287
6287
  const n = (function(D, F, U, S) {
6288
- if (cA[F.name] === void 0 || mg[S.name] === void 0) return null;
6288
+ if (cA[F.name] === void 0 || xg[S.name] === void 0) return null;
6289
6289
  const l = cA[F.name][0], f = cA[F.name][1];
6290
6290
  if (l !== U.length) return null;
6291
6291
  const k = new Array(f);
@@ -6300,7 +6300,7 @@ class gA extends io {
6300
6300
  }
6301
6301
  if (this._isVectorType(g) && this._isMatrixType(B)) {
6302
6302
  const n = (function(D, F, U, S) {
6303
- if (mg[F.name] === void 0 || cA[S.name] === void 0) return null;
6303
+ if (xg[F.name] === void 0 || cA[S.name] === void 0) return null;
6304
6304
  const l = cA[S.name][0], f = cA[S.name][1];
6305
6305
  if (f !== D.length) return null;
6306
6306
  const k = [];
@@ -6910,7 +6910,7 @@ class gA extends io {
6910
6910
  return g.typeInfo = this.getTypeInfo(A.type), g.getSubData(this, A.postfix, I).clone();
6911
6911
  }
6912
6912
  _callConstructorVec(A, I) {
6913
- const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = mg[B];
6913
+ const g = this.getTypeInfo(A.type), B = A.type.getTypeName(), Q = xg[B];
6914
6914
  if (Q === void 0) return console.error(`Invalid vec constructor ${B}. Line ${A.line}`), null;
6915
6915
  const E = [];
6916
6916
  if (A instanceof rA) if (A.isVector) {
@@ -6989,7 +6989,7 @@ class to {
6989
6989
  this._deferArrayCountEval.length = 0;
6990
6990
  }
6991
6991
  if (this._forwardTypeCount > 0) for (const g of I) g.search((B) => {
6992
- B instanceof SC || B instanceof $I ? B.type = this._forwardType(B.type) : B instanceof uI ? B.format = this._forwardType(B.format) : B instanceof HA || B instanceof MI || B instanceof zI ? B.type = this._forwardType(B.type) : B instanceof pI ? B.returnType = this._forwardType(B.returnType) : B instanceof FC && (B.type = this._forwardType(B.type));
6992
+ B instanceof SC || B instanceof Ig ? B.type = this._forwardType(B.type) : B instanceof fI ? B.format = this._forwardType(B.format) : B instanceof HA || B instanceof uI || B instanceof Ag ? B.type = this._forwardType(B.type) : B instanceof xI ? B.returnType = this._forwardType(B.returnType) : B instanceof FC && (B.type = this._forwardType(B.type));
6993
6993
  });
6994
6994
  return I;
6995
6995
  }
@@ -6997,12 +6997,12 @@ class to {
6997
6997
  if (A instanceof GC) {
6998
6998
  const I = this._getType(A.name);
6999
6999
  if (I) return I;
7000
- } else A instanceof $I ? A.type = this._forwardType(A.type) : A instanceof uI && (A.format = this._forwardType(A.format));
7000
+ } else A instanceof Ig ? A.type = this._forwardType(A.type) : A instanceof fI && (A.format = this._forwardType(A.format));
7001
7001
  return A;
7002
7002
  }
7003
7003
  _initialize(A) {
7004
7004
  if (A) if (typeof A == "string") {
7005
- const I = new Ug(A);
7005
+ const I = new dg(A);
7006
7006
  this._tokens = I.scanTokens();
7007
7007
  } else this._tokens = A;
7008
7008
  else this._tokens = [];
@@ -7130,7 +7130,7 @@ class to {
7130
7130
  B = this._type_decl(), B != null && (B.attributes = i);
7131
7131
  }
7132
7132
  const Q = this._compound_statement(), E = this._currentLine;
7133
- return this._updateNode(new pI(I, g, B, Q, A, E), A);
7133
+ return this._updateNode(new xI(I, g, B, Q, A, E), A);
7134
7134
  }
7135
7135
  _compound_statement() {
7136
7136
  const A = [];
@@ -7190,7 +7190,7 @@ class to {
7190
7190
  const A = this._currentLoop.length > 0 ? this._currentLoop[this._currentLoop.length - 1].id : -1;
7191
7191
  if (!this._match(a.keywords.continuing)) return null;
7192
7192
  const I = this._currentLine, g = this._compound_statement();
7193
- return this._updateNode(new CB(g, A), I);
7193
+ return this._updateNode(new QB(g, A), I);
7194
7194
  }
7195
7195
  _for_statement() {
7196
7196
  if (!this._match(a.keywords.for)) return null;
@@ -7220,7 +7220,7 @@ class to {
7220
7220
  }
7221
7221
  this._consume(a.tokens.equal, "Expected '=' for let.");
7222
7222
  const B = this._short_circuit_or_expression();
7223
- return this._updateNode(new MI(I, g, null, null, B), A);
7223
+ return this._updateNode(new uI(I, g, null, null, B), A);
7224
7224
  }
7225
7225
  if (this._match(a.keywords.const)) {
7226
7226
  const A = this._currentLine, I = this._consume(a.tokens.name, "Expected name for const.").toString();
@@ -7231,7 +7231,7 @@ class to {
7231
7231
  }
7232
7232
  this._consume(a.tokens.equal, "Expected '=' for const.");
7233
7233
  const B = this._short_circuit_or_expression();
7234
- return g === null && B instanceof rA && (g = B.type), this._updateNode(new zI(I, g, null, null, B), A);
7234
+ return g === null && B instanceof rA && (g = B.type), this._updateNode(new Ag(I, g, null, null, B), A);
7235
7235
  }
7236
7236
  return null;
7237
7237
  }
@@ -7265,7 +7265,7 @@ class to {
7265
7265
  for (; I !== null; ) {
7266
7266
  if (Array.isArray(I)) for (let g of I) A.body.push(g);
7267
7267
  else A.body.push(I);
7268
- if (I instanceof CB) {
7268
+ if (I instanceof QB) {
7269
7269
  A.continuing = I;
7270
7270
  break;
7271
7271
  }
@@ -7285,7 +7285,7 @@ class to {
7285
7285
  for (; this._check([a.keywords.default, a.keywords.case]); ) {
7286
7286
  if (this._match(a.keywords.case)) {
7287
7287
  const g = this._case_selectors();
7288
- for (const Q of g) if (Q instanceof Ag) {
7288
+ for (const Q of g) if (Q instanceof gg) {
7289
7289
  if (I) throw this._error(this._previous(), "Multiple default cases in switch statement.");
7290
7290
  I = !0;
7291
7291
  break;
@@ -7305,7 +7305,7 @@ class to {
7305
7305
  }
7306
7306
  _case_selectors() {
7307
7307
  const A = [];
7308
- for (this._match(a.keywords.default) ? A.push(this._updateNode(new Ag())) : A.push(this._shift_expression()); this._match(a.tokens.comma); ) this._match(a.keywords.default) ? A.push(this._updateNode(new Ag())) : A.push(this._shift_expression());
7308
+ for (this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression()); this._match(a.tokens.comma); ) this._match(a.keywords.default) ? A.push(this._updateNode(new gg())) : A.push(this._shift_expression());
7309
7309
  return A;
7310
7310
  }
7311
7311
  _case_body() {
@@ -7661,7 +7661,7 @@ class to {
7661
7661
  throw this._error(this._peek(), `Invalid cast from ${Q.type.name} to ${B.name}`);
7662
7662
  Q.type = B, Q.isScalar && this._validateTypeRange(Q.scalarValue, Q.type);
7663
7663
  } else B === null && Q instanceof rA && (B = (A = Q?.type) !== null && A !== void 0 ? A : N.f32, B === N.x32 && (B = N.i32));
7664
- const i = this._updateNode(new zI(I.toString(), B, "", "", Q), g);
7664
+ const i = this._updateNode(new Ag(I.toString(), B, "", "", Q), g);
7665
7665
  return this._context.constants.set(i.name, i), i;
7666
7666
  }
7667
7667
  _global_let_decl() {
@@ -7678,7 +7678,7 @@ class to {
7678
7678
  throw this._error(this._peek(), `Invalid cast from ${B.type.name} to ${g.name}`);
7679
7679
  B.type = g;
7680
7680
  } else g === null && B instanceof rA && (g = B.type.name === "x32" ? N.i32 : B.type);
7681
- return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new MI(I.toString(), g, "", "", B), A);
7681
+ return B instanceof rA && B.isScalar && this._validateTypeRange(B.scalarValue, g), this._updateNode(new uI(I.toString(), g, "", "", B), A);
7682
7682
  }
7683
7683
  _const_expression() {
7684
7684
  return this._short_circuit_or_expression();
@@ -7759,7 +7759,7 @@ class to {
7759
7759
  this._consume(a.tokens.comma, "Expected ',' for pointer.");
7760
7760
  const o = this._type_decl();
7761
7761
  let s = null;
7762
- return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new $I(E, i.toString(), o, s));
7762
+ return this._match(a.tokens.comma) && (s = this._consume(a.access_mode, "Expected access_mode for pointer").toString()), this._consume(a.tokens.greater_than, "Expected '>' for pointer."), this._updateNode(new Ig(E, i.toString(), o, s));
7763
7763
  }
7764
7764
  const Q = this._attribute();
7765
7765
  if (this._match(a.keywords.array)) {
@@ -7779,7 +7779,7 @@ class to {
7779
7779
  }
7780
7780
  this._consume(a.tokens.greater_than, "Expected '>' for array."), i = e ? parseInt(e) : 0;
7781
7781
  }
7782
- const t = this._updateNode(new uI(o.toString(), Q, E, i));
7782
+ const t = this._updateNode(new fI(o.toString(), Q, E, i));
7783
7783
  return s && this._deferArrayCountEval.push({ arrayType: t, countNode: s }), t;
7784
7784
  }
7785
7785
  return null;
@@ -7839,16 +7839,16 @@ function ao(C, A, I) {
7839
7839
  }
7840
7840
  return Object.values(C.entryPoints).filter((B) => B.stage === I)[0];
7841
7841
  }
7842
- function xg(C, A, I) {
7842
+ function bg(C, A, I) {
7843
7843
  return A ? ao(C, A, I)?.resources || [] : [];
7844
7844
  }
7845
7845
  const no = (C, A) => Math.sign(C.binding - A.binding);
7846
7846
  function ro(C, A) {
7847
7847
  C = Array.isArray(C) ? C : [C];
7848
7848
  const I = [
7849
- ...xg(C[0], A.vertex, GPUShaderStage.VERTEX),
7850
- ...xg(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
7851
- ...xg(C[0], A.compute, GPUShaderStage.COMPUTE)
7849
+ ...bg(C[0], A.vertex, GPUShaderStage.VERTEX),
7850
+ ...bg(C[C.length - 1], A.fragment, GPUShaderStage.FRAGMENT),
7851
+ ...bg(C[0], A.compute, GPUShaderStage.COMPUTE)
7852
7852
  ], g = [];
7853
7853
  for (const Q of I) {
7854
7854
  const E = g[Q.group] || /* @__PURE__ */ new Map();
@@ -7980,7 +7980,7 @@ function co(C, A) {
7980
7980
  throw new Error("unknown resource type");
7981
7981
  }
7982
7982
  }
7983
- function bg(C, A) {
7983
+ function Tg(C, A) {
7984
7984
  const I = {};
7985
7985
  for (const g of C)
7986
7986
  I[g.name] = {
@@ -7998,9 +7998,9 @@ function bg(C, A) {
7998
7998
  }
7999
7999
  function wo(C) {
8000
8000
  const A = new eo(C), I = Object.fromEntries(A.structs.map((e) => [e.name, $Q(A, e, 0)])), g = zA(A, A.uniforms), B = zA(A, A.immediates), Q = zA(A, A.storage.filter((e) => e.resourceType === sA.Storage)), E = zA(A, A.storage.filter((e) => e.resourceType === sA.StorageTexture)), i = zA(A, A.textures.filter((e) => e.type.name !== "texture_external")), o = zA(A, A.textures.filter((e) => e.type.name === "texture_external")), s = zA(A, A.samplers), t = {
8001
- ...bg(A.entry.vertex, GPUShaderStage.VERTEX),
8002
- ...bg(A.entry.fragment, GPUShaderStage.FRAGMENT),
8003
- ...bg(A.entry.compute, GPUShaderStage.COMPUTE)
8001
+ ...Tg(A.entry.vertex, GPUShaderStage.VERTEX),
8002
+ ...Tg(A.entry.fragment, GPUShaderStage.FRAGMENT),
8003
+ ...Tg(A.entry.compute, GPUShaderStage.COMPUTE)
8004
8004
  };
8005
8005
  return {
8006
8006
  externalTextures: o,
@@ -8014,7 +8014,7 @@ function wo(C) {
8014
8014
  entryPoints: t
8015
8015
  };
8016
8016
  }
8017
- function Tg(C, A = "") {
8017
+ function Wg(C, A = "") {
8018
8018
  if (!C)
8019
8019
  throw new Error(A);
8020
8020
  }
@@ -8034,7 +8034,7 @@ function Go(C, A, I) {
8034
8034
  }
8035
8035
  function qB(C, A, I) {
8036
8036
  if (A.isArray) {
8037
- Tg(!A.isStruct, "struct array is invalid"), Tg(!A.isStruct, "template array is invalid");
8037
+ Wg(!A.isStruct, "struct array is invalid"), Wg(!A.isStruct, "template array is invalid");
8038
8038
  const g = A;
8039
8039
  return {
8040
8040
  size: g.size,
@@ -8043,7 +8043,7 @@ function qB(C, A, I) {
8043
8043
  };
8044
8044
  } else {
8045
8045
  if (A.isStruct)
8046
- return Tg(!A.isTemplate, "template struct is invalid"), $Q(C, A, I);
8046
+ return Wg(!A.isTemplate, "template struct is invalid"), $Q(C, A, I);
8047
8047
  {
8048
8048
  const g = A, B = A.isTemplate ? `${g.name}<${g.format.name}>` : A.name;
8049
8049
  return {
@@ -8646,7 +8646,7 @@ function Ho(C) {
8646
8646
  return "image_scalar_u32";
8647
8647
  }
8648
8648
  }
8649
- function EB(C, A) {
8649
+ function JI(C, A) {
8650
8650
  const I = C.priority ?? Number.MAX_SAFE_INTEGER, g = A.priority ?? Number.MAX_SAFE_INTEGER;
8651
8651
  return I === g ? (C.orderKey ?? Number.MAX_SAFE_INTEGER) - (A.orderKey ?? Number.MAX_SAFE_INTEGER) : I - g;
8652
8652
  }
@@ -8680,7 +8680,7 @@ class qo {
8680
8680
  }
8681
8681
  pump() {
8682
8682
  if (!(this.running_.size >= this.maxConcurrent_ || this.pending_.length === 0))
8683
- for (this.pending_.sort((A, I) => EB(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
8683
+ for (this.pending_.sort((A, I) => JI(A.chunk, I.chunk)); this.running_.size < this.maxConcurrent_ && this.pending_.length > 0; )
8684
8684
  this.start(this.pending_.shift());
8685
8685
  }
8686
8686
  start(A) {
@@ -8699,15 +8699,15 @@ class qo {
8699
8699
  this.running_.set(I, { controller: B, promise: Q });
8700
8700
  }
8701
8701
  }
8702
- let tg = 0, eg = 0;
8702
+ let eg = 0, ag = 0;
8703
8703
  function po(C, A) {
8704
- C.data && (tg -= C.data.byteLength, eg -= 1), C.data = A, tg += A.byteLength, eg += 1;
8704
+ C.data && (eg -= C.data.byteLength, ag -= 1), C.data = A, eg += A.byteLength, ag += 1;
8705
8705
  }
8706
8706
  function dC(C) {
8707
- C.data && (tg -= C.data.byteLength, eg -= 1), C.data = void 0, C.texture?.releaseCpuData();
8707
+ C.data && (eg -= C.data.byteLength, ag -= 1), C.data = void 0, C.texture?.releaseCpuData();
8708
8708
  }
8709
8709
  function mo() {
8710
- return { cpuChunkBytes: tg, cpuChunkCount: eg };
8710
+ return { cpuChunkBytes: eg, cpuChunkCount: ag };
8711
8711
  }
8712
8712
  function lC(C, A, I = 1e-6) {
8713
8713
  return Math.abs(C - A) <= I;
@@ -8736,7 +8736,7 @@ function bo(C, A) {
8736
8736
  function TA(C, A, I) {
8737
8737
  return Math.max(A, Math.min(I, C));
8738
8738
  }
8739
- const dg = Symbol("INTERNAL_POLICY_KEY");
8739
+ const lg = Symbol("INTERNAL_POLICY_KEY");
8740
8740
  class To {
8741
8741
  store_;
8742
8742
  policy_;
@@ -8873,7 +8873,7 @@ class To {
8873
8873
  const A = this.fallbackLOD();
8874
8874
  let I = !1;
8875
8875
  for (const [g, B] of this.chunkViewStates_)
8876
- if (!(!B.visible || g.lod !== A) && (I = !0, g.state !== "loaded"))
8876
+ if (!(!B.visible || g.lod !== A) && (I = !0, g.texture === void 0))
8877
8877
  return !1;
8878
8878
  return I;
8879
8879
  }
@@ -8888,7 +8888,7 @@ class To {
8888
8888
  this.isDisposed_ = !0, this.chunkViewStates_.forEach(dI);
8889
8889
  }
8890
8890
  setImageSourcePolicy(A, I) {
8891
- if (I !== dg)
8891
+ if (I !== lg)
8892
8892
  throw new Error("Unauthorized policy mutation");
8893
8893
  this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, H.info(
8894
8894
  "ChunkStoreView",
@@ -9030,13 +9030,13 @@ class To {
9030
9030
  ];
9031
9031
  }
9032
9032
  viewBounds2DChanged(A) {
9033
- return this.lastViewBounds2D_ === null || !qg(this.lastViewBounds2D_.min, A.min) || !qg(this.lastViewBounds2D_.max, A.max);
9033
+ return this.lastViewBounds2D_ === null || !pg(this.lastViewBounds2D_.min, A.min) || !pg(this.lastViewBounds2D_.max, A.max);
9034
9034
  }
9035
9035
  hasViewProjectionChanged(A) {
9036
9036
  return this.lastViewProjection_ === null || !jE(this.lastViewProjection_, A);
9037
9037
  }
9038
9038
  zBoundsChanged(A) {
9039
- return !this.lastZBounds_ || !qg(this.lastZBounds_, A);
9039
+ return !this.lastZBounds_ || !pg(this.lastZBounds_, A);
9040
9040
  }
9041
9041
  cCoordsChanged(A) {
9042
9042
  return !this.lastCCoords_ && !A ? !1 : !this.lastCCoords_ || !A || this.lastCCoords_.length !== A.length ? !0 : !this.lastCCoords_.every((I, g) => I === A[g]);
@@ -9172,28 +9172,15 @@ class Wo {
9172
9172
  }
9173
9173
  aggregateChunkViewStates(A) {
9174
9174
  let I = !1, g = !1, B = null, Q = null;
9175
- for (const s of this.views_) {
9176
- const t = s.chunkViewStates.get(A);
9177
- t && (t.visible && (I = !0), t.prefetch && (g = !0), t.priority !== null && (B === null || t.priority < B) && (B = t.priority, Q = t.orderKey), !t.visible && !t.prefetch && t.priority === null && s.maybeForgetChunk(A));
9175
+ for (const o of this.views_) {
9176
+ const s = o.chunkViewStates.get(A);
9177
+ s && (s.visible && (I = !0), s.prefetch && (g = !0), s.priority !== null && (B === null || s.priority < B) && (B = s.priority, Q = s.orderKey), !s.visible && !s.prefetch && s.priority === null && o.maybeForgetChunk(A));
9178
9178
  }
9179
9179
  if (A.visible = I, A.prefetch = g, A.priority = B, A.orderKey = Q, A.priority !== null && A.state === "unloaded") {
9180
9180
  A.state = "queued";
9181
9181
  return;
9182
9182
  }
9183
- if (A.priority === null && A.state === "queued") {
9184
- A.state = "unloaded";
9185
- return;
9186
- }
9187
- if (A.state === "loaded" && A.priority === null) {
9188
- if (A.visible || A.prefetch)
9189
- throw new Error(
9190
- `Chunk state inconsistency detected: priority is null but visible=${A.visible} or prefetch=${A.prefetch} for chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
9191
- );
9192
- A.state = "unloaded", A.orderKey = null, H.debug(
9193
- "ChunkStore",
9194
- `Disposing chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
9195
- );
9196
- }
9183
+ A.priority === null && A.state === "queued" && (A.state = "unloaded");
9197
9184
  }
9198
9185
  validateXYScaleRatios() {
9199
9186
  const A = this.dimensions_.x, I = this.dimensions_.y;
@@ -9250,6 +9237,7 @@ class Po {
9250
9237
  getGpuResidentBytes_;
9251
9238
  memoryLimitBytes_;
9252
9239
  maxGpuUploadsPerUpdate_;
9240
+ resident_ = /* @__PURE__ */ new Set();
9253
9241
  constructor(A, I, g = () => 0, B = 1 / 0, Q = vo, E = Zo) {
9254
9242
  this.uploadTexture_ = A, this.disposeTexture_ = I, this.getGpuResidentBytes_ = g, this.memoryLimitBytes_ = B, this.maxGpuUploadsPerUpdate_ = Math.max(1, E), this.queue_ = new qo(Q);
9255
9243
  }
@@ -9274,25 +9262,53 @@ class Po {
9274
9262
  for (const { source: I, store: g } of this.stores_) {
9275
9263
  const B = g.updateAndCollectChunkChanges();
9276
9264
  for (const Q of B)
9277
- Q.priority === null ? (this.queue_.cancel(Q), this.disposeChunkTexture(Q), dC(Q)) : Q.state === "queued" && A.push({ source: I, chunk: Q });
9265
+ Q.priority === null ? this.releaseChunk(Q) : (Q.releasedAt = void 0, Q.state === "queued" && A.push({ source: I, chunk: Q }));
9278
9266
  this.uploadLoadedChunks(B);
9279
9267
  }
9280
9268
  this.enqueueWithinBudget(A), this.queue_.flush();
9281
9269
  for (let I = this.stores_.length - 1; I >= 0; I--)
9282
9270
  this.stores_[I].store.canDispose() && this.stores_.splice(I, 1);
9283
9271
  }
9272
+ releaseChunk(A) {
9273
+ if (this.queue_.cancel(A), A.texture !== void 0) {
9274
+ A.releasedAt ??= performance.now();
9275
+ return;
9276
+ }
9277
+ dC(A), A.state === "loaded" && (A.state = "unloaded");
9278
+ }
9284
9279
  enqueueWithinBudget(A) {
9285
9280
  if (A.length === 0) return;
9286
- A.sort((g, B) => EB(g.chunk, B.chunk));
9287
- let I = this.getGpuResidentBytes_();
9288
- for (const { source: g, chunk: B } of A) {
9289
- const Q = this.chunkBytes(g, B);
9290
- I + Q > this.memoryLimitBytes_ || (I += Q, this.queue_.enqueue(
9291
- B,
9292
- (E) => g.loader.loadChunkData(B, E)
9293
- ));
9281
+ A.sort((B, Q) => JI(B.chunk, Q.chunk));
9282
+ let I = this.getGpuResidentBytes_(), g = null;
9283
+ for (const { source: B, chunk: Q } of A) {
9284
+ const E = this.chunkBytes(B, Q);
9285
+ E > this.memoryLimitBytes_ || (I + E > this.memoryLimitBytes_ && (g ??= this.evictionCandidates(), I = this.evictWorseChunks(
9286
+ I,
9287
+ E,
9288
+ Q,
9289
+ g
9290
+ )), !(I + E > this.memoryLimitBytes_) && (I += E, this.queue_.enqueue(
9291
+ Q,
9292
+ (i) => B.loader.loadChunkData(Q, i)
9293
+ )));
9294
9294
  }
9295
9295
  }
9296
+ evictionCandidates() {
9297
+ const A = [];
9298
+ for (const I of this.resident_)
9299
+ I.visible || A.push(I);
9300
+ return A.sort((I, g) => {
9301
+ const B = -JI(I, g);
9302
+ return B !== 0 ? B : (I.releasedAt ?? 0) - (g.releasedAt ?? 0);
9303
+ });
9304
+ }
9305
+ evictWorseChunks(A, I, g, B) {
9306
+ for (; A + I > this.memoryLimitBytes_ && B.length > 0 && JI(B[0], g) > 0; ) {
9307
+ const Q = B.shift();
9308
+ Q.texture !== void 0 && (A -= mI(Q.texture), this.disposeChunkTexture(Q), Q.state = "unloaded", Q.releasedAt = void 0);
9309
+ }
9310
+ return A;
9311
+ }
9296
9312
  chunkBytes(A, I) {
9297
9313
  const g = A.loader.getBytesPerElement();
9298
9314
  return I.shape.x * I.shape.y * I.shape.z * g;
@@ -9303,18 +9319,18 @@ class Po {
9303
9319
  for (const B of A)
9304
9320
  B.state === "loaded" && B.texture === void 0 && I.push(B);
9305
9321
  if (I.length === 0) return;
9306
- I.sort(EB);
9322
+ I.sort(JI);
9307
9323
  const g = Math.min(I.length, this.maxGpuUploadsPerUpdate_);
9308
9324
  for (let B = 0; B < g; B++) {
9309
- const Q = I[B], E = TI.createWithChunk(Q);
9310
- this.uploadTexture_(E), Q.texture = E, dC(Q);
9325
+ const Q = I[B], E = vI.createWithChunk(Q);
9326
+ this.uploadTexture_(E), Q.texture = E, this.resident_.add(Q), dC(Q);
9311
9327
  }
9312
9328
  }
9313
9329
  disposeChunkTexture(A) {
9314
- this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0);
9330
+ this.disposeTexture_ && A.texture !== void 0 && (this.disposeTexture_(A.texture), A.texture = void 0, this.resident_.delete(A));
9315
9331
  }
9316
9332
  }
9317
- var fI = function(C = 1) {
9333
+ var KI = function(C = 1) {
9318
9334
  var A = 0, I = document.createElement("div");
9319
9335
  I.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", I.addEventListener("click", function(e) {
9320
9336
  e.preventDefault(), B(++A % I.children.length);
@@ -9327,9 +9343,9 @@ var fI = function(C = 1) {
9327
9343
  I.children[n].style.display = n === e ? "block" : "none";
9328
9344
  A = e;
9329
9345
  }
9330
- var Q = (performance || Date).now(), E = Q, i = 0, o = g(new fI.Panel("FPS", "#0ff", "#002", C)), s = g(new fI.Panel("MS", "#0f0", "#020", C));
9346
+ var Q = (performance || Date).now(), E = Q, i = 0, o = g(new KI.Panel("FPS", "#0ff", "#002", C)), s = g(new KI.Panel("MS", "#0f0", "#020", C));
9331
9347
  if (self.performance && self.performance.memory)
9332
- var t = g(new fI.Panel("MB", "#f08", "#201", C));
9348
+ var t = g(new KI.Panel("MB", "#f08", "#201", C));
9333
9349
  return B(0), {
9334
9350
  REVISION: 16,
9335
9351
  dom: I,
@@ -9355,7 +9371,7 @@ var fI = function(C = 1) {
9355
9371
  setMode: B
9356
9372
  };
9357
9373
  };
9358
- fI.Panel = function(C, A, I, g) {
9374
+ KI.Panel = function(C, A, I, g) {
9359
9375
  var B = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * g), s = E(48 * i * g), t = E(3 * i * g), e = E(2 * i * g), n = E(3 * i * g), D = E(15 * i * g), F = E(74 * i * g), U = E(30 * i * g), S = document.createElement("canvas");
9360
9376
  S.width = o, S.height = s, S.style.cssText = `width:${E(g * 80)}px;height:${E(g * 48)}px`;
9361
9377
  var l = S.getContext("2d");
@@ -9367,7 +9383,7 @@ fI.Panel = function(C, A, I, g) {
9367
9383
  };
9368
9384
  };
9369
9385
  function Oo({ scale: C } = { scale: 1.5 }) {
9370
- const A = new fI(C);
9386
+ const A = new KI(C);
9371
9387
  return A.showPanel(
9372
9388
  0
9373
9389
  /* 0 = fps, 1 = ms, 2 = mb */
@@ -9817,7 +9833,7 @@ async function MC(C) {
9817
9833
  throw new Error(`Unexpected response status ${C.status} ${C.statusText}`);
9818
9834
  }
9819
9835
  }
9820
- class WI {
9836
+ class ZI {
9821
9837
  url;
9822
9838
  #A;
9823
9839
  #I;
@@ -9872,9 +9888,9 @@ class WI {
9872
9888
  return this.#A(this.#B(A, s));
9873
9889
  }
9874
9890
  }
9875
- class vI extends Error {
9891
+ class PI extends Error {
9876
9892
  }
9877
- class NI extends vI {
9893
+ class NI extends PI {
9878
9894
  _tag = "NotFoundError";
9879
9895
  name = "NotFoundError";
9880
9896
  path;
@@ -9883,7 +9899,7 @@ class NI extends vI {
9883
9899
  super(`Not found: ${A}`, { cause: I.cause }), this.path = I.path, this.found = I.found;
9884
9900
  }
9885
9901
  }
9886
- class nA extends vI {
9902
+ class nA extends PI {
9887
9903
  _tag = "InvalidMetadataError";
9888
9904
  name = "InvalidMetadataError";
9889
9905
  path;
@@ -9891,7 +9907,7 @@ class nA extends vI {
9891
9907
  super(A, { cause: I.cause }), this.path = I.path;
9892
9908
  }
9893
9909
  }
9894
- class gs extends vI {
9910
+ class gs extends PI {
9895
9911
  _tag = "UnknownCodecError";
9896
9912
  name = "UnknownCodecError";
9897
9913
  codec;
@@ -9899,7 +9915,7 @@ class gs extends vI {
9899
9915
  super(`Unknown codec: ${A}`), this.codec = A;
9900
9916
  }
9901
9917
  }
9902
- class Bs extends vI {
9918
+ class Bs extends PI {
9903
9919
  _tag = "CodecPipelineError";
9904
9920
  name = "CodecPipelineError";
9905
9921
  direction;
@@ -9914,7 +9930,7 @@ class Bs extends vI {
9914
9930
  super(I.join(" "), { cause: A.cause }), this.direction = A.direction, this.codec = A.codec, this.chunkPath = A.chunkPath;
9915
9931
  }
9916
9932
  }
9917
- class pB extends vI {
9933
+ class pB extends PI {
9918
9934
  _tag = "UnsupportedError";
9919
9935
  name = "UnsupportedError";
9920
9936
  feature;
@@ -9927,14 +9943,14 @@ function EI(C) {
9927
9943
  throw new pB(`${C} encode`);
9928
9944
  };
9929
9945
  }
9930
- class ag {
9946
+ class ng {
9931
9947
  kind = "array_to_array";
9932
9948
  constructor(A, I) {
9933
9949
  if (A.keepbits < 0)
9934
9950
  throw new nA("keepbits must be zero or positive");
9935
9951
  }
9936
9952
  static fromConfig(A, I) {
9937
- return new ag(A, I);
9953
+ return new ng(A, I);
9938
9954
  }
9939
9955
  encode = EI("bitround");
9940
9956
  /**
@@ -10033,7 +10049,7 @@ class xB {
10033
10049
  yield this.get(A);
10034
10050
  }
10035
10051
  }
10036
- class ZI {
10052
+ class OI {
10037
10053
  #A;
10038
10054
  chars;
10039
10055
  constructor(A, I, g, B) {
@@ -10042,7 +10058,7 @@ class ZI {
10042
10058
  else if (mB(I))
10043
10059
  B && (B *= A), this.#A = new Int32Array(I, g, B);
10044
10060
  else {
10045
- const Q = I, E = new ZI(A, 1);
10061
+ const Q = I, E = new OI(A, 1);
10046
10062
  this.#A = new Int32Array((function* () {
10047
10063
  for (let i of Q)
10048
10064
  E.set(0, i), yield* E.#A;
@@ -10095,7 +10111,7 @@ function Cs() {
10095
10111
  function Qs(C, A) {
10096
10112
  return new SharedArrayBuffer(C);
10097
10113
  }
10098
- function PI(C) {
10114
+ function VI(C) {
10099
10115
  const A = new TextDecoder().decode(C);
10100
10116
  try {
10101
10117
  return JSON.parse(A);
@@ -10116,7 +10132,7 @@ function RI(C) {
10116
10132
  let A = C.match(/v2:([US])(\d+)/);
10117
10133
  if (A) {
10118
10134
  let [, g, B] = A;
10119
- return (g === "U" ? ZI : xB).bind(null, Number(B));
10135
+ return (g === "U" ? OI : xB).bind(null, Number(B));
10120
10136
  }
10121
10137
  if (C === "string")
10122
10138
  return globalThis.Array;
@@ -10318,7 +10334,7 @@ function es() {
10318
10334
  function HC(C) {
10319
10335
  return "BYTES_PER_ELEMENT" in C ? C.BYTES_PER_ELEMENT : 4;
10320
10336
  }
10321
- class lg {
10337
+ class Lg {
10322
10338
  kind = "array_to_bytes";
10323
10339
  #A;
10324
10340
  #I;
@@ -10331,7 +10347,7 @@ class lg {
10331
10347
  this.#g = g.BYTES_PER_ELEMENT;
10332
10348
  }
10333
10349
  static fromConfig(A, I) {
10334
- return new lg(A, I);
10350
+ return new Lg(A, I);
10335
10351
  }
10336
10352
  encode(A) {
10337
10353
  let I = new Uint8Array(A.data.buffer);
@@ -10357,7 +10373,7 @@ const qC = {
10357
10373
  float32: 4,
10358
10374
  float64: 8
10359
10375
  };
10360
- function ng(C) {
10376
+ function rg(C) {
10361
10377
  return C in EE;
10362
10378
  }
10363
10379
  function sB(C) {
@@ -10372,18 +10388,18 @@ function as(C, A) {
10372
10388
  }
10373
10389
  return A === 4 ? (B.setUint32(0, Number(I)), B.getFloat32(0)) : (B.setBigUint64(0, I), B.getFloat64(0));
10374
10390
  }
10375
- function rg(C, A) {
10391
+ function Dg(C, A) {
10376
10392
  if (sB(C)) {
10377
10393
  if (typeof A != "number" || !Number.isInteger(A))
10378
10394
  throw new nA(`Expected an integer value for data type "${C}", got ${JSON.stringify(A)}`);
10379
10395
  return BigInt(A);
10380
10396
  }
10381
10397
  if (typeof A == "number") {
10382
- if (!ng(C) && !Number.isInteger(A))
10398
+ if (!rg(C) && !Number.isInteger(A))
10383
10399
  throw new nA(`Expected an integer value for data type "${C}", got ${A}`);
10384
10400
  return A;
10385
10401
  }
10386
- if (!ng(C))
10402
+ if (!rg(C))
10387
10403
  throw new nA(`String-encoded scalar "${A}" is not valid for non-float data type "${C}"`);
10388
10404
  return A in qC ? qC[A] : as(A, EE[C]);
10389
10405
  }
@@ -10399,21 +10415,21 @@ const pC = /* @__PURE__ */ new Set([
10399
10415
  "float16",
10400
10416
  "float32",
10401
10417
  "float64"
10402
- ]), Wg = {
10418
+ ]), vg = {
10403
10419
  int8: [-128, 2 ** 7 - 1],
10404
10420
  uint8: [0, 2 ** 8 - 1],
10405
10421
  int16: [-32768, 2 ** 15 - 1],
10406
10422
  uint16: [0, 2 ** 16 - 1],
10407
10423
  int32: [-2147483648, 2 ** 31 - 1],
10408
10424
  uint32: [0, 2 ** 32 - 1]
10409
- }, vg = {
10425
+ }, Zg = {
10410
10426
  int64: [-(2n ** 63n), 2n ** 63n - 1n],
10411
10427
  uint64: [0n, 2n ** 64n - 1n]
10412
10428
  };
10413
10429
  function mC(C, A, I) {
10414
10430
  return C.map(([g, B]) => ({
10415
- src: rg(A, g),
10416
- tgt: rg(I, B)
10431
+ src: Dg(A, g),
10432
+ tgt: Dg(I, B)
10417
10433
  }));
10418
10434
  }
10419
10435
  function ns(C, A) {
@@ -10450,7 +10466,7 @@ function xC(C) {
10450
10466
  return Ds;
10451
10467
  }
10452
10468
  }
10453
- function Zg(C, A, I) {
10469
+ function Pg(C, A, I) {
10454
10470
  const g = A - C + 1;
10455
10471
  switch (I) {
10456
10472
  case "clamp":
@@ -10465,7 +10481,7 @@ function Zg(C, A, I) {
10465
10481
  };
10466
10482
  }
10467
10483
  }
10468
- function Pg(C, A, I) {
10484
+ function Og(C, A, I) {
10469
10485
  const g = A - C + 1n;
10470
10486
  switch (I) {
10471
10487
  case "clamp":
@@ -10512,21 +10528,21 @@ class bB {
10512
10528
  }
10513
10529
  }
10514
10530
  function bC(C, A, I, g, B) {
10515
- const Q = ng(C), E = sB(C), i = ng(A), o = sB(A);
10531
+ const Q = rg(C), E = sB(C), i = rg(A), o = sB(A);
10516
10532
  let s;
10517
10533
  if (Q && i) {
10518
10534
  if (I !== "nearest-even")
10519
10535
  throw new nA(`cast_value float -> float only supports "nearest-even" rounding, got "${I}"`);
10520
10536
  s = (e) => e;
10521
10537
  } else if (Q && !i && !o) {
10522
- const e = xC(I), n = Zg(...Wg[A], g);
10538
+ const e = xC(I), n = Pg(...vg[A], g);
10523
10539
  s = (D) => {
10524
10540
  if (!Number.isFinite(D))
10525
10541
  throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
10526
10542
  return n(e(D));
10527
10543
  };
10528
10544
  } else if (Q && o) {
10529
- const e = xC(I), n = Pg(...vg[A], g);
10545
+ const e = xC(I), n = Og(...Zg[A], g);
10530
10546
  s = (D) => {
10531
10547
  if (!Number.isFinite(D))
10532
10548
  throw new Error(`Cannot cast ${D} to integer type without scalar_map`);
@@ -10537,15 +10553,15 @@ function bC(C, A, I, g, B) {
10537
10553
  else if (E && i)
10538
10554
  s = (e) => Number(e);
10539
10555
  else if (!Q && !E && !i && !o)
10540
- s = Zg(...Wg[A], g);
10556
+ s = Pg(...vg[A], g);
10541
10557
  else if (!Q && !E && o) {
10542
- const e = Pg(...vg[A], g);
10558
+ const e = Og(...Zg[A], g);
10543
10559
  s = (n) => e(BigInt(n));
10544
10560
  } else if (E && !i && !o) {
10545
- const e = Zg(...Wg[A], g);
10561
+ const e = Pg(...vg[A], g);
10546
10562
  s = (n) => e(Number(n));
10547
10563
  } else if (E && o)
10548
- s = Pg(...vg[A], g);
10564
+ s = Og(...Zg[A], g);
10549
10565
  else
10550
10566
  throw new Error(`Unhandled type combination: ${C} -> ${A}`);
10551
10567
  return B.length === 0 ? s : (e) => {
@@ -10637,7 +10653,7 @@ function ys(C, A) {
10637
10653
  function cs(C, A) {
10638
10654
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, g) => (I[g] = A[g], I), {}) : A;
10639
10655
  }
10640
- class Dg {
10656
+ class hg {
10641
10657
  configuration;
10642
10658
  kind = "array_to_bytes";
10643
10659
  #A;
@@ -10658,7 +10674,7 @@ class Dg {
10658
10674
  }, this.#I = { strict: s };
10659
10675
  }
10660
10676
  static fromConfig(A) {
10661
- return new Dg(A);
10677
+ return new hg(A);
10662
10678
  }
10663
10679
  encode(A) {
10664
10680
  const { indent: I, encoding: g, ensure_ascii: B, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
@@ -10683,7 +10699,7 @@ class Dg {
10683
10699
  decode(A) {
10684
10700
  const { strict: I } = this.#I;
10685
10701
  FA(I, "JsonCodec does not yet support non-strict decoding.");
10686
- const g = PI(A), B = g.pop();
10702
+ const g = VI(A), B = g.pop();
10687
10703
  g.pop(), FA(B, "0D not implemented for JsonCodec.");
10688
10704
  const Q = BI(B, "C");
10689
10705
  return { data: g, shape: B, stride: Q };
@@ -10713,7 +10729,7 @@ class ZB {
10713
10729
  static fromConfig(A, I) {
10714
10730
  if (!ws.has(I.dataType))
10715
10731
  throw new nA(`scale_offset codec does not support data type: ${I.dataType}`);
10716
- return new ZB(rg(I.dataType, A.scale ?? 1), rg(I.dataType, A.offset ?? 0), RI(I.dataType));
10732
+ return new ZB(Dg(I.dataType, A.scale ?? 1), Dg(I.dataType, A.offset ?? 0), RI(I.dataType));
10717
10733
  }
10718
10734
  encode = EI("scale_offset");
10719
10735
  decode(A) {
@@ -10758,7 +10774,7 @@ function Fs(C, A) {
10758
10774
  return B;
10759
10775
  }
10760
10776
  function WC(C) {
10761
- return C instanceof gE || C instanceof xB || C instanceof ZI ? new Proxy(C, {
10777
+ return C instanceof gE || C instanceof xB || C instanceof OI ? new Proxy(C, {
10762
10778
  get(I, g) {
10763
10779
  return I.get(Number(g));
10764
10780
  },
@@ -10769,7 +10785,7 @@ function WC(C) {
10769
10785
  }
10770
10786
  function Ss(C, A) {
10771
10787
  let I;
10772
- return C.data instanceof xB || C.data instanceof ZI ? I = new C.constructor(
10788
+ return C.data instanceof xB || C.data instanceof OI ? I = new C.constructor(
10773
10789
  // @ts-expect-error
10774
10790
  C.data.length,
10775
10791
  C.data.chars
@@ -10835,7 +10851,7 @@ class OB {
10835
10851
  };
10836
10852
  }
10837
10853
  }
10838
- class hg {
10854
+ class yg {
10839
10855
  kind = "array_to_bytes";
10840
10856
  #A;
10841
10857
  #I;
@@ -10843,7 +10859,7 @@ class hg {
10843
10859
  this.#A = A, this.#I = BI(A, "C");
10844
10860
  }
10845
10861
  static fromConfig(A, I) {
10846
- return new hg(I.shape);
10862
+ return new yg(I.shape);
10847
10863
  }
10848
10864
  encode = EI("vlen-utf8");
10849
10865
  decode(A) {
@@ -10868,7 +10884,7 @@ class VB {
10868
10884
  }
10869
10885
  function Us() {
10870
10886
  let C = () => import("./blosc-D1xNXZJs.js").then((Q) => Q.default), A = () => import("./lz4-1Ws5oVWR.js").then((Q) => Q.default), I = () => import("./zstd-C4EcZnjq.js").then((Q) => Q.default), g = () => vB, B = () => VB;
10871
- return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () => lg).set("crc32c", () => TB).set("vlen-utf8", () => hg).set("json2", () => Dg).set("bitround", () => ag).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => hg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ag).set("numcodecs.json2", () => Dg);
10887
+ return (/* @__PURE__ */ new Map()).set("blosc", C).set("lz4", A).set("zstd", I).set("gzip", g).set("zlib", B).set("transpose", () => OB).set("bytes", () => Lg).set("crc32c", () => TB).set("vlen-utf8", () => yg).set("json2", () => hg).set("bitround", () => ng).set("cast_value", () => bB).set("scale_offset", () => ZB).set("numcodecs.blosc", C).set("numcodecs.lz4", A).set("numcodecs.zstd", I).set("numcodecs.gzip", g).set("numcodecs.zlib", B).set("numcodecs.vlen-utf8", () => yg).set("numcodecs.shuffle", () => PB).set("numcodecs.delta", () => WB).set("numcodecs.bitround", () => ng).set("numcodecs.json2", () => hg);
10872
10888
  }
10873
10889
  const ds = Us();
10874
10890
  function tB(C) {
@@ -10953,7 +10969,7 @@ async function ls(C) {
10953
10969
  throw new nA(`Cannot encode ${Q.dataType} to bytes without a codec`);
10954
10970
  g = {
10955
10971
  name: "bytes",
10956
- codec: lg.fromConfig({ endian: "little" }, Q)
10972
+ codec: Lg.fromConfig({ endian: "little" }, Q)
10957
10973
  };
10958
10974
  }
10959
10975
  return {
@@ -11018,7 +11034,7 @@ class _B extends UA {
11018
11034
  function PC(C) {
11019
11035
  return C.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
11020
11036
  }
11021
- const jI = Symbol("zarrita.context");
11037
+ const $I = Symbol("zarrita.context");
11022
11038
  function Ys(C, A) {
11023
11039
  let { configuration: I } = A.codecs.find(ts) ?? {}, g = {
11024
11040
  encodeChunkKey: Es(A.chunk_key_encoding),
@@ -11063,15 +11079,15 @@ function Ys(C, A) {
11063
11079
  }
11064
11080
  };
11065
11081
  }
11066
- let yg = class extends UA {
11082
+ let cg = class extends UA {
11067
11083
  kind = "array";
11068
11084
  #A;
11069
- [jI];
11085
+ [$I];
11070
11086
  constructor(A, I, g) {
11071
11087
  super(A, I), this.#A = {
11072
11088
  ...g,
11073
11089
  fill_value: BE(g)
11074
- }, this[jI] = Ys(this, this.#A);
11090
+ }, this[$I] = Ys(this, this.#A);
11075
11091
  }
11076
11092
  get attrs() {
11077
11093
  return this.#A.attributes;
@@ -11086,14 +11102,14 @@ let yg = class extends UA {
11086
11102
  return this.#A.shape;
11087
11103
  }
11088
11104
  get chunks() {
11089
- return this[jI].chunkShape;
11105
+ return this[$I].chunkShape;
11090
11106
  }
11091
11107
  get dtype() {
11092
11108
  return this.#A.data_type;
11093
11109
  }
11094
11110
  async getChunk(A, I, g) {
11095
11111
  g?.useSharedArrayBuffer && Cs();
11096
- let B = this[jI], Q = await B.getChunkBytes(A, I);
11112
+ let B = this[$I], Q = await B.getChunkBytes(A, I);
11097
11113
  if (!Q) {
11098
11114
  let E = B.chunkShape.reduce((o, s) => o * s, 1), i;
11099
11115
  if (g?.useSharedArrayBuffer) {
@@ -11148,7 +11164,7 @@ async function iE(C) {
11148
11164
  let A = C.store.arrayExtensions;
11149
11165
  return A?.length ? await us(C, ...A) : C;
11150
11166
  }
11151
- let Lg = fs();
11167
+ let Jg = fs();
11152
11168
  function fs() {
11153
11169
  let C = /* @__PURE__ */ new WeakMap();
11154
11170
  function A(I) {
@@ -11169,7 +11185,7 @@ async function Ks(C, A) {
11169
11185
  let I = await C.store.get(C.resolve(".zattrs").path, {
11170
11186
  signal: A
11171
11187
  });
11172
- return I ? PI(I) : {};
11188
+ return I ? VI(I) : {};
11173
11189
  }
11174
11190
  async function Hs(C, A = {}) {
11175
11191
  let I = "store" in C ? C : new UA(C), { signal: g } = A, B = {};
@@ -11179,33 +11195,33 @@ async function OC(C, A, I) {
11179
11195
  let { path: g } = C.resolve(".zarray"), B = await C.store.get(g, { signal: I });
11180
11196
  if (!B)
11181
11197
  throw new NI("v2 array", { path: g });
11182
- return Lg.increment(C.store, "v2"), iE(new yg(C.store, C.path, os(PI(B), A)));
11198
+ return Jg.increment(C.store, "v2"), iE(new cg(C.store, C.path, os(VI(B), A)));
11183
11199
  }
11184
11200
  async function VC(C, A, I) {
11185
11201
  let { path: g } = C.resolve(".zgroup"), B = await C.store.get(g, { signal: I });
11186
11202
  if (!B)
11187
11203
  throw new NI("v2 group", { path: g });
11188
- return Lg.increment(C.store, "v2"), new _B(C.store, C.path, ss(PI(B), A));
11204
+ return Jg.increment(C.store, "v2"), new _B(C.store, C.path, ss(VI(B), A));
11189
11205
  }
11190
11206
  async function qs(C, A) {
11191
11207
  let { store: I, path: g } = C.resolve("zarr.json"), B = await C.store.get(g, { signal: A });
11192
11208
  if (!B)
11193
11209
  throw new NI("v3 array or group", { path: g });
11194
- let Q = PI(B);
11195
- return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new yg(I, C.path, Q)) : new _B(I, C.path, Q);
11210
+ let Q = VI(B);
11211
+ return Q.node_type === "array" && (Q.fill_value = BE(Q)), Q.node_type === "array" ? iE(new cg(I, C.path, Q)) : new _B(I, C.path, Q);
11196
11212
  }
11197
11213
  async function ps(C, A = {}) {
11198
11214
  let I = "store" in C ? C : new UA(C), g = await qs(I, A.signal);
11199
- if (Lg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof yg || A.kind === "group" && g instanceof _B)
11215
+ if (Jg.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && g instanceof cg || A.kind === "group" && g instanceof _B)
11200
11216
  return g;
11201
- let B = g instanceof yg ? "array" : "group";
11217
+ let B = g instanceof cg ? "array" : "group";
11202
11218
  throw new NI(`${A.kind} at ${I.path}`, {
11203
11219
  path: I.path,
11204
11220
  found: B
11205
11221
  });
11206
11222
  }
11207
11223
  async function RA(C, A = {}) {
11208
- let I = "store" in C ? C.store : C, g = Lg.versionMax(I), B = g === "v2" ? RA.v2 : RA.v3, Q = g === "v2" ? RA.v3 : RA.v2;
11224
+ let I = "store" in C ? C.store : C, g = Jg.versionMax(I), B = g === "v2" ? RA.v2 : RA.v3, Q = g === "v2" ? RA.v3 : RA.v2;
11209
11225
  return B(C, A).catch((E) => (CE(E, NI, nA), Q(C, A)));
11210
11226
  }
11211
11227
  RA.v2 = Hs;
@@ -11237,7 +11253,7 @@ class XB {
11237
11253
  return new Uint8Array(B);
11238
11254
  }
11239
11255
  }
11240
- async function OI(C, A) {
11256
+ async function _I(C, A) {
11241
11257
  if (A === "v2")
11242
11258
  try {
11243
11259
  return RA.v2(C, { kind: "group", attrs: !0 });
@@ -11279,7 +11295,7 @@ async function bs(C) {
11279
11295
  let A;
11280
11296
  switch (C.type) {
11281
11297
  case "fetch": {
11282
- const g = new WI(C.url);
11298
+ const g = new ZI(C.url);
11283
11299
  A = new UA(g);
11284
11300
  break;
11285
11301
  }
@@ -11299,7 +11315,7 @@ async function bs(C) {
11299
11315
  return xs(I, C.zarrVersion);
11300
11316
  }
11301
11317
  function Ts(C, A, I) {
11302
- if (C.store instanceof WI)
11318
+ if (C.store instanceof ZI)
11303
11319
  return {
11304
11320
  type: "fetch",
11305
11321
  arrayPath: A,
@@ -15034,7 +15050,7 @@ function Zs(C) {
15034
15050
  }
15035
15051
  const Ps = Math.max(1, navigator.hardwareConcurrency - 2);
15036
15052
  let JA = [], Os = 0, sE = 0;
15037
- const CI = /* @__PURE__ */ new Map(), cg = /* @__PURE__ */ new Set();
15053
+ const CI = /* @__PURE__ */ new Map(), wg = /* @__PURE__ */ new Set();
15038
15054
  function tE(C) {
15039
15055
  const A = JA.find((I) => I.worker === C);
15040
15056
  return A || H.error(
@@ -15045,7 +15061,7 @@ function tE(C) {
15045
15061
  function Vs(C, A) {
15046
15062
  const { id: I, success: g } = C.data, B = CI.get(I);
15047
15063
  if (!B) {
15048
- cg.has(I) ? cg.delete(I) : H.warn(
15064
+ wg.has(I) ? wg.delete(I) : H.warn(
15049
15065
  "ZarrWorker",
15050
15066
  `Received response for unknown message ID ${I}:`,
15051
15067
  C.data
@@ -15116,10 +15132,10 @@ async function Xs(C, A, I, g) {
15116
15132
  E.worker.postMessage({
15117
15133
  id: i,
15118
15134
  type: "cancel"
15119
- }), CI.delete(i), cg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
15135
+ }), CI.delete(i), wg.add(i), E.pendingCount--, Q(new DOMException("Operation was aborted", "AbortError"));
15120
15136
  };
15121
15137
  if (g.signal.aborted) {
15122
- s(), cg.delete(i);
15138
+ s(), wg.delete(i);
15123
15139
  return;
15124
15140
  }
15125
15141
  g.signal.addEventListener("abort", s, { once: !0 }), o.abortListener = s, o.abortSignal = g.signal;
@@ -15280,25 +15296,25 @@ function gt(C, A) {
15280
15296
  x: E(I[B], B),
15281
15297
  y: E(I[Q], Q),
15282
15298
  numLods: A.length
15283
- }, o = Ig(I, "z");
15299
+ }, o = Bg(I, "z");
15284
15300
  o !== -1 && (i.z = E(I[o], o));
15285
- const s = Ig(I, "c");
15301
+ const s = Bg(I, "c");
15286
15302
  s !== -1 && (i.c = E(I[s], s));
15287
- const t = Ig(I, "t");
15303
+ const t = Bg(I, "t");
15288
15304
  return t !== -1 && (i.t = E(I[t], t)), i;
15289
15305
  }
15290
15306
  function Bt(C, A) {
15291
15307
  return C.toLowerCase() === A.toLowerCase();
15292
15308
  }
15293
15309
  function zC(C, A) {
15294
- const I = Ig(C, A);
15310
+ const I = Bg(C, A);
15295
15311
  if (I === -1)
15296
15312
  throw new Error(
15297
15313
  `Could not find "${A}" dimension in [${C.join(", ")}]`
15298
15314
  );
15299
15315
  return I;
15300
15316
  }
15301
- function Ig(C, A) {
15317
+ function Bg(C, A) {
15302
15318
  return C.findIndex((I) => Bt(I, A));
15303
15319
  }
15304
15320
  function Ct(C) {
@@ -15620,7 +15636,7 @@ class NA {
15620
15636
  }
15621
15637
  const m = Object.freeze({
15622
15638
  status: "aborted"
15623
- }), JI = (C) => ({ status: "dirty", value: C }), lA = (C) => ({ status: "valid", value: C }), AQ = (C) => C.status === "aborted", IQ = (C) => C.status === "dirty", DI = (C) => C.status === "valid", wg = (C) => typeof Promise < "u" && C instanceof Promise;
15639
+ }), YI = (C) => ({ status: "dirty", value: C }), lA = (C) => ({ status: "valid", value: C }), AQ = (C) => C.status === "aborted", IQ = (C) => C.status === "dirty", DI = (C) => C.status === "valid", Gg = (C) => typeof Promise < "u" && C instanceof Promise;
15624
15640
  var K;
15625
15641
  (function(C) {
15626
15642
  C.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, C.toString = (A) => typeof A == "string" ? A : A?.message;
@@ -15691,7 +15707,7 @@ class Z {
15691
15707
  }
15692
15708
  _parseSync(A) {
15693
15709
  const I = this._parse(A);
15694
- if (wg(I))
15710
+ if (Gg(I))
15695
15711
  throw new Error("Synchronous parse encountered promise.");
15696
15712
  return I;
15697
15713
  }
@@ -15770,7 +15786,7 @@ class Z {
15770
15786
  parent: null,
15771
15787
  data: A,
15772
15788
  parsedType: vA(A)
15773
- }, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (wg(B) ? B : Promise.resolve(B));
15789
+ }, B = this._parse({ data: A, path: g.path, parent: g }), Q = await (Gg(B) ? B : Promise.resolve(B));
15774
15790
  return gQ(g, Q);
15775
15791
  }
15776
15792
  refine(A, I) {
@@ -15816,13 +15832,13 @@ class Z {
15816
15832
  return pA.create(this);
15817
15833
  }
15818
15834
  promise() {
15819
- return Ng.create(this, this._def);
15835
+ return Rg.create(this, this._def);
15820
15836
  }
15821
15837
  or(A) {
15822
- return Fg.create([this, A], this._def);
15838
+ return Sg.create([this, A], this._def);
15823
15839
  }
15824
15840
  and(A) {
15825
- return Sg.create(this, A, this._def);
15841
+ return Ng.create(this, A, this._def);
15826
15842
  }
15827
15843
  transform(A) {
15828
15844
  return new cI({
@@ -15878,7 +15894,7 @@ class Z {
15878
15894
  }
15879
15895
  }
15880
15896
  const ot = /^c[^\s-]{8,}$/i, st = /^[0-9a-z]+$/, tt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, et = /^[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, at = /^[a-z0-9_-]{21}$/i, nt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, rt = /^[-+]?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)?)??$/, Dt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ht = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
15881
- let Og;
15897
+ let Vg;
15882
15898
  const yt = /^(?:(?: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])$/, ct = /^(?:(?: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])$/, wt = /^(([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]))$/, Gt = /^(([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])$/, Ft = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, St = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, aE = "((\\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])))", Nt = new RegExp(`^${aE}$`);
15883
15899
  function nE(C) {
15884
15900
  let A = "[0-5]\\d";
@@ -15968,7 +15984,7 @@ class PA extends Z {
15968
15984
  message: Q.message
15969
15985
  }), g.dirty());
15970
15986
  else if (Q.kind === "emoji")
15971
- Og || (Og = new RegExp(ht, "u")), Og.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15987
+ Vg || (Vg = new RegExp(ht, "u")), Vg.test(A.data) || (B = this._getOrReturnCtx(A, B), Y(B, {
15972
15988
  validation: "emoji",
15973
15989
  code: d.invalid_string,
15974
15990
  message: Q.message
@@ -16472,7 +16488,7 @@ hI.create = (C) => new hI({
16472
16488
  coerce: C?.coerce || !1,
16473
16489
  ...b(C)
16474
16490
  });
16475
- class mI extends Z {
16491
+ class bI extends Z {
16476
16492
  constructor() {
16477
16493
  super(...arguments), this.min = this.gte, this.max = this.lte;
16478
16494
  }
@@ -16528,7 +16544,7 @@ class mI extends Z {
16528
16544
  return this.setLimit("max", A, !1, K.toString(I));
16529
16545
  }
16530
16546
  setLimit(A, I, g, B) {
16531
- return new mI({
16547
+ return new bI({
16532
16548
  ...this._def,
16533
16549
  checks: [
16534
16550
  ...this._def.checks,
@@ -16542,7 +16558,7 @@ class mI extends Z {
16542
16558
  });
16543
16559
  }
16544
16560
  _addCheck(A) {
16545
- return new mI({
16561
+ return new bI({
16546
16562
  ...this._def,
16547
16563
  checks: [...this._def.checks, A]
16548
16564
  });
@@ -16599,7 +16615,7 @@ class mI extends Z {
16599
16615
  return A;
16600
16616
  }
16601
16617
  }
16602
- mI.create = (C) => new mI({
16618
+ bI.create = (C) => new bI({
16603
16619
  checks: [],
16604
16620
  typeName: x.ZodBigInt,
16605
16621
  coerce: C?.coerce ?? !1,
@@ -16623,7 +16639,7 @@ aB.create = (C) => new aB({
16623
16639
  coerce: C?.coerce || !1,
16624
16640
  ...b(C)
16625
16641
  });
16626
- class Gg extends Z {
16642
+ class Fg extends Z {
16627
16643
  _parse(A) {
16628
16644
  if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== u.date) {
16629
16645
  const Q = this._getOrReturnCtx(A);
@@ -16663,7 +16679,7 @@ class Gg extends Z {
16663
16679
  };
16664
16680
  }
16665
16681
  _addCheck(A) {
16666
- return new Gg({
16682
+ return new Fg({
16667
16683
  ...this._def,
16668
16684
  checks: [...this._def.checks, A]
16669
16685
  });
@@ -16695,7 +16711,7 @@ class Gg extends Z {
16695
16711
  return A != null ? new Date(A) : null;
16696
16712
  }
16697
16713
  }
16698
- Gg.create = (C) => new Gg({
16714
+ Fg.create = (C) => new Fg({
16699
16715
  checks: [],
16700
16716
  coerce: C?.coerce || !1,
16701
16717
  typeName: x.ZodDate,
@@ -17183,7 +17199,7 @@ eA.lazycreate = (C, A) => new eA({
17183
17199
  typeName: x.ZodObject,
17184
17200
  ...b(A)
17185
17201
  });
17186
- class Fg extends Z {
17202
+ class Sg extends Z {
17187
17203
  _parse(A) {
17188
17204
  const { ctx: I } = this._processInputParams(A), g = this._def.options;
17189
17205
  function B(Q) {
@@ -17251,7 +17267,7 @@ class Fg extends Z {
17251
17267
  return this._def.options;
17252
17268
  }
17253
17269
  }
17254
- Fg.create = (C, A) => new Fg({
17270
+ Sg.create = (C, A) => new Sg({
17255
17271
  options: C,
17256
17272
  typeName: x.ZodUnion,
17257
17273
  ...b(A)
@@ -17282,7 +17298,7 @@ function rB(C, A) {
17282
17298
  return { valid: !0, data: B };
17283
17299
  } else return I === u.date && g === u.date && +C == +A ? { valid: !0, data: C } : { valid: !1 };
17284
17300
  }
17285
- class Sg extends Z {
17301
+ class Ng extends Z {
17286
17302
  _parse(A) {
17287
17303
  const { status: I, ctx: g } = this._processInputParams(A), B = (Q, E) => {
17288
17304
  if (AQ(Q) || AQ(E))
@@ -17314,7 +17330,7 @@ class Sg extends Z {
17314
17330
  }));
17315
17331
  }
17316
17332
  }
17317
- Sg.create = (C, A, I) => new Sg({
17333
+ Ng.create = (C, A, I) => new Ng({
17318
17334
  left: C,
17319
17335
  right: A,
17320
17336
  typeName: x.ZodIntersection,
@@ -17418,7 +17434,7 @@ oQ.create = (C, A, I) => new oQ({
17418
17434
  typeName: x.ZodMap,
17419
17435
  ...b(I)
17420
17436
  });
17421
- class xI extends Z {
17437
+ class TI extends Z {
17422
17438
  _parse(A) {
17423
17439
  const { status: I, ctx: g } = this._processInputParams(A);
17424
17440
  if (g.parsedType !== u.set)
@@ -17457,13 +17473,13 @@ class xI extends Z {
17457
17473
  return g.common.async ? Promise.all(i).then((o) => E(o)) : E(i);
17458
17474
  }
17459
17475
  min(A, I) {
17460
- return new xI({
17476
+ return new TI({
17461
17477
  ...this._def,
17462
17478
  minSize: { value: A, message: K.toString(I) }
17463
17479
  });
17464
17480
  }
17465
17481
  max(A, I) {
17466
- return new xI({
17482
+ return new TI({
17467
17483
  ...this._def,
17468
17484
  maxSize: { value: A, message: K.toString(I) }
17469
17485
  });
@@ -17475,7 +17491,7 @@ class xI extends Z {
17475
17491
  return this.min(1, A);
17476
17492
  }
17477
17493
  }
17478
- xI.create = (C, A) => new xI({
17494
+ TI.create = (C, A) => new TI({
17479
17495
  valueType: C,
17480
17496
  minSize: null,
17481
17497
  maxSize: null,
@@ -17609,7 +17625,7 @@ tQ.create = (C, A) => new tQ({
17609
17625
  typeName: x.ZodNativeEnum,
17610
17626
  ...b(A)
17611
17627
  });
17612
- class Ng extends Z {
17628
+ class Rg extends Z {
17613
17629
  unwrap() {
17614
17630
  return this._def.type;
17615
17631
  }
@@ -17628,7 +17644,7 @@ class Ng extends Z {
17628
17644
  })));
17629
17645
  }
17630
17646
  }
17631
- Ng.create = (C, A) => new Ng({
17647
+ Rg.create = (C, A) => new Rg({
17632
17648
  type: C,
17633
17649
  typeName: x.ZodPromise,
17634
17650
  ...b(A)
@@ -17660,7 +17676,7 @@ class cI extends Z {
17660
17676
  path: g.path,
17661
17677
  parent: g
17662
17678
  });
17663
- return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ? JI(o.value) : o;
17679
+ return o.status === "aborted" ? m : o.status === "dirty" || I.value === "dirty" ? YI(o.value) : o;
17664
17680
  });
17665
17681
  {
17666
17682
  if (I.value === "aborted")
@@ -17670,7 +17686,7 @@ class cI extends Z {
17670
17686
  path: g.path,
17671
17687
  parent: g
17672
17688
  });
17673
- return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ? JI(i.value) : i;
17689
+ return i.status === "aborted" ? m : i.status === "dirty" || I.value === "dirty" ? YI(i.value) : i;
17674
17690
  }
17675
17691
  }
17676
17692
  if (B.type === "refinement") {
@@ -17786,7 +17802,7 @@ class yB extends Z {
17786
17802
  ...g
17787
17803
  }
17788
17804
  });
17789
- return wg(B) ? B.then((Q) => ({
17805
+ return Gg(B) ? B.then((Q) => ({
17790
17806
  status: "valid",
17791
17807
  value: Q.status === "valid" ? Q.value : this._def.catchValue({
17792
17808
  get error() {
@@ -17854,7 +17870,7 @@ class jB extends Z {
17854
17870
  path: g.path,
17855
17871
  parent: g
17856
17872
  });
17857
- return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(), JI(Q.value)) : this._def.out._parseAsync({
17873
+ return Q.status === "aborted" ? m : Q.status === "dirty" ? (I.dirty(), YI(Q.value)) : this._def.out._parseAsync({
17858
17874
  data: Q.value,
17859
17875
  path: g.path,
17860
17876
  parent: g
@@ -17887,7 +17903,7 @@ class jB extends Z {
17887
17903
  class cB extends Z {
17888
17904
  _parse(A) {
17889
17905
  const I = this._def.innerType._parse(A), g = (B) => (DI(B) && (B.value = Object.freeze(B.value)), B);
17890
- return wg(I) ? I.then((B) => g(B)) : g(I);
17906
+ return Gg(I) ? I.then((B) => g(B)) : g(I);
17891
17907
  }
17892
17908
  unwrap() {
17893
17909
  return this._def.innerType;
@@ -17905,11 +17921,11 @@ var x;
17905
17921
  const z = PA.create, T = hI.create, DE = aB.create, OA = nB.create;
17906
17922
  jA.create;
17907
17923
  const j = pA.create, q = eA.create;
17908
- Fg.create;
17909
17924
  Sg.create;
17925
+ Ng.create;
17910
17926
  QI.create;
17911
17927
  const yA = DB.create, aI = yI.create;
17912
- Ng.create;
17928
+ Rg.create;
17913
17929
  _A.create;
17914
17930
  wI.create;
17915
17931
  const Yt = q({
@@ -18349,7 +18365,7 @@ function hE(C, A) {
18349
18365
  return delete I[A], I;
18350
18366
  }
18351
18367
  async function de(C, A) {
18352
- const I = new WI(C), g = new UA(I), B = GI(A), Q = await OI(g, B);
18368
+ const I = new ZI(C), g = new UA(I), B = GI(A), Q = await _I(g, B);
18353
18369
  try {
18354
18370
  return xt(Q.attrs);
18355
18371
  } catch {
@@ -18408,7 +18424,7 @@ function Wt(C) {
18408
18424
  }
18409
18425
  }
18410
18426
  async function le(C, A, I) {
18411
- const g = C + "/" + A, B = new WI(g), Q = new UA(B), E = GI(I), i = await OI(Q, E);
18427
+ const g = C + "/" + A, B = new ZI(g), Q = new UA(B), E = GI(I), i = await _I(Q, E);
18412
18428
  try {
18413
18429
  return Wt(i.attrs);
18414
18430
  } catch {
@@ -18419,11 +18435,11 @@ ${JSON.stringify(i.attrs)}`
18419
18435
  }
18420
18436
  }
18421
18437
  async function Le(C) {
18422
- const A = GI(C.version), I = await OI(C.location, A);
18438
+ const A = GI(C.version), I = await _I(C.location, A);
18423
18439
  return $B(I.attrs).omero?.channels ?? [];
18424
18440
  }
18425
18441
  async function Je(C) {
18426
- const A = GI(C.version), I = await OI(C.location, A);
18442
+ const A = GI(C.version), I = await _I(C.location, A);
18427
18443
  return $B(I.attrs).omero?.rdefs;
18428
18444
  }
18429
18445
  function vt(C) {
@@ -18457,7 +18473,7 @@ function $B(C) {
18457
18473
  ${JSON.stringify(C)}`);
18458
18474
  }
18459
18475
  }
18460
- class YI {
18476
+ class MI {
18461
18477
  location;
18462
18478
  version;
18463
18479
  loader_;
@@ -18466,7 +18482,7 @@ class YI {
18466
18482
  }
18467
18483
  static async openLoader(A, I) {
18468
18484
  let g = GI(I);
18469
- const B = await OI(A, g), Q = $B(B.attrs), E = Q.multiscales;
18485
+ const B = await _I(A, g), Q = $B(B.attrs), E = Q.multiscales;
18470
18486
  if (E.length !== 1)
18471
18487
  throw new Error(
18472
18488
  `Exactly one multiscale image is supported. Found ${E.length} images.`
@@ -18502,8 +18518,8 @@ class YI {
18502
18518
  * @param props.version OME-Zarr version
18503
18519
  */
18504
18520
  static async fromHttp(A) {
18505
- const I = new UA(new WI(A.url)), g = await YI.openLoader(I, A.version);
18506
- return new YI({ location: I, version: A.version, loader: g });
18521
+ const I = new UA(new ZI(A.url)), g = await MI.openLoader(I, A.version);
18522
+ return new MI({ location: I, version: A.version, loader: g });
18507
18523
  }
18508
18524
  /**
18509
18525
  * Creates and opens an OmeZarrImageSource from a local filesystem directory.
@@ -18518,11 +18534,11 @@ class YI {
18518
18534
  const I = new UA(
18519
18535
  new XB(A.directory),
18520
18536
  A.path
18521
- ), g = await YI.openLoader(I, A.version);
18522
- return new YI({ location: I, version: A.version, loader: g });
18537
+ ), g = await MI.openLoader(I, A.version);
18538
+ return new MI({ location: I, version: A.version, loader: g });
18523
18539
  }
18524
18540
  }
18525
- class Jg {
18541
+ class Yg {
18526
18542
  objects_ = [];
18527
18543
  state_ = "initialized";
18528
18544
  attached_ = !1;
@@ -18675,7 +18691,7 @@ const Vt = P(0, 1, 0);
18675
18691
  class _t {
18676
18692
  dirty_ = !0;
18677
18693
  matrix_ = SA();
18678
- rotation_ = AB();
18694
+ rotation_ = IB();
18679
18695
  translation_ = QA();
18680
18696
  scale_ = P(1, 1, 1);
18681
18697
  addRotation(A) {
@@ -18688,10 +18704,10 @@ class _t {
18688
18704
  return si(this.rotation_);
18689
18705
  }
18690
18706
  addTranslation(A) {
18691
- KI(this.translation_, this.translation_, A), this.dirty_ = !0;
18707
+ HI(this.translation_, this.translation_, A), this.dirty_ = !0;
18692
18708
  }
18693
18709
  setTranslation(A) {
18694
- zg(this.translation_, A), this.dirty_ = !0;
18710
+ $g(this.translation_, A), this.dirty_ = !0;
18695
18711
  }
18696
18712
  get translation() {
18697
18713
  return bA(this.translation_);
@@ -18700,7 +18716,7 @@ class _t {
18700
18716
  $E(this.scale_, this.scale_, A), this.dirty_ = !0;
18701
18717
  }
18702
18718
  setScale(A) {
18703
- zg(this.scale_, A), this.dirty_ = !0;
18719
+ $g(this.scale_, A), this.dirty_ = !0;
18704
18720
  }
18705
18721
  targetTo(A) {
18706
18722
  NB(this.translation_, A) && (A = bA(A), A[2] += AA);
@@ -18714,7 +18730,7 @@ class _t {
18714
18730
  return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
18715
18731
  }
18716
18732
  get inverse() {
18717
- return kg(SA(), this.matrix);
18733
+ return Ug(SA(), this.matrix);
18718
18734
  }
18719
18735
  computeMatrix() {
18720
18736
  ZE(
@@ -18816,25 +18832,25 @@ class Xt extends kI {
18816
18832
  };
18817
18833
  }
18818
18834
  }
18819
- class Ye extends Jg {
18835
+ class Ye extends Yg {
18820
18836
  type = "AxesLayer";
18821
18837
  constructor(A) {
18822
18838
  super();
18823
18839
  const { length: I, width: g } = A;
18824
18840
  this.addObject(
18825
- Vg({
18841
+ _g({
18826
18842
  end: [I, 0, 0],
18827
18843
  width: g,
18828
18844
  color: [1, 0, 0]
18829
18845
  })
18830
18846
  ), this.addObject(
18831
- Vg({
18847
+ _g({
18832
18848
  end: [0, I, 0],
18833
18849
  width: g,
18834
18850
  color: [0, 1, 0]
18835
18851
  })
18836
18852
  ), this.addObject(
18837
- Vg({
18853
+ _g({
18838
18854
  end: [0, 0, I],
18839
18855
  width: g,
18840
18856
  color: [0, 0, 1]
@@ -18844,7 +18860,7 @@ class Ye extends Jg {
18844
18860
  update() {
18845
18861
  }
18846
18862
  }
18847
- function Vg(C) {
18863
+ function _g(C) {
18848
18864
  const { end: A, width: I, color: g } = C, B = new Pt([[0, 0, 0], A]);
18849
18865
  return new Xt({
18850
18866
  geometry: B,
@@ -18853,7 +18869,7 @@ function Vg(C) {
18853
18869
  });
18854
18870
  }
18855
18871
  const aQ = 32;
18856
- function bI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
18872
+ function WI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
18857
18873
  return A ??= !0, I = I === void 0 ? X.WHITE : X.from(I), B = B === void 0 ? 1 : TA(B, 0, 1), C !== null ? g = jt(g, C) : g === void 0 && (H.debug(
18858
18874
  "Channel",
18859
18875
  "No texture provided, defaulting channel contrast limits to [0, 1]."
@@ -18867,7 +18883,7 @@ function bI(C, { visible: A, color: I, contrastLimits: g, opacity: B }) {
18867
18883
  function wB(C, A) {
18868
18884
  if (A.length > aQ)
18869
18885
  throw new Error(`Maximum number of channels is ${aQ}`);
18870
- return A.map((I) => bI(C, I));
18886
+ return A.map((I) => WI(C, I));
18871
18887
  }
18872
18888
  function yE(C, A) {
18873
18889
  if (C && C.length !== A)
@@ -18930,7 +18946,7 @@ class zt extends kI {
18930
18946
  this.channels_ = wB(this.textures[0], A);
18931
18947
  }
18932
18948
  setChannelProperty(A, I, g) {
18933
- const B = bI(this.textures[0], {
18949
+ const B = WI(this.textures[0], {
18934
18950
  ...this.channels_[A],
18935
18951
  [I]: g
18936
18952
  });
@@ -18940,7 +18956,7 @@ class zt extends kI {
18940
18956
  const A = this.textures[0];
18941
18957
  if (!A)
18942
18958
  throw new Error("No texture set");
18943
- const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? bI(A, {});
18959
+ const { color: I, contrastLimits: g, opacity: B } = this.channels_[0] ?? WI(A, {});
18944
18960
  return {
18945
18961
  u_imageSampler: 0,
18946
18962
  u_color: I.rgb,
@@ -19006,7 +19022,7 @@ class AC {
19006
19022
  this.bins_.clear();
19007
19023
  }
19008
19024
  }
19009
- class GE extends Jg {
19025
+ class GE extends Yg {
19010
19026
  type = "ImageLayer";
19011
19027
  source_;
19012
19028
  sliceCoords_;
@@ -19118,13 +19134,13 @@ class GE extends Jg {
19118
19134
  set imageSourcePolicy(A) {
19119
19135
  this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
19120
19136
  A,
19121
- dg
19137
+ lg
19122
19138
  ));
19123
19139
  }
19124
19140
  getImageForChunk(A, I) {
19125
19141
  const g = this.visibleChunks_.get(A);
19126
19142
  if (g) return g;
19127
- const B = this.pool_.acquire(Rg(A));
19143
+ const B = this.pool_.acquire(kg(A));
19128
19144
  return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setChannelProps(this.getChannelPropsForChunk(A)), this.updateImageChunk(B, A), B) : this.createImage(A, I);
19129
19145
  }
19130
19146
  getChannelPropsForChunk(A) {
@@ -19205,11 +19221,11 @@ class GE extends Jg {
19205
19221
  releaseAndRemoveChunks(A) {
19206
19222
  for (const I of A) {
19207
19223
  const g = this.visibleChunks_.get(I);
19208
- g && (this.pool_.release(Rg(I), g), this.visibleChunks_.delete(I));
19224
+ g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
19209
19225
  }
19210
19226
  }
19211
19227
  }
19212
- function Rg(C) {
19228
+ function kg(C) {
19213
19229
  return [
19214
19230
  `lod${C.lod}`,
19215
19231
  `shape${C.shape.x}x${C.shape.y}x${C.shape.z}`,
@@ -19319,7 +19335,7 @@ class Ie extends kI {
19319
19335
  for (let o = 0; o < i && E.length < 4; o++) {
19320
19336
  const s = this.channelToTextureIndex_.get(o);
19321
19337
  if (s === void 0 || !this.loadedChannels_.has(o)) continue;
19322
- const t = this.textures[s], e = bI(t, this.channels_[o] || {});
19338
+ const t = this.textures[s], e = WI(t, this.channels_[o] || {});
19323
19339
  if (!e.visible) continue;
19324
19340
  const n = E.length;
19325
19341
  I[n * 3] = e.color.rgb[0], I[n * 3 + 1] = e.color.rgb[1], I[n * 3 + 2] = e.color.rgb[2], E.push(s), g[n] = -e.contrastLimits[0], B[n] = 1 / (e.contrastLimits[1] - e.contrastLimits[0]), A[n] = 1, Q[n] = e.opacity;
@@ -19358,7 +19374,7 @@ class Ie extends kI {
19358
19374
  );
19359
19375
  }
19360
19376
  setChannelProperty(A, I, g) {
19361
- const B = bI(
19377
+ const B = WI(
19362
19378
  this.getAvailableChannelTexture(A),
19363
19379
  {
19364
19380
  ...this.channels_[A],
@@ -19385,13 +19401,13 @@ function ge(C) {
19385
19401
  function Be(C, A) {
19386
19402
  const I = A.position, g = QA(), B = QA();
19387
19403
  return C.sort((Q, E) => {
19388
- KI(g, Q.boundingBox.max, Q.boundingBox.min), HI(g, g, 0.5), KI(B, E.boundingBox.max, E.boundingBox.min), HI(B, B, 0.5);
19404
+ HI(g, Q.boundingBox.max, Q.boundingBox.min), qI(g, g, 0.5), HI(B, E.boundingBox.max, E.boundingBox.min), qI(B, B, 0.5);
19389
19405
  const i = sC(I, g), o = sC(I, B);
19390
19406
  return i - o;
19391
19407
  }), C;
19392
19408
  }
19393
19409
  const Ce = 2;
19394
- class Me extends Jg {
19410
+ class Me extends Yg {
19395
19411
  type = "VolumeLayer";
19396
19412
  source_;
19397
19413
  sliceCoords_;
@@ -19425,7 +19441,7 @@ class Me extends Jg {
19425
19441
  set sourcePolicy(A) {
19426
19442
  this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
19427
19443
  A,
19428
- dg
19444
+ lg
19429
19445
  ));
19430
19446
  }
19431
19447
  setChannelProps(A) {
@@ -19657,7 +19673,7 @@ class rQ {
19657
19673
  this.lookupTable = ae(A.lookupTable), this.cycle = ne(A.cycle);
19658
19674
  }
19659
19675
  }
19660
- class FE extends Jg {
19676
+ class FE extends Yg {
19661
19677
  type = "LabelLayer";
19662
19678
  source_;
19663
19679
  sliceCoords_;
@@ -19766,7 +19782,7 @@ class FE extends Jg {
19766
19782
  set imageSourcePolicy(A) {
19767
19783
  this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
19768
19784
  A,
19769
- dg
19785
+ lg
19770
19786
  ));
19771
19787
  }
19772
19788
  // exposed for use in chunk info overlay
@@ -19800,7 +19816,7 @@ class FE extends Jg {
19800
19816
  getLabelForChunk(A, I) {
19801
19817
  const g = this.visibleChunks_.get(A);
19802
19818
  if (g) return g;
19803
- const B = this.pool_.acquire(Rg(A));
19819
+ const B = this.pool_.acquire(kg(A));
19804
19820
  return B ? (B.setTexture(0, I), B.zTexCoord = this.zTexCoordForChunk(A), B.setColorMap(this.colorMap_), B.setSelectedValue(this.selectedValue_), this.updateLabelChunk(B, A), B) : this.createLabel(A, I);
19805
19821
  }
19806
19822
  createLabel(A, I) {
@@ -19829,7 +19845,7 @@ class FE extends Jg {
19829
19845
  releaseAndRemoveChunks(A) {
19830
19846
  for (const I of A) {
19831
19847
  const g = this.visibleChunks_.get(I);
19832
- g && (this.pool_.release(Rg(I), g), this.visibleChunks_.delete(I));
19848
+ g && (this.pool_.release(kg(I), g), this.visibleChunks_.delete(I));
19833
19849
  }
19834
19850
  }
19835
19851
  }
@@ -19897,9 +19913,9 @@ class ue extends kI {
19897
19913
  return "Points";
19898
19914
  }
19899
19915
  }
19900
- let _g;
19916
+ let Xg;
19901
19917
  function De() {
19902
- return _g || (_g = he()), _g;
19918
+ return Xg || (Xg = he()), Xg;
19903
19919
  }
19904
19920
  function he() {
19905
19921
  const C = (s) => {
@@ -19943,7 +19959,7 @@ class DQ {
19943
19959
  );
19944
19960
  }
19945
19961
  }
19946
- const Xg = -1, hQ = 0, ye = 1, yQ = 9e-3, ce = 1e-3, we = 9e-4, Ge = 0.5, Fe = 60;
19962
+ const jg = -1, hQ = 0, ye = 1, yQ = 9e-3, ce = 1e-3, we = 9e-4, Ge = 0.5, Fe = 60;
19947
19963
  class fe {
19948
19964
  camera_;
19949
19965
  orbitVelocity_ = new DQ(0, 0, 0);
@@ -19951,13 +19967,13 @@ class fe {
19951
19967
  currPos_;
19952
19968
  currCenter_ = QA();
19953
19969
  dampingFactor_;
19954
- currMouseButton_ = Xg;
19970
+ currMouseButton_ = jg;
19955
19971
  constructor(A, I) {
19956
19972
  this.camera_ = A, this.currPos_ = new DQ(
19957
19973
  I?.radius ?? 1,
19958
19974
  I?.yaw ?? 0,
19959
19975
  I?.pitch ?? 0
19960
- ), I?.target && zg(this.currCenter_, I.target), this.dampingFactor_ = TA(
19976
+ ), I?.target && $g(this.currCenter_, I.target), this.dampingFactor_ = TA(
19961
19977
  I?.dampingFactor ?? Ge,
19962
19978
  0,
19963
19979
  1
@@ -19986,18 +20002,18 @@ class fe {
19986
20002
  onUpdate(A) {
19987
20003
  if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && NB(this.panVelocity_, P(0, 0, 0)))
19988
20004
  return;
19989
- this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, KI(this.currCenter_, this.currCenter_, this.panVelocity_);
20005
+ this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, HI(this.currCenter_, this.currCenter_, this.panVelocity_);
19990
20006
  const I = Math.PI / 2 - AA;
19991
20007
  this.currPos_.theta = TA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
19992
20008
  const g = Math.pow(1 - this.dampingFactor_, A * Fe);
19993
- this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, HI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
20009
+ this.orbitVelocity_.phi *= g, this.orbitVelocity_.theta *= g, this.orbitVelocity_.radius *= g, qI(this.panVelocity_, this.panVelocity_, g), this.cutoffLowVelocity();
19994
20010
  }
19995
20011
  onPointerDown(A) {
19996
20012
  const I = A.event;
19997
20013
  this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
19998
20014
  }
19999
20015
  onPointerMove(A) {
20000
- if (this.currMouseButton_ == Xg) return;
20016
+ if (this.currMouseButton_ == jg) return;
20001
20017
  const I = A.event, g = I.movementX ?? 0, B = I.movementY ?? 0, Q = this.currMouseButton_ === hQ && !I.shiftKey, E = this.currMouseButton_ === hQ && I.shiftKey || this.currMouseButton_ === ye;
20002
20018
  Q && this.orbit(g, B), E && this.pan(g, B);
20003
20019
  }
@@ -20008,7 +20024,7 @@ class fe {
20008
20024
  this.zoom(g);
20009
20025
  }
20010
20026
  onPointerEnd(A) {
20011
- this.currMouseButton_ = Xg;
20027
+ this.currMouseButton_ = jg;
20012
20028
  const I = A.event;
20013
20029
  I.target?.releasePointerCapture?.(I.pointerId);
20014
20030
  }
@@ -20017,13 +20033,13 @@ class fe {
20017
20033
  }
20018
20034
  pan(A, I) {
20019
20035
  const g = this.currPos_.radius * ce, B = QA();
20020
- oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I), HI(B, B, g), $g(this.panVelocity_, this.panVelocity_, B);
20036
+ oC(B, B, this.camera_.right, A), oC(B, B, this.camera_.up, I), qI(B, B, g), AB(this.panVelocity_, this.panVelocity_, B);
20021
20037
  }
20022
20038
  zoom(A) {
20023
20039
  this.orbitVelocity_.radius += A * we;
20024
20040
  }
20025
20041
  updateCamera() {
20026
- const A = KI(QA(), this.currCenter_, this.currPos_.toVec3());
20042
+ const A = HI(QA(), this.currCenter_, this.currPos_.toVec3());
20027
20043
  this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
20028
20044
  }
20029
20045
  cutoffLowVelocity() {
@@ -20046,7 +20062,7 @@ class oI {
20046
20062
  const A = FB(this.normal);
20047
20063
  if (A > 0) {
20048
20064
  const I = 1 / A;
20049
- HI(this.normal, this.normal, I), this.signedDistance *= I;
20065
+ qI(this.normal, this.normal, I), this.signedDistance *= I;
20050
20066
  }
20051
20067
  }
20052
20068
  }
@@ -20130,16 +20146,16 @@ class NE extends kI {
20130
20146
  return this.transform.translation;
20131
20147
  }
20132
20148
  clipToWorld(A) {
20133
- const I = Bg(A[0], A[1], A[2], 1), g = kg(
20149
+ const I = Qg(A[0], A[1], A[2], 1), g = Ug(
20134
20150
  SA(),
20135
20151
  this.projectionMatrix_
20136
- ), B = qI(
20152
+ ), B = pI(
20137
20153
  nI(),
20138
20154
  I,
20139
20155
  g
20140
20156
  );
20141
20157
  Qi(B, B, 1 / B[3]);
20142
- const Q = qI(
20158
+ const Q = pI(
20143
20159
  nI(),
20144
20160
  B,
20145
20161
  this.transform.matrix
@@ -20188,9 +20204,9 @@ class Ke extends NE {
20188
20204
  this.transform.addScale([I, I, 1]);
20189
20205
  }
20190
20206
  getWorldViewRect() {
20191
- let A = Bg(-1, -1, 0, 1), I = Bg(1, 1, 0, 1);
20192
- const g = kg(SA(), this.getViewProjection());
20193
- return A = qI(nI(), A, g), I = qI(nI(), I, g), new GA(
20207
+ let A = Qg(-1, -1, 0, 1), I = Qg(1, 1, 0, 1);
20208
+ const g = Ug(SA(), this.getViewProjection());
20209
+ return A = pI(nI(), A, g), I = pI(nI(), I, g), new GA(
20194
20210
  aA(A[0], A[1]),
20195
20211
  aA(I[0], I[1])
20196
20212
  );
@@ -20245,7 +20261,7 @@ class He {
20245
20261
  I.preventDefault();
20246
20262
  const g = bA(A.worldPos), B = I.deltaY < 0 ? 1.05 : 0.95;
20247
20263
  this.camera_.zoom(B);
20248
- const Q = this.camera_.clipToWorld(A.clipPos), E = $g(QA(), g, Q);
20264
+ const Q = this.camera_.clipToWorld(A.clipPos), E = AB(QA(), g, Q);
20249
20265
  this.camera_.pan(E);
20250
20266
  }
20251
20267
  onPointerDown(A) {
@@ -20254,7 +20270,7 @@ class He {
20254
20270
  }
20255
20271
  onPointerMove(A) {
20256
20272
  if (!this.dragActive_ || !A.worldPos) return;
20257
- const I = $g(QA(), this.dragStart_, A.worldPos);
20273
+ const I = AB(QA(), this.dragStart_, A.worldPos);
20258
20274
  this.camera_.pan(I);
20259
20275
  }
20260
20276
  onPointerEnd(A) {
@@ -20262,7 +20278,7 @@ class He {
20262
20278
  !this.dragActive_ || I.button !== GQ || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
20263
20279
  }
20264
20280
  }
20265
- const Ne = 60, Re = 1.77, gg = 0.1, jg = 180 - gg;
20281
+ const Ne = 60, Re = 1.77, Cg = 0.1, zg = 180 - Cg;
20266
20282
  class qe extends NE {
20267
20283
  fov_;
20268
20284
  aspectRatio_;
@@ -20274,9 +20290,9 @@ class qe extends NE {
20274
20290
  far: Q = 1e4,
20275
20291
  position: E = P(0, 0, 0)
20276
20292
  } = A;
20277
- if (I < gg || I > jg)
20293
+ if (I < Cg || I > zg)
20278
20294
  throw new Error(
20279
- `Invalid field of view: ${I}, must be in [${gg}, ${jg}] degrees`
20295
+ `Invalid field of view: ${I}, must be in [${Cg}, ${zg}] degrees`
20280
20296
  );
20281
20297
  super(), this.fov_ = I, this.aspectRatio_ = g, this.near_ = B, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
20282
20298
  }
@@ -20292,7 +20308,7 @@ class qe extends NE {
20292
20308
  zoom(A) {
20293
20309
  if (A <= 0)
20294
20310
  throw new Error(`Invalid zoom factor: ${A}`);
20295
- this.fov_ = Math.max(gg, Math.min(jg, this.fov_ / A)), this.updateProjectionMatrix();
20311
+ this.fov_ = Math.max(Cg, Math.min(zg, this.fov_ / A)), this.updateProjectionMatrix();
20296
20312
  }
20297
20313
  updateProjectionMatrix() {
20298
20314
  OE(
@@ -20406,8 +20422,8 @@ export {
20406
20422
  rQ as LabelColorMap,
20407
20423
  te as LabelImageRenderable,
20408
20424
  FE as LabelLayer,
20409
- Jg as Layer,
20410
- YI as OmeZarrImageSource,
20425
+ Yg as Layer,
20426
+ MI as OmeZarrImageSource,
20411
20427
  fe as OrbitControls,
20412
20428
  Ke as OrthographicCamera,
20413
20429
  He as PanZoomControls,