@idetik/core 0.7.7 → 0.7.8

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
@@ -592,25 +592,25 @@ function sC() {
592
592
  }
593
593
  return "development";
594
594
  }
595
- class c {
595
+ class U {
596
596
  static logLevel_ = sC() === "production" ? "warn" : "debug";
597
597
  static setLogLevel(A) {
598
- c.logLevel_ = A;
598
+ U.logLevel_ = A;
599
599
  }
600
600
  static debug(A, I, ...B) {
601
- c.log("debug", A, I, ...B);
601
+ U.log("debug", A, I, ...B);
602
602
  }
603
603
  static info(A, I, ...B) {
604
- c.log("info", A, I, ...B);
604
+ U.log("info", A, I, ...B);
605
605
  }
606
606
  static warn(A, I, ...B) {
607
- c.log("warn", A, I, ...B);
607
+ U.log("warn", A, I, ...B);
608
608
  }
609
609
  static error(A, I, ...B) {
610
- c.log("error", A, I, ...B);
610
+ U.log("error", A, I, ...B);
611
611
  }
612
612
  static log(A, I, B, ...C) {
613
- if (pg[A] < pg[c.logLevel_]) return;
613
+ if (pg[A] < pg[U.logLevel_]) return;
614
614
  const Q = (/* @__PURE__ */ new Date()).toISOString(), E = DC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
615
615
  switch (A) {
616
616
  case "debug":
@@ -712,7 +712,7 @@ class hC {
712
712
  `Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
713
713
  );
714
714
  const C = this.gl_.getUniformLocation(this.program_, B.name);
715
- C && (this.uniformInfo_.set(B.name, [C, B]), c.debug(
715
+ C && (this.uniformInfo_.set(B.name, [C, B]), U.debug(
716
716
  "WebGLShaderProgram",
717
717
  "Uniform found:",
718
718
  B.name,
@@ -1102,19 +1102,19 @@ function AA() {
1102
1102
  return W != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0), g[0] = 1, g[5] = 1, g[10] = 1, g[15] = 1, g;
1103
1103
  }
1104
1104
  function qI(g, A) {
1105
- var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], h = A[9], t = A[10], y = A[11], w = A[12], F = A[13], S = A[14], G = A[15], U = I * i - B * E, N = I * o - C * E, d = I * a - Q * E, Y = B * o - C * i, J = B * a - Q * i, x = C * a - Q * o, v = D * F - h * w, X = D * S - t * w, O = D * G - y * w, j = h * S - t * F, nA = h * G - y * F, FA = t * G - y * S, m = U * FA - N * nA + d * j + Y * O - J * X + x * v;
1106
- return m ? (m = 1 / m, g[0] = (i * FA - o * nA + a * j) * m, g[1] = (C * nA - B * FA - Q * j) * m, g[2] = (F * x - S * J + G * Y) * m, g[3] = (t * J - h * x - y * Y) * m, g[4] = (o * O - E * FA - a * X) * m, g[5] = (I * FA - C * O + Q * X) * m, g[6] = (S * d - w * x - G * N) * m, g[7] = (D * x - t * d + y * N) * m, g[8] = (E * nA - i * O + a * v) * m, g[9] = (B * O - I * nA - Q * v) * m, g[10] = (w * J - F * d + G * U) * m, g[11] = (h * d - D * J - y * U) * m, g[12] = (i * X - E * j - o * v) * m, g[13] = (I * j - B * X + C * v) * m, g[14] = (F * N - w * Y - S * U) * m, g[15] = (D * Y - h * N + t * U) * m, g) : null;
1105
+ var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], h = A[9], t = A[10], y = A[11], w = A[12], n = A[13], S = A[14], G = A[15], c = I * i - B * E, N = I * o - C * E, d = I * a - Q * E, Y = B * o - C * i, J = B * a - Q * i, x = C * a - Q * o, v = D * n - h * w, X = D * S - t * w, O = D * G - y * w, j = h * S - t * n, nA = h * G - y * n, FA = t * G - y * S, m = c * FA - N * nA + d * j + Y * O - J * X + x * v;
1106
+ return m ? (m = 1 / m, g[0] = (i * FA - o * nA + a * j) * m, g[1] = (C * nA - B * FA - Q * j) * m, g[2] = (n * x - S * J + G * Y) * m, g[3] = (t * J - h * x - y * Y) * m, g[4] = (o * O - E * FA - a * X) * m, g[5] = (I * FA - C * O + Q * X) * m, g[6] = (S * d - w * x - G * N) * m, g[7] = (D * x - t * d + y * N) * m, g[8] = (E * nA - i * O + a * v) * m, g[9] = (B * O - I * nA - Q * v) * m, g[10] = (w * J - n * d + G * c) * m, g[11] = (h * d - D * J - y * c) * m, g[12] = (i * X - E * j - o * v) * m, g[13] = (I * j - B * X + C * v) * m, g[14] = (n * N - w * Y - S * c) * m, g[15] = (D * Y - h * N + t * c) * m, g) : null;
1107
1107
  }
1108
1108
  function FI(g, A, I) {
1109
- var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], h = A[8], t = A[9], y = A[10], w = A[11], F = A[12], S = A[13], G = A[14], U = A[15], N = I[0], d = I[1], Y = I[2], J = I[3];
1110
- return g[0] = N * B + d * i + Y * h + J * F, g[1] = N * C + d * o + Y * t + J * S, g[2] = N * Q + d * a + Y * y + J * G, g[3] = N * E + d * D + Y * w + J * U, N = I[4], d = I[5], Y = I[6], J = I[7], g[4] = N * B + d * i + Y * h + J * F, g[5] = N * C + d * o + Y * t + J * S, g[6] = N * Q + d * a + Y * y + J * G, g[7] = N * E + d * D + Y * w + J * U, N = I[8], d = I[9], Y = I[10], J = I[11], g[8] = N * B + d * i + Y * h + J * F, g[9] = N * C + d * o + Y * t + J * S, g[10] = N * Q + d * a + Y * y + J * G, g[11] = N * E + d * D + Y * w + J * U, N = I[12], d = I[13], Y = I[14], J = I[15], g[12] = N * B + d * i + Y * h + J * F, g[13] = N * C + d * o + Y * t + J * S, g[14] = N * Q + d * a + Y * y + J * G, g[15] = N * E + d * D + Y * w + J * U, g;
1109
+ var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], h = A[8], t = A[9], y = A[10], w = A[11], n = A[12], S = A[13], G = A[14], c = A[15], N = I[0], d = I[1], Y = I[2], J = I[3];
1110
+ return g[0] = N * B + d * i + Y * h + J * n, g[1] = N * C + d * o + Y * t + J * S, g[2] = N * Q + d * a + Y * y + J * G, g[3] = N * E + d * D + Y * w + J * c, N = I[4], d = I[5], Y = I[6], J = I[7], g[4] = N * B + d * i + Y * h + J * n, g[5] = N * C + d * o + Y * t + J * S, g[6] = N * Q + d * a + Y * y + J * G, g[7] = N * E + d * D + Y * w + J * c, N = I[8], d = I[9], Y = I[10], J = I[11], g[8] = N * B + d * i + Y * h + J * n, g[9] = N * C + d * o + Y * t + J * S, g[10] = N * Q + d * a + Y * y + J * G, g[11] = N * E + d * D + Y * w + J * c, N = I[12], d = I[13], Y = I[14], J = I[15], g[12] = N * B + d * i + Y * h + J * n, g[13] = N * C + d * o + Y * t + J * S, g[14] = N * Q + d * a + Y * y + J * G, g[15] = N * E + d * D + Y * w + J * c, g;
1111
1111
  }
1112
1112
  function FC(g, A) {
1113
1113
  return g[0] = A[0], g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = A[1], g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = A[2], g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0, g[15] = 1, g;
1114
1114
  }
1115
1115
  function rC(g, A, I, B) {
1116
- var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, D = E + E, h = C * o, t = C * a, y = C * D, w = Q * a, F = Q * D, S = E * D, G = i * o, U = i * a, N = i * D, d = B[0], Y = B[1], J = B[2];
1117
- return g[0] = (1 - (w + S)) * d, g[1] = (t + N) * d, g[2] = (y - U) * d, g[3] = 0, g[4] = (t - N) * Y, g[5] = (1 - (h + S)) * Y, g[6] = (F + G) * Y, g[7] = 0, g[8] = (y + U) * J, g[9] = (F - G) * J, g[10] = (1 - (h + w)) * J, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
1116
+ var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, D = E + E, h = C * o, t = C * a, y = C * D, w = Q * a, n = Q * D, S = E * D, G = i * o, c = i * a, N = i * D, d = B[0], Y = B[1], J = B[2];
1117
+ return g[0] = (1 - (w + S)) * d, g[1] = (t + N) * d, g[2] = (y - c) * d, g[3] = 0, g[4] = (t - N) * Y, g[5] = (1 - (h + S)) * Y, g[6] = (n + G) * Y, g[7] = 0, g[8] = (y + c) * J, g[9] = (n - G) * J, g[10] = (1 - (h + w)) * J, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
1118
1118
  }
1119
1119
  function SC(g, A, I, B, C) {
1120
1120
  var Q = 1 / Math.tan(A / 2), E;
@@ -1129,8 +1129,8 @@ var cC = NC;
1129
1129
  function UC(g, A, I, B) {
1130
1130
  var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], D = C - I[0], h = Q - I[1], t = E - I[2], y = D * D + h * h + t * t;
1131
1131
  y > 0 && (y = 1 / Math.sqrt(y), D *= y, h *= y, t *= y);
1132
- var w = o * t - a * h, F = a * D - i * t, S = i * h - o * D;
1133
- return y = w * w + F * F + S * S, y > 0 && (y = 1 / Math.sqrt(y), w *= y, F *= y, S *= y), g[0] = w, g[1] = F, g[2] = S, g[3] = 0, g[4] = h * S - t * F, g[5] = t * w - D * S, g[6] = D * F - h * w, g[7] = 0, g[8] = D, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
1132
+ var w = o * t - a * h, n = a * D - i * t, S = i * h - o * D;
1133
+ return y = w * w + n * n + S * S, y > 0 && (y = 1 / Math.sqrt(y), w *= y, n *= y, S *= y), g[0] = w, g[1] = n, g[2] = S, g[3] = 0, g[4] = h * S - t * n, g[5] = t * w - D * S, g[6] = D * n - h * w, g[7] = 0, g[8] = D, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
1134
1134
  }
1135
1135
  function f() {
1136
1136
  var g = new W(3);
@@ -1259,8 +1259,8 @@ function pC(g, A, I) {
1259
1259
  return g[0] = B * D + E * i + C * a - Q * o, g[1] = C * D + E * o + Q * i - B * a, g[2] = Q * D + E * a + B * o - C * i, g[3] = E * D - B * i - C * o - Q * a, g;
1260
1260
  }
1261
1261
  function OI(g, A, I, B) {
1262
- var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], h = I[3], t, y, w, F, S;
1263
- return y = C * o + Q * a + E * D + i * h, y < 0 && (y = -y, o = -o, a = -a, D = -D, h = -h), 1 - y > hA ? (t = Math.acos(y), w = Math.sin(t), F = Math.sin((1 - B) * t) / w, S = Math.sin(B * t) / w) : (F = 1 - B, S = B), g[0] = F * C + S * o, g[1] = F * Q + S * a, g[2] = F * E + S * D, g[3] = F * i + S * h, g;
1262
+ var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], h = I[3], t, y, w, n, S;
1263
+ return y = C * o + Q * a + E * D + i * h, y < 0 && (y = -y, o = -o, a = -a, D = -D, h = -h), 1 - y > hA ? (t = Math.acos(y), w = Math.sin(t), n = Math.sin((1 - B) * t) / w, S = Math.sin(B * t) / w) : (n = 1 - B, S = B), g[0] = n * C + S * o, g[1] = n * Q + S * a, g[2] = n * E + S * D, g[3] = n * i + S * h, g;
1264
1264
  }
1265
1265
  function cB(g, A) {
1266
1266
  var I = A[0] + A[4] + A[8], B;
@@ -1609,7 +1609,7 @@ class PC {
1609
1609
  getFilter(A, I) {
1610
1610
  const { dataFormat: B, dataType: C } = I;
1611
1611
  if (B === "scalar" && C !== "float" && A !== "nearest")
1612
- return c.warn(
1612
+ return U.warn(
1613
1613
  "WebGLTexture",
1614
1614
  "Integer values are not filterable. Using gl.NEAREST instead."
1615
1615
  ), this.gl_.NEAREST;
@@ -1892,7 +1892,7 @@ class vC extends IC {
1892
1892
  });
1893
1893
  if (!I)
1894
1894
  throw new Error("Failed to initialize WebGL2 context");
1895
- this.gl_ = I, c.info(
1895
+ this.gl_ = I, U.info(
1896
1896
  "WebGLRenderer",
1897
1897
  `WebGL version ${I.getParameter(I.VERSION)}`
1898
1898
  ), this.programs_ = new eC(I), this.bindings_ = new ZC(I), this.textures_ = new PC(I), this.state_ = new OC(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
@@ -1907,7 +1907,7 @@ class vC extends IC {
1907
1907
  else if (_.intersects(I, B))
1908
1908
  this.state_.setScissor(I), this.state_.setScissorTest(!0);
1909
1909
  else {
1910
- c.warn(
1910
+ U.warn(
1911
1911
  "WebGLRenderer",
1912
1912
  `Viewport ${A.id} is entirely outside canvas bounds, skipping render`
1913
1913
  );
@@ -1986,10 +1986,10 @@ class vC extends IC {
1986
1986
  C.setUniform(w, B.opacity);
1987
1987
  break;
1988
1988
  case "CameraPositionModel": {
1989
- const F = qI(AA(), E), S = RI(0, 0, 0, 1), G = VA(
1989
+ const n = qI(AA(), E), S = RI(0, 0, 0, 1), G = VA(
1990
1990
  HA(),
1991
1991
  S,
1992
- F
1992
+ n
1993
1993
  );
1994
1994
  C.setUniform(
1995
1995
  w,
@@ -2049,11 +2049,11 @@ class jC {
2049
2049
  cancel(A) {
2050
2050
  const I = this.pending_.findIndex((C) => C.chunk === A);
2051
2051
  if (I >= 0) {
2052
- this.pending_.splice(I, 1), c.debug("ChunkQueue", "Cancelled pending request");
2052
+ this.pending_.splice(I, 1), U.debug("ChunkQueue", "Cancelled pending request");
2053
2053
  return;
2054
2054
  }
2055
2055
  const B = this.running_.get(A);
2056
- B && (B.controller.abort(), c.debug("ChunkQueue", "Cancelled fetch request"));
2056
+ B && (B.controller.abort(), U.debug("ChunkQueue", "Cancelled fetch request"));
2057
2057
  }
2058
2058
  get pendingCount() {
2059
2059
  return this.pending_.length;
@@ -2077,7 +2077,7 @@ class jC {
2077
2077
  I.state === "loading" && (I.state = "loaded");
2078
2078
  },
2079
2079
  (E) => {
2080
- I.state === "loading" && (I.state = "unloaded"), E.name !== "AbortError" && c.error("ChunkQueue", String(E));
2080
+ I.state === "loading" && (I.state = "unloaded"), E.name !== "AbortError" && U.error("ChunkQueue", String(E));
2081
2081
  }
2082
2082
  ).finally(() => {
2083
2083
  this.running_.delete(I), this.pump();
@@ -2098,7 +2098,7 @@ function Pg(g) {
2098
2098
  if (Zg.some((I) => g instanceof I))
2099
2099
  return !0;
2100
2100
  const A = Zg.map((I) => I.name);
2101
- return c.debug(
2101
+ return U.debug(
2102
2102
  "Chunk",
2103
2103
  `Unsupported chunk data type: ${g}. Supported data types: ${A}`
2104
2104
  ), !1;
@@ -2125,7 +2125,7 @@ class _C {
2125
2125
  chunkViewStates_ = /* @__PURE__ */ new Map();
2126
2126
  isDisposed_ = !1;
2127
2127
  constructor(A, I) {
2128
- this.store_ = A, this.policy_ = I, c.info(
2128
+ this.store_ = A, this.policy_ = I, U.info(
2129
2129
  "ChunkStoreView",
2130
2130
  "Using image source policy:",
2131
2131
  this.policy_.profile
@@ -2162,20 +2162,52 @@ class _C {
2162
2162
  );
2163
2163
  return [...C, ...E];
2164
2164
  }
2165
- // TODO: Eventually unify visibility calculations using the camera frustum for both
2166
- // orthographic (2D slices) and perspective (volume rendering) cameras. This would
2167
- // replace both updateChunkStates and updateChunkStatesForVolume with a single method
2168
- // that performs frustum culling based on the camera type.
2169
- updateChunkStatesForVolume(A) {
2165
+ updateChunksForImage(A, I) {
2166
+ const B = I.camera;
2167
+ if (B.type !== "OrthographicCamera")
2168
+ throw new Error(
2169
+ "ChunkStoreView currently supports only orthographic cameras. Update the implementation before using a perspective camera."
2170
+ );
2171
+ const Q = B.getWorldViewRect(), E = Math.abs(Q.max[0] - Q.min[0]), i = I.element, o = I.getBoxRelativeTo(i).toRect().width, a = E / o, D = Math.log2(1 / a);
2172
+ this.setLOD(D);
2173
+ const h = this.getZBounds(A);
2174
+ if (!(this.policyChanged_ || this.viewBounds2DChanged(Q) || this.zBoundsChanged(h) || this.lastTCoord_ !== A.t)) return;
2175
+ const y = this.store_.getTimeIndex(A);
2176
+ if (this.store_.getChunksAtTime(y).length === 0) {
2177
+ U.warn(
2178
+ "ChunkStoreView",
2179
+ "updateChunkViewStates called with no chunks initialized"
2180
+ ), this.chunkViewStates_.clear();
2181
+ return;
2182
+ }
2183
+ const n = UB();
2184
+ xC(n, Q.min, Q.max, 0.5);
2185
+ const [S, G] = this.getZBounds(A), c = new SA(
2186
+ q(Q.min[0], Q.min[1], S),
2187
+ q(Q.max[0], Q.max[1], G)
2188
+ );
2189
+ this.chunkViewStates_.forEach(vI), this.updateChunksAtTimeIndex(
2190
+ y,
2191
+ A,
2192
+ c,
2193
+ n
2194
+ ), A.t !== void 0 && this.markTimeChunksForPrefetch(
2195
+ y,
2196
+ A,
2197
+ c,
2198
+ n
2199
+ ), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t;
2200
+ }
2201
+ updateChunksForVolume(A) {
2170
2202
  const I = this.store_.getTimeIndex(A), B = this.store_.getChunksAtTime(I);
2171
2203
  if (B.length === 0) {
2172
- c.warn(
2204
+ U.warn(
2173
2205
  "ChunkStoreView",
2174
- "updateChunkStatesForVolume called with no chunks initialized"
2206
+ "updateChunksForVolume called with no chunks initialized"
2175
2207
  ), this.chunkViewStates_.clear();
2176
2208
  return;
2177
2209
  }
2178
- this.setLOD(0), this.chunkViewStates_.forEach(vI);
2210
+ this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(vI);
2179
2211
  for (const C of B) {
2180
2212
  if (C.lod !== this.currentLOD_ || !(A.c === void 0 || A.c === C.chunkIndex.c)) continue;
2181
2213
  const E = this.policy_.priorityMap.visibleCurrent;
@@ -2189,17 +2221,6 @@ class _C {
2189
2221
  }
2190
2222
  this.lastTCoord_ = A.t;
2191
2223
  }
2192
- updateChunkStates(A, I) {
2193
- const B = I.camera;
2194
- if (B.type !== "OrthographicCamera")
2195
- throw new Error(
2196
- "ChunkStoreView currently supports only orthographic cameras. Update the implementation before using a perspective camera."
2197
- );
2198
- const Q = B.getWorldViewRect(), E = Math.abs(Q.max[0] - Q.min[0]), i = I.element, o = I.getBoxRelativeTo(i).toRect().width, a = E / o, D = Math.log2(1 / a);
2199
- this.setLOD(D);
2200
- const h = this.getZBounds(A);
2201
- (this.policyChanged_ || this.viewBounds2DChanged(Q) || this.zBoundsChanged(h) || this.lastTCoord_ !== A.t) && (this.updateChunkViewStates(A, Q), this.policyChanged_ = !1, this.lastViewBounds2D_ = Q.clone(), this.lastZBounds_ = h, this.lastTCoord_ = A.t);
2202
- }
2203
2224
  allVisibleFallbackLODLoaded(A) {
2204
2225
  const I = this.store_.getTimeIndex(A), B = this.fallbackLOD(), C = this.store_.getChunksAtTime(I).filter((Q) => Q.visible && Q.lod === B);
2205
2226
  return C.length > 0 && C.every((Q) => Q.state === "loaded");
@@ -2217,7 +2238,7 @@ class _C {
2217
2238
  setImageSourcePolicy(A, I) {
2218
2239
  if (I !== hg)
2219
2240
  throw new Error("Unauthorized policy mutation");
2220
- this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, c.info(
2241
+ this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, U.info(
2221
2242
  "ChunkStoreView",
2222
2243
  "Using image source policy:",
2223
2244
  this.policy_.profile
@@ -2233,52 +2254,25 @@ class _C {
2233
2254
  ), D = vA(E, o, a);
2234
2255
  D !== this.currentLOD_ && (this.currentLOD_ = D);
2235
2256
  }
2236
- updateChunkViewStates(A, I) {
2237
- const B = this.store_.getTimeIndex(A);
2238
- if (this.store_.getChunksAtTime(B).length === 0) {
2239
- c.warn(
2240
- "ChunkStoreView",
2241
- "updateChunkViewStates called with no chunks initialized"
2242
- ), this.chunkViewStates_.clear();
2243
- return;
2244
- }
2245
- const Q = UB();
2246
- xC(Q, I.min, I.max, 0.5);
2247
- const [E, i] = this.getZBounds(A), o = new SA(
2248
- q(I.min[0], I.min[1], E),
2249
- q(I.max[0], I.max[1], i)
2250
- );
2251
- this.chunkViewStates_.forEach(vI), this.updateChunksAtTimeIndex(
2252
- B,
2253
- A,
2254
- o,
2255
- Q
2256
- ), A.t !== void 0 && this.markTimeChunksForPrefetch(
2257
- B,
2258
- A,
2259
- o,
2260
- Q
2261
- );
2262
- }
2263
2257
  isChunkChannelInSlice(A, I) {
2264
2258
  return I.c === void 0 || I.c === A.chunkIndex.c;
2265
2259
  }
2266
2260
  updateChunksAtTimeIndex(A, I, B, C) {
2267
2261
  const Q = this.getPaddedBounds(B), E = this.store_.getChunksAtTime(A), i = this.fallbackLOD();
2268
2262
  for (const o of E) {
2269
- const a = this.isChunkWithinBounds(o, B), D = this.isChunkChannelInSlice(o, I), h = o.lod === this.currentLOD_, t = o.lod === i, y = !a && D && h && this.isChunkWithinBounds(o, Q), w = a && D, F = this.computePriority(
2263
+ const a = this.isChunkWithinBounds(o, B), D = this.isChunkChannelInSlice(o, I), h = o.lod === this.currentLOD_, t = o.lod === i, y = !a && D && h && this.isChunkWithinBounds(o, Q), w = a && D, n = this.computePriority(
2270
2264
  t,
2271
2265
  h,
2272
2266
  a,
2273
2267
  y,
2274
2268
  D
2275
2269
  );
2276
- if (F !== null) {
2270
+ if (n !== null) {
2277
2271
  const S = this.squareDistance2D(o, C);
2278
2272
  this.chunkViewStates_.set(o, {
2279
2273
  visible: w,
2280
2274
  prefetch: y,
2281
- priority: F,
2275
+ priority: n,
2282
2276
  orderKey: S
2283
2277
  });
2284
2278
  }
@@ -2390,13 +2384,13 @@ class $C {
2390
2384
  for (let C = 0; C < I; ++C) {
2391
2385
  const Q = this.chunks_[C];
2392
2386
  for (let E = 0; E < this.dimensions_.numLods; ++E) {
2393
- const i = this.dimensions_.x.lods[E], o = this.dimensions_.y.lods[E], a = this.dimensions_.z?.lods[E], D = i.chunkSize, h = o.chunkSize, t = a?.chunkSize ?? 1, y = Math.ceil(i.size / D), w = Math.ceil(o.size / h), F = Math.ceil((a?.size ?? 1) / t);
2387
+ const i = this.dimensions_.x.lods[E], o = this.dimensions_.y.lods[E], a = this.dimensions_.z?.lods[E], D = i.chunkSize, h = o.chunkSize, t = a?.chunkSize ?? 1, y = Math.ceil(i.size / D), w = Math.ceil(o.size / h), n = Math.ceil((a?.size ?? 1) / t);
2394
2388
  for (let S = 0; S < B; ++S)
2395
2389
  for (let G = 0; G < y; ++G) {
2396
- const U = i.translation + G * i.chunkSize * i.scale;
2390
+ const c = i.translation + G * i.chunkSize * i.scale;
2397
2391
  for (let N = 0; N < w; ++N) {
2398
2392
  const d = o.translation + N * o.chunkSize * o.scale;
2399
- for (let Y = 0; Y < F; ++Y) {
2393
+ for (let Y = 0; Y < n; ++Y) {
2400
2394
  const J = a !== void 0 ? a.translation + Y * t * a.scale : 0;
2401
2395
  Q.push({
2402
2396
  state: "unloaded",
@@ -2419,7 +2413,7 @@ class $C {
2419
2413
  z: a?.scale ?? 1
2420
2414
  },
2421
2415
  offset: {
2422
- x: U,
2416
+ x: c,
2423
2417
  y: d,
2424
2418
  z: J
2425
2419
  }
@@ -2490,7 +2484,7 @@ class $C {
2490
2484
  throw new Error(
2491
2485
  `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}`
2492
2486
  );
2493
- A.data = void 0, A.state = "unloaded", A.orderKey = null, c.debug(
2487
+ A.data = void 0, A.state = "unloaded", A.orderKey = null, U.debug(
2494
2488
  "ChunkStore",
2495
2489
  `Disposing chunk ${JSON.stringify(A.chunkIndex)} in LOD ${A.lod}`
2496
2490
  );
@@ -2629,13 +2623,13 @@ var OA = function(g = 1) {
2629
2623
  };
2630
2624
  };
2631
2625
  OA.Panel = function(g, A, I, B) {
2632
- var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), D = E(3 * i * B), h = E(2 * i * B), t = E(3 * i * B), y = E(15 * i * B), w = E(74 * i * B), F = E(30 * i * B), S = document.createElement("canvas");
2626
+ var C = 1 / 0, Q = 0, E = Math.round, i = E(window.devicePixelRatio || 1), o = E(80 * i * B), a = E(48 * i * B), D = E(3 * i * B), h = E(2 * i * B), t = E(3 * i * B), y = E(15 * i * B), w = E(74 * i * B), n = E(30 * i * B), S = document.createElement("canvas");
2633
2627
  S.width = o, S.height = a, S.style.cssText = `width:${E(B * 80)}px;height:${E(B * 48)}px`;
2634
2628
  var G = S.getContext("2d");
2635
- return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, D, h), G.fillRect(t, y, w, F), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, y, w, F), {
2629
+ return G.font = "bold " + E(9 * i * B) + "px Helvetica,Arial,sans-serif", G.textBaseline = "top", G.fillStyle = I, G.fillRect(0, 0, o, a), G.fillStyle = A, G.fillText(g, D, h), G.fillRect(t, y, w, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, y, w, n), {
2636
2630
  dom: S,
2637
- update: function(U, N) {
2638
- C = Math.min(C, U), Q = Math.max(Q, U), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, y), G.fillStyle = A, G.fillText(E(U) + " " + g + " (" + E(C) + "-" + E(Q) + ")", D, h), G.drawImage(S, t + i, y, w - i, F, t, y, w - i, F), G.fillRect(t + w - i, y, i, F), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + w - i, y, i, E((1 - U / N) * F));
2631
+ update: function(c, N) {
2632
+ C = Math.min(C, c), Q = Math.max(Q, c), G.fillStyle = I, G.globalAlpha = 1, G.fillRect(0, 0, o, y), G.fillStyle = A, G.fillText(E(c) + " " + g + " (" + E(C) + "-" + E(Q) + ")", D, h), G.drawImage(S, t + i, y, w - i, n, t, y, w - i, n), G.fillRect(t + w - i, y, i, n), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + w - i, y, i, E((1 - c / N) * n));
2639
2633
  }
2640
2634
  };
2641
2635
  };
@@ -2734,7 +2728,7 @@ class QQ {
2734
2728
  }
2735
2729
  connect() {
2736
2730
  if (this.isConnected_) {
2737
- c.warn(
2731
+ U.warn(
2738
2732
  "EventDispatcher",
2739
2733
  "Attempted to connect already connected event dispatcher",
2740
2734
  `element id: ${this.element_.id}`
@@ -2749,7 +2743,7 @@ class QQ {
2749
2743
  }
2750
2744
  disconnect() {
2751
2745
  if (!this.isConnected_) {
2752
- c.debug(
2746
+ U.debug(
2753
2747
  "EventDispatcher",
2754
2748
  "Attempted to disconnect already disconnected event dispatcher",
2755
2749
  `element id: ${this.element_.id}`
@@ -2762,7 +2756,7 @@ class QQ {
2762
2756
  }
2763
2757
  handleEvent = (A) => {
2764
2758
  if (!BQ(A.type)) {
2765
- c.error("EventDispatcher", `Unsupported event type ${A.type}`);
2759
+ U.error("EventDispatcher", `Unsupported event type ${A.type}`);
2766
2760
  return;
2767
2761
  }
2768
2762
  const I = new CQ(A.type, A);
@@ -2822,7 +2816,7 @@ class EQ {
2822
2816
  updateAspectRatio() {
2823
2817
  const { width: A, height: I } = this.getBox().toRect();
2824
2818
  if (A <= 0 || I <= 0) {
2825
- c.debug(
2819
+ U.debug(
2826
2820
  "Viewport",
2827
2821
  `Skipping aspect ratio update for viewport ${this.id}: invalid dimensions ${A}x${I}`
2828
2822
  );
@@ -2871,7 +2865,7 @@ class aQ {
2871
2865
  }
2872
2866
  connect() {
2873
2867
  if (this.resizeObserver_) {
2874
- c.warn(
2868
+ U.warn(
2875
2869
  "PixelSizeObserver",
2876
2870
  "Attempted to connect already connected observer"
2877
2871
  );
@@ -2895,7 +2889,7 @@ class aQ {
2895
2889
  }
2896
2890
  disconnect() {
2897
2891
  if (!this.resizeObserver_) {
2898
- c.warn(
2892
+ U.warn(
2899
2893
  "PixelSizeObserver",
2900
2894
  "Attempted to disconnect already disconnected observer"
2901
2895
  );
@@ -3002,14 +2996,14 @@ class to {
3002
2996
  return this.viewports_.find((I) => I.id === A);
3003
2997
  }
3004
2998
  start() {
3005
- if (c.info("Idetik", "Idetik runtime starting"), this.lastAnimationId_ === void 0) {
2999
+ if (U.info("Idetik", "Idetik runtime starting"), this.lastAnimationId_ === void 0) {
3006
3000
  for (const A of this.viewports_)
3007
3001
  A.events.connect();
3008
3002
  this.sizeObserver_.connect(), this.lastAnimationId_ = requestAnimationFrame((A) => {
3009
3003
  this.lastTimestamp_ = A, this.animate(A);
3010
3004
  });
3011
3005
  } else
3012
- c.warn("Idetik", "Idetik runtime already started");
3006
+ U.warn("Idetik", "Idetik runtime already started");
3013
3007
  return this;
3014
3008
  }
3015
3009
  animate(A) {
@@ -3026,8 +3020,8 @@ class to {
3026
3020
  );
3027
3021
  }
3028
3022
  stop() {
3029
- if (c.info("Idetik", "Idetik runtime stopping"), this.lastAnimationId_ === void 0)
3030
- c.warn("Idetik", "Idetik runtime not started");
3023
+ if (U.info("Idetik", "Idetik runtime stopping"), this.lastAnimationId_ === void 0)
3024
+ U.warn("Idetik", "Idetik runtime not started");
3031
3025
  else {
3032
3026
  this.sizeObserver_.disconnect();
3033
3027
  for (const A of this.viewports_)
@@ -3039,11 +3033,11 @@ class to {
3039
3033
  class DQ extends uA {
3040
3034
  constructor(A) {
3041
3035
  if (super(), A.primitive != "triangles") {
3042
- c.warn("WireframeGeometry", "Only indexed geometries are supported");
3036
+ U.warn("WireframeGeometry", "Only indexed geometries are supported");
3043
3037
  return;
3044
3038
  }
3045
3039
  if (A.indexData.length == 0) {
3046
- c.warn(
3040
+ U.warn(
3047
3041
  "WireframeGeometry",
3048
3042
  "Only triangulated geometries are supported"
3049
3043
  );
@@ -3451,7 +3445,7 @@ class wA {
3451
3445
  opacity: I = 1,
3452
3446
  blendMode: B = "normal"
3453
3447
  } = {}) {
3454
- (I < 0 || I > 1) && c.warn(
3448
+ (I < 0 || I > 1) && U.warn(
3455
3449
  "Layer",
3456
3450
  `Layer opacity out of bounds: ${I} — clamping to [0.0, 1.0]`
3457
3451
  ), this.transparent = A, this.opacity_ = vA(I, 0, 1), this.blendMode = B;
@@ -3460,7 +3454,7 @@ class wA {
3460
3454
  return this.opacity_;
3461
3455
  }
3462
3456
  set opacity(A) {
3463
- (A < 0 || A > 1) && c.warn(
3457
+ (A < 0 || A > 1) && U.warn(
3464
3458
  "Layer",
3465
3459
  `Opacity out of bounds: ${A} — clamping to [0.0, 1.0]`
3466
3460
  ), this.opacity_ = vA(A, 0, 1);
@@ -3771,15 +3765,15 @@ class JB extends uA {
3771
3765
  const Q = [], E = [], i = B, o = C, a = i + 1, D = o + 1, h = A / i, t = I / o;
3772
3766
  for (let y = 0; y < D; ++y) {
3773
3767
  const w = y * t;
3774
- for (let F = 0; F < a; ++F) {
3775
- const S = F * h, G = F / i, U = y / o, N = [S, w, 0], d = [0, 0, 1], Y = [G, U];
3768
+ for (let n = 0; n < a; ++n) {
3769
+ const S = n * h, G = n / i, c = y / o, N = [S, w, 0], d = [0, 0, 1], Y = [G, c];
3776
3770
  Q.push(...N, ...d, ...Y);
3777
3771
  }
3778
3772
  }
3779
3773
  for (let y = 0; y < o; ++y)
3780
3774
  for (let w = 0; w < i; ++w) {
3781
- const F = w + a * y, S = w + a * (y + 1), G = w + 1 + a * (y + 1), U = w + 1 + a * y;
3782
- E.push(F, S, U), E.push(S, G, U);
3775
+ const n = w + a * y, S = w + a * (y + 1), G = w + 1 + a * (y + 1), c = w + 1 + a * y;
3776
+ E.push(n, S, c), E.push(S, G, c);
3783
3777
  }
3784
3778
  this.vertexData_ = new Float32Array(Q), this.indexData_ = new Uint32Array(E), this.addAttribute({
3785
3779
  type: "position",
@@ -3853,7 +3847,7 @@ class yg extends Dg {
3853
3847
  }
3854
3848
  const jg = 32;
3855
3849
  function Bg(g, { visible: A, color: I, contrastLimits: B }) {
3856
- return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = SQ(B, g) : B === void 0 && (c.debug(
3850
+ return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = SQ(B, g) : B === void 0 && (U.debug(
3857
3851
  "Channel",
3858
3852
  "No texture provided, defaulting channel contrast limits to [0, 1]."
3859
3853
  ), B = [0, 1]), {
@@ -4044,11 +4038,11 @@ class YB {
4044
4038
  bins_ = /* @__PURE__ */ new Map();
4045
4039
  acquire(A) {
4046
4040
  const B = this.bins_.get(A)?.pop();
4047
- return B && c.debug("RenderablePool", "Renderable object acquired"), B;
4041
+ return B && U.debug("RenderablePool", "Renderable object acquired"), B;
4048
4042
  }
4049
4043
  release(A, I) {
4050
4044
  let B = this.bins_.get(A);
4051
- B || (B = [], this.bins_.set(A, B)), B.push(I), c.debug("RenderablePool", "Renderable object released");
4045
+ B || (B = [], this.bins_.set(A, B)), B.push(I), U.debug("RenderablePool", "Renderable object released");
4052
4046
  }
4053
4047
  clearAll(A) {
4054
4048
  if (A) for (const I of this.bins_.values()) I.forEach(A);
@@ -4103,7 +4097,10 @@ class dB extends wA {
4103
4097
  this.chunkStoreView_ && (this.releaseAndRemoveChunks(this.visibleChunks_.keys()), this.clearObjects(), this.chunkStoreView_.dispose(), this.chunkStoreView_ = void 0);
4104
4098
  }
4105
4099
  update(A) {
4106
- !A || !this.chunkStoreView_ || (this.chunkStoreView_.updateChunkStates(this.sliceCoords_, A.viewport), this.updateChunks(), this.resliceIfZChanged());
4100
+ !A || !this.chunkStoreView_ || (this.chunkStoreView_.updateChunksForImage(
4101
+ this.sliceCoords_,
4102
+ A.viewport
4103
+ ), this.updateChunks(), this.resliceIfZChanged());
4107
4104
  }
4108
4105
  updateChunks() {
4109
4106
  if (!this.chunkStoreView_ || (this.state !== "ready" && this.setState("ready"), this.visibleChunks_.size > 0 && !this.chunkStoreView_.allVisibleFallbackLODLoaded(this.sliceCoords_) && !this.isPresentationStale()))
@@ -4171,7 +4168,7 @@ class dB extends wA {
4171
4168
  slicePlane(A, I) {
4172
4169
  if (!A.data) return;
4173
4170
  const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q = vA(C, 0, A.shape.z - 1);
4174
- Ig(B, Q, 1 + 1e-6) || c.error("ImageLayer", "slicePlane zValue outside extent");
4171
+ Ig(B, Q, 1 + 1e-6) || U.error("ImageLayer", "slicePlane zValue outside extent");
4175
4172
  const E = A.shape.x * A.shape.y, i = E * Q;
4176
4173
  return A.data.slice(i, i + E);
4177
4174
  }
@@ -4193,7 +4190,7 @@ class dB extends wA {
4193
4190
  getDataForImage(A) {
4194
4191
  const I = this.sliceCoords_?.z !== void 0 ? this.slicePlane(A, this.sliceCoords_.z) : A.data;
4195
4192
  if (!I) {
4196
- c.warn("ChunkedImageLayer", "No data for image");
4193
+ U.warn("ChunkedImageLayer", "No data for image");
4197
4194
  return;
4198
4195
  }
4199
4196
  return I;
@@ -4291,12 +4288,12 @@ class UQ extends uA {
4291
4288
  });
4292
4289
  }
4293
4290
  buildFace(A, I, B, C, Q, E, i, o, a, D, h, t, y) {
4294
- const w = E / a, F = i / D, S = E / 2, G = i / 2, U = o / 2 * h, N = a + 1, d = D + 1, Y = t.length / 8;
4291
+ const w = E / a, n = i / D, S = E / 2, G = i / 2, c = o / 2 * h, N = a + 1, d = D + 1, Y = t.length / 8;
4295
4292
  for (let J = 0; J < d; J++) {
4296
- const x = -G + J * F;
4293
+ const x = -G + J * n;
4297
4294
  for (let v = 0; v < N; v++) {
4298
4295
  const X = -S + v * w, O = { x: 0, y: 0, z: 0 };
4299
- O[A] = X * C, O[I] = x * Q, O[B] = U;
4296
+ O[A] = X * C, O[I] = x * Q, O[B] = c;
4300
4297
  const j = { x: 0, y: 0, z: 0 };
4301
4298
  j[B] = h;
4302
4299
  const nA = v / a, FA = 1 - J / D;
@@ -4494,7 +4491,7 @@ class ro extends wA {
4494
4491
  throw new Error(
4495
4492
  "RenderContext is required for the VolumeLayer update as camera information is used to reorder the chunks."
4496
4493
  );
4497
- this.reorderObjects(A.viewport.camera), this.chunkStoreView_.updateChunkStatesForVolume(this.sliceCoords_), this.updateChunks();
4494
+ this.reorderObjects(A.viewport.camera), this.chunkStoreView_.updateChunksForVolume(this.sliceCoords_), this.updateChunks();
4498
4495
  }
4499
4496
  }
4500
4497
  reorderObjects(A) {
@@ -4928,11 +4925,11 @@ class lQ {
4928
4925
  const I = this.loadingToken_;
4929
4926
  if (I) {
4930
4927
  if (I.index === A && !I.canceled)
4931
- return c.debug(
4928
+ return U.debug(
4932
4929
  "ImageSeriesLoader",
4933
4930
  "Ignoring duplicate active setIndex request"
4934
4931
  ), { success: !1, reason: "duplicate" };
4935
- c.debug(
4932
+ U.debug(
4936
4933
  "ImageSeriesLoader",
4937
4934
  `Cancelling setIndex request for index ${I.index}, new requested index is ${A}`
4938
4935
  ), I.canceled = !0;
@@ -5000,7 +4997,7 @@ class lQ {
5000
4997
  if (C.status === "rejected") {
5001
4998
  if (C.reason instanceof fI)
5002
4999
  return Promise.reject(C.reason);
5003
- c.error(
5000
+ U.error(
5004
5001
  "ImageSeriesLoader",
5005
5002
  `Error loading slice: ${C.reason}`
5006
5003
  );
@@ -5569,8 +5566,8 @@ class Rg {
5569
5566
  let D;
5570
5567
  o.length && (D = (t, y) => {
5571
5568
  let w = y;
5572
- for (let F of o)
5573
- w = F(t, w);
5569
+ for (let n of o)
5570
+ w = n(t, w);
5574
5571
  return w;
5575
5572
  });
5576
5573
  let h = JSON.stringify(a, D, I);
@@ -5770,18 +5767,18 @@ function AE(g, A, I, B) {
5770
5767
  codecs: B.index_codecs
5771
5768
  }), i = {};
5772
5769
  return async (o) => {
5773
- let a = o.map((U, N) => Math.floor(U / Q[N])), D = g.resolve(I(a)).path, h;
5770
+ let a = o.map((c, N) => Math.floor(c / Q[N])), D = g.resolve(I(a)).path, h;
5774
5771
  if (D in i)
5775
5772
  h = i[D];
5776
5773
  else {
5777
- let U = 4, N = 16 * Q.reduce((Y, J) => Y * J, 1), d = await C(D, {
5778
- suffixLength: N + U
5774
+ let c = 4, N = 16 * Q.reduce((Y, J) => Y * J, 1), d = await C(D, {
5775
+ suffixLength: N + c
5779
5776
  });
5780
5777
  h = i[D] = d ? await E.decode(d) : null;
5781
5778
  }
5782
5779
  if (h === null)
5783
5780
  return;
5784
- let { data: t, shape: y, stride: w } = h, F = o.map((U, N) => U % y[N]).reduce((U, N, d) => U + N * w[d], 0), S = t[F], G = t[F + 1];
5781
+ let { data: t, shape: y, stride: w } = h, n = o.map((c, N) => c % y[N]).reduce((c, N, d) => c + N * w[d], 0), S = t[n], G = t[n + 1];
5785
5782
  if (!(S === oB && G === oB))
5786
5783
  return C(D, {
5787
5784
  offset: Number(S),
@@ -6164,16 +6161,16 @@ function GI(g, A, I, B) {
6164
6161
  }, I, Q);
6165
6162
  return;
6166
6163
  }
6167
- const [D, h, t] = C.to, [y, w, F] = C.from, S = pB(D, h, t);
6164
+ const [D, h, t] = C.to, [y, w, n] = C.from, S = pB(D, h, t);
6168
6165
  if (Q.length === 0) {
6169
- if (t === 1 && F === 1 && E === 1 && o === 1) {
6170
- let G = y * I, U = S * I;
6171
- g.data.set(A.data.subarray(G, G + U), D * I);
6166
+ if (t === 1 && n === 1 && E === 1 && o === 1) {
6167
+ let G = y * I, c = S * I;
6168
+ g.data.set(A.data.subarray(G, G + c), D * I);
6172
6169
  return;
6173
6170
  }
6174
6171
  for (let G = 0; G < S; G++) {
6175
- let U = o * (y + F * G) * I;
6176
- g.data.set(A.data.subarray(U, U + I), E * (D + t * G) * I);
6172
+ let c = o * (y + n * G) * I;
6173
+ g.data.set(A.data.subarray(c, c + I), E * (D + t * G) * I);
6177
6174
  }
6178
6175
  return;
6179
6176
  }
@@ -6182,7 +6179,7 @@ function GI(g, A, I, B) {
6182
6179
  data: g.data.subarray(E * (D + G * t) * I),
6183
6180
  stride: i
6184
6181
  }, {
6185
- data: A.data.subarray(o * (y + G * F) * I),
6182
+ data: A.data.subarray(o * (y + G * n) * I),
6186
6183
  stride: a
6187
6184
  }, I, Q);
6188
6185
  }
@@ -6321,14 +6318,14 @@ class Mg extends WA {
6321
6318
  async getRange(A, I, B) {
6322
6319
  if (this.credentials && this.region) {
6323
6320
  const Q = `${this.url.toString().replace(/\/$/, "")}${A}`, E = await this.generateAuthHeaders(Q, "HEAD"), i = await this.generateAuthHeaders(Q, "GET"), o = globalThis.fetch, a = async (h, t) => {
6324
- const w = (t?.method || "GET") === "HEAD" ? E : i, F = {
6321
+ const w = (t?.method || "GET") === "HEAD" ? E : i, n = {
6325
6322
  ...t,
6326
6323
  headers: {
6327
6324
  ...t?.headers,
6328
6325
  ...w
6329
6326
  }
6330
6327
  };
6331
- return o(h, F);
6328
+ return o(h, n);
6332
6329
  }, D = globalThis.fetch;
6333
6330
  globalThis.fetch = a;
6334
6331
  try {
@@ -6350,12 +6347,12 @@ class Mg extends WA {
6350
6347
  x-amz-content-sha256:UNSIGNED-PAYLOAD
6351
6348
  x-amz-date:${o}
6352
6349
  ` + (Q ? `x-amz-security-token:${Q}
6353
- ` : ""), F = Q ? "host;x-amz-content-sha256;x-amz-date;x-amz-security-token" : "host;x-amz-content-sha256;x-amz-date", S = "UNSIGNED-PAYLOAD", G = `${I}
6350
+ ` : ""), n = Q ? "host;x-amz-content-sha256;x-amz-date;x-amz-security-token" : "host;x-amz-content-sha256;x-amz-date", S = "UNSIGNED-PAYLOAD", G = `${I}
6354
6351
  ${t}
6355
6352
  ${y}
6356
6353
  ${w}
6357
- ${F}
6358
- ${S}`, U = "AWS4-HMAC-SHA256", N = `${a}/${E}/${i}/aws4_request`, d = await this.sha256(G), Y = `${U}
6354
+ ${n}
6355
+ ${S}`, c = "AWS4-HMAC-SHA256", N = `${a}/${E}/${i}/aws4_request`, d = await this.sha256(G), Y = `${c}
6359
6356
  ${o}
6360
6357
  ${N}
6361
6358
  ${d}`, J = await this.getSignatureKey(
@@ -6364,7 +6361,7 @@ ${d}`, J = await this.getSignatureKey(
6364
6361
  E,
6365
6362
  i
6366
6363
  ), x = await this.hmacSha256(J, Y), X = {
6367
- Authorization: `${U} Credential=${B}/${N}, SignedHeaders=${F}, Signature=${x}`,
6364
+ Authorization: `${c} Credential=${B}/${N}, SignedHeaders=${n}, Signature=${x}`,
6368
6365
  "X-Amz-Date": o,
6369
6366
  "X-Amz-Content-Sha256": S
6370
6367
  };
@@ -9679,7 +9676,7 @@ let BA = [], HE = 0, uB = 0;
9679
9676
  const cA = /* @__PURE__ */ new Map(), kI = /* @__PURE__ */ new Set();
9680
9677
  function TB(g) {
9681
9678
  const A = BA.find((I) => I.worker === g);
9682
- return A || c.error(
9679
+ return A || U.error(
9683
9680
  "ZarrWorker",
9684
9681
  "Worker not found in pool - this should not happen"
9685
9682
  ), A;
@@ -9687,7 +9684,7 @@ function TB(g) {
9687
9684
  function qE(g, A) {
9688
9685
  const { id: I, success: B } = g.data, C = cA.get(I);
9689
9686
  if (!C) {
9690
- kI.has(I) ? kI.delete(I) : c.warn(
9687
+ kI.has(I) ? kI.delete(I) : U.warn(
9691
9688
  "ZarrWorker",
9692
9689
  `Received response for unknown message ID ${I}:`,
9693
9690
  g.data
@@ -9696,20 +9693,20 @@ function qE(g, A) {
9696
9693
  }
9697
9694
  cA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
9698
9695
  const Q = TB(A);
9699
- Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && c.error(
9696
+ Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
9700
9697
  "ZarrWorker",
9701
9698
  "Received message but no pending tasks - this should not happen"
9702
9699
  ), B && g.data.type === "getChunk" ? C.resolve(g.data.chunk) : B || C.reject(new Error(g.data.error || "Unknown worker error"));
9703
9700
  }
9704
9701
  function yB(g, A) {
9705
9702
  if (g instanceof MessageEvent) {
9706
- c.error(
9703
+ U.error(
9707
9704
  "ZarrWorker",
9708
9705
  "Message serialization error occurred - worker remains active"
9709
9706
  );
9710
9707
  return;
9711
9708
  }
9712
- c.error(
9709
+ U.error(
9713
9710
  "ZarrWorker",
9714
9711
  "Worker failed - replacing worker and canceling its in-flight messages",
9715
9712
  g.message
@@ -9729,9 +9726,9 @@ function yB(g, A) {
9729
9726
  worker: C,
9730
9727
  pendingCount: 0,
9731
9728
  workerId: uB++
9732
- }), c.debug("ZarrWorker", "Replacement worker created successfully");
9729
+ }), U.debug("ZarrWorker", "Replacement worker created successfully");
9733
9730
  } catch (C) {
9734
- c.error("ZarrWorker", "Failed to create replacement worker", C);
9731
+ U.error("ZarrWorker", "Failed to create replacement worker", C);
9735
9732
  }
9736
9733
  }
9737
9734
  function WB() {
@@ -9785,12 +9782,12 @@ function pE() {
9785
9782
  workerId: uB++
9786
9783
  });
9787
9784
  }
9788
- c.debug(
9785
+ U.debug(
9789
9786
  "ZarrWorker",
9790
9787
  `Initialized worker pool with ${BA.length} workers`
9791
9788
  );
9792
9789
  } catch {
9793
- c.warn("ZarrWorker", "Failed to create workers - clearing pool"), uE();
9790
+ U.warn("ZarrWorker", "Failed to create workers - clearing pool"), uE();
9794
9791
  return;
9795
9792
  }
9796
9793
  }
@@ -9801,7 +9798,7 @@ async function mE(g, A, I, B) {
9801
9798
  } catch (C) {
9802
9799
  if (C instanceof DOMException && C.name === "AbortError")
9803
9800
  throw C;
9804
- return c.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
9801
+ return U.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
9805
9802
  }
9806
9803
  }
9807
9804
  function uE() {
@@ -9903,7 +9900,7 @@ class WE {
9903
9900
  throw new Error(
9904
9901
  "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
9905
9902
  );
9906
- const a = (G, U) => typeof G == "number" ? G * U.scale + U.translation : G.start === null ? U.translation : G.start * U.scale + U.translation, D = this.dimensions_.x.lods[I], h = C[this.dimensions_.x.index], t = a(h, D), y = C[this.dimensions_.y.index], w = this.dimensions_.y.lods[I], F = a(y, w);
9903
+ const a = (G, c) => typeof G == "number" ? G * c.scale + c.translation : G.start === null ? c.translation : G.start * c.scale + c.translation, D = this.dimensions_.x.lods[I], h = C[this.dimensions_.x.index], t = a(h, D), y = C[this.dimensions_.y.index], w = this.dimensions_.y.lods[I], n = a(y, w);
9907
9904
  return {
9908
9905
  state: "loaded",
9909
9906
  lod: I,
@@ -9925,7 +9922,7 @@ class WE {
9925
9922
  y: w.scale,
9926
9923
  z: 1
9927
9924
  },
9928
- offset: { x: t, y: F, z: 0 }
9925
+ offset: { x: t, y: n, z: 0 }
9929
9926
  };
9930
9927
  }
9931
9928
  regionToIndices(A, I) {
@@ -9955,12 +9952,12 @@ function xE(g, A) {
9955
9952
  const I = g.axes.map((h) => h.name), B = g.axes.length, C = eB(I, "x"), Q = eB(I, "y"), E = (h, t) => {
9956
9953
  const y = [];
9957
9954
  for (let w = 0; w < g.datasets.length; w++) {
9958
- const F = g.datasets[w], S = A[w], G = F.coordinateTransformations[0].scale, U = F.coordinateTransformations.length === 2 ? F.coordinateTransformations[1].translation : new Array(B).fill(0);
9955
+ const n = g.datasets[w], S = A[w], G = n.coordinateTransformations[0].scale, c = n.coordinateTransformations.length === 2 ? n.coordinateTransformations[1].translation : new Array(B).fill(0);
9959
9956
  y.push({
9960
9957
  size: S.shape[t],
9961
9958
  chunkSize: S.chunks[t],
9962
9959
  scale: G[t],
9963
- translation: U[t]
9960
+ translation: c[t]
9964
9961
  });
9965
9962
  }
9966
9963
  return {
@@ -10252,7 +10249,7 @@ const JI = (g) => {
10252
10249
  message: i
10253
10250
  };
10254
10251
  }, PE = [];
10255
- function n(g, A) {
10252
+ function F(g, A) {
10256
10253
  const I = LI(), B = JI({
10257
10254
  issueData: A,
10258
10255
  data: g.data,
@@ -10617,7 +10614,7 @@ class IA extends K {
10617
10614
  _parse(A) {
10618
10615
  if (this._def.coerce && (A.data = String(A.data)), this._getType(A) !== r.string) {
10619
10616
  const Q = this._getOrReturnCtx(A);
10620
- return n(Q, {
10617
+ return F(Q, {
10621
10618
  code: e.invalid_type,
10622
10619
  expected: r.string,
10623
10620
  received: Q.parsedType
@@ -10627,7 +10624,7 @@ class IA extends K {
10627
10624
  let C;
10628
10625
  for (const Q of this._def.checks)
10629
10626
  if (Q.kind === "min")
10630
- A.data.length < Q.value && (C = this._getOrReturnCtx(A, C), n(C, {
10627
+ A.data.length < Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
10631
10628
  code: e.too_small,
10632
10629
  minimum: Q.value,
10633
10630
  type: "string",
@@ -10636,7 +10633,7 @@ class IA extends K {
10636
10633
  message: Q.message
10637
10634
  }), B.dirty());
10638
10635
  else if (Q.kind === "max")
10639
- A.data.length > Q.value && (C = this._getOrReturnCtx(A, C), n(C, {
10636
+ A.data.length > Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
10640
10637
  code: e.too_big,
10641
10638
  maximum: Q.value,
10642
10639
  type: "string",
@@ -10646,14 +10643,14 @@ class IA extends K {
10646
10643
  }), B.dirty());
10647
10644
  else if (Q.kind === "length") {
10648
10645
  const E = A.data.length > Q.value, i = A.data.length < Q.value;
10649
- (E || i) && (C = this._getOrReturnCtx(A, C), E ? n(C, {
10646
+ (E || i) && (C = this._getOrReturnCtx(A, C), E ? F(C, {
10650
10647
  code: e.too_big,
10651
10648
  maximum: Q.value,
10652
10649
  type: "string",
10653
10650
  inclusive: !0,
10654
10651
  exact: !0,
10655
10652
  message: Q.message
10656
- }) : i && n(C, {
10653
+ }) : i && F(C, {
10657
10654
  code: e.too_small,
10658
10655
  minimum: Q.value,
10659
10656
  type: "string",
@@ -10662,43 +10659,43 @@ class IA extends K {
10662
10659
  message: Q.message
10663
10660
  }), B.dirty());
10664
10661
  } else if (Q.kind === "email")
10665
- $E.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10662
+ $E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10666
10663
  validation: "email",
10667
10664
  code: e.invalid_string,
10668
10665
  message: Q.message
10669
10666
  }), B.dirty());
10670
10667
  else if (Q.kind === "emoji")
10671
- _I || (_I = new RegExp(Ai, "u")), _I.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10668
+ _I || (_I = new RegExp(Ai, "u")), _I.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10672
10669
  validation: "emoji",
10673
10670
  code: e.invalid_string,
10674
10671
  message: Q.message
10675
10672
  }), B.dirty());
10676
10673
  else if (Q.kind === "uuid")
10677
- XE.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10674
+ XE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10678
10675
  validation: "uuid",
10679
10676
  code: e.invalid_string,
10680
10677
  message: Q.message
10681
10678
  }), B.dirty());
10682
10679
  else if (Q.kind === "nanoid")
10683
- jE.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10680
+ jE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10684
10681
  validation: "nanoid",
10685
10682
  code: e.invalid_string,
10686
10683
  message: Q.message
10687
10684
  }), B.dirty());
10688
10685
  else if (Q.kind === "cuid")
10689
- OE.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10686
+ OE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10690
10687
  validation: "cuid",
10691
10688
  code: e.invalid_string,
10692
10689
  message: Q.message
10693
10690
  }), B.dirty());
10694
10691
  else if (Q.kind === "cuid2")
10695
- VE.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10692
+ VE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10696
10693
  validation: "cuid2",
10697
10694
  code: e.invalid_string,
10698
10695
  message: Q.message
10699
10696
  }), B.dirty());
10700
10697
  else if (Q.kind === "ulid")
10701
- vE.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10698
+ vE.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10702
10699
  validation: "ulid",
10703
10700
  code: e.invalid_string,
10704
10701
  message: Q.message
@@ -10707,61 +10704,61 @@ class IA extends K {
10707
10704
  try {
10708
10705
  new URL(A.data);
10709
10706
  } catch {
10710
- C = this._getOrReturnCtx(A, C), n(C, {
10707
+ C = this._getOrReturnCtx(A, C), F(C, {
10711
10708
  validation: "url",
10712
10709
  code: e.invalid_string,
10713
10710
  message: Q.message
10714
10711
  }), B.dirty();
10715
10712
  }
10716
- else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10713
+ else Q.kind === "regex" ? (Q.regex.lastIndex = 0, Q.regex.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10717
10714
  validation: "regex",
10718
10715
  code: e.invalid_string,
10719
10716
  message: Q.message
10720
- }), B.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (C = this._getOrReturnCtx(A, C), n(C, {
10717
+ }), B.dirty())) : Q.kind === "trim" ? A.data = A.data.trim() : Q.kind === "includes" ? A.data.includes(Q.value, Q.position) || (C = this._getOrReturnCtx(A, C), F(C, {
10721
10718
  code: e.invalid_string,
10722
10719
  validation: { includes: Q.value, position: Q.position },
10723
10720
  message: Q.message
10724
- }), B.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (C = this._getOrReturnCtx(A, C), n(C, {
10721
+ }), B.dirty()) : Q.kind === "toLowerCase" ? A.data = A.data.toLowerCase() : Q.kind === "toUpperCase" ? A.data = A.data.toUpperCase() : Q.kind === "startsWith" ? A.data.startsWith(Q.value) || (C = this._getOrReturnCtx(A, C), F(C, {
10725
10722
  code: e.invalid_string,
10726
10723
  validation: { startsWith: Q.value },
10727
10724
  message: Q.message
10728
- }), B.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (C = this._getOrReturnCtx(A, C), n(C, {
10725
+ }), B.dirty()) : Q.kind === "endsWith" ? A.data.endsWith(Q.value) || (C = this._getOrReturnCtx(A, C), F(C, {
10729
10726
  code: e.invalid_string,
10730
10727
  validation: { endsWith: Q.value },
10731
10728
  message: Q.message
10732
- }), B.dirty()) : Q.kind === "datetime" ? VB(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10729
+ }), B.dirty()) : Q.kind === "datetime" ? VB(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10733
10730
  code: e.invalid_string,
10734
10731
  validation: "datetime",
10735
10732
  message: Q.message
10736
- }), B.dirty()) : Q.kind === "date" ? ii.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10733
+ }), B.dirty()) : Q.kind === "date" ? ii.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10737
10734
  code: e.invalid_string,
10738
10735
  validation: "date",
10739
10736
  message: Q.message
10740
- }), B.dirty()) : Q.kind === "time" ? oi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10737
+ }), B.dirty()) : Q.kind === "time" ? oi(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10741
10738
  code: e.invalid_string,
10742
10739
  validation: "time",
10743
10740
  message: Q.message
10744
- }), B.dirty()) : Q.kind === "duration" ? _E.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10741
+ }), B.dirty()) : Q.kind === "duration" ? _E.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10745
10742
  validation: "duration",
10746
10743
  code: e.invalid_string,
10747
10744
  message: Q.message
10748
- }), B.dirty()) : Q.kind === "ip" ? ai(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), n(C, {
10745
+ }), B.dirty()) : Q.kind === "ip" ? ai(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10749
10746
  validation: "ip",
10750
10747
  code: e.invalid_string,
10751
10748
  message: Q.message
10752
- }), B.dirty()) : Q.kind === "jwt" ? Di(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), n(C, {
10749
+ }), B.dirty()) : Q.kind === "jwt" ? Di(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
10753
10750
  validation: "jwt",
10754
10751
  code: e.invalid_string,
10755
10752
  message: Q.message
10756
- }), B.dirty()) : Q.kind === "cidr" ? si(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), n(C, {
10753
+ }), B.dirty()) : Q.kind === "cidr" ? si(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
10757
10754
  validation: "cidr",
10758
10755
  code: e.invalid_string,
10759
10756
  message: Q.message
10760
- }), B.dirty()) : Q.kind === "base64" ? Qi.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10757
+ }), B.dirty()) : Q.kind === "base64" ? Qi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10761
10758
  validation: "base64",
10762
10759
  code: e.invalid_string,
10763
10760
  message: Q.message
10764
- }), B.dirty()) : Q.kind === "base64url" ? Ei.test(A.data) || (C = this._getOrReturnCtx(A, C), n(C, {
10761
+ }), B.dirty()) : Q.kind === "base64url" ? Ei.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
10765
10762
  validation: "base64url",
10766
10763
  code: e.invalid_string,
10767
10764
  message: Q.message
@@ -11011,7 +11008,7 @@ class tA extends K {
11011
11008
  _parse(A) {
11012
11009
  if (this._def.coerce && (A.data = Number(A.data)), this._getType(A) !== r.number) {
11013
11010
  const Q = this._getOrReturnCtx(A);
11014
- return n(Q, {
11011
+ return F(Q, {
11015
11012
  code: e.invalid_type,
11016
11013
  expected: r.number,
11017
11014
  received: Q.parsedType
@@ -11020,30 +11017,30 @@ class tA extends K {
11020
11017
  let B;
11021
11018
  const C = new Z();
11022
11019
  for (const Q of this._def.checks)
11023
- Q.kind === "int" ? H.isInteger(A.data) || (B = this._getOrReturnCtx(A, B), n(B, {
11020
+ Q.kind === "int" ? H.isInteger(A.data) || (B = this._getOrReturnCtx(A, B), F(B, {
11024
11021
  code: e.invalid_type,
11025
11022
  expected: "integer",
11026
11023
  received: "float",
11027
11024
  message: Q.message
11028
- }), C.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), n(B, {
11025
+ }), C.dirty()) : Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
11029
11026
  code: e.too_small,
11030
11027
  minimum: Q.value,
11031
11028
  type: "number",
11032
11029
  inclusive: Q.inclusive,
11033
11030
  exact: !1,
11034
11031
  message: Q.message
11035
- }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), n(B, {
11032
+ }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
11036
11033
  code: e.too_big,
11037
11034
  maximum: Q.value,
11038
11035
  type: "number",
11039
11036
  inclusive: Q.inclusive,
11040
11037
  exact: !1,
11041
11038
  message: Q.message
11042
- }), C.dirty()) : Q.kind === "multipleOf" ? hi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), n(B, {
11039
+ }), C.dirty()) : Q.kind === "multipleOf" ? hi(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
11043
11040
  code: e.not_multiple_of,
11044
11041
  multipleOf: Q.value,
11045
11042
  message: Q.message
11046
- }), C.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (B = this._getOrReturnCtx(A, B), n(B, {
11043
+ }), C.dirty()) : Q.kind === "finite" ? Number.isFinite(A.data) || (B = this._getOrReturnCtx(A, B), F(B, {
11047
11044
  code: e.not_finite,
11048
11045
  message: Q.message
11049
11046
  }), C.dirty()) : H.assertNever(Q);
@@ -11192,19 +11189,19 @@ class yA extends K {
11192
11189
  let B;
11193
11190
  const C = new Z();
11194
11191
  for (const Q of this._def.checks)
11195
- Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), n(B, {
11192
+ Q.kind === "min" ? (Q.inclusive ? A.data < Q.value : A.data <= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
11196
11193
  code: e.too_small,
11197
11194
  type: "bigint",
11198
11195
  minimum: Q.value,
11199
11196
  inclusive: Q.inclusive,
11200
11197
  message: Q.message
11201
- }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), n(B, {
11198
+ }), C.dirty()) : Q.kind === "max" ? (Q.inclusive ? A.data > Q.value : A.data >= Q.value) && (B = this._getOrReturnCtx(A, B), F(B, {
11202
11199
  code: e.too_big,
11203
11200
  type: "bigint",
11204
11201
  maximum: Q.value,
11205
11202
  inclusive: Q.inclusive,
11206
11203
  message: Q.message
11207
- }), C.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (B = this._getOrReturnCtx(A, B), n(B, {
11204
+ }), C.dirty()) : Q.kind === "multipleOf" ? A.data % Q.value !== BigInt(0) && (B = this._getOrReturnCtx(A, B), F(B, {
11208
11205
  code: e.not_multiple_of,
11209
11206
  multipleOf: Q.value,
11210
11207
  message: Q.message
@@ -11213,7 +11210,7 @@ class yA extends K {
11213
11210
  }
11214
11211
  _getInvalidInput(A) {
11215
11212
  const I = this._getOrReturnCtx(A);
11216
- return n(I, {
11213
+ return F(I, {
11217
11214
  code: e.invalid_type,
11218
11215
  expected: r.bigint,
11219
11216
  received: I.parsedType
@@ -11316,7 +11313,7 @@ class zA extends K {
11316
11313
  _parse(A) {
11317
11314
  if (this._def.coerce && (A.data = !!A.data), this._getType(A) !== r.boolean) {
11318
11315
  const B = this._getOrReturnCtx(A);
11319
- return n(B, {
11316
+ return F(B, {
11320
11317
  code: e.invalid_type,
11321
11318
  expected: r.boolean,
11322
11319
  received: B.parsedType
@@ -11334,7 +11331,7 @@ class kA extends K {
11334
11331
  _parse(A) {
11335
11332
  if (this._def.coerce && (A.data = new Date(A.data)), this._getType(A) !== r.date) {
11336
11333
  const Q = this._getOrReturnCtx(A);
11337
- return n(Q, {
11334
+ return F(Q, {
11338
11335
  code: e.invalid_type,
11339
11336
  expected: r.date,
11340
11337
  received: Q.parsedType
@@ -11342,21 +11339,21 @@ class kA extends K {
11342
11339
  }
11343
11340
  if (isNaN(A.data.getTime())) {
11344
11341
  const Q = this._getOrReturnCtx(A);
11345
- return n(Q, {
11342
+ return F(Q, {
11346
11343
  code: e.invalid_date
11347
11344
  }), L;
11348
11345
  }
11349
11346
  const B = new Z();
11350
11347
  let C;
11351
11348
  for (const Q of this._def.checks)
11352
- Q.kind === "min" ? A.data.getTime() < Q.value && (C = this._getOrReturnCtx(A, C), n(C, {
11349
+ Q.kind === "min" ? A.data.getTime() < Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
11353
11350
  code: e.too_small,
11354
11351
  message: Q.message,
11355
11352
  inclusive: !0,
11356
11353
  exact: !1,
11357
11354
  minimum: Q.value,
11358
11355
  type: "date"
11359
- }), B.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (C = this._getOrReturnCtx(A, C), n(C, {
11356
+ }), B.dirty()) : Q.kind === "max" ? A.data.getTime() > Q.value && (C = this._getOrReturnCtx(A, C), F(C, {
11360
11357
  code: e.too_big,
11361
11358
  message: Q.message,
11362
11359
  inclusive: !0,
@@ -11412,7 +11409,7 @@ class dI extends K {
11412
11409
  _parse(A) {
11413
11410
  if (this._getType(A) !== r.symbol) {
11414
11411
  const B = this._getOrReturnCtx(A);
11415
- return n(B, {
11412
+ return F(B, {
11416
11413
  code: e.invalid_type,
11417
11414
  expected: r.symbol,
11418
11415
  received: B.parsedType
@@ -11429,7 +11426,7 @@ class _A extends K {
11429
11426
  _parse(A) {
11430
11427
  if (this._getType(A) !== r.undefined) {
11431
11428
  const B = this._getOrReturnCtx(A);
11432
- return n(B, {
11429
+ return F(B, {
11433
11430
  code: e.invalid_type,
11434
11431
  expected: r.undefined,
11435
11432
  received: B.parsedType
@@ -11446,7 +11443,7 @@ class $A extends K {
11446
11443
  _parse(A) {
11447
11444
  if (this._getType(A) !== r.null) {
11448
11445
  const B = this._getOrReturnCtx(A);
11449
- return n(B, {
11446
+ return F(B, {
11450
11447
  code: e.invalid_type,
11451
11448
  expected: r.null,
11452
11449
  received: B.parsedType
@@ -11486,7 +11483,7 @@ RA.create = (g) => new RA({
11486
11483
  class sA extends K {
11487
11484
  _parse(A) {
11488
11485
  const I = this._getOrReturnCtx(A);
11489
- return n(I, {
11486
+ return F(I, {
11490
11487
  code: e.invalid_type,
11491
11488
  expected: r.never,
11492
11489
  received: I.parsedType
@@ -11501,7 +11498,7 @@ class MI extends K {
11501
11498
  _parse(A) {
11502
11499
  if (this._getType(A) !== r.undefined) {
11503
11500
  const B = this._getOrReturnCtx(A);
11504
- return n(B, {
11501
+ return F(B, {
11505
11502
  code: e.invalid_type,
11506
11503
  expected: r.void,
11507
11504
  received: B.parsedType
@@ -11518,14 +11515,14 @@ class CA extends K {
11518
11515
  _parse(A) {
11519
11516
  const { ctx: I, status: B } = this._processInputParams(A), C = this._def;
11520
11517
  if (I.parsedType !== r.array)
11521
- return n(I, {
11518
+ return F(I, {
11522
11519
  code: e.invalid_type,
11523
11520
  expected: r.array,
11524
11521
  received: I.parsedType
11525
11522
  }), L;
11526
11523
  if (C.exactLength !== null) {
11527
11524
  const E = I.data.length > C.exactLength.value, i = I.data.length < C.exactLength.value;
11528
- (E || i) && (n(I, {
11525
+ (E || i) && (F(I, {
11529
11526
  code: E ? e.too_big : e.too_small,
11530
11527
  minimum: i ? C.exactLength.value : void 0,
11531
11528
  maximum: E ? C.exactLength.value : void 0,
@@ -11535,14 +11532,14 @@ class CA extends K {
11535
11532
  message: C.exactLength.message
11536
11533
  }), B.dirty());
11537
11534
  }
11538
- if (C.minLength !== null && I.data.length < C.minLength.value && (n(I, {
11535
+ if (C.minLength !== null && I.data.length < C.minLength.value && (F(I, {
11539
11536
  code: e.too_small,
11540
11537
  minimum: C.minLength.value,
11541
11538
  type: "array",
11542
11539
  inclusive: !0,
11543
11540
  exact: !1,
11544
11541
  message: C.minLength.message
11545
- }), B.dirty()), C.maxLength !== null && I.data.length > C.maxLength.value && (n(I, {
11542
+ }), B.dirty()), C.maxLength !== null && I.data.length > C.maxLength.value && (F(I, {
11546
11543
  code: e.too_big,
11547
11544
  maximum: C.maxLength.value,
11548
11545
  type: "array",
@@ -11616,7 +11613,7 @@ class p extends K {
11616
11613
  _parse(A) {
11617
11614
  if (this._getType(A) !== r.object) {
11618
11615
  const a = this._getOrReturnCtx(A);
11619
- return n(a, {
11616
+ return F(a, {
11620
11617
  code: e.invalid_type,
11621
11618
  expected: r.object,
11622
11619
  received: a.parsedType
@@ -11644,7 +11641,7 @@ class p extends K {
11644
11641
  value: { status: "valid", value: C.data[D] }
11645
11642
  });
11646
11643
  else if (a === "strict")
11647
- i.length > 0 && (n(C, {
11644
+ i.length > 0 && (F(C, {
11648
11645
  code: e.unrecognized_keys,
11649
11646
  keys: i
11650
11647
  }), B.dirty());
@@ -11901,7 +11898,7 @@ class AI extends K {
11901
11898
  if (i.result.status === "dirty")
11902
11899
  return I.common.issues.push(...i.ctx.common.issues), i.result;
11903
11900
  const E = Q.map((i) => new z(i.ctx.common.issues));
11904
- return n(I, {
11901
+ return F(I, {
11905
11902
  code: e.invalid_union,
11906
11903
  unionErrors: E
11907
11904
  }), L;
@@ -11948,7 +11945,7 @@ class AI extends K {
11948
11945
  if (Q)
11949
11946
  return I.common.issues.push(...Q.ctx.common.issues), Q.result;
11950
11947
  const i = E.map((o) => new z(o));
11951
- return n(I, {
11948
+ return F(I, {
11952
11949
  code: e.invalid_union,
11953
11950
  unionErrors: i
11954
11951
  }), L;
@@ -11968,7 +11965,7 @@ class uI extends K {
11968
11965
  _parse(A) {
11969
11966
  const { ctx: I } = this._processInputParams(A);
11970
11967
  if (I.parsedType !== r.object)
11971
- return n(I, {
11968
+ return F(I, {
11972
11969
  code: e.invalid_type,
11973
11970
  expected: r.object,
11974
11971
  received: I.parsedType
@@ -11982,7 +11979,7 @@ class uI extends K {
11982
11979
  data: I.data,
11983
11980
  path: I.path,
11984
11981
  parent: I
11985
- }) : (n(I, {
11982
+ }) : (F(I, {
11986
11983
  code: e.invalid_union_discriminator,
11987
11984
  options: Array.from(this.optionsMap.keys()),
11988
11985
  path: [B]
@@ -12058,7 +12055,7 @@ class II extends K {
12058
12055
  if (ig(Q) || ig(E))
12059
12056
  return L;
12060
12057
  const i = ag(Q.value, E.value);
12061
- return i.valid ? ((og(Q) || og(E)) && I.dirty(), { status: I.value, value: i.data }) : (n(B, {
12058
+ return i.valid ? ((og(Q) || og(E)) && I.dirty(), { status: I.value, value: i.data }) : (F(B, {
12062
12059
  code: e.invalid_intersection_types
12063
12060
  }), L);
12064
12061
  };
@@ -12094,20 +12091,20 @@ class oA extends K {
12094
12091
  _parse(A) {
12095
12092
  const { status: I, ctx: B } = this._processInputParams(A);
12096
12093
  if (B.parsedType !== r.array)
12097
- return n(B, {
12094
+ return F(B, {
12098
12095
  code: e.invalid_type,
12099
12096
  expected: r.array,
12100
12097
  received: B.parsedType
12101
12098
  }), L;
12102
12099
  if (B.data.length < this._def.items.length)
12103
- return n(B, {
12100
+ return F(B, {
12104
12101
  code: e.too_small,
12105
12102
  minimum: this._def.items.length,
12106
12103
  inclusive: !0,
12107
12104
  exact: !1,
12108
12105
  type: "array"
12109
12106
  }), L;
12110
- !this._def.rest && B.data.length > this._def.items.length && (n(B, {
12107
+ !this._def.rest && B.data.length > this._def.items.length && (F(B, {
12111
12108
  code: e.too_big,
12112
12109
  maximum: this._def.items.length,
12113
12110
  inclusive: !0,
@@ -12150,7 +12147,7 @@ class gI extends K {
12150
12147
  _parse(A) {
12151
12148
  const { status: I, ctx: B } = this._processInputParams(A);
12152
12149
  if (B.parsedType !== r.object)
12153
- return n(B, {
12150
+ return F(B, {
12154
12151
  code: e.invalid_type,
12155
12152
  expected: r.object,
12156
12153
  received: B.parsedType
@@ -12191,7 +12188,7 @@ class KI extends K {
12191
12188
  _parse(A) {
12192
12189
  const { status: I, ctx: B } = this._processInputParams(A);
12193
12190
  if (B.parsedType !== r.map)
12194
- return n(B, {
12191
+ return F(B, {
12195
12192
  code: e.invalid_type,
12196
12193
  expected: r.map,
12197
12194
  received: B.parsedType
@@ -12233,20 +12230,20 @@ class LA extends K {
12233
12230
  _parse(A) {
12234
12231
  const { status: I, ctx: B } = this._processInputParams(A);
12235
12232
  if (B.parsedType !== r.set)
12236
- return n(B, {
12233
+ return F(B, {
12237
12234
  code: e.invalid_type,
12238
12235
  expected: r.set,
12239
12236
  received: B.parsedType
12240
12237
  }), L;
12241
12238
  const C = this._def;
12242
- C.minSize !== null && B.data.size < C.minSize.value && (n(B, {
12239
+ C.minSize !== null && B.data.size < C.minSize.value && (F(B, {
12243
12240
  code: e.too_small,
12244
12241
  minimum: C.minSize.value,
12245
12242
  type: "set",
12246
12243
  inclusive: !0,
12247
12244
  exact: !1,
12248
12245
  message: C.minSize.message
12249
- }), I.dirty()), C.maxSize !== null && B.data.size > C.maxSize.value && (n(B, {
12246
+ }), I.dirty()), C.maxSize !== null && B.data.size > C.maxSize.value && (F(B, {
12250
12247
  code: e.too_big,
12251
12248
  maximum: C.maxSize.value,
12252
12249
  type: "set",
@@ -12300,7 +12297,7 @@ class KA extends K {
12300
12297
  _parse(A) {
12301
12298
  const { ctx: I } = this._processInputParams(A);
12302
12299
  if (I.parsedType !== r.function)
12303
- return n(I, {
12300
+ return F(I, {
12304
12301
  code: e.invalid_type,
12305
12302
  expected: r.function,
12306
12303
  received: I.parsedType
@@ -12412,7 +12409,7 @@ class CI extends K {
12412
12409
  _parse(A) {
12413
12410
  if (A.data !== this._def.value) {
12414
12411
  const I = this._getOrReturnCtx(A);
12415
- return n(I, {
12412
+ return F(I, {
12416
12413
  received: I.data,
12417
12414
  code: e.invalid_literal,
12418
12415
  expected: this._def.value
@@ -12443,7 +12440,7 @@ class eA extends K {
12443
12440
  _parse(A) {
12444
12441
  if (typeof A.data != "string") {
12445
12442
  const I = this._getOrReturnCtx(A), B = this._def.values;
12446
- return n(I, {
12443
+ return F(I, {
12447
12444
  expected: H.joinValues(B),
12448
12445
  received: I.parsedType,
12449
12446
  code: e.invalid_type
@@ -12451,7 +12448,7 @@ class eA extends K {
12451
12448
  }
12452
12449
  if (YI(this, bA) || ZB(this, bA, new Set(this._def.values)), !YI(this, bA).has(A.data)) {
12453
12450
  const I = this._getOrReturnCtx(A), B = this._def.values;
12454
- return n(I, {
12451
+ return F(I, {
12455
12452
  received: I.data,
12456
12453
  code: e.invalid_enum_value,
12457
12454
  options: B
@@ -12503,7 +12500,7 @@ class QI extends K {
12503
12500
  const I = H.getValidEnumValues(this._def.values), B = this._getOrReturnCtx(A);
12504
12501
  if (B.parsedType !== r.string && B.parsedType !== r.number) {
12505
12502
  const C = H.objectValues(I);
12506
- return n(B, {
12503
+ return F(B, {
12507
12504
  expected: H.joinValues(C),
12508
12505
  received: B.parsedType,
12509
12506
  code: e.invalid_type
@@ -12511,7 +12508,7 @@ class QI extends K {
12511
12508
  }
12512
12509
  if (YI(this, ZA) || ZB(this, ZA, new Set(H.getValidEnumValues(this._def.values))), !YI(this, ZA).has(A.data)) {
12513
12510
  const C = H.objectValues(I);
12514
- return n(B, {
12511
+ return F(B, {
12515
12512
  received: B.data,
12516
12513
  code: e.invalid_enum_value,
12517
12514
  options: C
@@ -12536,7 +12533,7 @@ class pA extends K {
12536
12533
  _parse(A) {
12537
12534
  const { ctx: I } = this._processInputParams(A);
12538
12535
  if (I.parsedType !== r.promise && I.common.async === !1)
12539
- return n(I, {
12536
+ return F(I, {
12540
12537
  code: e.invalid_type,
12541
12538
  expected: r.promise,
12542
12539
  received: I.parsedType
@@ -12563,7 +12560,7 @@ class QA extends K {
12563
12560
  _parse(A) {
12564
12561
  const { status: I, ctx: B } = this._processInputParams(A), C = this._def.effect || null, Q = {
12565
12562
  addIssue: (E) => {
12566
- n(B, E), E.fatal ? I.abort() : I.dirty();
12563
+ F(B, E), E.fatal ? I.abort() : I.dirty();
12567
12564
  },
12568
12565
  get path() {
12569
12566
  return B.path;
@@ -12735,7 +12732,7 @@ class HI extends K {
12735
12732
  _parse(A) {
12736
12733
  if (this._getType(A) !== r.nan) {
12737
12734
  const B = this._getOrReturnCtx(A);
12738
- return n(B, {
12735
+ return F(B, {
12739
12736
  code: e.invalid_type,
12740
12737
  expected: r.nan,
12741
12738
  received: B.parsedType
@@ -12864,7 +12861,7 @@ var s = /* @__PURE__ */ Object.freeze({
12864
12861
  getErrorMap: LI,
12865
12862
  makeIssue: JI,
12866
12863
  EMPTY_PATH: PE,
12867
- addIssueToContext: n,
12864
+ addIssueToContext: F,
12868
12865
  ParseStatus: Z,
12869
12866
  INVALID: L,
12870
12867
  DIRTY: MA,