@idetik/core 0.14.0 → 0.15.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
@@ -1136,7 +1136,7 @@ function JB() {
1136
1136
  class yg {
1137
1137
  uuid = JB();
1138
1138
  }
1139
- var p = 1e-6, b = typeof Float32Array < "u" ? Float32Array : Array, UC = Math.PI / 180;
1139
+ var p = 1e-6, P = typeof Float32Array < "u" ? Float32Array : Array, UC = Math.PI / 180;
1140
1140
  function kC(g) {
1141
1141
  return g * UC;
1142
1142
  }
@@ -1146,30 +1146,30 @@ Math.hypot || (Math.hypot = function() {
1146
1146
  return Math.sqrt(g);
1147
1147
  });
1148
1148
  function YB() {
1149
- var g = new b(9);
1150
- return b != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[5] = 0, g[6] = 0, g[7] = 0), g[0] = 1, g[4] = 1, g[8] = 1, g;
1149
+ var g = new P(9);
1150
+ return P != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[5] = 0, g[6] = 0, g[7] = 0), g[0] = 1, g[4] = 1, g[8] = 1, g;
1151
1151
  }
1152
1152
  function LC(g, A) {
1153
1153
  return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[4], g[4] = A[5], g[5] = A[6], g[6] = A[8], g[7] = A[9], g[8] = A[10], g;
1154
1154
  }
1155
1155
  function _() {
1156
- var g = new b(16);
1157
- return b != 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;
1156
+ var g = new P(16);
1157
+ return P != 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;
1158
1158
  }
1159
1159
  function mI(g, A) {
1160
- 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], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, N = I * o - C * E, d = I * a - Q * E, L = B * o - C * i, k = B * a - Q * i, T = C * a - Q * o, P = s * w - h * n, O = s * r - t * n, Z = s * G - y * n, V = h * r - t * w, iA = h * G - y * w, oA = t * G - y * r, u = c * oA - N * iA + d * V + L * Z - k * O + T * P;
1161
- return u ? (u = 1 / u, g[0] = (i * oA - o * iA + a * V) * u, g[1] = (C * iA - B * oA - Q * V) * u, g[2] = (w * T - r * k + G * L) * u, g[3] = (t * k - h * T - y * L) * u, g[4] = (o * Z - E * oA - a * O) * u, g[5] = (I * oA - C * Z + Q * O) * u, g[6] = (r * d - n * T - G * N) * u, g[7] = (s * T - t * d + y * N) * u, g[8] = (E * iA - i * Z + a * P) * u, g[9] = (B * Z - I * iA - Q * P) * u, g[10] = (n * k - w * d + G * c) * u, g[11] = (h * d - s * k - y * c) * u, g[12] = (i * O - E * V - o * P) * u, g[13] = (I * V - B * O + C * P) * u, g[14] = (w * N - n * L - r * c) * u, g[15] = (s * L - h * N + t * c) * u, g) : null;
1160
+ 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], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, R = I * o - C * E, Y = I * a - Q * E, k = B * o - C * i, L = B * a - Q * i, m = C * a - Q * o, x = s * w - h * n, b = s * r - t * n, O = s * G - y * n, V = h * r - t * w, iA = h * G - y * w, oA = t * G - y * r, T = c * oA - R * iA + Y * V + k * O - L * b + m * x;
1161
+ return T ? (T = 1 / T, g[0] = (i * oA - o * iA + a * V) * T, g[1] = (C * iA - B * oA - Q * V) * T, g[2] = (w * m - r * L + G * k) * T, g[3] = (t * L - h * m - y * k) * T, g[4] = (o * O - E * oA - a * b) * T, g[5] = (I * oA - C * O + Q * b) * T, g[6] = (r * Y - n * m - G * R) * T, g[7] = (s * m - t * Y + y * R) * T, g[8] = (E * iA - i * O + a * x) * T, g[9] = (B * O - I * iA - Q * x) * T, g[10] = (n * L - w * Y + G * c) * T, g[11] = (h * Y - s * L - y * c) * T, g[12] = (i * b - E * V - o * x) * T, g[13] = (I * V - B * b + C * x) * T, g[14] = (w * R - n * k - r * c) * T, g[15] = (s * k - h * R + t * c) * T, g) : null;
1162
1162
  }
1163
1163
  function zA(g, A, I) {
1164
- var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], N = I[0], d = I[1], L = I[2], k = I[3];
1165
- return g[0] = N * B + d * i + L * h + k * w, g[1] = N * C + d * o + L * t + k * r, g[2] = N * Q + d * a + L * y + k * G, g[3] = N * E + d * s + L * n + k * c, N = I[4], d = I[5], L = I[6], k = I[7], g[4] = N * B + d * i + L * h + k * w, g[5] = N * C + d * o + L * t + k * r, g[6] = N * Q + d * a + L * y + k * G, g[7] = N * E + d * s + L * n + k * c, N = I[8], d = I[9], L = I[10], k = I[11], g[8] = N * B + d * i + L * h + k * w, g[9] = N * C + d * o + L * t + k * r, g[10] = N * Q + d * a + L * y + k * G, g[11] = N * E + d * s + L * n + k * c, N = I[12], d = I[13], L = I[14], k = I[15], g[12] = N * B + d * i + L * h + k * w, g[13] = N * C + d * o + L * t + k * r, g[14] = N * Q + d * a + L * y + k * G, g[15] = N * E + d * s + L * n + k * c, g;
1164
+ var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], R = I[0], Y = I[1], k = I[2], L = I[3];
1165
+ return g[0] = R * B + Y * i + k * h + L * w, g[1] = R * C + Y * o + k * t + L * r, g[2] = R * Q + Y * a + k * y + L * G, g[3] = R * E + Y * s + k * n + L * c, R = I[4], Y = I[5], k = I[6], L = I[7], g[4] = R * B + Y * i + k * h + L * w, g[5] = R * C + Y * o + k * t + L * r, g[6] = R * Q + Y * a + k * y + L * G, g[7] = R * E + Y * s + k * n + L * c, R = I[8], Y = I[9], k = I[10], L = I[11], g[8] = R * B + Y * i + k * h + L * w, g[9] = R * C + Y * o + k * t + L * r, g[10] = R * Q + Y * a + k * y + L * G, g[11] = R * E + Y * s + k * n + L * c, R = I[12], Y = I[13], k = I[14], L = I[15], g[12] = R * B + Y * i + k * h + L * w, g[13] = R * C + Y * o + k * t + L * r, g[14] = R * Q + Y * a + k * y + L * G, g[15] = R * E + Y * s + k * n + L * c, g;
1166
1166
  }
1167
1167
  function JC(g, A) {
1168
1168
  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;
1169
1169
  }
1170
1170
  function YC(g, A, I, B) {
1171
- var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, h = C * o, t = C * a, y = C * s, n = Q * a, w = Q * s, r = E * s, G = i * o, c = i * a, N = i * s, d = B[0], L = B[1], k = B[2];
1172
- return g[0] = (1 - (n + r)) * d, g[1] = (t + N) * d, g[2] = (y - c) * d, g[3] = 0, g[4] = (t - N) * L, g[5] = (1 - (h + r)) * L, g[6] = (w + G) * L, g[7] = 0, g[8] = (y + c) * k, g[9] = (w - G) * k, g[10] = (1 - (h + n)) * k, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
1171
+ var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, h = C * o, t = C * a, y = C * s, n = Q * a, w = Q * s, r = E * s, G = i * o, c = i * a, R = i * s, Y = B[0], k = B[1], L = B[2];
1172
+ return g[0] = (1 - (n + r)) * Y, g[1] = (t + R) * Y, g[2] = (y - c) * Y, g[3] = 0, g[4] = (t - R) * k, g[5] = (1 - (h + r)) * k, g[6] = (w + G) * k, g[7] = 0, g[8] = (y + c) * L, g[9] = (w - G) * L, g[10] = (1 - (h + n)) * L, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
1173
1173
  }
1174
1174
  function dC(g, A, I, B, C) {
1175
1175
  var Q = 1 / Math.tan(A / 2), E;
@@ -1188,15 +1188,15 @@ function qC(g, A, I, B) {
1188
1188
  return y = n * n + w * w + r * r, y > 0 && (y = 1 / Math.sqrt(y), n *= y, w *= y, r *= y), g[0] = n, g[1] = w, g[2] = r, g[3] = 0, g[4] = h * r - t * w, g[5] = t * n - s * r, g[6] = s * w - h * n, g[7] = 0, g[8] = s, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
1189
1189
  }
1190
1190
  function lC(g, A) {
1191
- var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], N = A[1], d = A[2], L = A[3], k = A[4], T = A[5], P = A[6], O = A[7], Z = A[8], V = A[9], iA = A[10], oA = A[11], u = A[12], xg = A[13], Wg = A[14], bg = A[15];
1192
- return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - N) <= p * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - d) <= p * Math.max(1, Math.abs(C), Math.abs(d)) && Math.abs(Q - L) <= p * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - k) <= p * Math.max(1, Math.abs(E), Math.abs(k)) && Math.abs(i - T) <= p * Math.max(1, Math.abs(i), Math.abs(T)) && Math.abs(o - P) <= p * Math.max(1, Math.abs(o), Math.abs(P)) && Math.abs(a - O) <= p * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(s - Z) <= p * Math.max(1, Math.abs(s), Math.abs(Z)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - iA) <= p * Math.max(1, Math.abs(t), Math.abs(iA)) && Math.abs(y - oA) <= p * Math.max(1, Math.abs(y), Math.abs(oA)) && Math.abs(n - u) <= p * Math.max(1, Math.abs(n), Math.abs(u)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
1191
+ var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], R = A[1], Y = A[2], k = A[3], L = A[4], m = A[5], x = A[6], b = A[7], O = A[8], V = A[9], iA = A[10], oA = A[11], T = A[12], xg = A[13], Wg = A[14], bg = A[15];
1192
+ return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - R) <= p * Math.max(1, Math.abs(B), Math.abs(R)) && Math.abs(C - Y) <= p * Math.max(1, Math.abs(C), Math.abs(Y)) && Math.abs(Q - k) <= p * Math.max(1, Math.abs(Q), Math.abs(k)) && Math.abs(E - L) <= p * Math.max(1, Math.abs(E), Math.abs(L)) && Math.abs(i - m) <= p * Math.max(1, Math.abs(i), Math.abs(m)) && Math.abs(o - x) <= p * Math.max(1, Math.abs(o), Math.abs(x)) && Math.abs(a - b) <= p * Math.max(1, Math.abs(a), Math.abs(b)) && Math.abs(s - O) <= p * Math.max(1, Math.abs(s), Math.abs(O)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - iA) <= p * Math.max(1, Math.abs(t), Math.abs(iA)) && Math.abs(y - oA) <= p * Math.max(1, Math.abs(y), Math.abs(oA)) && Math.abs(n - T) <= p * Math.max(1, Math.abs(n), Math.abs(T)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
1193
1193
  }
1194
1194
  function f() {
1195
- var g = new b(3);
1196
- return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g;
1195
+ var g = new P(3);
1196
+ return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g;
1197
1197
  }
1198
1198
  function BA(g) {
1199
- var A = new b(3);
1199
+ var A = new P(3);
1200
1200
  return A[0] = g[0], A[1] = g[1], A[2] = g[2], A;
1201
1201
  }
1202
1202
  function eg(g) {
@@ -1204,7 +1204,7 @@ function eg(g) {
1204
1204
  return Math.hypot(A, I, B);
1205
1205
  }
1206
1206
  function q(g, A, I) {
1207
- var B = new b(3);
1207
+ var B = new P(3);
1208
1208
  return B[0] = g, B[1] = A, B[2] = I, B;
1209
1209
  }
1210
1210
  function HA(g, A) {
@@ -1273,15 +1273,15 @@ var UI = fC, xC = eg;
1273
1273
  };
1274
1274
  })();
1275
1275
  function pA() {
1276
- var g = new b(4);
1277
- return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
1276
+ var g = new P(4);
1277
+ return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
1278
1278
  }
1279
1279
  function WC(g) {
1280
- var A = new b(4);
1280
+ var A = new P(4);
1281
1281
  return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
1282
1282
  }
1283
1283
  function kI(g, A, I, B) {
1284
- var C = new b(4);
1284
+ var C = new P(4);
1285
1285
  return C[0] = g, C[1] = A, C[2] = I, C[3] = B, C;
1286
1286
  }
1287
1287
  function bC(g, A) {
@@ -1308,8 +1308,8 @@ function _A(g, A, I) {
1308
1308
  };
1309
1309
  })();
1310
1310
  function Cg() {
1311
- var g = new b(4);
1312
- return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
1311
+ var g = new P(4);
1312
+ return P != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
1313
1313
  }
1314
1314
  function OC(g, A, I) {
1315
1315
  I = I * 0.5;
@@ -1357,15 +1357,15 @@ var vC = WC, XC = bC, Gg = PC;
1357
1357
  };
1358
1358
  })();
1359
1359
  function HB() {
1360
- var g = new b(2);
1361
- return b != Float32Array && (g[0] = 0, g[1] = 0), g;
1360
+ var g = new P(2);
1361
+ return P != Float32Array && (g[0] = 0, g[1] = 0), g;
1362
1362
  }
1363
1363
  function vg(g) {
1364
- var A = new b(2);
1364
+ var A = new P(2);
1365
1365
  return A[0] = g[0], A[1] = g[1], A;
1366
1366
  }
1367
- function W(g, A) {
1368
- var I = new b(2);
1367
+ function Z(g, A) {
1368
+ var I = new P(2);
1369
1369
  return I[0] = g, I[1] = A, I;
1370
1370
  }
1371
1371
  function jC(g, A) {
@@ -1811,7 +1811,7 @@ class AA {
1811
1811
  * the first element, and avoids biasing toward (0,0).
1812
1812
  */
1813
1813
  constructor(A, I) {
1814
- this.min = A ? vg(A) : W(1 / 0, 1 / 0), this.max = I ? vg(I) : W(-1 / 0, -1 / 0);
1814
+ this.min = A ? vg(A) : Z(1 / 0, 1 / 0), this.max = I ? vg(I) : Z(-1 / 0, -1 / 0);
1815
1815
  }
1816
1816
  clone() {
1817
1817
  return new AA(this.min, this.max);
@@ -1828,8 +1828,8 @@ class AA {
1828
1828
  }
1829
1829
  floor() {
1830
1830
  return new AA(
1831
- W(Math.floor(this.min[0]), Math.floor(this.min[1])),
1832
- W(Math.floor(this.max[0]), Math.floor(this.max[1]))
1831
+ Z(Math.floor(this.min[0]), Math.floor(this.min[1])),
1832
+ Z(Math.floor(this.max[0]), Math.floor(this.max[1]))
1833
1833
  );
1834
1834
  }
1835
1835
  toRect() {
@@ -1962,8 +1962,8 @@ class CQ extends sC {
1962
1962
  render(A) {
1963
1963
  let I = getComputedStyle(A.element).visibility !== "hidden";
1964
1964
  const B = A.getBoxRelativeTo(this.canvas), C = new AA(
1965
- W(0, 0),
1966
- W(this.width, this.height)
1965
+ Z(0, 0),
1966
+ Z(this.width, this.height)
1967
1967
  );
1968
1968
  AA.equals(B.floor(), C.floor()) ? this.state_.setScissorTest(!1) : AA.intersects(B, C) ? (this.state_.setScissor(B), this.state_.setScissorTest(!0)) : (U.warn(
1969
1969
  "WebGLRenderer",
@@ -2079,8 +2079,8 @@ class CQ extends sC {
2079
2079
  }
2080
2080
  resize(A, I) {
2081
2081
  const B = new AA(
2082
- W(0, 0),
2083
- W(A, I)
2082
+ Z(0, 0),
2083
+ Z(A, I)
2084
2084
  );
2085
2085
  this.state_.setViewport(B);
2086
2086
  }
@@ -2189,7 +2189,7 @@ class oQ {
2189
2189
  );
2190
2190
  const B = this.store_.dimensions, C = B.x.lods[0], Q = B.y.lods[0];
2191
2191
  this.sourceMaxSquareDistance2D_ = zC(
2192
- W(C.size * C.scale, Q.size * Q.scale)
2192
+ Z(C.size * C.scale, Q.size * Q.scale)
2193
2193
  );
2194
2194
  }
2195
2195
  get chunkViewStates() {
@@ -2486,10 +2486,10 @@ class aQ {
2486
2486
  for (let r = 0; r < B; ++r)
2487
2487
  for (let G = 0; G < y; ++G) {
2488
2488
  const c = i.translation + G * i.chunkSize * i.scale;
2489
- for (let N = 0; N < n; ++N) {
2490
- const d = o.translation + N * o.chunkSize * o.scale;
2491
- for (let L = 0; L < w; ++L) {
2492
- const k = a !== void 0 ? a.translation + L * t * a.scale : 0;
2489
+ for (let R = 0; R < n; ++R) {
2490
+ const Y = o.translation + R * o.chunkSize * o.scale;
2491
+ for (let k = 0; k < w; ++k) {
2492
+ const L = a !== void 0 ? a.translation + k * t * a.scale : 0;
2493
2493
  Q.push({
2494
2494
  state: "unloaded",
2495
2495
  lod: E,
@@ -2499,12 +2499,12 @@ class aQ {
2499
2499
  orderKey: null,
2500
2500
  shape: {
2501
2501
  x: Math.min(s, i.size - G * s),
2502
- y: Math.min(h, o.size - N * h),
2503
- z: Math.min(t, (a?.size ?? 1) - L * t),
2502
+ y: Math.min(h, o.size - R * h),
2503
+ z: Math.min(t, (a?.size ?? 1) - k * t),
2504
2504
  c: 1
2505
2505
  },
2506
2506
  rowAlignmentBytes: 1,
2507
- chunkIndex: { x: G, y: N, z: L, c: r, t: C },
2507
+ chunkIndex: { x: G, y: R, z: k, c: r, t: C },
2508
2508
  scale: {
2509
2509
  x: i.scale,
2510
2510
  y: o.scale,
@@ -2512,8 +2512,8 @@ class aQ {
2512
2512
  },
2513
2513
  offset: {
2514
2514
  x: c,
2515
- y: d,
2516
- z: k
2515
+ y: Y,
2516
+ z: L
2517
2517
  }
2518
2518
  });
2519
2519
  }
@@ -2602,10 +2602,6 @@ class aQ {
2602
2602
  for (let A = 0; A < this.dimensions_.numLods; ++A) {
2603
2603
  const I = this.dimensions_.t?.lods[A];
2604
2604
  if (!I) continue;
2605
- if (I.chunkSize !== 1)
2606
- throw new Error(
2607
- `ChunkStore only supports a chunk size of 1 in t. Found ${I.chunkSize} at LOD ${A}`
2608
- );
2609
2605
  const B = this.dimensions_.t?.lods[A - 1];
2610
2606
  if (B && I.size !== B.size)
2611
2607
  throw new Error(
@@ -2620,10 +2616,6 @@ class aQ {
2620
2616
  for (let A = 0; A < this.dimensions_.numLods; ++A) {
2621
2617
  const I = this.dimensions_.c?.lods[A];
2622
2618
  if (!I) continue;
2623
- if (I.chunkSize !== 1)
2624
- throw new Error(
2625
- `ChunkStore only supports a chunk size of 1 in c. Found ${I.chunkSize} at LOD ${A}`
2626
- );
2627
2619
  if (I.scale !== 1)
2628
2620
  throw new Error(
2629
2621
  `ChunkStore does not support scale in c. Found ${I.scale} at LOD ${A}`
@@ -2726,8 +2718,8 @@ XA.Panel = function(g, A, I, B) {
2726
2718
  var G = r.getContext("2d");
2727
2719
  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, s, h), G.fillRect(t, y, n, w), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t, y, n, w), {
2728
2720
  dom: r,
2729
- update: function(c, N) {
2730
- 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) + ")", s, h), G.drawImage(r, t + i, y, n - i, w, t, y, n - i, w), G.fillRect(t + n - i, y, i, w), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + n - i, y, i, E((1 - c / N) * w));
2721
+ update: function(c, R) {
2722
+ 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) + ")", s, h), G.drawImage(r, t + i, y, n - i, w, t, y, n - i, w), G.fillRect(t + n - i, y, i, w), G.fillStyle = I, G.globalAlpha = 0.9, G.fillRect(t + n - i, y, i, E((1 - c / R) * w));
2731
2723
  }
2732
2724
  };
2733
2725
  };
@@ -2872,7 +2864,7 @@ class GQ {
2872
2864
  constructor(A) {
2873
2865
  this.id = A.id, this.element = A.element, this.camera = A.camera, this.layerManager = A.layerManager, this.cameraControls = A.cameraControls, this.updateAspectRatio(), this.events = new eQ(this.element), this.events.addEventListener((I) => {
2874
2866
  if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
2875
- const { clientX: B, clientY: C } = I.event, Q = W(B, C);
2867
+ const { clientX: B, clientY: C } = I.event, Q = Z(B, C);
2876
2868
  I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
2877
2869
  }
2878
2870
  for (const B of this.layerManager.layers)
@@ -2888,8 +2880,8 @@ class GQ {
2888
2880
  getBoxRelativeTo(A) {
2889
2881
  const I = this.getBox().toRect(), B = A.getBoundingClientRect(), C = window.devicePixelRatio || 1, Q = B.left * C, E = B.top * C, i = B.height * C, o = I.x - Q, a = I.y - E, s = Math.floor(o), h = Math.floor(i - a - I.height), t = Math.floor(I.width), y = Math.floor(I.height);
2890
2882
  return new AA(
2891
- W(s, h),
2892
- W(s + t, h + y)
2883
+ Z(s, h),
2884
+ Z(s + t, h + y)
2893
2885
  );
2894
2886
  }
2895
2887
  clientToClip(A, I = 0) {
@@ -2907,8 +2899,8 @@ class GQ {
2907
2899
  getBox() {
2908
2900
  const A = this.element.getBoundingClientRect(), I = window.devicePixelRatio || 1, B = A.left * I, C = A.top * I, Q = A.width * I, E = A.height * I;
2909
2901
  return new AA(
2910
- W(B, C),
2911
- W(B + Q, C + E)
2902
+ Z(B, C),
2903
+ Z(B + Q, C + E)
2912
2904
  );
2913
2905
  }
2914
2906
  updateAspectRatio() {
@@ -3452,8 +3444,8 @@ class qo extends lB {
3452
3444
  this.viewMatrix
3453
3445
  ), C = mI(_(), B);
3454
3446
  return A = _A(pA(), A, C), I = _A(pA(), I, C), new AA(
3455
- W(A[0], A[1]),
3456
- W(I[0], I[1])
3447
+ Z(A[0], A[1]),
3448
+ Z(I[0], I[1])
3457
3449
  );
3458
3450
  }
3459
3451
  updateProjectionMatrix() {
@@ -4001,8 +3993,8 @@ class pB extends bA {
4001
3993
  for (let y = 0; y < s; ++y) {
4002
3994
  const n = y * t;
4003
3995
  for (let w = 0; w < a; ++w) {
4004
- const r = w * h, G = w / i, c = y / o, N = [r, n, 0], d = [0, 0, 1], L = [G, c];
4005
- Q.push(...N, ...d, ...L);
3996
+ const r = w * h, G = w / i, c = y / o, R = [r, n, 0], Y = [0, 0, 1], k = [G, c];
3997
+ Q.push(...R, ...Y, ...k);
4006
3998
  }
4007
3999
  }
4008
4000
  for (let y = 0; y < o; ++y)
@@ -4247,11 +4239,11 @@ function Sg(g, A, I, B, C = 3) {
4247
4239
  switch (g.type) {
4248
4240
  case "pointerdown": {
4249
4241
  const Q = g.event;
4250
- return W(Q.clientX, Q.clientY);
4242
+ return Z(Q.clientX, Q.clientY);
4251
4243
  }
4252
4244
  case "pointerup": {
4253
4245
  if (!A) return A;
4254
- const Q = g.event, E = W(Q.clientX, Q.clientY);
4246
+ const Q = g.event, E = Z(Q.clientX, Q.clientY);
4255
4247
  if (jC(A, E) < C) {
4256
4248
  if (!B) return null;
4257
4249
  const o = g.worldPos;
@@ -4523,19 +4515,19 @@ class uQ extends bA {
4523
4515
  });
4524
4516
  }
4525
4517
  buildFace(A, I, B, C, Q, E, i, o, a, s, h, t, y) {
4526
- const n = E / a, w = i / s, r = E / 2, G = i / 2, c = o / 2 * h, N = a + 1, d = s + 1, L = t.length / 8;
4527
- for (let k = 0; k < d; k++) {
4528
- const T = -G + k * w;
4529
- for (let P = 0; P < N; P++) {
4530
- const O = -r + P * n, Z = { x: 0, y: 0, z: 0 };
4531
- Z[A] = O * C, Z[I] = T * Q, Z[B] = c;
4518
+ const n = E / a, w = i / s, r = E / 2, G = i / 2, c = o / 2 * h, R = a + 1, Y = s + 1, k = t.length / 8;
4519
+ for (let L = 0; L < Y; L++) {
4520
+ const m = -G + L * w;
4521
+ for (let x = 0; x < R; x++) {
4522
+ const b = -r + x * n, O = { x: 0, y: 0, z: 0 };
4523
+ O[A] = b * C, O[I] = m * Q, O[B] = c;
4532
4524
  const V = { x: 0, y: 0, z: 0 };
4533
4525
  V[B] = h;
4534
- const iA = P / a, oA = 1 - k / s;
4526
+ const iA = x / a, oA = 1 - L / s;
4535
4527
  t.push(
4536
- Z.x,
4537
- Z.y,
4538
- Z.z,
4528
+ O.x,
4529
+ O.y,
4530
+ O.z,
4539
4531
  V.x,
4540
4532
  V.y,
4541
4533
  V.z,
@@ -4544,10 +4536,10 @@ class uQ extends bA {
4544
4536
  );
4545
4537
  }
4546
4538
  }
4547
- for (let k = 0; k < s; k++)
4548
- for (let T = 0; T < a; T++) {
4549
- const P = L + T + N * k, O = L + T + N * (k + 1), Z = L + (T + 1) + N * (k + 1), V = L + (T + 1) + N * k;
4550
- y.push(P, O, V, O, Z, V);
4539
+ for (let L = 0; L < s; L++)
4540
+ for (let m = 0; m < a; m++) {
4541
+ const x = k + m + R * L, b = k + m + R * (L + 1), O = k + (m + 1) + R * (L + 1), V = k + (m + 1) + R * L;
4542
+ y.push(x, b, V, b, O, V);
4551
4543
  }
4552
4544
  }
4553
4545
  }
@@ -5699,11 +5691,11 @@ function WB(g) {
5699
5691
  float64: Float64Array,
5700
5692
  bool: xB
5701
5693
  }[g];
5702
- return x(I, `Unknown or unsupported data_type: ${g}`), I;
5694
+ return W(I, `Unknown or unsupported data_type: ${g}`), I;
5703
5695
  }
5704
5696
  function UA(g, A) {
5705
5697
  const I = g.length;
5706
- typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), x(I === A.length, "Order length must match the number of dimensions.");
5698
+ typeof A == "string" && (A = A === "C" ? Array.from({ length: I }, (Q, E) => E) : Array.from({ length: I }, (Q, E) => I - 1 - E)), W(I === A.length, "Order length must match the number of dimensions.");
5707
5699
  let B = 1, C = new Array(I);
5708
5700
  for (let Q = A.length - 1; Q >= 0; Q--)
5709
5701
  C[A[Q]] = B, B *= g[A[Q]];
@@ -5724,7 +5716,7 @@ function CE(g) {
5724
5716
  if (g === "|O")
5725
5717
  return { data_type: "v2:object" };
5726
5718
  let A = g.match(/^([<|>])(.*)$/);
5727
- x(A, `Invalid dtype: ${g}`);
5719
+ W(A, `Invalid dtype: ${g}`);
5728
5720
  let [, I, B] = A, C = {
5729
5721
  b1: "bool",
5730
5722
  i1: "int8",
@@ -5739,7 +5731,7 @@ function CE(g) {
5739
5731
  f4: "float32",
5740
5732
  f8: "float64"
5741
5733
  }[B] ?? (B.startsWith("S") || B.startsWith("U") ? `v2:${B}` : void 0);
5742
- return x(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
5734
+ return W(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
5743
5735
  }
5744
5736
  function QE(g, A = {}) {
5745
5737
  let I = [], B = CE(g.dtype);
@@ -5804,13 +5796,13 @@ function ZB(g, ...A) {
5804
5796
  if (!A.some((I) => g instanceof I))
5805
5797
  throw g;
5806
5798
  }
5807
- function x(g, A = "") {
5799
+ function W(g, A = "") {
5808
5800
  if (!g)
5809
5801
  throw new Error(A);
5810
5802
  }
5811
5803
  async function PB(g, { format: A, signal: I }) {
5812
5804
  const B = g instanceof Response ? g : new Response(g);
5813
- x(B.body, "Response does not contain body.");
5805
+ W(B.body, "Response does not contain body.");
5814
5806
  try {
5815
5807
  return await new Response(B.body.pipeThrough(new DecompressionStream(A), { signal: I })).arrayBuffer();
5816
5808
  } catch {
@@ -5820,7 +5812,7 @@ async function PB(g, { format: A, signal: I }) {
5820
5812
  class Ng {
5821
5813
  kind = "array_to_array";
5822
5814
  constructor(A, I) {
5823
- x(A.keepbits >= 0, "keepbits must be zero or positive");
5815
+ W(A.keepbits >= 0, "keepbits must be zero or positive");
5824
5816
  }
5825
5817
  static fromConfig(A, I) {
5826
5818
  return new Ng(A, I);
@@ -5902,7 +5894,7 @@ class Ug {
5902
5894
  }
5903
5895
  }
5904
5896
  function sE(g, A) {
5905
- return x(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), x(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), x(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
5897
+ return W(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), W(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), W(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
5906
5898
  }
5907
5899
  function DE(g, A) {
5908
5900
  return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
@@ -5932,9 +5924,9 @@ class kg {
5932
5924
  }
5933
5925
  encode(A) {
5934
5926
  const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
5935
- x(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
5927
+ W(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
5936
5928
  const o = [];
5937
- x(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(sE), i && o.push(DE);
5929
+ W(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(sE), i && o.push(DE);
5938
5930
  const a = Array.from(A.data);
5939
5931
  a.push("|O"), a.push(A.shape);
5940
5932
  let s;
@@ -5952,9 +5944,9 @@ class kg {
5952
5944
  }
5953
5945
  decode(A) {
5954
5946
  const { strict: I } = this.#I;
5955
- x(I, "JsonCodec does not yet support non-strict decoding.");
5947
+ W(I, "JsonCodec does not yet support non-strict decoding.");
5956
5948
  const B = GI(A), C = B.pop();
5957
- B.pop(), x(C, "0D not implemented for JsonCodec.");
5949
+ B.pop(), W(C, "0D not implemented for JsonCodec.");
5958
5950
  const Q = UA(C, "C");
5959
5951
  return { data: B, shape: C, stride: Q };
5960
5952
  }
@@ -5999,11 +5991,11 @@ function tE(g, A) {
5999
5991
  }
6000
5992
  function yE(g) {
6001
5993
  let A = g.shape.length;
6002
- return x(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
5994
+ return W(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
6003
5995
  }
6004
5996
  function eE(g, A) {
6005
5997
  let I = yE(g);
6006
- return x(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
5998
+ return W(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
6007
5999
  }
6008
6000
  class Lg {
6009
6001
  kind = "array_to_array";
@@ -6019,7 +6011,7 @@ class Lg {
6019
6011
  Q[i] = C - i - 1, E[i] = C - i - 1;
6020
6012
  else
6021
6013
  Q = B, Q.forEach((i, o) => {
6022
- x(E[i] === void 0, `Invalid permutation: ${JSON.stringify(B)}`), E[i] = o;
6014
+ W(E[i] === void 0, `Invalid permutation: ${JSON.stringify(B)}`), E[i] = o;
6023
6015
  });
6024
6016
  this.#A = Q, this.#I = E;
6025
6017
  }
@@ -6102,7 +6094,7 @@ function og(g) {
6102
6094
  async function eB(g) {
6103
6095
  let A = g.codecs.map(async (Q) => {
6104
6096
  let E = await nE.get(Q.name)?.();
6105
- return x(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
6097
+ return W(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
6106
6098
  }), I = [], B, C = [];
6107
6099
  for await (let { Codec: Q, meta: E } of A) {
6108
6100
  let i = Q.fromConfig(E.configuration, g);
@@ -6117,7 +6109,7 @@ async function eB(g) {
6117
6109
  C.push(i);
6118
6110
  }
6119
6111
  }
6120
- return B || (x(wE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = xI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
6112
+ return B || (W(wE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = xI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
6121
6113
  }
6122
6114
  function wE(g) {
6123
6115
  return g.data_type !== "v2:object";
@@ -6134,25 +6126,25 @@ class dg extends Error {
6134
6126
  }
6135
6127
  const GB = 18446744073709551615n;
6136
6128
  function FE(g, A, I, B) {
6137
- x(g.store.getRange, "Store does not support range requests");
6129
+ W(g.store.getRange, "Store does not support range requests");
6138
6130
  let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = og({
6139
6131
  data_type: "uint64",
6140
6132
  shape: [...Q, 2],
6141
6133
  codecs: B.index_codecs
6142
6134
  }), i = {};
6143
6135
  return async (o) => {
6144
- let a = o.map((c, N) => Math.floor(c / Q[N])), s = g.resolve(I(a)).path, h;
6136
+ let a = o.map((c, R) => Math.floor(c / Q[R])), s = g.resolve(I(a)).path, h;
6145
6137
  if (s in i)
6146
6138
  h = i[s];
6147
6139
  else {
6148
- let c = 4, N = 16 * Q.reduce((L, k) => L * k, 1), d = await C(s, {
6149
- suffixLength: N + c
6140
+ let c = 4, R = 16 * Q.reduce((k, L) => k * L, 1), Y = await C(s, {
6141
+ suffixLength: R + c
6150
6142
  });
6151
- h = i[s] = d ? await E.decode(d) : null;
6143
+ h = i[s] = Y ? await E.decode(Y) : null;
6152
6144
  }
6153
6145
  if (h === null)
6154
6146
  return;
6155
- let { data: t, shape: y, stride: n } = h, w = o.map((c, N) => c % y[N]).reduce((c, N, d) => c + N * n[d], 0), r = t[w], G = t[w + 1];
6147
+ let { data: t, shape: y, stride: n } = h, w = o.map((c, R) => c % y[R]).reduce((c, R, Y) => c + R * n[Y], 0), r = t[w], G = t[w + 1];
6156
6148
  if (!(r === GB && G === GB))
6157
6149
  return C(s, {
6158
6150
  offset: Number(r),
@@ -6726,20 +6718,20 @@ ${t}
6726
6718
  ${y}
6727
6719
  ${n}
6728
6720
  ${w}
6729
- ${r}`, c = "AWS4-HMAC-SHA256", N = `${a}/${E}/${i}/aws4_request`, d = await this.sha256(G), L = `${c}
6721
+ ${r}`, c = "AWS4-HMAC-SHA256", R = `${a}/${E}/${i}/aws4_request`, Y = await this.sha256(G), k = `${c}
6730
6722
  ${o}
6731
- ${N}
6732
- ${d}`, k = await this.getSignatureKey(
6723
+ ${R}
6724
+ ${Y}`, L = await this.getSignatureKey(
6733
6725
  C,
6734
6726
  a,
6735
6727
  E,
6736
6728
  i
6737
- ), T = await this.hmacSha256(k, L), O = {
6738
- Authorization: `${c} Credential=${B}/${N}, SignedHeaders=${w}, Signature=${T}`,
6729
+ ), m = await this.hmacSha256(L, k), b = {
6730
+ Authorization: `${c} Credential=${B}/${R}, SignedHeaders=${w}, Signature=${m}`,
6739
6731
  "X-Amz-Date": o,
6740
6732
  "X-Amz-Content-Sha256": r
6741
6733
  };
6742
- return Q && (O["X-Amz-Security-Token"] = Q), O;
6734
+ return Q && (b["X-Amz-Security-Token"] = Q), b;
6743
6735
  }
6744
6736
  getAmzDate() {
6745
6737
  return (/* @__PURE__ */ new Date()).toISOString().replace(/[:-]|\.\d{3}/g, "");
@@ -10206,48 +10198,63 @@ class Ei {
10206
10198
  }
10207
10199
  async loadChunkData(A, I) {
10208
10200
  const B = [];
10209
- B[this.dimensions_.x.index] = A.chunkIndex.x, B[this.dimensions_.y.index] = A.chunkIndex.y, this.dimensions_.z && (B[this.dimensions_.z.index] = A.chunkIndex.z), this.dimensions_.c && (B[this.dimensions_.c.index] = A.chunkIndex.c), this.dimensions_.t && (B[this.dimensions_.t.index] = A.chunkIndex.t);
10201
+ if (B[this.dimensions_.x.index] = A.chunkIndex.x, B[this.dimensions_.y.index] = A.chunkIndex.y, this.dimensions_.z && (B[this.dimensions_.z.index] = A.chunkIndex.z), this.dimensions_.c) {
10202
+ const o = this.dimensions_.c.lods[A.lod];
10203
+ B[this.dimensions_.c.index] = Math.floor(
10204
+ A.chunkIndex.c / o.chunkSize
10205
+ );
10206
+ }
10207
+ if (this.dimensions_.t) {
10208
+ const o = this.dimensions_.t.lods[A.lod];
10209
+ B[this.dimensions_.t.index] = Math.floor(
10210
+ A.chunkIndex.t / o.chunkSize
10211
+ );
10212
+ }
10210
10213
  const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await Bi(C, Q, B, {
10211
10214
  signal: I
10212
10215
  });
10213
- if (!zg(E.data))
10216
+ A.data = this.sliceReceivedChunk(A, E);
10217
+ const i = A.data.BYTES_PER_ELEMENT;
10218
+ if (!QB(i))
10214
10219
  throw new Error(
10215
- `Received chunk has an unsupported data type, data=${E.data.constructor.name}`
10220
+ "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
10216
10221
  );
10217
- cB(E);
10218
- const i = {
10219
- x: E.shape[this.dimensions_.x.index],
10220
- y: E.shape[this.dimensions_.y.index],
10221
- z: this.dimensions_.z ? E.shape[this.dimensions_.z.index] : A.shape.z
10222
- };
10223
- if (i.x < A.shape.x || i.y < A.shape.y || i.z < A.shape.z)
10222
+ A.rowAlignmentBytes = i;
10223
+ }
10224
+ // trim any padding (XYZ padding for edge chunks)
10225
+ // and extract the channel/timepoint
10226
+ sliceReceivedChunk(A, I) {
10227
+ const B = I.data;
10228
+ if (!zg(B))
10224
10229
  throw new Error(
10225
- `Received incompatible shape for chunkIndex ${JSON.stringify(A.chunkIndex)} at LOD ${A.lod}: expected shape: ${JSON.stringify(A.shape)}, received shape: ${JSON.stringify(i)} (too small)`
10230
+ `Received chunk has an unsupported data type, data=${I.data.constructor.name}`
10226
10231
  );
10227
- i.x > A.shape.x || i.y > A.shape.y || i.z > A.shape.z ? A.data = this.trimChunkPadding(
10228
- A,
10229
- E.data,
10230
- E.stride
10231
- ) : A.data = E.data;
10232
- const s = A.data.BYTES_PER_ELEMENT;
10233
- if (!QB(s))
10232
+ cB(I);
10233
+ const C = {
10234
+ x: I.shape[this.dimensions_.x.index],
10235
+ y: I.shape[this.dimensions_.y.index],
10236
+ z: this.dimensions_.z ? I.shape[this.dimensions_.z.index] : A.shape.z
10237
+ };
10238
+ if (C.x < A.shape.x || C.y < A.shape.y || C.z < A.shape.z)
10234
10239
  throw new Error(
10235
- "Invalid row alignment value. Possible values are 1, 2, 4, or 8"
10240
+ `Received incompatible shape for chunkIndex ${JSON.stringify(A.chunkIndex)} at LOD ${A.lod}: expected shape: ${JSON.stringify(A.shape)}, received shape: ${JSON.stringify(C)} (too small)`
10236
10241
  );
10237
- A.rowAlignmentBytes = s;
10238
- }
10239
- trimChunkPadding(A, I, B) {
10240
- const C = A.shape.x * A.shape.y * A.shape.z, Q = new I.constructor(C);
10241
- let E = 0;
10242
- const i = this.dimensions_.z ? B[this.dimensions_.z.index] : 0, o = B[this.dimensions_.y.index];
10243
- for (let a = 0; a < A.shape.z; a++) {
10244
- const s = a * i;
10245
- for (let h = 0; h < A.shape.y; h++) {
10246
- const t = s + h * o, y = t + A.shape.x;
10247
- Q.set(I.subarray(t, y), E), E += A.shape.x;
10242
+ const E = I.stride, i = this.dimensions_.c?.lods[A.lod], o = this.dimensions_.t?.lods[A.lod], a = i ? A.chunkIndex.c % i.chunkSize : 0, s = o ? A.chunkIndex.t % o.chunkSize : 0, h = A.shape.x * A.shape.y * A.shape.z, t = this.dimensions_.c ? E[this.dimensions_.c.index] : 0, y = this.dimensions_.t ? E[this.dimensions_.t.index] : 0, n = s * y + a * t, w = C.x === A.shape.x && C.y === A.shape.y && C.z === A.shape.z;
10243
+ if (n === 0 && B.length === h && w)
10244
+ return B;
10245
+ const G = new B.constructor(h), c = this.dimensions_.z ? E[this.dimensions_.z.index] : 0, R = E[this.dimensions_.y.index];
10246
+ let Y = 0;
10247
+ for (let k = 0; k < A.shape.z; k++) {
10248
+ const L = n + k * c;
10249
+ for (let m = 0; m < A.shape.y; m++) {
10250
+ const x = L + m * R, b = x + A.shape.x;
10251
+ G.set(
10252
+ B.subarray(x, b),
10253
+ Y
10254
+ ), Y += A.shape.x;
10248
10255
  }
10249
10256
  }
10250
- return Q;
10257
+ return G;
10251
10258
  }
10252
10259
  async loadRegion(A, I, B) {
10253
10260
  if (I >= this.arrays_.length)
@@ -10655,7 +10662,7 @@ class X {
10655
10662
  const B = [];
10656
10663
  for (const C of I) {
10657
10664
  if (C.status === "aborted")
10658
- return Y;
10665
+ return d;
10659
10666
  C.status === "dirty" && A.dirty(), B.push(C.value);
10660
10667
  }
10661
10668
  return { status: A.value, value: B };
@@ -10676,13 +10683,13 @@ class X {
10676
10683
  for (const C of I) {
10677
10684
  const { key: Q, value: E } = C;
10678
10685
  if (Q.status === "aborted" || E.status === "aborted")
10679
- return Y;
10686
+ return d;
10680
10687
  Q.status === "dirty" && A.dirty(), E.status === "dirty" && A.dirty(), Q.value !== "__proto__" && (typeof E.value < "u" || C.alwaysSet) && (B[Q.value] = E.value);
10681
10688
  }
10682
10689
  return { status: A.value, value: B };
10683
10690
  }
10684
10691
  }
10685
- const Y = Object.freeze({
10692
+ const d = Object.freeze({
10686
10693
  status: "aborted"
10687
10694
  }), KA = (g) => ({ status: "dirty", value: g }), j = (g) => ({ status: "valid", value: g }), Dg = (g) => g.status === "aborted", hg = (g) => g.status === "dirty", LA = (g) => g.status === "valid", II = (g) => typeof Promise < "u" && g instanceof Promise;
10688
10695
  function HI(g, A, I, B) {
@@ -10693,10 +10700,10 @@ function $B(g, A, I, B, C) {
10693
10700
  if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10694
10701
  return A.set(g, I), I;
10695
10702
  }
10696
- var R;
10703
+ var N;
10697
10704
  (function(g) {
10698
10705
  g.errToObj = (A) => typeof A == "string" ? { message: A } : A || {}, g.toString = (A) => typeof A == "string" ? A : A?.message;
10699
- })(R || (R = {}));
10706
+ })(N || (N = {}));
10700
10707
  var VA, vA;
10701
10708
  class sA {
10702
10709
  constructor(A, I, B, C) {
@@ -10992,7 +10999,7 @@ class gA extends K {
10992
10999
  code: e.invalid_type,
10993
11000
  expected: S.string,
10994
11001
  received: Q.parsedType
10995
- }), Y;
11002
+ }), d;
10996
11003
  }
10997
11004
  const B = new X();
10998
11005
  let C;
@@ -11143,7 +11150,7 @@ class gA extends K {
11143
11150
  return this.refinement((C) => A.test(C), {
11144
11151
  validation: I,
11145
11152
  code: e.invalid_string,
11146
- ...R.errToObj(B)
11153
+ ...N.errToObj(B)
11147
11154
  });
11148
11155
  }
11149
11156
  _addCheck(A) {
@@ -11153,46 +11160,46 @@ class gA extends K {
11153
11160
  });
11154
11161
  }
11155
11162
  email(A) {
11156
- return this._addCheck({ kind: "email", ...R.errToObj(A) });
11163
+ return this._addCheck({ kind: "email", ...N.errToObj(A) });
11157
11164
  }
11158
11165
  url(A) {
11159
- return this._addCheck({ kind: "url", ...R.errToObj(A) });
11166
+ return this._addCheck({ kind: "url", ...N.errToObj(A) });
11160
11167
  }
11161
11168
  emoji(A) {
11162
- return this._addCheck({ kind: "emoji", ...R.errToObj(A) });
11169
+ return this._addCheck({ kind: "emoji", ...N.errToObj(A) });
11163
11170
  }
11164
11171
  uuid(A) {
11165
- return this._addCheck({ kind: "uuid", ...R.errToObj(A) });
11172
+ return this._addCheck({ kind: "uuid", ...N.errToObj(A) });
11166
11173
  }
11167
11174
  nanoid(A) {
11168
- return this._addCheck({ kind: "nanoid", ...R.errToObj(A) });
11175
+ return this._addCheck({ kind: "nanoid", ...N.errToObj(A) });
11169
11176
  }
11170
11177
  cuid(A) {
11171
- return this._addCheck({ kind: "cuid", ...R.errToObj(A) });
11178
+ return this._addCheck({ kind: "cuid", ...N.errToObj(A) });
11172
11179
  }
11173
11180
  cuid2(A) {
11174
- return this._addCheck({ kind: "cuid2", ...R.errToObj(A) });
11181
+ return this._addCheck({ kind: "cuid2", ...N.errToObj(A) });
11175
11182
  }
11176
11183
  ulid(A) {
11177
- return this._addCheck({ kind: "ulid", ...R.errToObj(A) });
11184
+ return this._addCheck({ kind: "ulid", ...N.errToObj(A) });
11178
11185
  }
11179
11186
  base64(A) {
11180
- return this._addCheck({ kind: "base64", ...R.errToObj(A) });
11187
+ return this._addCheck({ kind: "base64", ...N.errToObj(A) });
11181
11188
  }
11182
11189
  base64url(A) {
11183
11190
  return this._addCheck({
11184
11191
  kind: "base64url",
11185
- ...R.errToObj(A)
11192
+ ...N.errToObj(A)
11186
11193
  });
11187
11194
  }
11188
11195
  jwt(A) {
11189
- return this._addCheck({ kind: "jwt", ...R.errToObj(A) });
11196
+ return this._addCheck({ kind: "jwt", ...N.errToObj(A) });
11190
11197
  }
11191
11198
  ip(A) {
11192
- return this._addCheck({ kind: "ip", ...R.errToObj(A) });
11199
+ return this._addCheck({ kind: "ip", ...N.errToObj(A) });
11193
11200
  }
11194
11201
  cidr(A) {
11195
- return this._addCheck({ kind: "cidr", ...R.errToObj(A) });
11202
+ return this._addCheck({ kind: "cidr", ...N.errToObj(A) });
11196
11203
  }
11197
11204
  datetime(A) {
11198
11205
  var I, B;
@@ -11207,7 +11214,7 @@ class gA extends K {
11207
11214
  precision: typeof A?.precision > "u" ? null : A?.precision,
11208
11215
  offset: (I = A?.offset) !== null && I !== void 0 ? I : !1,
11209
11216
  local: (B = A?.local) !== null && B !== void 0 ? B : !1,
11210
- ...R.errToObj(A?.message)
11217
+ ...N.errToObj(A?.message)
11211
11218
  });
11212
11219
  }
11213
11220
  date(A) {
@@ -11221,17 +11228,17 @@ class gA extends K {
11221
11228
  }) : this._addCheck({
11222
11229
  kind: "time",
11223
11230
  precision: typeof A?.precision > "u" ? null : A?.precision,
11224
- ...R.errToObj(A?.message)
11231
+ ...N.errToObj(A?.message)
11225
11232
  });
11226
11233
  }
11227
11234
  duration(A) {
11228
- return this._addCheck({ kind: "duration", ...R.errToObj(A) });
11235
+ return this._addCheck({ kind: "duration", ...N.errToObj(A) });
11229
11236
  }
11230
11237
  regex(A, I) {
11231
11238
  return this._addCheck({
11232
11239
  kind: "regex",
11233
11240
  regex: A,
11234
- ...R.errToObj(I)
11241
+ ...N.errToObj(I)
11235
11242
  });
11236
11243
  }
11237
11244
  includes(A, I) {
@@ -11239,49 +11246,49 @@ class gA extends K {
11239
11246
  kind: "includes",
11240
11247
  value: A,
11241
11248
  position: I?.position,
11242
- ...R.errToObj(I?.message)
11249
+ ...N.errToObj(I?.message)
11243
11250
  });
11244
11251
  }
11245
11252
  startsWith(A, I) {
11246
11253
  return this._addCheck({
11247
11254
  kind: "startsWith",
11248
11255
  value: A,
11249
- ...R.errToObj(I)
11256
+ ...N.errToObj(I)
11250
11257
  });
11251
11258
  }
11252
11259
  endsWith(A, I) {
11253
11260
  return this._addCheck({
11254
11261
  kind: "endsWith",
11255
11262
  value: A,
11256
- ...R.errToObj(I)
11263
+ ...N.errToObj(I)
11257
11264
  });
11258
11265
  }
11259
11266
  min(A, I) {
11260
11267
  return this._addCheck({
11261
11268
  kind: "min",
11262
11269
  value: A,
11263
- ...R.errToObj(I)
11270
+ ...N.errToObj(I)
11264
11271
  });
11265
11272
  }
11266
11273
  max(A, I) {
11267
11274
  return this._addCheck({
11268
11275
  kind: "max",
11269
11276
  value: A,
11270
- ...R.errToObj(I)
11277
+ ...N.errToObj(I)
11271
11278
  });
11272
11279
  }
11273
11280
  length(A, I) {
11274
11281
  return this._addCheck({
11275
11282
  kind: "length",
11276
11283
  value: A,
11277
- ...R.errToObj(I)
11284
+ ...N.errToObj(I)
11278
11285
  });
11279
11286
  }
11280
11287
  /**
11281
11288
  * Equivalent to `.min(1)`
11282
11289
  */
11283
11290
  nonempty(A) {
11284
- return this.min(1, R.errToObj(A));
11291
+ return this.min(1, N.errToObj(A));
11285
11292
  }
11286
11293
  trim() {
11287
11294
  return new gA({
@@ -11386,7 +11393,7 @@ class eA extends K {
11386
11393
  code: e.invalid_type,
11387
11394
  expected: S.number,
11388
11395
  received: Q.parsedType
11389
- }), Y;
11396
+ }), d;
11390
11397
  }
11391
11398
  let B;
11392
11399
  const C = new X();
@@ -11421,16 +11428,16 @@ class eA extends K {
11421
11428
  return { status: C.value, value: A.data };
11422
11429
  }
11423
11430
  gte(A, I) {
11424
- return this.setLimit("min", A, !0, R.toString(I));
11431
+ return this.setLimit("min", A, !0, N.toString(I));
11425
11432
  }
11426
11433
  gt(A, I) {
11427
- return this.setLimit("min", A, !1, R.toString(I));
11434
+ return this.setLimit("min", A, !1, N.toString(I));
11428
11435
  }
11429
11436
  lte(A, I) {
11430
- return this.setLimit("max", A, !0, R.toString(I));
11437
+ return this.setLimit("max", A, !0, N.toString(I));
11431
11438
  }
11432
11439
  lt(A, I) {
11433
- return this.setLimit("max", A, !1, R.toString(I));
11440
+ return this.setLimit("max", A, !1, N.toString(I));
11434
11441
  }
11435
11442
  setLimit(A, I, B, C) {
11436
11443
  return new eA({
@@ -11441,7 +11448,7 @@ class eA extends K {
11441
11448
  kind: A,
11442
11449
  value: I,
11443
11450
  inclusive: B,
11444
- message: R.toString(C)
11451
+ message: N.toString(C)
11445
11452
  }
11446
11453
  ]
11447
11454
  });
@@ -11455,7 +11462,7 @@ class eA extends K {
11455
11462
  int(A) {
11456
11463
  return this._addCheck({
11457
11464
  kind: "int",
11458
- message: R.toString(A)
11465
+ message: N.toString(A)
11459
11466
  });
11460
11467
  }
11461
11468
  positive(A) {
@@ -11463,7 +11470,7 @@ class eA extends K {
11463
11470
  kind: "min",
11464
11471
  value: 0,
11465
11472
  inclusive: !1,
11466
- message: R.toString(A)
11473
+ message: N.toString(A)
11467
11474
  });
11468
11475
  }
11469
11476
  negative(A) {
@@ -11471,7 +11478,7 @@ class eA extends K {
11471
11478
  kind: "max",
11472
11479
  value: 0,
11473
11480
  inclusive: !1,
11474
- message: R.toString(A)
11481
+ message: N.toString(A)
11475
11482
  });
11476
11483
  }
11477
11484
  nonpositive(A) {
@@ -11479,7 +11486,7 @@ class eA extends K {
11479
11486
  kind: "max",
11480
11487
  value: 0,
11481
11488
  inclusive: !0,
11482
- message: R.toString(A)
11489
+ message: N.toString(A)
11483
11490
  });
11484
11491
  }
11485
11492
  nonnegative(A) {
@@ -11487,20 +11494,20 @@ class eA extends K {
11487
11494
  kind: "min",
11488
11495
  value: 0,
11489
11496
  inclusive: !0,
11490
- message: R.toString(A)
11497
+ message: N.toString(A)
11491
11498
  });
11492
11499
  }
11493
11500
  multipleOf(A, I) {
11494
11501
  return this._addCheck({
11495
11502
  kind: "multipleOf",
11496
11503
  value: A,
11497
- message: R.toString(I)
11504
+ message: N.toString(I)
11498
11505
  });
11499
11506
  }
11500
11507
  finite(A) {
11501
11508
  return this._addCheck({
11502
11509
  kind: "finite",
11503
- message: R.toString(A)
11510
+ message: N.toString(A)
11504
11511
  });
11505
11512
  }
11506
11513
  safe(A) {
@@ -11508,12 +11515,12 @@ class eA extends K {
11508
11515
  kind: "min",
11509
11516
  inclusive: !0,
11510
11517
  value: Number.MIN_SAFE_INTEGER,
11511
- message: R.toString(A)
11518
+ message: N.toString(A)
11512
11519
  })._addCheck({
11513
11520
  kind: "max",
11514
11521
  inclusive: !0,
11515
11522
  value: Number.MAX_SAFE_INTEGER,
11516
- message: R.toString(A)
11523
+ message: N.toString(A)
11517
11524
  });
11518
11525
  }
11519
11526
  get minValue() {
@@ -11588,19 +11595,19 @@ class GA extends K {
11588
11595
  code: e.invalid_type,
11589
11596
  expected: S.bigint,
11590
11597
  received: I.parsedType
11591
- }), Y;
11598
+ }), d;
11592
11599
  }
11593
11600
  gte(A, I) {
11594
- return this.setLimit("min", A, !0, R.toString(I));
11601
+ return this.setLimit("min", A, !0, N.toString(I));
11595
11602
  }
11596
11603
  gt(A, I) {
11597
- return this.setLimit("min", A, !1, R.toString(I));
11604
+ return this.setLimit("min", A, !1, N.toString(I));
11598
11605
  }
11599
11606
  lte(A, I) {
11600
- return this.setLimit("max", A, !0, R.toString(I));
11607
+ return this.setLimit("max", A, !0, N.toString(I));
11601
11608
  }
11602
11609
  lt(A, I) {
11603
- return this.setLimit("max", A, !1, R.toString(I));
11610
+ return this.setLimit("max", A, !1, N.toString(I));
11604
11611
  }
11605
11612
  setLimit(A, I, B, C) {
11606
11613
  return new GA({
@@ -11611,7 +11618,7 @@ class GA extends K {
11611
11618
  kind: A,
11612
11619
  value: I,
11613
11620
  inclusive: B,
11614
- message: R.toString(C)
11621
+ message: N.toString(C)
11615
11622
  }
11616
11623
  ]
11617
11624
  });
@@ -11627,7 +11634,7 @@ class GA extends K {
11627
11634
  kind: "min",
11628
11635
  value: BigInt(0),
11629
11636
  inclusive: !1,
11630
- message: R.toString(A)
11637
+ message: N.toString(A)
11631
11638
  });
11632
11639
  }
11633
11640
  negative(A) {
@@ -11635,7 +11642,7 @@ class GA extends K {
11635
11642
  kind: "max",
11636
11643
  value: BigInt(0),
11637
11644
  inclusive: !1,
11638
- message: R.toString(A)
11645
+ message: N.toString(A)
11639
11646
  });
11640
11647
  }
11641
11648
  nonpositive(A) {
@@ -11643,7 +11650,7 @@ class GA extends K {
11643
11650
  kind: "max",
11644
11651
  value: BigInt(0),
11645
11652
  inclusive: !0,
11646
- message: R.toString(A)
11653
+ message: N.toString(A)
11647
11654
  });
11648
11655
  }
11649
11656
  nonnegative(A) {
@@ -11651,14 +11658,14 @@ class GA extends K {
11651
11658
  kind: "min",
11652
11659
  value: BigInt(0),
11653
11660
  inclusive: !0,
11654
- message: R.toString(A)
11661
+ message: N.toString(A)
11655
11662
  });
11656
11663
  }
11657
11664
  multipleOf(A, I) {
11658
11665
  return this._addCheck({
11659
11666
  kind: "multipleOf",
11660
11667
  value: A,
11661
- message: R.toString(I)
11668
+ message: N.toString(I)
11662
11669
  });
11663
11670
  }
11664
11671
  get minValue() {
@@ -11691,7 +11698,7 @@ class gI extends K {
11691
11698
  code: e.invalid_type,
11692
11699
  expected: S.boolean,
11693
11700
  received: B.parsedType
11694
- }), Y;
11701
+ }), d;
11695
11702
  }
11696
11703
  return j(A.data);
11697
11704
  }
@@ -11709,13 +11716,13 @@ class JA extends K {
11709
11716
  code: e.invalid_type,
11710
11717
  expected: S.date,
11711
11718
  received: Q.parsedType
11712
- }), Y;
11719
+ }), d;
11713
11720
  }
11714
11721
  if (isNaN(A.data.getTime())) {
11715
11722
  const Q = this._getOrReturnCtx(A);
11716
11723
  return F(Q, {
11717
11724
  code: e.invalid_date
11718
- }), Y;
11725
+ }), d;
11719
11726
  }
11720
11727
  const B = new X();
11721
11728
  let C;
@@ -11750,14 +11757,14 @@ class JA extends K {
11750
11757
  return this._addCheck({
11751
11758
  kind: "min",
11752
11759
  value: A.getTime(),
11753
- message: R.toString(I)
11760
+ message: N.toString(I)
11754
11761
  });
11755
11762
  }
11756
11763
  max(A, I) {
11757
11764
  return this._addCheck({
11758
11765
  kind: "max",
11759
11766
  value: A.getTime(),
11760
- message: R.toString(I)
11767
+ message: N.toString(I)
11761
11768
  });
11762
11769
  }
11763
11770
  get minDate() {
@@ -11787,7 +11794,7 @@ class qI extends K {
11787
11794
  code: e.invalid_type,
11788
11795
  expected: S.symbol,
11789
11796
  received: B.parsedType
11790
- }), Y;
11797
+ }), d;
11791
11798
  }
11792
11799
  return j(A.data);
11793
11800
  }
@@ -11804,7 +11811,7 @@ class BI extends K {
11804
11811
  code: e.invalid_type,
11805
11812
  expected: S.undefined,
11806
11813
  received: B.parsedType
11807
- }), Y;
11814
+ }), d;
11808
11815
  }
11809
11816
  return j(A.data);
11810
11817
  }
@@ -11821,7 +11828,7 @@ class CI extends K {
11821
11828
  code: e.invalid_type,
11822
11829
  expected: S.null,
11823
11830
  received: B.parsedType
11824
- }), Y;
11831
+ }), d;
11825
11832
  }
11826
11833
  return j(A.data);
11827
11834
  }
@@ -11861,7 +11868,7 @@ class yA extends K {
11861
11868
  code: e.invalid_type,
11862
11869
  expected: S.never,
11863
11870
  received: I.parsedType
11864
- }), Y;
11871
+ }), d;
11865
11872
  }
11866
11873
  }
11867
11874
  yA.create = (g) => new yA({
@@ -11876,7 +11883,7 @@ class lI extends K {
11876
11883
  code: e.invalid_type,
11877
11884
  expected: S.void,
11878
11885
  received: B.parsedType
11879
- }), Y;
11886
+ }), d;
11880
11887
  }
11881
11888
  return j(A.data);
11882
11889
  }
@@ -11893,7 +11900,7 @@ class QA extends K {
11893
11900
  code: e.invalid_type,
11894
11901
  expected: S.array,
11895
11902
  received: I.parsedType
11896
- }), Y;
11903
+ }), d;
11897
11904
  if (C.exactLength !== null) {
11898
11905
  const E = I.data.length > C.exactLength.value, i = I.data.length < C.exactLength.value;
11899
11906
  (E || i) && (F(I, {
@@ -11931,19 +11938,19 @@ class QA extends K {
11931
11938
  min(A, I) {
11932
11939
  return new QA({
11933
11940
  ...this._def,
11934
- minLength: { value: A, message: R.toString(I) }
11941
+ minLength: { value: A, message: N.toString(I) }
11935
11942
  });
11936
11943
  }
11937
11944
  max(A, I) {
11938
11945
  return new QA({
11939
11946
  ...this._def,
11940
- maxLength: { value: A, message: R.toString(I) }
11947
+ maxLength: { value: A, message: N.toString(I) }
11941
11948
  });
11942
11949
  }
11943
11950
  length(A, I) {
11944
11951
  return new QA({
11945
11952
  ...this._def,
11946
- exactLength: { value: A, message: R.toString(I) }
11953
+ exactLength: { value: A, message: N.toString(I) }
11947
11954
  });
11948
11955
  }
11949
11956
  nonempty(A) {
@@ -11959,13 +11966,13 @@ QA.create = (g, A) => new QA({
11959
11966
  ...M(A)
11960
11967
  });
11961
11968
  function MA(g) {
11962
- if (g instanceof m) {
11969
+ if (g instanceof u) {
11963
11970
  const A = {};
11964
11971
  for (const I in g.shape) {
11965
11972
  const B = g.shape[I];
11966
11973
  A[I] = aA.create(MA(B));
11967
11974
  }
11968
- return new m({
11975
+ return new u({
11969
11976
  ...g._def,
11970
11977
  shape: () => A
11971
11978
  });
@@ -11974,7 +11981,7 @@ function MA(g) {
11974
11981
  type: MA(g.element)
11975
11982
  }) : g instanceof aA ? aA.create(MA(g.unwrap())) : g instanceof wA ? wA.create(MA(g.unwrap())) : g instanceof DA ? DA.create(g.items.map((A) => MA(A))) : g;
11976
11983
  }
11977
- class m extends K {
11984
+ class u extends K {
11978
11985
  constructor() {
11979
11986
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
11980
11987
  }
@@ -11991,7 +11998,7 @@ class m extends K {
11991
11998
  code: e.invalid_type,
11992
11999
  expected: S.object,
11993
12000
  received: a.parsedType
11994
- }), Y;
12001
+ }), d;
11995
12002
  }
11996
12003
  const { status: B, ctx: C } = this._processInputParams(A), { shape: Q, keys: E } = this._getCached(), i = [];
11997
12004
  if (!(this._def.catchall instanceof yA && this._def.unknownKeys === "strip"))
@@ -12051,7 +12058,7 @@ class m extends K {
12051
12058
  return this._def.shape();
12052
12059
  }
12053
12060
  strict(A) {
12054
- return R.errToObj, new m({
12061
+ return N.errToObj, new u({
12055
12062
  ...this._def,
12056
12063
  unknownKeys: "strict",
12057
12064
  ...A !== void 0 ? {
@@ -12059,7 +12066,7 @@ class m extends K {
12059
12066
  var C, Q, E, i;
12060
12067
  const o = (E = (Q = (C = this._def).errorMap) === null || Q === void 0 ? void 0 : Q.call(C, I, B).message) !== null && E !== void 0 ? E : B.defaultError;
12061
12068
  return I.code === "unrecognized_keys" ? {
12062
- message: (i = R.errToObj(A).message) !== null && i !== void 0 ? i : o
12069
+ message: (i = N.errToObj(A).message) !== null && i !== void 0 ? i : o
12063
12070
  } : {
12064
12071
  message: o
12065
12072
  };
@@ -12068,13 +12075,13 @@ class m extends K {
12068
12075
  });
12069
12076
  }
12070
12077
  strip() {
12071
- return new m({
12078
+ return new u({
12072
12079
  ...this._def,
12073
12080
  unknownKeys: "strip"
12074
12081
  });
12075
12082
  }
12076
12083
  passthrough() {
12077
- return new m({
12084
+ return new u({
12078
12085
  ...this._def,
12079
12086
  unknownKeys: "passthrough"
12080
12087
  });
@@ -12097,7 +12104,7 @@ class m extends K {
12097
12104
  // }) as any;
12098
12105
  // };
12099
12106
  extend(A) {
12100
- return new m({
12107
+ return new u({
12101
12108
  ...this._def,
12102
12109
  shape: () => ({
12103
12110
  ...this._def.shape(),
@@ -12111,7 +12118,7 @@ class m extends K {
12111
12118
  * upgrade if you are experiencing issues.
12112
12119
  */
12113
12120
  merge(A) {
12114
- return new m({
12121
+ return new u({
12115
12122
  unknownKeys: A._def.unknownKeys,
12116
12123
  catchall: A._def.catchall,
12117
12124
  shape: () => ({
@@ -12181,7 +12188,7 @@ class m extends K {
12181
12188
  // return merged;
12182
12189
  // }
12183
12190
  catchall(A) {
12184
- return new m({
12191
+ return new u({
12185
12192
  ...this._def,
12186
12193
  catchall: A
12187
12194
  });
@@ -12190,7 +12197,7 @@ class m extends K {
12190
12197
  const I = {};
12191
12198
  return H.objectKeys(A).forEach((B) => {
12192
12199
  A[B] && this.shape[B] && (I[B] = this.shape[B]);
12193
- }), new m({
12200
+ }), new u({
12194
12201
  ...this._def,
12195
12202
  shape: () => I
12196
12203
  });
@@ -12199,7 +12206,7 @@ class m extends K {
12199
12206
  const I = {};
12200
12207
  return H.objectKeys(this.shape).forEach((B) => {
12201
12208
  A[B] || (I[B] = this.shape[B]);
12202
- }), new m({
12209
+ }), new u({
12203
12210
  ...this._def,
12204
12211
  shape: () => I
12205
12212
  });
@@ -12215,7 +12222,7 @@ class m extends K {
12215
12222
  return H.objectKeys(this.shape).forEach((B) => {
12216
12223
  const C = this.shape[B];
12217
12224
  A && !A[B] ? I[B] = C : I[B] = C.optional();
12218
- }), new m({
12225
+ }), new u({
12219
12226
  ...this._def,
12220
12227
  shape: () => I
12221
12228
  });
@@ -12231,7 +12238,7 @@ class m extends K {
12231
12238
  Q = Q._def.innerType;
12232
12239
  I[B] = Q;
12233
12240
  }
12234
- }), new m({
12241
+ }), new u({
12235
12242
  ...this._def,
12236
12243
  shape: () => I
12237
12244
  });
@@ -12240,21 +12247,21 @@ class m extends K {
12240
12247
  return BC(H.objectKeys(this.shape));
12241
12248
  }
12242
12249
  }
12243
- m.create = (g, A) => new m({
12250
+ u.create = (g, A) => new u({
12244
12251
  shape: () => g,
12245
12252
  unknownKeys: "strip",
12246
12253
  catchall: yA.create(),
12247
12254
  typeName: J.ZodObject,
12248
12255
  ...M(A)
12249
12256
  });
12250
- m.strictCreate = (g, A) => new m({
12257
+ u.strictCreate = (g, A) => new u({
12251
12258
  shape: () => g,
12252
12259
  unknownKeys: "strict",
12253
12260
  catchall: yA.create(),
12254
12261
  typeName: J.ZodObject,
12255
12262
  ...M(A)
12256
12263
  });
12257
- m.lazycreate = (g, A) => new m({
12264
+ u.lazycreate = (g, A) => new u({
12258
12265
  shape: g,
12259
12266
  unknownKeys: "strip",
12260
12267
  catchall: yA.create(),
@@ -12275,7 +12282,7 @@ class QI extends K {
12275
12282
  return F(I, {
12276
12283
  code: e.invalid_union,
12277
12284
  unionErrors: E
12278
- }), Y;
12285
+ }), d;
12279
12286
  }
12280
12287
  if (I.common.async)
12281
12288
  return Promise.all(B.map(async (Q) => {
@@ -12322,7 +12329,7 @@ class QI extends K {
12322
12329
  return F(I, {
12323
12330
  code: e.invalid_union,
12324
12331
  unionErrors: i
12325
- }), Y;
12332
+ }), d;
12326
12333
  }
12327
12334
  }
12328
12335
  get options() {
@@ -12343,7 +12350,7 @@ class bI extends K {
12343
12350
  code: e.invalid_type,
12344
12351
  expected: S.object,
12345
12352
  received: I.parsedType
12346
- }), Y;
12353
+ }), d;
12347
12354
  const B = this.discriminator, C = I.data[B], Q = this.optionsMap.get(C);
12348
12355
  return Q ? I.common.async ? Q._parseAsync({
12349
12356
  data: I.data,
@@ -12357,7 +12364,7 @@ class bI extends K {
12357
12364
  code: e.invalid_union_discriminator,
12358
12365
  options: Array.from(this.optionsMap.keys()),
12359
12366
  path: [B]
12360
- }), Y);
12367
+ }), d);
12361
12368
  }
12362
12369
  get discriminator() {
12363
12370
  return this._def.discriminator;
@@ -12427,11 +12434,11 @@ class EI extends K {
12427
12434
  _parse(A) {
12428
12435
  const { status: I, ctx: B } = this._processInputParams(A), C = (Q, E) => {
12429
12436
  if (Dg(Q) || Dg(E))
12430
- return Y;
12437
+ return d;
12431
12438
  const i = tg(Q.value, E.value);
12432
12439
  return i.valid ? ((hg(Q) || hg(E)) && I.dirty(), { status: I.value, value: i.data }) : (F(B, {
12433
12440
  code: e.invalid_intersection_types
12434
- }), Y);
12441
+ }), d);
12435
12442
  };
12436
12443
  return B.common.async ? Promise.all([
12437
12444
  this._def.left._parseAsync({
@@ -12469,7 +12476,7 @@ class DA extends K {
12469
12476
  code: e.invalid_type,
12470
12477
  expected: S.array,
12471
12478
  received: B.parsedType
12472
- }), Y;
12479
+ }), d;
12473
12480
  if (B.data.length < this._def.items.length)
12474
12481
  return F(B, {
12475
12482
  code: e.too_small,
@@ -12477,7 +12484,7 @@ class DA extends K {
12477
12484
  inclusive: !0,
12478
12485
  exact: !1,
12479
12486
  type: "array"
12480
- }), Y;
12487
+ }), d;
12481
12488
  !this._def.rest && B.data.length > this._def.items.length && (F(B, {
12482
12489
  code: e.too_big,
12483
12490
  maximum: this._def.items.length,
@@ -12525,7 +12532,7 @@ class iI extends K {
12525
12532
  code: e.invalid_type,
12526
12533
  expected: S.object,
12527
12534
  received: B.parsedType
12528
- }), Y;
12535
+ }), d;
12529
12536
  const C = [], Q = this._def.keyType, E = this._def.valueType;
12530
12537
  for (const i in B.data)
12531
12538
  C.push({
@@ -12566,7 +12573,7 @@ class fI extends K {
12566
12573
  code: e.invalid_type,
12567
12574
  expected: S.map,
12568
12575
  received: B.parsedType
12569
- }), Y;
12576
+ }), d;
12570
12577
  const C = this._def.keyType, Q = this._def.valueType, E = [...B.data.entries()].map(([i, o], a) => ({
12571
12578
  key: C._parse(new sA(B, i, B.path, [a, "key"])),
12572
12579
  value: Q._parse(new sA(B, o, B.path, [a, "value"]))
@@ -12577,7 +12584,7 @@ class fI extends K {
12577
12584
  for (const o of E) {
12578
12585
  const a = await o.key, s = await o.value;
12579
12586
  if (a.status === "aborted" || s.status === "aborted")
12580
- return Y;
12587
+ return d;
12581
12588
  (a.status === "dirty" || s.status === "dirty") && I.dirty(), i.set(a.value, s.value);
12582
12589
  }
12583
12590
  return { status: I.value, value: i };
@@ -12587,7 +12594,7 @@ class fI extends K {
12587
12594
  for (const o of E) {
12588
12595
  const a = o.key, s = o.value;
12589
12596
  if (a.status === "aborted" || s.status === "aborted")
12590
- return Y;
12597
+ return d;
12591
12598
  (a.status === "dirty" || s.status === "dirty") && I.dirty(), i.set(a.value, s.value);
12592
12599
  }
12593
12600
  return { status: I.value, value: i };
@@ -12608,7 +12615,7 @@ class YA extends K {
12608
12615
  code: e.invalid_type,
12609
12616
  expected: S.set,
12610
12617
  received: B.parsedType
12611
- }), Y;
12618
+ }), d;
12612
12619
  const C = this._def;
12613
12620
  C.minSize !== null && B.data.size < C.minSize.value && (F(B, {
12614
12621
  code: e.too_small,
@@ -12630,7 +12637,7 @@ class YA extends K {
12630
12637
  const a = /* @__PURE__ */ new Set();
12631
12638
  for (const s of o) {
12632
12639
  if (s.status === "aborted")
12633
- return Y;
12640
+ return d;
12634
12641
  s.status === "dirty" && I.dirty(), a.add(s.value);
12635
12642
  }
12636
12643
  return { status: I.value, value: a };
@@ -12641,13 +12648,13 @@ class YA extends K {
12641
12648
  min(A, I) {
12642
12649
  return new YA({
12643
12650
  ...this._def,
12644
- minSize: { value: A, message: R.toString(I) }
12651
+ minSize: { value: A, message: N.toString(I) }
12645
12652
  });
12646
12653
  }
12647
12654
  max(A, I) {
12648
12655
  return new YA({
12649
12656
  ...this._def,
12650
- maxSize: { value: A, message: R.toString(I) }
12657
+ maxSize: { value: A, message: N.toString(I) }
12651
12658
  });
12652
12659
  }
12653
12660
  size(A, I) {
@@ -12675,7 +12682,7 @@ class qA extends K {
12675
12682
  code: e.invalid_type,
12676
12683
  expected: S.function,
12677
12684
  received: I.parsedType
12678
- }), Y;
12685
+ }), d;
12679
12686
  function B(i, o) {
12680
12687
  return KI({
12681
12688
  data: i,
@@ -12787,7 +12794,7 @@ class aI extends K {
12787
12794
  received: I.data,
12788
12795
  code: e.invalid_literal,
12789
12796
  expected: this._def.value
12790
- }), Y;
12797
+ }), d;
12791
12798
  }
12792
12799
  return { status: "valid", value: A.data };
12793
12800
  }
@@ -12818,7 +12825,7 @@ class nA extends K {
12818
12825
  expected: H.joinValues(B),
12819
12826
  received: I.parsedType,
12820
12827
  code: e.invalid_type
12821
- }), Y;
12828
+ }), d;
12822
12829
  }
12823
12830
  if (HI(this, VA) || $B(this, VA, new Set(this._def.values)), !HI(this, VA).has(A.data)) {
12824
12831
  const I = this._getOrReturnCtx(A), B = this._def.values;
@@ -12826,7 +12833,7 @@ class nA extends K {
12826
12833
  received: I.data,
12827
12834
  code: e.invalid_enum_value,
12828
12835
  options: B
12829
- }), Y;
12836
+ }), d;
12830
12837
  }
12831
12838
  return j(A.data);
12832
12839
  }
@@ -12878,7 +12885,7 @@ class sI extends K {
12878
12885
  expected: H.joinValues(C),
12879
12886
  received: B.parsedType,
12880
12887
  code: e.invalid_type
12881
- }), Y;
12888
+ }), d;
12882
12889
  }
12883
12890
  if (HI(this, vA) || $B(this, vA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, vA).has(A.data)) {
12884
12891
  const C = H.objectValues(I);
@@ -12886,7 +12893,7 @@ class sI extends K {
12886
12893
  received: B.data,
12887
12894
  code: e.invalid_enum_value,
12888
12895
  options: C
12889
- }), Y;
12896
+ }), d;
12890
12897
  }
12891
12898
  return j(A.data);
12892
12899
  }
@@ -12911,7 +12918,7 @@ class xA extends K {
12911
12918
  code: e.invalid_type,
12912
12919
  expected: S.promise,
12913
12920
  received: I.parsedType
12914
- }), Y;
12921
+ }), d;
12915
12922
  const B = I.parsedType === S.promise ? I.data : Promise.resolve(I.data);
12916
12923
  return j(B.then((C) => this._def.type.parseAsync(C, {
12917
12924
  path: I.path,
@@ -12945,23 +12952,23 @@ class EA extends K {
12945
12952
  if (B.common.async)
12946
12953
  return Promise.resolve(E).then(async (i) => {
12947
12954
  if (I.value === "aborted")
12948
- return Y;
12955
+ return d;
12949
12956
  const o = await this._def.schema._parseAsync({
12950
12957
  data: i,
12951
12958
  path: B.path,
12952
12959
  parent: B
12953
12960
  });
12954
- return o.status === "aborted" ? Y : o.status === "dirty" || I.value === "dirty" ? KA(o.value) : o;
12961
+ return o.status === "aborted" ? d : o.status === "dirty" || I.value === "dirty" ? KA(o.value) : o;
12955
12962
  });
12956
12963
  {
12957
12964
  if (I.value === "aborted")
12958
- return Y;
12965
+ return d;
12959
12966
  const i = this._def.schema._parseSync({
12960
12967
  data: E,
12961
12968
  path: B.path,
12962
12969
  parent: B
12963
12970
  });
12964
- return i.status === "aborted" ? Y : i.status === "dirty" || I.value === "dirty" ? KA(i.value) : i;
12971
+ return i.status === "aborted" ? d : i.status === "dirty" || I.value === "dirty" ? KA(i.value) : i;
12965
12972
  }
12966
12973
  }
12967
12974
  if (C.type === "refinement") {
@@ -12979,9 +12986,9 @@ class EA extends K {
12979
12986
  path: B.path,
12980
12987
  parent: B
12981
12988
  });
12982
- return i.status === "aborted" ? Y : (i.status === "dirty" && I.dirty(), E(i.value), { status: I.value, value: i.value });
12989
+ return i.status === "aborted" ? d : (i.status === "dirty" && I.dirty(), E(i.value), { status: I.value, value: i.value });
12983
12990
  } else
12984
- return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((i) => i.status === "aborted" ? Y : (i.status === "dirty" && I.dirty(), E(i.value).then(() => ({ status: I.value, value: i.value }))));
12991
+ return this._def.schema._parseAsync({ data: B.data, path: B.path, parent: B }).then((i) => i.status === "aborted" ? d : (i.status === "dirty" && I.dirty(), E(i.value).then(() => ({ status: I.value, value: i.value }))));
12985
12992
  }
12986
12993
  if (C.type === "transform")
12987
12994
  if (B.common.async === !1) {
@@ -13110,7 +13117,7 @@ class pI extends K {
13110
13117
  code: e.invalid_type,
13111
13118
  expected: S.nan,
13112
13119
  received: B.parsedType
13113
- }), Y;
13120
+ }), d;
13114
13121
  }
13115
13122
  return { status: "valid", value: A.data };
13116
13123
  }
@@ -13143,7 +13150,7 @@ class FI extends K {
13143
13150
  path: B.path,
13144
13151
  parent: B
13145
13152
  });
13146
- return Q.status === "aborted" ? Y : Q.status === "dirty" ? (I.dirty(), KA(Q.value)) : this._def.out._parseAsync({
13153
+ return Q.status === "aborted" ? d : Q.status === "dirty" ? (I.dirty(), KA(Q.value)) : this._def.out._parseAsync({
13147
13154
  data: Q.value,
13148
13155
  path: B.path,
13149
13156
  parent: B
@@ -13155,7 +13162,7 @@ class FI extends K {
13155
13162
  path: B.path,
13156
13163
  parent: B
13157
13164
  });
13158
- return C.status === "aborted" ? Y : C.status === "dirty" ? (I.dirty(), {
13165
+ return C.status === "aborted" ? d : C.status === "dirty" ? (I.dirty(), {
13159
13166
  status: "dirty",
13160
13167
  value: C.value
13161
13168
  }) : this._def.out._parseSync({
@@ -13210,7 +13217,7 @@ function CC(g, A = {}, I) {
13210
13217
  }) : TA.create();
13211
13218
  }
13212
13219
  const Hi = {
13213
- object: m.lazycreate
13220
+ object: u.lazycreate
13214
13221
  };
13215
13222
  var J;
13216
13223
  (function(g) {
@@ -13218,7 +13225,7 @@ var J;
13218
13225
  })(J || (J = {}));
13219
13226
  const qi = (g, A = {
13220
13227
  message: `Input not instance of ${g.name}`
13221
- }) => CC((I) => I instanceof g, A), QC = gA.create, EC = eA.create, li = pI.create, fi = GA.create, iC = gI.create, pi = JA.create, mi = qI.create, ui = BI.create, Ti = CI.create, xi = TA.create, Wi = NA.create, bi = yA.create, Zi = lI.create, Pi = QA.create, Oi = m.create, Vi = m.strictCreate, vi = QI.create, Xi = bI.create, ji = EI.create, zi = DA.create, _i = iI.create, $i = fI.create, Ao = YA.create, Io = qA.create, go = oI.create, Bo = aI.create, Co = nA.create, Qo = sI.create, Eo = xA.create, LB = EA.create, io = aA.create, oo = wA.create, ao = EA.createWithPreprocess, so = FI.create, Do = () => QC().optional(), ho = () => EC().optional(), to = () => iC().optional(), yo = {
13228
+ }) => CC((I) => I instanceof g, A), QC = gA.create, EC = eA.create, li = pI.create, fi = GA.create, iC = gI.create, pi = JA.create, mi = qI.create, ui = BI.create, Ti = CI.create, xi = TA.create, Wi = NA.create, bi = yA.create, Zi = lI.create, Pi = QA.create, Oi = u.create, Vi = u.strictCreate, vi = QI.create, Xi = bI.create, ji = EI.create, zi = DA.create, _i = iI.create, $i = fI.create, Ao = YA.create, Io = qA.create, go = oI.create, Bo = aI.create, Co = nA.create, Qo = sI.create, Eo = xA.create, LB = EA.create, io = aA.create, oo = wA.create, ao = EA.createWithPreprocess, so = FI.create, Do = () => QC().optional(), ho = () => EC().optional(), to = () => iC().optional(), yo = {
13222
13229
  string: (g) => gA.create({ ...g, coerce: !0 }),
13223
13230
  number: (g) => eA.create({ ...g, coerce: !0 }),
13224
13231
  boolean: (g) => gI.create({
@@ -13227,7 +13234,7 @@ const qi = (g, A = {
13227
13234
  }),
13228
13235
  bigint: (g) => GA.create({ ...g, coerce: !0 }),
13229
13236
  date: (g) => JA.create({ ...g, coerce: !0 })
13230
- }, eo = Y;
13237
+ }, eo = d;
13231
13238
  var D = /* @__PURE__ */ Object.freeze({
13232
13239
  __proto__: null,
13233
13240
  defaultErrorMap: uA,
@@ -13237,7 +13244,7 @@ var D = /* @__PURE__ */ Object.freeze({
13237
13244
  EMPTY_PATH: si,
13238
13245
  addIssueToContext: F,
13239
13246
  ParseStatus: X,
13240
- INVALID: Y,
13247
+ INVALID: d,
13241
13248
  DIRTY: KA,
13242
13249
  OK: j,
13243
13250
  isAborted: Dg,
@@ -13267,7 +13274,7 @@ var D = /* @__PURE__ */ Object.freeze({
13267
13274
  ZodNever: yA,
13268
13275
  ZodVoid: lI,
13269
13276
  ZodArray: QA,
13270
- ZodObject: m,
13277
+ ZodObject: u,
13271
13278
  ZodUnion: QI,
13272
13279
  ZodDiscriminatedUnion: bI,
13273
13280
  ZodIntersection: EI,