@idetik/core 0.2.3 → 0.3.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.d.ts +19 -3
- package/dist/index.js +687 -658
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +26 -26
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/data/ome_zarr/image_source.d.ts +20 -3
- package/dist/types/src/data/ome_zarr/image_source.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ class l {
|
|
|
64
64
|
return I.length === 1 ? "0" + I : I;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class PB {
|
|
68
68
|
canvas_;
|
|
69
69
|
width_ = 0;
|
|
70
70
|
height_ = 0;
|
|
@@ -98,7 +98,7 @@ class ZB {
|
|
|
98
98
|
this.backgroundColor_ = l.from(A);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
var
|
|
101
|
+
var OB = `#version 300 es
|
|
102
102
|
|
|
103
103
|
const float PI = 3.14159265;
|
|
104
104
|
|
|
@@ -164,7 +164,7 @@ void main() {
|
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
gl_PointSize = 5.0;
|
|
167
|
-
}`,
|
|
167
|
+
}`, VB = `#version 300 es
|
|
168
168
|
|
|
169
169
|
precision mediump float;
|
|
170
170
|
|
|
@@ -251,7 +251,7 @@ void main() {
|
|
|
251
251
|
rgbColor += value * Color[i];
|
|
252
252
|
}
|
|
253
253
|
fragColor = vec4(rgbColor, u_opacity);
|
|
254
|
-
}`,
|
|
254
|
+
}`, vB = `#version 300 es
|
|
255
255
|
|
|
256
256
|
precision mediump float;
|
|
257
257
|
|
|
@@ -271,7 +271,7 @@ void main() {
|
|
|
271
271
|
gl_PointSize = inSize;
|
|
272
272
|
color = inColor;
|
|
273
273
|
marker = uint(inMarker);
|
|
274
|
-
}`,
|
|
274
|
+
}`, XB = `#version 300 es
|
|
275
275
|
|
|
276
276
|
precision mediump float;
|
|
277
277
|
|
|
@@ -291,7 +291,7 @@ void main() {
|
|
|
291
291
|
discard;
|
|
292
292
|
}
|
|
293
293
|
fragColor = vec4(color.rgb, u_opacity * alpha * color.a);
|
|
294
|
-
}`,
|
|
294
|
+
}`, jB = `#version 300 es
|
|
295
295
|
|
|
296
296
|
layout (location = 0) in vec3 inPosition;
|
|
297
297
|
layout (location = 1) in vec3 inNormal;
|
|
@@ -301,7 +301,7 @@ uniform mat4 ModelView;
|
|
|
301
301
|
|
|
302
302
|
void main() {
|
|
303
303
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
304
|
-
}`,
|
|
304
|
+
}`, zB = `#version 300 es
|
|
305
305
|
|
|
306
306
|
precision mediump float;
|
|
307
307
|
|
|
@@ -353,7 +353,7 @@ void main() {
|
|
|
353
353
|
}
|
|
354
354
|
float displayValue = alpha;
|
|
355
355
|
fragColor = vec4(displayValue, displayValue, displayValue, 1.0);
|
|
356
|
-
}`,
|
|
356
|
+
}`, _B = `#version 300 es
|
|
357
357
|
|
|
358
358
|
precision mediump float;
|
|
359
359
|
precision highp int;
|
|
@@ -443,18 +443,18 @@ void main() {
|
|
|
443
443
|
|
|
444
444
|
fragColor = vec4(color.rgb, alpha);
|
|
445
445
|
}`;
|
|
446
|
-
const
|
|
446
|
+
const $B = {
|
|
447
447
|
projectedLine: {
|
|
448
|
-
vertex:
|
|
449
|
-
fragment:
|
|
448
|
+
vertex: OB,
|
|
449
|
+
fragment: VB
|
|
450
450
|
},
|
|
451
451
|
points: {
|
|
452
|
-
vertex:
|
|
453
|
-
fragment:
|
|
452
|
+
vertex: vB,
|
|
453
|
+
fragment: XB
|
|
454
454
|
},
|
|
455
455
|
wireframe: {
|
|
456
|
-
vertex:
|
|
457
|
-
fragment:
|
|
456
|
+
vertex: jB,
|
|
457
|
+
fragment: zB
|
|
458
458
|
},
|
|
459
459
|
floatScalarImage: {
|
|
460
460
|
vertex: nA,
|
|
@@ -486,7 +486,7 @@ const _B = {
|
|
|
486
486
|
},
|
|
487
487
|
labelImage: {
|
|
488
488
|
vertex: nA,
|
|
489
|
-
fragment:
|
|
489
|
+
fragment: _B
|
|
490
490
|
},
|
|
491
491
|
floatVolume: {
|
|
492
492
|
vertex: fI,
|
|
@@ -502,12 +502,12 @@ const _B = {
|
|
|
502
502
|
fragment: pI,
|
|
503
503
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
504
504
|
}
|
|
505
|
-
},
|
|
505
|
+
}, Mg = {
|
|
506
506
|
debug: 10,
|
|
507
507
|
info: 20,
|
|
508
508
|
warn: 30,
|
|
509
509
|
error: 40
|
|
510
|
-
},
|
|
510
|
+
}, AQ = {
|
|
511
511
|
debug: "\x1B[90m",
|
|
512
512
|
// gray
|
|
513
513
|
info: "\x1B[36m",
|
|
@@ -517,7 +517,7 @@ const _B = {
|
|
|
517
517
|
error: "\x1B[31m"
|
|
518
518
|
// red
|
|
519
519
|
};
|
|
520
|
-
function
|
|
520
|
+
function IQ() {
|
|
521
521
|
const g = typeof process < "u" && typeof process.env?.NODE_ENV == "string" ? process.env.NODE_ENV : void 0;
|
|
522
522
|
if (g === "production" || g === "development" || g === "test")
|
|
523
523
|
return g;
|
|
@@ -529,7 +529,7 @@ function AQ() {
|
|
|
529
529
|
return "development";
|
|
530
530
|
}
|
|
531
531
|
class c {
|
|
532
|
-
static logLevel_ =
|
|
532
|
+
static logLevel_ = IQ() === "production" ? "warn" : "debug";
|
|
533
533
|
static setLogLevel(A) {
|
|
534
534
|
c.logLevel_ = A;
|
|
535
535
|
}
|
|
@@ -546,8 +546,8 @@ class c {
|
|
|
546
546
|
c.log("error", A, I, ...B);
|
|
547
547
|
}
|
|
548
548
|
static log(A, I, B, ...Q) {
|
|
549
|
-
if (
|
|
550
|
-
const C = (/* @__PURE__ */ new Date()).toISOString(), E =
|
|
549
|
+
if (Mg[A] < Mg[c.logLevel_]) return;
|
|
550
|
+
const C = (/* @__PURE__ */ new Date()).toISOString(), E = AQ[A], i = `[${C}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...Q];
|
|
551
551
|
switch (A) {
|
|
552
552
|
case "debug":
|
|
553
553
|
console.debug(...o);
|
|
@@ -564,7 +564,7 @@ class c {
|
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
class
|
|
567
|
+
class gQ {
|
|
568
568
|
gl_;
|
|
569
569
|
program_;
|
|
570
570
|
uniformInfo_ = /* @__PURE__ */ new Map();
|
|
@@ -643,7 +643,7 @@ class IQ {
|
|
|
643
643
|
for (let I = 0; I < A; I++) {
|
|
644
644
|
const B = this.gl_.getActiveUniform(this.program_, I);
|
|
645
645
|
if (B) {
|
|
646
|
-
if (!
|
|
646
|
+
if (!QQ.has(B.type))
|
|
647
647
|
throw new Error(
|
|
648
648
|
`Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
|
|
649
649
|
);
|
|
@@ -684,7 +684,7 @@ class IQ {
|
|
|
684
684
|
return Array.from(this.uniformInfo_.keys());
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const BQ = typeof window < "u" ? [
|
|
688
688
|
WebGL2RenderingContext.BOOL,
|
|
689
689
|
WebGL2RenderingContext.FLOAT,
|
|
690
690
|
WebGL2RenderingContext.FLOAT_VEC2,
|
|
@@ -707,10 +707,10 @@ const gQ = typeof window < "u" ? [
|
|
|
707
707
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D,
|
|
708
708
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_CUBE,
|
|
709
709
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
710
|
-
] : [],
|
|
711
|
-
|
|
710
|
+
] : [], QQ = new Set(
|
|
711
|
+
BQ
|
|
712
712
|
), mI = "#pragma inject_defines";
|
|
713
|
-
class
|
|
713
|
+
class CQ {
|
|
714
714
|
gl_;
|
|
715
715
|
programs_ = /* @__PURE__ */ new Map();
|
|
716
716
|
constructor(A) {
|
|
@@ -719,14 +719,14 @@ class QQ {
|
|
|
719
719
|
use(A) {
|
|
720
720
|
let I = this.programs_.get(A);
|
|
721
721
|
if (I === void 0) {
|
|
722
|
-
const B =
|
|
722
|
+
const B = $B[A], Q = Kg(
|
|
723
723
|
B.vertex,
|
|
724
724
|
B.vertexDefines
|
|
725
|
-
), C =
|
|
725
|
+
), C = Kg(
|
|
726
726
|
B.fragment,
|
|
727
727
|
B.fragmentDefines
|
|
728
728
|
);
|
|
729
|
-
I = new
|
|
729
|
+
I = new gQ(
|
|
730
730
|
this.gl_,
|
|
731
731
|
Q,
|
|
732
732
|
C
|
|
@@ -740,7 +740,7 @@ class QQ {
|
|
|
740
740
|
return I;
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Kg(g, A) {
|
|
744
744
|
if (A === void 0 || A.size == 0) return g;
|
|
745
745
|
if (!g.includes(mI))
|
|
746
746
|
throw new Error(
|
|
@@ -1009,34 +1009,34 @@ const W = [
|
|
|
1009
1009
|
"fe",
|
|
1010
1010
|
"ff"
|
|
1011
1011
|
];
|
|
1012
|
-
function
|
|
1012
|
+
function DB() {
|
|
1013
1013
|
const g = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, I = Math.random() * 4294967295 | 0, B = Math.random() * 4294967295 | 0;
|
|
1014
1014
|
return (W[g & 255] + W[g >> 8 & 255] + W[g >> 16 & 255] + W[g >> 24 & 255] + "-" + W[A & 255] + W[A >> 8 & 255] + "-" + W[A >> 16 & 15 | 64] + W[A >> 24 & 255] + "-" + W[I & 63 | 128] + W[I >> 8 & 255] + "-" + W[I >> 16 & 255] + W[I >> 24 & 255] + W[B & 255] + W[B >> 8 & 255] + W[B >> 16 & 255] + W[B >> 24 & 255]).toLowerCase();
|
|
1015
1015
|
}
|
|
1016
|
-
class
|
|
1017
|
-
uuid =
|
|
1016
|
+
class Eg {
|
|
1017
|
+
uuid = DB();
|
|
1018
1018
|
}
|
|
1019
|
-
var rA = 1e-6, T = typeof Float32Array < "u" ? Float32Array : Array,
|
|
1020
|
-
function
|
|
1021
|
-
return g *
|
|
1019
|
+
var rA = 1e-6, T = typeof Float32Array < "u" ? Float32Array : Array, EQ = Math.PI / 180;
|
|
1020
|
+
function iQ(g) {
|
|
1021
|
+
return g * EQ;
|
|
1022
1022
|
}
|
|
1023
1023
|
Math.hypot || (Math.hypot = function() {
|
|
1024
1024
|
for (var g = 0, A = arguments.length; A--; )
|
|
1025
1025
|
g += arguments[A] * arguments[A];
|
|
1026
1026
|
return Math.sqrt(g);
|
|
1027
1027
|
});
|
|
1028
|
-
function
|
|
1028
|
+
function sB() {
|
|
1029
1029
|
var g = new T(9);
|
|
1030
1030
|
return T != 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;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function oQ(g, A) {
|
|
1033
1033
|
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;
|
|
1034
1034
|
}
|
|
1035
1035
|
function AA() {
|
|
1036
1036
|
var g = new T(16);
|
|
1037
1037
|
return T != 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;
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function ig(g, A) {
|
|
1040
1040
|
var I = A[0], B = A[1], Q = A[2], C = A[3], E = A[4], i = A[5], o = A[6], a = A[7], D = A[8], h = A[9], y = A[10], t = A[11], e = A[12], r = A[13], R = A[14], F = A[15], k = I * i - B * E, N = I * o - Q * E, K = I * a - C * E, Y = B * o - Q * i, J = B * a - C * i, O = Q * a - C * o, V = D * r - h * e, X = D * R - y * e, b = D * F - t * e, Z = h * R - y * r, wA = h * F - t * r, FA = y * F - t * R, m = k * FA - N * wA + K * Z + Y * b - J * X + O * V;
|
|
1041
1041
|
return m ? (m = 1 / m, g[0] = (i * FA - o * wA + a * Z) * m, g[1] = (Q * wA - B * FA - C * Z) * m, g[2] = (r * O - R * J + F * Y) * m, g[3] = (y * J - h * O - t * Y) * m, g[4] = (o * b - E * FA - a * X) * m, g[5] = (I * FA - Q * b + C * X) * m, g[6] = (R * K - e * O - F * N) * m, g[7] = (D * O - y * K + t * N) * m, g[8] = (E * wA - i * b + a * V) * m, g[9] = (B * b - I * wA - C * V) * m, g[10] = (e * J - r * K + F * k) * m, g[11] = (h * K - D * J - t * k) * m, g[12] = (i * X - E * Z - o * V) * m, g[13] = (I * Z - B * X + Q * V) * m, g[14] = (r * N - e * Y - R * k) * m, g[15] = (D * Y - h * N + y * k) * m, g) : null;
|
|
1042
1042
|
}
|
|
@@ -1044,24 +1044,24 @@ function wI(g, A, I) {
|
|
|
1044
1044
|
var B = A[0], Q = A[1], C = A[2], E = A[3], i = A[4], o = A[5], a = A[6], D = A[7], h = A[8], y = A[9], t = A[10], e = A[11], r = A[12], R = A[13], F = A[14], k = A[15], N = I[0], K = I[1], Y = I[2], J = I[3];
|
|
1045
1045
|
return g[0] = N * B + K * i + Y * h + J * r, g[1] = N * Q + K * o + Y * y + J * R, g[2] = N * C + K * a + Y * t + J * F, g[3] = N * E + K * D + Y * e + J * k, N = I[4], K = I[5], Y = I[6], J = I[7], g[4] = N * B + K * i + Y * h + J * r, g[5] = N * Q + K * o + Y * y + J * R, g[6] = N * C + K * a + Y * t + J * F, g[7] = N * E + K * D + Y * e + J * k, N = I[8], K = I[9], Y = I[10], J = I[11], g[8] = N * B + K * i + Y * h + J * r, g[9] = N * Q + K * o + Y * y + J * R, g[10] = N * C + K * a + Y * t + J * F, g[11] = N * E + K * D + Y * e + J * k, N = I[12], K = I[13], Y = I[14], J = I[15], g[12] = N * B + K * i + Y * h + J * r, g[13] = N * Q + K * o + Y * y + J * R, g[14] = N * C + K * a + Y * t + J * F, g[15] = N * E + K * D + Y * e + J * k, g;
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function aQ(g, A) {
|
|
1048
1048
|
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;
|
|
1049
1049
|
}
|
|
1050
|
-
function
|
|
1050
|
+
function DQ(g, A, I, B) {
|
|
1051
1051
|
var Q = A[0], C = A[1], E = A[2], i = A[3], o = Q + Q, a = C + C, D = E + E, h = Q * o, y = Q * a, t = Q * D, e = C * a, r = C * D, R = E * D, F = i * o, k = i * a, N = i * D, K = B[0], Y = B[1], J = B[2];
|
|
1052
1052
|
return g[0] = (1 - (e + R)) * K, g[1] = (y + N) * K, g[2] = (t - k) * K, g[3] = 0, g[4] = (y - N) * Y, g[5] = (1 - (h + R)) * Y, g[6] = (r + F) * Y, g[7] = 0, g[8] = (t + k) * J, g[9] = (r - F) * J, g[10] = (1 - (h + e)) * J, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function sQ(g, A, I, B, Q) {
|
|
1055
1055
|
var C = 1 / Math.tan(A / 2), E;
|
|
1056
1056
|
return g[0] = C / I, g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = C, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = -1, g[12] = 0, g[13] = 0, g[15] = 0, Q != null && Q !== 1 / 0 ? (E = 1 / (B - Q), g[10] = (Q + B) * E, g[14] = 2 * Q * B * E) : (g[10] = -1, g[14] = -2 * B), g;
|
|
1057
1057
|
}
|
|
1058
|
-
var
|
|
1059
|
-
function
|
|
1058
|
+
var hQ = sQ;
|
|
1059
|
+
function yQ(g, A, I, B, Q, C, E) {
|
|
1060
1060
|
var i = 1 / (A - I), o = 1 / (B - Q), a = 1 / (C - E);
|
|
1061
1061
|
return g[0] = -2 * i, g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = -2 * o, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = 2 * a, g[11] = 0, g[12] = (A + I) * i, g[13] = (Q + B) * o, g[14] = (E + C) * a, g[15] = 1, g;
|
|
1062
1062
|
}
|
|
1063
|
-
var
|
|
1064
|
-
function
|
|
1063
|
+
var tQ = yQ;
|
|
1064
|
+
function GQ(g, A, I, B) {
|
|
1065
1065
|
var Q = A[0], C = A[1], E = A[2], i = B[0], o = B[1], a = B[2], D = Q - I[0], h = C - I[1], y = E - I[2], t = D * D + h * h + y * y;
|
|
1066
1066
|
t > 0 && (t = 1 / Math.sqrt(t), D *= t, h *= t, y *= t);
|
|
1067
1067
|
var e = o * y - a * h, r = a * D - i * y, R = i * h - o * D;
|
|
@@ -1075,7 +1075,7 @@ function IA(g) {
|
|
|
1075
1075
|
var A = new T(3);
|
|
1076
1076
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A;
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function hB(g) {
|
|
1079
1079
|
var A = g[0], I = g[1], B = g[2];
|
|
1080
1080
|
return Math.hypot(A, I, B);
|
|
1081
1081
|
}
|
|
@@ -1089,37 +1089,37 @@ function xA(g, A) {
|
|
|
1089
1089
|
function LA(g, A, I, B) {
|
|
1090
1090
|
return g[0] = A, g[1] = I, g[2] = B, g;
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function yB(g, A, I) {
|
|
1093
1093
|
return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function wQ(g, A, I) {
|
|
1096
1096
|
return g[0] = A[0] - I[0], g[1] = A[1] - I[1], g[2] = A[2] - I[2], g;
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function FQ(g, A, I) {
|
|
1099
1099
|
return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1101
|
+
function tB(g, A, I) {
|
|
1102
1102
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g;
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function dg(g, A, I, B) {
|
|
1105
1105
|
return g[0] = A[0] + I[0] * B, g[1] = A[1] + I[1] * B, g[2] = A[2] + I[2] * B, g;
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Hg(g, A) {
|
|
1108
1108
|
var I = A[0] - g[0], B = A[1] - g[1], Q = A[2] - g[2];
|
|
1109
1109
|
return Math.hypot(I, B, Q);
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function nQ(g, A) {
|
|
1112
1112
|
var I = A[0], B = A[1], Q = A[2], C = I * I + B * B + Q * Q;
|
|
1113
1113
|
return C > 0 && (C = 1 / Math.sqrt(C)), g[0] = A[0] * C, g[1] = A[1] * C, g[2] = A[2] * C, g;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function GB(g, A) {
|
|
1116
1116
|
return g[0] * A[0] + g[1] * A[1] + g[2] * A[2];
|
|
1117
1117
|
}
|
|
1118
1118
|
function uI(g, A, I) {
|
|
1119
1119
|
var B = A[0], Q = A[1], C = A[2], E = I[0], i = I[1], o = I[2];
|
|
1120
1120
|
return g[0] = Q * o - C * i, g[1] = C * E - B * o, g[2] = B * i - Q * E, g;
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function eQ(g, A, I, B, Q, C) {
|
|
1123
1123
|
var E = 1 - C, i = E * E, o = C * C, a = i * E, D = 3 * C * i, h = 3 * o * E, y = o * C;
|
|
1124
1124
|
return g[0] = A[0] * a + I[0] * D + B[0] * h + Q[0] * y, g[1] = A[1] * a + I[1] * D + B[1] * h + Q[1] * y, g[2] = A[2] * a + I[2] * D + B[2] * h + Q[2] * y, g;
|
|
1125
1125
|
}
|
|
@@ -1127,11 +1127,11 @@ function YI(g, A, I) {
|
|
|
1127
1127
|
var B = A[0], Q = A[1], C = A[2], E = I[3] * B + I[7] * Q + I[11] * C + I[15];
|
|
1128
1128
|
return E = E || 1, g[0] = (I[0] * B + I[4] * Q + I[8] * C + I[12]) / E, g[1] = (I[1] * B + I[5] * Q + I[9] * C + I[13]) / E, g[2] = (I[2] * B + I[6] * Q + I[10] * C + I[14]) / E, g;
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1130
|
+
function rQ(g, A) {
|
|
1131
1131
|
var I = g[0], B = g[1], Q = g[2], C = A[0], E = A[1], i = A[2];
|
|
1132
1132
|
return Math.abs(I - C) <= rA * Math.max(1, Math.abs(I), Math.abs(C)) && Math.abs(B - E) <= rA * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(Q - i) <= rA * Math.max(1, Math.abs(Q), Math.abs(i));
|
|
1133
1133
|
}
|
|
1134
|
-
var OI =
|
|
1134
|
+
var OI = wQ, SQ = hB;
|
|
1135
1135
|
(function() {
|
|
1136
1136
|
var g = p();
|
|
1137
1137
|
return function(A, I, B, Q, C, E) {
|
|
@@ -1145,7 +1145,7 @@ function ZA() {
|
|
|
1145
1145
|
var g = new T(4);
|
|
1146
1146
|
return T != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function RQ(g) {
|
|
1149
1149
|
var A = new T(4);
|
|
1150
1150
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
|
|
1151
1151
|
}
|
|
@@ -1153,13 +1153,13 @@ function VI(g, A, I, B) {
|
|
|
1153
1153
|
var Q = new T(4);
|
|
1154
1154
|
return Q[0] = g, Q[1] = A, Q[2] = I, Q[3] = B, Q;
|
|
1155
1155
|
}
|
|
1156
|
-
function
|
|
1156
|
+
function NQ(g, A) {
|
|
1157
1157
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[3], g;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function cQ(g, A, I) {
|
|
1160
1160
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g[3] = A[3] * I, g;
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1162
|
+
function UQ(g, A) {
|
|
1163
1163
|
var I = A[0], B = A[1], Q = A[2], C = A[3], E = I * I + B * B + Q * Q + C * C;
|
|
1164
1164
|
return E > 0 && (E = 1 / Math.sqrt(E)), g[0] = I * E, g[1] = B * E, g[2] = Q * E, g[3] = C * E, g;
|
|
1165
1165
|
}
|
|
@@ -1180,12 +1180,12 @@ function vI() {
|
|
|
1180
1180
|
var g = new T(4);
|
|
1181
1181
|
return T != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function kQ(g, A, I) {
|
|
1184
1184
|
I = I * 0.5;
|
|
1185
1185
|
var B = Math.sin(I);
|
|
1186
1186
|
return g[0] = B * A[0], g[1] = B * A[1], g[2] = B * A[2], g[3] = Math.cos(I), g;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function LQ(g, A, I) {
|
|
1189
1189
|
var B = A[0], Q = A[1], C = A[2], E = A[3], i = I[0], o = I[1], a = I[2], D = I[3];
|
|
1190
1190
|
return g[0] = B * D + E * i + Q * a - C * o, g[1] = Q * D + E * o + C * i - B * a, g[2] = C * D + E * a + B * o - Q * i, g[3] = E * D - B * i - Q * o - C * a, g;
|
|
1191
1191
|
}
|
|
@@ -1193,7 +1193,7 @@ function TI(g, A, I, B) {
|
|
|
1193
1193
|
var Q = A[0], C = A[1], E = A[2], i = A[3], o = I[0], a = I[1], D = I[2], h = I[3], y, t, e, r, R;
|
|
1194
1194
|
return t = Q * o + C * a + E * D + i * h, t < 0 && (t = -t, o = -o, a = -a, D = -D, h = -h), 1 - t > rA ? (y = Math.acos(t), e = Math.sin(y), r = Math.sin((1 - B) * y) / e, R = Math.sin(B * y) / e) : (r = 1 - B, R = B), g[0] = r * Q + R * o, g[1] = r * C + R * a, g[2] = r * E + R * D, g[3] = r * i + R * h, g;
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function wB(g, A) {
|
|
1197
1197
|
var I = A[0] + A[4] + A[8], B;
|
|
1198
1198
|
if (I > 0)
|
|
1199
1199
|
B = Math.sqrt(I + 1), g[3] = 0.5 * B, B = 0.5 / B, g[0] = (A[5] - A[7]) * B, g[1] = (A[6] - A[2]) * B, g[2] = (A[1] - A[3]) * B;
|
|
@@ -1205,12 +1205,12 @@ function GB(g, A) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
return g;
|
|
1207
1207
|
}
|
|
1208
|
-
var
|
|
1208
|
+
var JQ = RQ, YQ = NQ, og = UQ;
|
|
1209
1209
|
(function() {
|
|
1210
1210
|
var g = p(), A = q(1, 0, 0), I = q(0, 1, 0);
|
|
1211
1211
|
return function(B, Q, C) {
|
|
1212
|
-
var E =
|
|
1213
|
-
return E < -0.999999 ? (uI(g, A, Q),
|
|
1212
|
+
var E = GB(Q, C);
|
|
1213
|
+
return E < -0.999999 ? (uI(g, A, Q), SQ(g) < 1e-6 && uI(g, I, Q), nQ(g, g), kQ(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (uI(g, Q, C), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, og(B, B));
|
|
1214
1214
|
};
|
|
1215
1215
|
})();
|
|
1216
1216
|
(function() {
|
|
@@ -1220,16 +1220,16 @@ var LQ = SQ, JQ = RQ, ig = cQ;
|
|
|
1220
1220
|
};
|
|
1221
1221
|
})();
|
|
1222
1222
|
(function() {
|
|
1223
|
-
var g =
|
|
1223
|
+
var g = sB();
|
|
1224
1224
|
return function(A, I, B, Q) {
|
|
1225
|
-
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = Q[0], g[4] = Q[1], g[7] = Q[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2],
|
|
1225
|
+
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = Q[0], g[4] = Q[1], g[7] = Q[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], og(A, wB(A, g));
|
|
1226
1226
|
};
|
|
1227
1227
|
})();
|
|
1228
|
-
function
|
|
1228
|
+
function FB() {
|
|
1229
1229
|
var g = new T(2);
|
|
1230
1230
|
return T != Float32Array && (g[0] = 0, g[1] = 0), g;
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1232
|
+
function qg(g) {
|
|
1233
1233
|
var A = new T(2);
|
|
1234
1234
|
return A[0] = g[0], A[1] = g[1], A;
|
|
1235
1235
|
}
|
|
@@ -1237,19 +1237,19 @@ function u(g, A) {
|
|
|
1237
1237
|
var I = new T(2);
|
|
1238
1238
|
return I[0] = g, I[1] = A, I;
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1240
|
+
function MQ(g, A) {
|
|
1241
1241
|
var I = A[0] - g[0], B = A[1] - g[1];
|
|
1242
1242
|
return Math.hypot(I, B);
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function KQ(g) {
|
|
1245
1245
|
var A = g[0], I = g[1];
|
|
1246
1246
|
return A * A + I * I;
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function dQ(g, A, I, B) {
|
|
1249
1249
|
var Q = A[0], C = A[1];
|
|
1250
1250
|
return g[0] = Q + B * (I[0] - Q), g[1] = C + B * (I[1] - C), g;
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function lg(g, A) {
|
|
1253
1253
|
return g[0] === A[0] && g[1] === A[1];
|
|
1254
1254
|
}
|
|
1255
1255
|
function WI(g, A) {
|
|
@@ -1257,7 +1257,7 @@ function WI(g, A) {
|
|
|
1257
1257
|
return Math.abs(I - Q) <= rA * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - C) <= rA * Math.max(1, Math.abs(B), Math.abs(C));
|
|
1258
1258
|
}
|
|
1259
1259
|
(function() {
|
|
1260
|
-
var g =
|
|
1260
|
+
var g = FB();
|
|
1261
1261
|
return function(A, I, B, Q, C, E) {
|
|
1262
1262
|
var i, o;
|
|
1263
1263
|
for (I || (I = 2), B || (B = 0), Q ? o = Math.min(Q * I + B, A.length) : o = A.length, i = B; i < o; i += I)
|
|
@@ -1307,7 +1307,7 @@ class eA {
|
|
|
1307
1307
|
YI(C, E, A), this.expandWithPoint(C);
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1310
|
+
const HQ = {
|
|
1311
1311
|
position: 0,
|
|
1312
1312
|
normal: 1,
|
|
1313
1313
|
uv: 2,
|
|
@@ -1319,7 +1319,7 @@ const dQ = {
|
|
|
1319
1319
|
size: 8,
|
|
1320
1320
|
marker: 9
|
|
1321
1321
|
};
|
|
1322
|
-
class pA extends
|
|
1322
|
+
class pA extends Eg {
|
|
1323
1323
|
boundingBox_ = null;
|
|
1324
1324
|
primitive_;
|
|
1325
1325
|
attributes_;
|
|
@@ -1371,7 +1371,7 @@ class pA extends Cg {
|
|
|
1371
1371
|
return this.attributes_.find((I) => I.type === A);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
class
|
|
1374
|
+
class qQ {
|
|
1375
1375
|
gl_;
|
|
1376
1376
|
buffers_ = /* @__PURE__ */ new Map();
|
|
1377
1377
|
currentGeometry_ = null;
|
|
@@ -1407,7 +1407,7 @@ class HQ {
|
|
|
1407
1407
|
this.gl_.bindBuffer(Q, C), this.gl_.bufferData(Q, B, this.gl_.STATIC_DRAW);
|
|
1408
1408
|
const { attributes: E, strideBytes: i } = A;
|
|
1409
1409
|
E.forEach((D) => {
|
|
1410
|
-
const h =
|
|
1410
|
+
const h = HQ[D.type];
|
|
1411
1411
|
this.gl_.vertexAttribPointer(
|
|
1412
1412
|
h,
|
|
1413
1413
|
D.itemSize,
|
|
@@ -1426,7 +1426,7 @@ class HQ {
|
|
|
1426
1426
|
this.buffers_.set(A, o), this.gl_.bindVertexArray(null);
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
class
|
|
1429
|
+
class lQ {
|
|
1430
1430
|
gl_;
|
|
1431
1431
|
textures_ = /* @__PURE__ */ new Map();
|
|
1432
1432
|
currentTexture_ = null;
|
|
@@ -1680,7 +1680,7 @@ class j {
|
|
|
1680
1680
|
* the first element, and avoids biasing toward (0,0).
|
|
1681
1681
|
*/
|
|
1682
1682
|
constructor(A, I) {
|
|
1683
|
-
this.min = A ?
|
|
1683
|
+
this.min = A ? qg(A) : u(1 / 0, 1 / 0), this.max = I ? qg(I) : u(-1 / 0, -1 / 0);
|
|
1684
1684
|
}
|
|
1685
1685
|
clone() {
|
|
1686
1686
|
return new j(this.min, this.max);
|
|
@@ -1693,7 +1693,7 @@ class j {
|
|
|
1693
1693
|
return !(A.max[0] <= I.min[0] || A.min[0] >= I.max[0] || A.max[1] <= I.min[1] || A.min[1] >= I.max[1]);
|
|
1694
1694
|
}
|
|
1695
1695
|
static equals(A, I) {
|
|
1696
|
-
return
|
|
1696
|
+
return lg(A.min, I.min) && lg(A.max, I.max);
|
|
1697
1697
|
}
|
|
1698
1698
|
floor() {
|
|
1699
1699
|
return new j(
|
|
@@ -1706,7 +1706,7 @@ class j {
|
|
|
1706
1706
|
return { x: A, y: I, width: B, height: Q };
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
|
-
class
|
|
1709
|
+
class fQ {
|
|
1710
1710
|
gl_;
|
|
1711
1711
|
enabledCapabilities_ = /* @__PURE__ */ new Map();
|
|
1712
1712
|
depthMaskEnabled_ = null;
|
|
@@ -1800,8 +1800,8 @@ class lQ {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
|
-
const
|
|
1804
|
-
class
|
|
1803
|
+
const pQ = aQ(AA(), [1, -1, 1]);
|
|
1804
|
+
class mQ extends PB {
|
|
1805
1805
|
gl_ = null;
|
|
1806
1806
|
programs_;
|
|
1807
1807
|
bindings_;
|
|
@@ -1817,7 +1817,7 @@ class pQ extends ZB {
|
|
|
1817
1817
|
c.info(
|
|
1818
1818
|
"WebGLRenderer",
|
|
1819
1819
|
`WebGL version ${this.gl.getParameter(this.gl.VERSION)}`
|
|
1820
|
-
), this.programs_ = new
|
|
1820
|
+
), this.programs_ = new CQ(this.gl), this.bindings_ = new qQ(this.gl), this.textures_ = new lQ(this.gl), this.state_ = new fQ(this.gl), this.resize(this.canvas.width, this.canvas.height);
|
|
1821
1821
|
}
|
|
1822
1822
|
render(A) {
|
|
1823
1823
|
const I = A.getBoxRelativeTo(this.canvas), B = new j(
|
|
@@ -1881,7 +1881,7 @@ class pQ extends ZB {
|
|
|
1881
1881
|
I.transform.matrix
|
|
1882
1882
|
), i = wI(
|
|
1883
1883
|
AA(),
|
|
1884
|
-
|
|
1884
|
+
pQ,
|
|
1885
1885
|
C.projectionMatrix
|
|
1886
1886
|
), o = [this.canvas.width, this.canvas.height], a = I.getUniforms();
|
|
1887
1887
|
for (const y of Q.uniformNames)
|
|
@@ -1932,12 +1932,12 @@ class pQ extends ZB {
|
|
|
1932
1932
|
return this.gl_;
|
|
1933
1933
|
}
|
|
1934
1934
|
}
|
|
1935
|
-
const
|
|
1936
|
-
class
|
|
1935
|
+
const uQ = 8;
|
|
1936
|
+
class TQ {
|
|
1937
1937
|
maxConcurrent_;
|
|
1938
1938
|
pending_ = [];
|
|
1939
1939
|
running_ = /* @__PURE__ */ new Map();
|
|
1940
|
-
constructor(A =
|
|
1940
|
+
constructor(A = uQ) {
|
|
1941
1941
|
this.maxConcurrent_ = Math.max(1, A);
|
|
1942
1942
|
}
|
|
1943
1943
|
enqueue(A, I) {
|
|
@@ -1985,7 +1985,7 @@ class uQ {
|
|
|
1985
1985
|
this.running_.set(I, { controller: Q, promise: C });
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
|
-
const
|
|
1988
|
+
const fg = [
|
|
1989
1989
|
Int8Array,
|
|
1990
1990
|
Int16Array,
|
|
1991
1991
|
Int32Array,
|
|
@@ -1994,22 +1994,22 @@ const lg = [
|
|
|
1994
1994
|
Uint32Array,
|
|
1995
1995
|
Float32Array
|
|
1996
1996
|
];
|
|
1997
|
-
function
|
|
1998
|
-
if (
|
|
1997
|
+
function pg(g) {
|
|
1998
|
+
if (fg.some((I) => g instanceof I))
|
|
1999
1999
|
return !0;
|
|
2000
|
-
const A =
|
|
2000
|
+
const A = fg.map((I) => I.name);
|
|
2001
2001
|
return c.debug(
|
|
2002
2002
|
"Chunk",
|
|
2003
2003
|
`Unsupported chunk data type: ${g}. Supported data types: ${A}`
|
|
2004
2004
|
), !1;
|
|
2005
2005
|
}
|
|
2006
|
-
function
|
|
2006
|
+
function WQ(g, A) {
|
|
2007
2007
|
return Math.round((A - g.translation) / g.scale);
|
|
2008
2008
|
}
|
|
2009
2009
|
function XI(g, A, I = 1e-6) {
|
|
2010
2010
|
return Math.abs(g - A) <= I;
|
|
2011
2011
|
}
|
|
2012
|
-
class
|
|
2012
|
+
class xQ {
|
|
2013
2013
|
chunks_;
|
|
2014
2014
|
loader_;
|
|
2015
2015
|
lowestResLOD_;
|
|
@@ -2065,7 +2065,7 @@ class WQ {
|
|
|
2065
2065
|
return this.chunks_[A];
|
|
2066
2066
|
}
|
|
2067
2067
|
getTimeIndex(A) {
|
|
2068
|
-
return A.t === void 0 || this.dimensions_.t === void 0 ? 0 :
|
|
2068
|
+
return A.t === void 0 || this.dimensions_.t === void 0 ? 0 : WQ(this.dimensions_.t.lods[0], A.t);
|
|
2069
2069
|
}
|
|
2070
2070
|
get lodCount() {
|
|
2071
2071
|
return this.lowestResLOD_ + 1;
|
|
@@ -2137,8 +2137,8 @@ class WQ {
|
|
|
2137
2137
|
function PA(g, A, I) {
|
|
2138
2138
|
return Math.max(A, Math.min(I, g));
|
|
2139
2139
|
}
|
|
2140
|
-
const
|
|
2141
|
-
class
|
|
2140
|
+
const nB = Symbol("INTERNAL_POLICY_KEY");
|
|
2141
|
+
class bQ {
|
|
2142
2142
|
store_;
|
|
2143
2143
|
policy_;
|
|
2144
2144
|
policyChanged_ = !1;
|
|
@@ -2155,7 +2155,7 @@ class xQ {
|
|
|
2155
2155
|
this.policy_.profile
|
|
2156
2156
|
);
|
|
2157
2157
|
const B = this.store_.dimensions, Q = B.x.lods[0], C = B.y.lods[0];
|
|
2158
|
-
this.sourceMaxSquareDistance2D_ =
|
|
2158
|
+
this.sourceMaxSquareDistance2D_ = KQ(
|
|
2159
2159
|
u(Q.size * Q.scale, C.size * C.scale)
|
|
2160
2160
|
);
|
|
2161
2161
|
}
|
|
@@ -2196,7 +2196,7 @@ class xQ {
|
|
|
2196
2196
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
2197
2197
|
}
|
|
2198
2198
|
setImageSourcePolicy(A, I) {
|
|
2199
|
-
if (I !==
|
|
2199
|
+
if (I !== nB)
|
|
2200
2200
|
throw new Error("Unauthorized policy mutation");
|
|
2201
2201
|
this.policy_ !== A && (this.policy_ = A, this.policyChanged_ = !0, c.info(
|
|
2202
2202
|
"ChunkStoreView",
|
|
@@ -2223,13 +2223,13 @@ class xQ {
|
|
|
2223
2223
|
), this.chunkViewStates_.clear();
|
|
2224
2224
|
return;
|
|
2225
2225
|
}
|
|
2226
|
-
const C =
|
|
2227
|
-
|
|
2226
|
+
const C = FB();
|
|
2227
|
+
dQ(C, I.min, I.max, 0.5);
|
|
2228
2228
|
const [E, i] = this.getZBounds(A), o = new eA(
|
|
2229
2229
|
q(I.min[0], I.min[1], E),
|
|
2230
2230
|
q(I.max[0], I.max[1], i)
|
|
2231
2231
|
);
|
|
2232
|
-
this.chunkViewStates_.forEach(
|
|
2232
|
+
this.chunkViewStates_.forEach(ZQ), this.updateChunksAtTimeIndex(
|
|
2233
2233
|
B,
|
|
2234
2234
|
A,
|
|
2235
2235
|
o,
|
|
@@ -2346,16 +2346,16 @@ class xQ {
|
|
|
2346
2346
|
return Q * Q + C * C;
|
|
2347
2347
|
}
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function ZQ(g) {
|
|
2350
2350
|
g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
|
|
2351
2351
|
}
|
|
2352
|
-
class
|
|
2352
|
+
class PQ {
|
|
2353
2353
|
stores_ = /* @__PURE__ */ new Map();
|
|
2354
2354
|
pendingStores_ = /* @__PURE__ */ new Map();
|
|
2355
2355
|
views_ = /* @__PURE__ */ new Map();
|
|
2356
|
-
queue_ = new
|
|
2356
|
+
queue_ = new TQ();
|
|
2357
2357
|
async addView(A, I) {
|
|
2358
|
-
const B = await this.addSource(A), Q = new
|
|
2358
|
+
const B = await this.addSource(A), Q = new bQ(B, I);
|
|
2359
2359
|
return this.views_.set(B, (this.views_.get(B) ?? []).concat(Q)), Q;
|
|
2360
2360
|
}
|
|
2361
2361
|
removeView(A) {
|
|
@@ -2378,7 +2378,7 @@ class ZQ {
|
|
|
2378
2378
|
if (I)
|
|
2379
2379
|
return I;
|
|
2380
2380
|
const Q = (async () => {
|
|
2381
|
-
const C = await A.open(), E = new
|
|
2381
|
+
const C = await A.open(), E = new xQ(C);
|
|
2382
2382
|
return this.stores_.set(A, E), this.pendingStores_.delete(A), E;
|
|
2383
2383
|
})();
|
|
2384
2384
|
return this.pendingStores_.set(A, Q), Q;
|
|
@@ -2485,14 +2485,14 @@ bA.Panel = function(g, A, I, B) {
|
|
|
2485
2485
|
}
|
|
2486
2486
|
};
|
|
2487
2487
|
};
|
|
2488
|
-
function
|
|
2488
|
+
function OQ({ scale: g } = { scale: 1.5 }) {
|
|
2489
2489
|
const A = new bA(g);
|
|
2490
2490
|
return A.showPanel(
|
|
2491
2491
|
0
|
|
2492
2492
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
2493
2493
|
), document.body.appendChild(A.dom), A;
|
|
2494
2494
|
}
|
|
2495
|
-
class
|
|
2495
|
+
class VQ {
|
|
2496
2496
|
layers_ = [];
|
|
2497
2497
|
callbacks_ = [];
|
|
2498
2498
|
context_;
|
|
@@ -2549,10 +2549,10 @@ const jI = [
|
|
|
2549
2549
|
"pointercancel",
|
|
2550
2550
|
"wheel"
|
|
2551
2551
|
];
|
|
2552
|
-
function
|
|
2552
|
+
function vQ(g) {
|
|
2553
2553
|
return jI.includes(g);
|
|
2554
2554
|
}
|
|
2555
|
-
class
|
|
2555
|
+
class XQ {
|
|
2556
2556
|
propagationStopped_ = !1;
|
|
2557
2557
|
type;
|
|
2558
2558
|
event;
|
|
@@ -2568,7 +2568,7 @@ class vQ {
|
|
|
2568
2568
|
this.propagationStopped_ = !0;
|
|
2569
2569
|
}
|
|
2570
2570
|
}
|
|
2571
|
-
class
|
|
2571
|
+
class jQ {
|
|
2572
2572
|
listeners_ = [];
|
|
2573
2573
|
element_;
|
|
2574
2574
|
isConnected_ = !1;
|
|
@@ -2607,16 +2607,16 @@ class XQ {
|
|
|
2607
2607
|
});
|
|
2608
2608
|
}
|
|
2609
2609
|
handleEvent = (A) => {
|
|
2610
|
-
if (!
|
|
2610
|
+
if (!vQ(A.type)) {
|
|
2611
2611
|
c.error("EventDispatcher", `Unsupported event type ${A.type}`);
|
|
2612
2612
|
return;
|
|
2613
2613
|
}
|
|
2614
|
-
const I = new
|
|
2614
|
+
const I = new XQ(A.type, A);
|
|
2615
2615
|
for (const B of this.listeners_)
|
|
2616
2616
|
if (B(I), I.propagationStopped) break;
|
|
2617
2617
|
};
|
|
2618
2618
|
}
|
|
2619
|
-
class
|
|
2619
|
+
class zQ {
|
|
2620
2620
|
id;
|
|
2621
2621
|
element;
|
|
2622
2622
|
camera;
|
|
@@ -2624,7 +2624,7 @@ class jQ {
|
|
|
2624
2624
|
events;
|
|
2625
2625
|
cameraControls;
|
|
2626
2626
|
constructor(A) {
|
|
2627
|
-
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
|
|
2627
|
+
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 jQ(this.element), this.events.addEventListener((I) => {
|
|
2628
2628
|
if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
|
|
2629
2629
|
const { clientX: B, clientY: Q } = I.event, C = u(B, Q);
|
|
2630
2630
|
I.clipPos = this.clientToClip(C, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
|
|
@@ -2678,7 +2678,7 @@ class jQ {
|
|
|
2678
2678
|
this.camera.setAspectRatio(B);
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2681
|
+
function _Q(g) {
|
|
2682
2682
|
const A = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Set();
|
|
2683
2683
|
for (const B of g) {
|
|
2684
2684
|
if (I.has(B.id))
|
|
@@ -2694,19 +2694,19 @@ function zQ(g) {
|
|
|
2694
2694
|
A.set(B.element, B.id);
|
|
2695
2695
|
}
|
|
2696
2696
|
}
|
|
2697
|
-
function
|
|
2697
|
+
function $Q(g, A, I) {
|
|
2698
2698
|
const B = g.map((Q) => {
|
|
2699
2699
|
const C = Q.element ?? A;
|
|
2700
2700
|
return {
|
|
2701
2701
|
...Q,
|
|
2702
2702
|
element: C,
|
|
2703
|
-
id: Q.id ?? C.id ??
|
|
2704
|
-
layerManager: new
|
|
2703
|
+
id: Q.id ?? C.id ?? DB(),
|
|
2704
|
+
layerManager: new VQ(I)
|
|
2705
2705
|
};
|
|
2706
2706
|
});
|
|
2707
|
-
return
|
|
2707
|
+
return _Q(B), B.map((Q) => new zQ(Q));
|
|
2708
2708
|
}
|
|
2709
|
-
class
|
|
2709
|
+
class AC {
|
|
2710
2710
|
elements_;
|
|
2711
2711
|
resizeObserver_;
|
|
2712
2712
|
mediaQuery_;
|
|
@@ -2754,7 +2754,7 @@ class $Q {
|
|
|
2754
2754
|
this.resizeObserver_?.disconnect(), this.mediaQuery_ && this.onMediaQueryChange_ && this.mediaQuery_.removeEventListener("change", this.onMediaQueryChange_);
|
|
2755
2755
|
}
|
|
2756
2756
|
}
|
|
2757
|
-
class
|
|
2757
|
+
class oo {
|
|
2758
2758
|
lastAnimationId_;
|
|
2759
2759
|
chunkManager_;
|
|
2760
2760
|
context_;
|
|
@@ -2815,17 +2815,17 @@ class io {
|
|
|
2815
2815
|
constructor(A) {
|
|
2816
2816
|
if (this.canvas = A.canvas, A.viewports.length === 0)
|
|
2817
2817
|
throw new Error("At least one viewport config must be specified.");
|
|
2818
|
-
this.renderer_ = new
|
|
2818
|
+
this.renderer_ = new mQ(this.canvas), this.chunkManager_ = new PQ(), this.context_ = {
|
|
2819
2819
|
chunkManager: this.chunkManager_
|
|
2820
|
-
}, this.viewports_ =
|
|
2820
|
+
}, this.viewports_ = $Q(
|
|
2821
2821
|
A.viewports,
|
|
2822
2822
|
this.canvas,
|
|
2823
2823
|
this.context_
|
|
2824
|
-
), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ =
|
|
2824
|
+
), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ = OQ());
|
|
2825
2825
|
const I = [this.canvas];
|
|
2826
2826
|
for (const B of this.viewports_)
|
|
2827
2827
|
B.element !== this.canvas && I.push(B.element);
|
|
2828
|
-
this.sizeObserver_ = new
|
|
2828
|
+
this.sizeObserver_ = new AC(I);
|
|
2829
2829
|
}
|
|
2830
2830
|
get renderedObjects() {
|
|
2831
2831
|
return this.renderer_.renderedObjects;
|
|
@@ -2881,7 +2881,7 @@ class io {
|
|
|
2881
2881
|
A.updateSize();
|
|
2882
2882
|
}
|
|
2883
2883
|
}
|
|
2884
|
-
class
|
|
2884
|
+
class IC extends pA {
|
|
2885
2885
|
constructor(A) {
|
|
2886
2886
|
if (super(), A.primitive != "triangles") {
|
|
2887
2887
|
c.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
@@ -2906,24 +2906,24 @@ class AC extends pA {
|
|
|
2906
2906
|
this.indexData_ = new Uint32Array(B);
|
|
2907
2907
|
}
|
|
2908
2908
|
}
|
|
2909
|
-
const
|
|
2910
|
-
class
|
|
2909
|
+
const gC = q(0, 1, 0);
|
|
2910
|
+
class BC {
|
|
2911
2911
|
dirty_ = !0;
|
|
2912
2912
|
matrix_ = AA();
|
|
2913
2913
|
rotation_ = vI();
|
|
2914
2914
|
translation_ = p();
|
|
2915
2915
|
scale_ = q(1, 1, 1);
|
|
2916
2916
|
addRotation(A) {
|
|
2917
|
-
|
|
2917
|
+
LQ(this.rotation_, this.rotation_, A), this.dirty_ = !0;
|
|
2918
2918
|
}
|
|
2919
2919
|
setRotation(A) {
|
|
2920
|
-
|
|
2920
|
+
YQ(this.rotation_, A), this.dirty_ = !0;
|
|
2921
2921
|
}
|
|
2922
2922
|
get rotation() {
|
|
2923
|
-
return
|
|
2923
|
+
return JQ(this.rotation_);
|
|
2924
2924
|
}
|
|
2925
2925
|
addTranslation(A) {
|
|
2926
|
-
|
|
2926
|
+
yB(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
2927
2927
|
}
|
|
2928
2928
|
setTranslation(A) {
|
|
2929
2929
|
xA(this.translation_, A), this.dirty_ = !0;
|
|
@@ -2932,15 +2932,15 @@ class gC {
|
|
|
2932
2932
|
return IA(this.translation_);
|
|
2933
2933
|
}
|
|
2934
2934
|
addScale(A) {
|
|
2935
|
-
|
|
2935
|
+
FQ(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
2936
2936
|
}
|
|
2937
2937
|
setScale(A) {
|
|
2938
2938
|
xA(this.scale_, A), this.dirty_ = !0;
|
|
2939
2939
|
}
|
|
2940
2940
|
targetTo(A) {
|
|
2941
|
-
|
|
2942
|
-
const I =
|
|
2943
|
-
|
|
2941
|
+
rQ(this.translation_, A) && (A = IA(A), A[2] += rA);
|
|
2942
|
+
const I = GQ(AA(), this.translation_, A, gC), B = oQ(sB(), I);
|
|
2943
|
+
wB(this.rotation_, B), og(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
2944
2944
|
}
|
|
2945
2945
|
get scale() {
|
|
2946
2946
|
return IA(this.scale_);
|
|
@@ -2949,10 +2949,10 @@ class gC {
|
|
|
2949
2949
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
2950
2950
|
}
|
|
2951
2951
|
get inverse() {
|
|
2952
|
-
return
|
|
2952
|
+
return ig(AA(), this.matrix);
|
|
2953
2953
|
}
|
|
2954
2954
|
computeMatrix() {
|
|
2955
|
-
|
|
2955
|
+
DQ(
|
|
2956
2956
|
this.matrix_,
|
|
2957
2957
|
this.rotation_,
|
|
2958
2958
|
this.translation_,
|
|
@@ -2960,12 +2960,12 @@ class gC {
|
|
|
2960
2960
|
);
|
|
2961
2961
|
}
|
|
2962
2962
|
}
|
|
2963
|
-
class mA extends
|
|
2963
|
+
class mA extends Eg {
|
|
2964
2964
|
wireframeEnabled = !1;
|
|
2965
2965
|
wireframeColor = l.WHITE;
|
|
2966
2966
|
textures_ = [];
|
|
2967
2967
|
staleTextures_ = [];
|
|
2968
|
-
transform_ = new
|
|
2968
|
+
transform_ = new BC();
|
|
2969
2969
|
geometry_ = new pA();
|
|
2970
2970
|
wireframeGeometry_ = null;
|
|
2971
2971
|
programName_ = null;
|
|
@@ -2982,7 +2982,7 @@ class mA extends Cg {
|
|
|
2982
2982
|
return this.geometry_;
|
|
2983
2983
|
}
|
|
2984
2984
|
get wireframeGeometry() {
|
|
2985
|
-
return this.wireframeGeometry_ ??= new
|
|
2985
|
+
return this.wireframeGeometry_ ??= new IC(this.geometry), this.wireframeGeometry_;
|
|
2986
2986
|
}
|
|
2987
2987
|
get textures() {
|
|
2988
2988
|
return this.textures_;
|
|
@@ -3029,17 +3029,17 @@ class JA {
|
|
|
3029
3029
|
this.normal = IA(A), this.signedDistance = I;
|
|
3030
3030
|
}
|
|
3031
3031
|
signedDistanceToPoint(A) {
|
|
3032
|
-
return
|
|
3032
|
+
return GB(this.normal, A) + this.signedDistance;
|
|
3033
3033
|
}
|
|
3034
3034
|
normalize() {
|
|
3035
|
-
const A =
|
|
3035
|
+
const A = hB(this.normal);
|
|
3036
3036
|
if (A > 0) {
|
|
3037
3037
|
const I = 1 / A;
|
|
3038
|
-
|
|
3038
|
+
tB(this.normal, this.normal, I), this.signedDistance *= I;
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
3041
|
}
|
|
3042
|
-
class
|
|
3042
|
+
class QC {
|
|
3043
3043
|
planes_;
|
|
3044
3044
|
constructor(A) {
|
|
3045
3045
|
this.planes_ = [
|
|
@@ -3085,7 +3085,7 @@ class BC {
|
|
|
3085
3085
|
return !0;
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
|
-
class
|
|
3088
|
+
class eB extends mA {
|
|
3089
3089
|
projectionMatrix_ = AA();
|
|
3090
3090
|
near_ = 0;
|
|
3091
3091
|
far_ = 0;
|
|
@@ -3107,7 +3107,7 @@ class nB extends mA {
|
|
|
3107
3107
|
return q(A[4], A[5], A[6]);
|
|
3108
3108
|
}
|
|
3109
3109
|
get frustum() {
|
|
3110
|
-
return new
|
|
3110
|
+
return new QC(
|
|
3111
3111
|
wI(AA(), this.projectionMatrix, this.viewMatrix)
|
|
3112
3112
|
);
|
|
3113
3113
|
}
|
|
@@ -3118,7 +3118,7 @@ class nB extends mA {
|
|
|
3118
3118
|
return this.transform.translation;
|
|
3119
3119
|
}
|
|
3120
3120
|
clipToWorld(A) {
|
|
3121
|
-
const I = VI(A[0], A[1], A[2], 1), B =
|
|
3121
|
+
const I = VI(A[0], A[1], A[2], 1), B = ig(
|
|
3122
3122
|
AA(),
|
|
3123
3123
|
this.projectionMatrix_
|
|
3124
3124
|
), Q = FI(
|
|
@@ -3126,7 +3126,7 @@ class nB extends mA {
|
|
|
3126
3126
|
I,
|
|
3127
3127
|
B
|
|
3128
3128
|
);
|
|
3129
|
-
|
|
3129
|
+
cQ(Q, Q, 1 / Q[3]);
|
|
3130
3130
|
const C = FI(
|
|
3131
3131
|
ZA(),
|
|
3132
3132
|
Q,
|
|
@@ -3135,13 +3135,13 @@ class nB extends mA {
|
|
|
3135
3135
|
return q(C[0], C[1], C[2]);
|
|
3136
3136
|
}
|
|
3137
3137
|
}
|
|
3138
|
-
const
|
|
3139
|
-
class
|
|
3138
|
+
const rB = 1.77, mg = 128, ug = 128 / rB;
|
|
3139
|
+
class ao extends eB {
|
|
3140
3140
|
// width_ and height_ should always be defined by constructor (see setFrame)
|
|
3141
|
-
width_ =
|
|
3142
|
-
height_ =
|
|
3143
|
-
viewportAspectRatio_ =
|
|
3144
|
-
viewportSize_ = [
|
|
3141
|
+
width_ = mg;
|
|
3142
|
+
height_ = ug;
|
|
3143
|
+
viewportAspectRatio_ = rB;
|
|
3144
|
+
viewportSize_ = [mg, ug];
|
|
3145
3145
|
constructor(A, I, B, Q, C = 0, E = 100) {
|
|
3146
3146
|
super(), this.near_ = C, this.far_ = E, this.setFrame(A, I, Q, B), this.updateProjectionMatrix();
|
|
3147
3147
|
}
|
|
@@ -3171,7 +3171,7 @@ class oo extends nB {
|
|
|
3171
3171
|
AA(),
|
|
3172
3172
|
this.projectionMatrix,
|
|
3173
3173
|
this.viewMatrix
|
|
3174
|
-
), Q =
|
|
3174
|
+
), Q = ig(AA(), B);
|
|
3175
3175
|
return A = FI(ZA(), A, Q), I = FI(ZA(), I, Q), new j(
|
|
3176
3176
|
u(A[0], A[1]),
|
|
3177
3177
|
u(I[0], I[1])
|
|
@@ -3180,7 +3180,7 @@ class oo extends nB {
|
|
|
3180
3180
|
updateProjectionMatrix() {
|
|
3181
3181
|
const A = this.width_, I = this.height_, B = A / I;
|
|
3182
3182
|
let Q = 0.5 * A, C = 0.5 * I;
|
|
3183
|
-
this.viewportAspectRatio_ > B ? Q *= this.viewportAspectRatio_ / B : C *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * Q, 2 * C],
|
|
3183
|
+
this.viewportAspectRatio_ > B ? Q *= this.viewportAspectRatio_ / B : C *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * Q, 2 * C], tQ(
|
|
3184
3184
|
this.projectionMatrix_,
|
|
3185
3185
|
-Q,
|
|
3186
3186
|
Q,
|
|
@@ -3191,14 +3191,14 @@ class oo extends nB {
|
|
|
3191
3191
|
);
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
const
|
|
3195
|
-
class
|
|
3194
|
+
const CC = 60, EC = 1.77, yI = 0.1, xI = 180 - yI;
|
|
3195
|
+
class Do extends eB {
|
|
3196
3196
|
fov_;
|
|
3197
3197
|
aspectRatio_;
|
|
3198
3198
|
constructor(A = {}) {
|
|
3199
3199
|
const {
|
|
3200
|
-
fov: I =
|
|
3201
|
-
aspectRatio: B =
|
|
3200
|
+
fov: I = CC,
|
|
3201
|
+
aspectRatio: B = EC,
|
|
3202
3202
|
near: Q = 0.1,
|
|
3203
3203
|
far: C = 1e4,
|
|
3204
3204
|
position: E = q(0, 0, 0)
|
|
@@ -3224,17 +3224,17 @@ class ao extends nB {
|
|
|
3224
3224
|
this.fov_ = Math.max(yI, Math.min(xI, this.fov_ / A)), this.updateProjectionMatrix();
|
|
3225
3225
|
}
|
|
3226
3226
|
updateProjectionMatrix() {
|
|
3227
|
-
|
|
3227
|
+
hQ(
|
|
3228
3228
|
this.projectionMatrix_,
|
|
3229
|
-
|
|
3229
|
+
iQ(this.fov),
|
|
3230
3230
|
this.aspectRatio_,
|
|
3231
3231
|
this.near_,
|
|
3232
3232
|
this.far_
|
|
3233
3233
|
);
|
|
3234
3234
|
}
|
|
3235
3235
|
}
|
|
3236
|
-
const
|
|
3237
|
-
class
|
|
3236
|
+
const Tg = 0;
|
|
3237
|
+
class so {
|
|
3238
3238
|
camera_;
|
|
3239
3239
|
dragActive_ = !1;
|
|
3240
3240
|
dragStart_ = p();
|
|
@@ -3269,7 +3269,7 @@ class Do {
|
|
|
3269
3269
|
}
|
|
3270
3270
|
onPointerDown(A) {
|
|
3271
3271
|
const I = A.event;
|
|
3272
|
-
!A.worldPos || I.button !==
|
|
3272
|
+
!A.worldPos || I.button !== Tg || (this.dragStart_ = IA(A.worldPos), this.dragActive_ = !0, I.target?.setPointerCapture?.(I.pointerId));
|
|
3273
3273
|
}
|
|
3274
3274
|
onPointerMove(A) {
|
|
3275
3275
|
if (!this.dragActive_ || !A.worldPos) return;
|
|
@@ -3278,7 +3278,7 @@ class Do {
|
|
|
3278
3278
|
}
|
|
3279
3279
|
onPointerEnd(A) {
|
|
3280
3280
|
const I = A.event;
|
|
3281
|
-
!this.dragActive_ || I.button !==
|
|
3281
|
+
!this.dragActive_ || I.button !== Tg || (this.dragActive_ = !1, I.target?.releasePointerCapture?.(I.pointerId));
|
|
3282
3282
|
}
|
|
3283
3283
|
}
|
|
3284
3284
|
class GA {
|
|
@@ -3381,7 +3381,7 @@ class nI extends pA {
|
|
|
3381
3381
|
createVertices(A) {
|
|
3382
3382
|
const I = new Float32Array(2 * A.length * 11);
|
|
3383
3383
|
let B = 0, Q = 0;
|
|
3384
|
-
const C = A.reduce((E, i, o) => E +
|
|
3384
|
+
const C = A.reduce((E, i, o) => E + Hg(i, A[o + 1] ?? i), 0);
|
|
3385
3385
|
for (const E of [...Array(A.length).keys()]) {
|
|
3386
3386
|
for (const i of [-1, 1]) {
|
|
3387
3387
|
const o = A[E];
|
|
@@ -3391,7 +3391,7 @@ class nI extends pA {
|
|
|
3391
3391
|
const D = A[E + 1] ?? A[E];
|
|
3392
3392
|
I[B++] = D[0], I[B++] = D[1], I[B++] = D[2], I[B++] = i, I[B++] = Q;
|
|
3393
3393
|
}
|
|
3394
|
-
Q +=
|
|
3394
|
+
Q += Hg(A[E], A[E + 1] ?? A[E]) / C;
|
|
3395
3395
|
}
|
|
3396
3396
|
return I;
|
|
3397
3397
|
}
|
|
@@ -3403,7 +3403,7 @@ class nI extends pA {
|
|
|
3403
3403
|
return I;
|
|
3404
3404
|
}
|
|
3405
3405
|
}
|
|
3406
|
-
class
|
|
3406
|
+
class ag extends mA {
|
|
3407
3407
|
color_;
|
|
3408
3408
|
width_;
|
|
3409
3409
|
taperOffset_ = 0.5;
|
|
@@ -3453,7 +3453,7 @@ class og extends mA {
|
|
|
3453
3453
|
};
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
3456
|
-
class
|
|
3456
|
+
class ho extends GA {
|
|
3457
3457
|
type = "AxesLayer";
|
|
3458
3458
|
constructor(A) {
|
|
3459
3459
|
super();
|
|
@@ -3483,13 +3483,13 @@ class so extends GA {
|
|
|
3483
3483
|
}
|
|
3484
3484
|
function bI(g) {
|
|
3485
3485
|
const { end: A, width: I, color: B } = g, Q = new nI([[0, 0, 0], A]);
|
|
3486
|
-
return new
|
|
3486
|
+
return new ag({
|
|
3487
3487
|
geometry: Q,
|
|
3488
3488
|
color: B,
|
|
3489
3489
|
width: I
|
|
3490
3490
|
});
|
|
3491
3491
|
}
|
|
3492
|
-
class
|
|
3492
|
+
class yo extends GA {
|
|
3493
3493
|
type = "ProjectedLineLayer";
|
|
3494
3494
|
paths_ = [];
|
|
3495
3495
|
constructor(A = []) {
|
|
@@ -3499,17 +3499,17 @@ class ho extends GA {
|
|
|
3499
3499
|
const { path: I, color: B, width: Q } = A;
|
|
3500
3500
|
this.paths_.push(I);
|
|
3501
3501
|
const C = new nI(I);
|
|
3502
|
-
this.addObject(new
|
|
3502
|
+
this.addObject(new ag({ geometry: C, color: B, width: Q }));
|
|
3503
3503
|
}
|
|
3504
3504
|
update() {
|
|
3505
3505
|
}
|
|
3506
3506
|
// TODO: this is temporary - we may want to generalize this to all layers
|
|
3507
3507
|
// for now it is used to set the initial camera position to be centered on the tracks
|
|
3508
3508
|
get extent() {
|
|
3509
|
-
return
|
|
3509
|
+
return iC(this.paths_.flat());
|
|
3510
3510
|
}
|
|
3511
3511
|
}
|
|
3512
|
-
function
|
|
3512
|
+
function iC(g) {
|
|
3513
3513
|
function A(o) {
|
|
3514
3514
|
const a = g.map((D) => D[o]);
|
|
3515
3515
|
return [Math.min(...a), Math.max(...a)];
|
|
@@ -3517,7 +3517,7 @@ function EC(g) {
|
|
|
3517
3517
|
const [I, B] = A(0), [Q, C] = A(1), [E, i] = A(2);
|
|
3518
3518
|
return { xMin: I, xMax: B, yMin: Q, yMax: C, zMin: E, zMax: i };
|
|
3519
3519
|
}
|
|
3520
|
-
class
|
|
3520
|
+
class to extends GA {
|
|
3521
3521
|
type = "TracksLayer";
|
|
3522
3522
|
tracks_ = [];
|
|
3523
3523
|
constructor(A = []) {
|
|
@@ -3527,7 +3527,7 @@ class yo extends GA {
|
|
|
3527
3527
|
this.tracks_.push(A);
|
|
3528
3528
|
let I;
|
|
3529
3529
|
if (A.interpolation) {
|
|
3530
|
-
const i =
|
|
3530
|
+
const i = aC({
|
|
3531
3531
|
path: A.path,
|
|
3532
3532
|
pointsPerSegment: A.interpolation.pointsPerSegment,
|
|
3533
3533
|
tangentFactor: A.interpolation.tangentFactor
|
|
@@ -3537,7 +3537,7 @@ class yo extends GA {
|
|
|
3537
3537
|
I = new nI(A.path);
|
|
3538
3538
|
const { color: B, width: Q } = A, C = 0.5, E = 1.5;
|
|
3539
3539
|
this.addObject(
|
|
3540
|
-
new
|
|
3540
|
+
new ag({ geometry: I, color: B, width: Q, taperOffset: C, taperPower: E })
|
|
3541
3541
|
);
|
|
3542
3542
|
}
|
|
3543
3543
|
setTimeIndex(A) {
|
|
@@ -3558,10 +3558,10 @@ class yo extends GA {
|
|
|
3558
3558
|
// for now it is used to set the initial camera position to be centered on the tracks
|
|
3559
3559
|
get extent() {
|
|
3560
3560
|
const A = this.tracks_.map((I) => I.path);
|
|
3561
|
-
return
|
|
3561
|
+
return oC(A.flat());
|
|
3562
3562
|
}
|
|
3563
3563
|
}
|
|
3564
|
-
function
|
|
3564
|
+
function oC(g) {
|
|
3565
3565
|
function A(o) {
|
|
3566
3566
|
const a = g.map((D) => D[o]);
|
|
3567
3567
|
return [Math.min(...a), Math.max(...a)];
|
|
@@ -3569,35 +3569,35 @@ function iC(g) {
|
|
|
3569
3569
|
const [I, B] = A(0), [Q, C] = A(1), [E, i] = A(2);
|
|
3570
3570
|
return { xMin: I, xMax: B, yMin: Q, yMax: C, zMin: E, zMax: i };
|
|
3571
3571
|
}
|
|
3572
|
-
function
|
|
3572
|
+
function aC({
|
|
3573
3573
|
path: g,
|
|
3574
3574
|
pointsPerSegment: A,
|
|
3575
3575
|
tangentFactor: I = 1 / 3
|
|
3576
3576
|
}) {
|
|
3577
|
-
const B =
|
|
3577
|
+
const B = DC(g), Q = Array((g.length - 1) * A);
|
|
3578
3578
|
for (let C = 0; C < g.length - 1; C++) {
|
|
3579
3579
|
const E = g[C], i = g[C + 1], o = IA(B[C]);
|
|
3580
|
-
|
|
3580
|
+
dg(o, E, o, I);
|
|
3581
3581
|
const a = IA(B[C + 1]);
|
|
3582
|
-
|
|
3582
|
+
dg(a, i, a, -I);
|
|
3583
3583
|
for (let D = 0; D < A; D++) {
|
|
3584
3584
|
const h = D / A, y = Q[C * A + D] = p();
|
|
3585
|
-
|
|
3585
|
+
eQ(y, E, o, a, i, h);
|
|
3586
3586
|
}
|
|
3587
3587
|
}
|
|
3588
3588
|
return Q;
|
|
3589
3589
|
}
|
|
3590
|
-
function
|
|
3590
|
+
function DC(g) {
|
|
3591
3591
|
if (g.length < 2)
|
|
3592
3592
|
throw new Error("Path must contain at least 2 points");
|
|
3593
3593
|
const A = Array(g.length), I = p(), B = p();
|
|
3594
3594
|
for (let Q = 0; Q < g.length; Q++) {
|
|
3595
3595
|
const C = g[Q], E = g[Q + 1] ?? g[Q];
|
|
3596
|
-
A[Q] = p(), Q !== 0 && xA(I, B), Q !== g.length - 1 && OI(B, E, C), Q === 0 ? xA(A[Q], B) : Q == g.length - 1 ? xA(A[Q], I) : (
|
|
3596
|
+
A[Q] = p(), Q !== 0 && xA(I, B), Q !== g.length - 1 && OI(B, E, C), Q === 0 ? xA(A[Q], B) : Q == g.length - 1 ? xA(A[Q], I) : (yB(A[Q], I, B), tB(A[Q], A[Q], 0.5));
|
|
3597
3597
|
}
|
|
3598
3598
|
return A;
|
|
3599
3599
|
}
|
|
3600
|
-
class
|
|
3600
|
+
class SB extends pA {
|
|
3601
3601
|
constructor(A, I, B, Q) {
|
|
3602
3602
|
super();
|
|
3603
3603
|
const C = [], E = [], i = B, o = Q, a = i + 1, D = o + 1, h = A / i, y = I / o;
|
|
@@ -3628,7 +3628,7 @@ class rB extends pA {
|
|
|
3628
3628
|
});
|
|
3629
3629
|
}
|
|
3630
3630
|
}
|
|
3631
|
-
function
|
|
3631
|
+
function Wg(g) {
|
|
3632
3632
|
return g === 1 || g === 2 || g === 4 || g === 8;
|
|
3633
3633
|
}
|
|
3634
3634
|
function dA(g) {
|
|
@@ -3648,7 +3648,7 @@ function dA(g) {
|
|
|
3648
3648
|
return "float";
|
|
3649
3649
|
throw new Error("Unsupported buffer type.");
|
|
3650
3650
|
}
|
|
3651
|
-
function
|
|
3651
|
+
function sC(g) {
|
|
3652
3652
|
if (g.dataFormat === "rgb" || g.dataFormat === "rgba")
|
|
3653
3653
|
return [0, 1];
|
|
3654
3654
|
switch (g.dataType) {
|
|
@@ -3668,7 +3668,7 @@ function DC(g) {
|
|
|
3668
3668
|
return [0, 1];
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
class
|
|
3671
|
+
class Dg extends Eg {
|
|
3672
3672
|
dataFormat = "rgba";
|
|
3673
3673
|
dataType = "unsigned_byte";
|
|
3674
3674
|
maxFilter = "nearest";
|
|
@@ -3683,9 +3683,9 @@ class ag extends Cg {
|
|
|
3683
3683
|
return "Texture";
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
|
-
const
|
|
3686
|
+
const xg = 32;
|
|
3687
3687
|
function zI(g, { visible: A, color: I, contrastLimits: B }) {
|
|
3688
|
-
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B =
|
|
3688
|
+
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = hC(B, g) : B === void 0 && (c.debug(
|
|
3689
3689
|
"Channel",
|
|
3690
3690
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
3691
3691
|
), B = [0, 1]), {
|
|
@@ -3694,9 +3694,9 @@ function zI(g, { visible: A, color: I, contrastLimits: B }) {
|
|
|
3694
3694
|
contrastLimits: B
|
|
3695
3695
|
};
|
|
3696
3696
|
}
|
|
3697
|
-
function
|
|
3698
|
-
if (A.length >
|
|
3699
|
-
throw new Error(`Maximum number of channels is ${
|
|
3697
|
+
function bg(g, A) {
|
|
3698
|
+
if (A.length > xg)
|
|
3699
|
+
throw new Error(`Maximum number of channels is ${xg}`);
|
|
3700
3700
|
if (g?.type === "Texture2DArray") {
|
|
3701
3701
|
const I = g.depth;
|
|
3702
3702
|
if (A.length !== I)
|
|
@@ -3706,25 +3706,25 @@ function xg(g, A) {
|
|
|
3706
3706
|
}
|
|
3707
3707
|
return A.map((I) => zI(g, I));
|
|
3708
3708
|
}
|
|
3709
|
-
function
|
|
3709
|
+
function hC(g, A) {
|
|
3710
3710
|
if (g === void 0)
|
|
3711
|
-
return
|
|
3711
|
+
return sC(A);
|
|
3712
3712
|
if (g[1] <= g[0])
|
|
3713
3713
|
throw new Error(
|
|
3714
3714
|
`Contrast limits must be strictly increasing: ${g}.`
|
|
3715
3715
|
);
|
|
3716
3716
|
return g;
|
|
3717
3717
|
}
|
|
3718
|
-
class
|
|
3718
|
+
class sg extends mA {
|
|
3719
3719
|
channels_;
|
|
3720
3720
|
constructor(A, I, B, Q = []) {
|
|
3721
|
-
super(), this.geometry = new
|
|
3721
|
+
super(), this.geometry = new SB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = bg(B, Q), this.programName = yC(B);
|
|
3722
3722
|
}
|
|
3723
3723
|
get type() {
|
|
3724
3724
|
return "ImageRenderable";
|
|
3725
3725
|
}
|
|
3726
3726
|
setChannelProps(A) {
|
|
3727
|
-
this.channels_ =
|
|
3727
|
+
this.channels_ = bg(this.textures[0], A);
|
|
3728
3728
|
}
|
|
3729
3729
|
setChannelProperty(A, I, B) {
|
|
3730
3730
|
const Q = zI(this.textures[0], {
|
|
@@ -3763,14 +3763,14 @@ class Dg extends mA {
|
|
|
3763
3763
|
}
|
|
3764
3764
|
}
|
|
3765
3765
|
}
|
|
3766
|
-
function
|
|
3766
|
+
function yC(g) {
|
|
3767
3767
|
if (g.type === "Texture2D")
|
|
3768
|
-
return yC(g.dataType);
|
|
3769
|
-
if (g.type === "Texture2DArray")
|
|
3770
3768
|
return tC(g.dataType);
|
|
3769
|
+
if (g.type === "Texture2DArray")
|
|
3770
|
+
return GC(g.dataType);
|
|
3771
3771
|
throw new Error(`Unsupported image texture type: ${g.type}`);
|
|
3772
3772
|
}
|
|
3773
|
-
function
|
|
3773
|
+
function tC(g) {
|
|
3774
3774
|
switch (g) {
|
|
3775
3775
|
case "byte":
|
|
3776
3776
|
case "int":
|
|
@@ -3784,7 +3784,7 @@ function yC(g) {
|
|
|
3784
3784
|
return "floatScalarImage";
|
|
3785
3785
|
}
|
|
3786
3786
|
}
|
|
3787
|
-
function
|
|
3787
|
+
function GC(g) {
|
|
3788
3788
|
switch (g) {
|
|
3789
3789
|
case "byte":
|
|
3790
3790
|
case "int":
|
|
@@ -3798,7 +3798,7 @@ function tC(g) {
|
|
|
3798
3798
|
return "floatScalarImageArray";
|
|
3799
3799
|
}
|
|
3800
3800
|
}
|
|
3801
|
-
class EI extends
|
|
3801
|
+
class EI extends Dg {
|
|
3802
3802
|
data_;
|
|
3803
3803
|
width_;
|
|
3804
3804
|
height_;
|
|
@@ -3846,7 +3846,7 @@ class EI extends ag {
|
|
|
3846
3846
|
return Q.unpackAlignment = A.rowAlignmentBytes, Q;
|
|
3847
3847
|
}
|
|
3848
3848
|
}
|
|
3849
|
-
function
|
|
3849
|
+
function hg(g, A, I, B, Q = 3) {
|
|
3850
3850
|
switch (g.type) {
|
|
3851
3851
|
case "pointerdown": {
|
|
3852
3852
|
const C = g.event;
|
|
@@ -3855,7 +3855,7 @@ function sg(g, A, I, B, Q = 3) {
|
|
|
3855
3855
|
case "pointerup": {
|
|
3856
3856
|
if (!A) return A;
|
|
3857
3857
|
const C = g.event, E = u(C.clientX, C.clientY);
|
|
3858
|
-
if (
|
|
3858
|
+
if (MQ(A, E) < Q) {
|
|
3859
3859
|
if (!B) return null;
|
|
3860
3860
|
const o = g.worldPos;
|
|
3861
3861
|
if (o) {
|
|
@@ -3872,7 +3872,7 @@ function sg(g, A, I, B, Q = 3) {
|
|
|
3872
3872
|
return A;
|
|
3873
3873
|
}
|
|
3874
3874
|
}
|
|
3875
|
-
class
|
|
3875
|
+
class wC {
|
|
3876
3876
|
bins_ = /* @__PURE__ */ new Map();
|
|
3877
3877
|
acquire(A) {
|
|
3878
3878
|
const B = this.bins_.get(A)?.pop();
|
|
@@ -3887,13 +3887,13 @@ class GC {
|
|
|
3887
3887
|
this.bins_.clear();
|
|
3888
3888
|
}
|
|
3889
3889
|
}
|
|
3890
|
-
class
|
|
3890
|
+
class RB extends GA {
|
|
3891
3891
|
type = "ChunkedImageLayer";
|
|
3892
3892
|
source_;
|
|
3893
3893
|
sliceCoords_;
|
|
3894
3894
|
onPickValue_;
|
|
3895
3895
|
visibleChunks_ = /* @__PURE__ */ new Map();
|
|
3896
|
-
pool_ = new
|
|
3896
|
+
pool_ = new wC();
|
|
3897
3897
|
initialChannelProps_;
|
|
3898
3898
|
channelChangeCallbacks_ = [];
|
|
3899
3899
|
policy_;
|
|
@@ -3957,7 +3957,7 @@ class SB extends GA {
|
|
|
3957
3957
|
return this.lastPresentationTimeCoord_;
|
|
3958
3958
|
}
|
|
3959
3959
|
isPresentationStale() {
|
|
3960
|
-
return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ >
|
|
3960
|
+
return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > RB.STALE_PRESENTATION_MS_;
|
|
3961
3961
|
}
|
|
3962
3962
|
resliceIfZChanged() {
|
|
3963
3963
|
const A = this.sliceCoords_.z;
|
|
@@ -3971,7 +3971,7 @@ class SB extends GA {
|
|
|
3971
3971
|
}
|
|
3972
3972
|
}
|
|
3973
3973
|
onEvent(A) {
|
|
3974
|
-
this.pointerDownPos_ =
|
|
3974
|
+
this.pointerDownPos_ = hg(
|
|
3975
3975
|
A,
|
|
3976
3976
|
this.pointerDownPos_,
|
|
3977
3977
|
(I) => this.getValueAtWorld(I),
|
|
@@ -3994,7 +3994,7 @@ class SB extends GA {
|
|
|
3994
3994
|
set imageSourcePolicy(A) {
|
|
3995
3995
|
this.policy_ !== A && (this.policy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
3996
3996
|
A,
|
|
3997
|
-
|
|
3997
|
+
nB
|
|
3998
3998
|
));
|
|
3999
3999
|
}
|
|
4000
4000
|
slicePlane(A, I) {
|
|
@@ -4007,11 +4007,11 @@ class SB extends GA {
|
|
|
4007
4007
|
getImageForChunk(A) {
|
|
4008
4008
|
const I = this.visibleChunks_.get(A);
|
|
4009
4009
|
if (I) return I;
|
|
4010
|
-
const B = this.pool_.acquire(
|
|
4010
|
+
const B = this.pool_.acquire(Zg(A));
|
|
4011
4011
|
return B ? (B.textures[0].updateWithChunk(A, this.getDataForImage(A)), this.updateImageChunk(B, A), this.channelProps_ && B.setChannelProps(this.channelProps_), B) : this.createImage(A);
|
|
4012
4012
|
}
|
|
4013
4013
|
createImage(A) {
|
|
4014
|
-
const I = new
|
|
4014
|
+
const I = new sg(
|
|
4015
4015
|
A.shape.x,
|
|
4016
4016
|
A.shape.y,
|
|
4017
4017
|
EI.createWithChunk(A, this.getDataForImage(A)),
|
|
@@ -4090,18 +4090,18 @@ class SB extends GA {
|
|
|
4090
4090
|
releaseAndRemoveChunks(A) {
|
|
4091
4091
|
for (const I of A) {
|
|
4092
4092
|
const B = this.visibleChunks_.get(I);
|
|
4093
|
-
B && (this.pool_.release(
|
|
4093
|
+
B && (this.pool_.release(Zg(I), B), this.visibleChunks_.delete(I));
|
|
4094
4094
|
}
|
|
4095
4095
|
}
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function Zg(g) {
|
|
4098
4098
|
return [
|
|
4099
4099
|
`lod${g.lod}`,
|
|
4100
4100
|
`shape${g.shape.x}x${g.shape.y}`,
|
|
4101
4101
|
`align${g.rowAlignmentBytes}`
|
|
4102
4102
|
].join(":");
|
|
4103
4103
|
}
|
|
4104
|
-
class
|
|
4104
|
+
class yg extends Dg {
|
|
4105
4105
|
data_;
|
|
4106
4106
|
width_;
|
|
4107
4107
|
height_;
|
|
@@ -4145,7 +4145,7 @@ class hg extends ag {
|
|
|
4145
4145
|
throw new Error(
|
|
4146
4146
|
"Unable to create texture, chunk data is not initialized."
|
|
4147
4147
|
);
|
|
4148
|
-
const B = new
|
|
4148
|
+
const B = new yg(
|
|
4149
4149
|
I,
|
|
4150
4150
|
A.shape.x,
|
|
4151
4151
|
A.shape.y,
|
|
@@ -4154,7 +4154,7 @@ class hg extends ag {
|
|
|
4154
4154
|
return B.unpackAlignment = A.rowAlignmentBytes, B;
|
|
4155
4155
|
}
|
|
4156
4156
|
}
|
|
4157
|
-
class
|
|
4157
|
+
class FC extends pA {
|
|
4158
4158
|
constructor(A, I, B, Q, C, E) {
|
|
4159
4159
|
super();
|
|
4160
4160
|
const i = [], o = [], a = Math.floor(Q), D = Math.floor(C), h = Math.floor(E);
|
|
@@ -4201,15 +4201,15 @@ class wC extends pA {
|
|
|
4201
4201
|
}
|
|
4202
4202
|
}
|
|
4203
4203
|
}
|
|
4204
|
-
class
|
|
4204
|
+
class nC extends mA {
|
|
4205
4205
|
constructor(A, I, B, Q) {
|
|
4206
|
-
super(), this.geometry = new
|
|
4206
|
+
super(), this.geometry = new FC(A, I, B, 1, 1, 1), this.cullFaceMode = "back", this.setTexture(0, Q), this.programName = eC(Q.dataType);
|
|
4207
4207
|
}
|
|
4208
4208
|
get type() {
|
|
4209
4209
|
return "VolumeRenderable";
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
4212
|
-
function
|
|
4212
|
+
function eC(g) {
|
|
4213
4213
|
switch (g) {
|
|
4214
4214
|
case "byte":
|
|
4215
4215
|
case "int":
|
|
@@ -4223,19 +4223,19 @@ function nC(g) {
|
|
|
4223
4223
|
return "floatVolume";
|
|
4224
4224
|
}
|
|
4225
4225
|
}
|
|
4226
|
-
class
|
|
4226
|
+
class Go extends GA {
|
|
4227
4227
|
type = "VolumeLayer";
|
|
4228
4228
|
constructor() {
|
|
4229
4229
|
super();
|
|
4230
|
-
const A = new Int8Array([127, 0, 0, 127, 127, 0, 0, 127]), I = new
|
|
4230
|
+
const A = new Int8Array([127, 0, 0, 127, 127, 0, 0, 127]), I = new yg(A, 2, 2, 2);
|
|
4231
4231
|
I.unpackAlignment = 1;
|
|
4232
|
-
const B = new
|
|
4232
|
+
const B = new nC(1, 1, 1, I);
|
|
4233
4233
|
B.wireframeEnabled = !0, this.addObject(B), this.setState("ready");
|
|
4234
4234
|
}
|
|
4235
4235
|
update() {
|
|
4236
4236
|
}
|
|
4237
4237
|
}
|
|
4238
|
-
class
|
|
4238
|
+
class wo extends GA {
|
|
4239
4239
|
type = "ImageLayer";
|
|
4240
4240
|
source_;
|
|
4241
4241
|
region_;
|
|
@@ -4273,7 +4273,7 @@ class Go extends GA {
|
|
|
4273
4273
|
}
|
|
4274
4274
|
}
|
|
4275
4275
|
onEvent(A) {
|
|
4276
|
-
this.pointerDownPos_ =
|
|
4276
|
+
this.pointerDownPos_ = hg(
|
|
4277
4277
|
A,
|
|
4278
4278
|
this.pointerDownPos_,
|
|
4279
4279
|
(I) => this.getValueAtWorld(I),
|
|
@@ -4316,7 +4316,7 @@ class Go extends GA {
|
|
|
4316
4316
|
return this.extent_;
|
|
4317
4317
|
}
|
|
4318
4318
|
createImage(A) {
|
|
4319
|
-
const I = new
|
|
4319
|
+
const I = new sg(
|
|
4320
4320
|
A.shape.x,
|
|
4321
4321
|
A.shape.y,
|
|
4322
4322
|
EI.createWithChunk(A),
|
|
@@ -4338,7 +4338,7 @@ class Go extends GA {
|
|
|
4338
4338
|
return null;
|
|
4339
4339
|
}
|
|
4340
4340
|
}
|
|
4341
|
-
class OA extends
|
|
4341
|
+
class OA extends Dg {
|
|
4342
4342
|
data_;
|
|
4343
4343
|
width_;
|
|
4344
4344
|
height_;
|
|
@@ -4382,7 +4382,7 @@ class OA extends ag {
|
|
|
4382
4382
|
return Q.unpackAlignment = A.rowAlignmentBytes, Q;
|
|
4383
4383
|
}
|
|
4384
4384
|
}
|
|
4385
|
-
const
|
|
4385
|
+
const rC = [
|
|
4386
4386
|
[1, 0.5, 0.5],
|
|
4387
4387
|
[0.5, 1, 0.5],
|
|
4388
4388
|
[0.5, 0.5, 1],
|
|
@@ -4390,7 +4390,7 @@ const eC = [
|
|
|
4390
4390
|
[1, 0.5, 1],
|
|
4391
4391
|
[1, 1, 0.5]
|
|
4392
4392
|
];
|
|
4393
|
-
function
|
|
4393
|
+
function SC(g) {
|
|
4394
4394
|
return g = g ?? /* @__PURE__ */ new Map(), new Map(
|
|
4395
4395
|
Array.from(g.entries()).map(([A, I]) => [
|
|
4396
4396
|
A,
|
|
@@ -4398,37 +4398,37 @@ function rC(g) {
|
|
|
4398
4398
|
])
|
|
4399
4399
|
);
|
|
4400
4400
|
}
|
|
4401
|
-
function
|
|
4402
|
-
return g = g ??
|
|
4401
|
+
function RC(g) {
|
|
4402
|
+
return g = g ?? rC, g.map(l.from);
|
|
4403
4403
|
}
|
|
4404
|
-
class
|
|
4404
|
+
class Pg {
|
|
4405
4405
|
lookupTable;
|
|
4406
4406
|
cycle;
|
|
4407
4407
|
constructor(A = {}) {
|
|
4408
|
-
this.lookupTable =
|
|
4408
|
+
this.lookupTable = SC(A.lookupTable), this.cycle = RC(A.cycle);
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
-
const
|
|
4411
|
+
const NC = /* @__PURE__ */ new Set([
|
|
4412
4412
|
"unsigned_byte",
|
|
4413
4413
|
"unsigned_short",
|
|
4414
4414
|
"unsigned_int"
|
|
4415
4415
|
]);
|
|
4416
|
-
function
|
|
4416
|
+
function cC(g) {
|
|
4417
4417
|
if (g.dataFormat !== "scalar")
|
|
4418
4418
|
throw new Error(
|
|
4419
4419
|
`Image data format must be scalar, instead found: ${g.dataFormat}`
|
|
4420
4420
|
);
|
|
4421
|
-
if (!
|
|
4421
|
+
if (!NC.has(g.dataType))
|
|
4422
4422
|
throw new Error(
|
|
4423
4423
|
`Image data type must be unsigned, instead found: ${g.dataType}`
|
|
4424
4424
|
);
|
|
4425
4425
|
return g;
|
|
4426
4426
|
}
|
|
4427
|
-
class
|
|
4427
|
+
class UC extends mA {
|
|
4428
4428
|
outlineSelected_;
|
|
4429
4429
|
selectedValue_;
|
|
4430
4430
|
constructor(A) {
|
|
4431
|
-
super(), this.geometry = new
|
|
4431
|
+
super(), this.geometry = new SB(A.width, A.height, 1, 1), this.setTexture(0, cC(A.imageData));
|
|
4432
4432
|
const I = this.makeColorCycleTexture(A.colorMap.cycle);
|
|
4433
4433
|
this.setTexture(1, I);
|
|
4434
4434
|
const B = this.makeColorLookupTableTexture(
|
|
@@ -4466,7 +4466,7 @@ class cC extends mA {
|
|
|
4466
4466
|
return C.set(I, 0), C.set(B, Q), new OA(C, Q, 2);
|
|
4467
4467
|
}
|
|
4468
4468
|
}
|
|
4469
|
-
class
|
|
4469
|
+
class Fo extends GA {
|
|
4470
4470
|
type = "LabelImageLayer";
|
|
4471
4471
|
source_;
|
|
4472
4472
|
region_;
|
|
@@ -4487,7 +4487,7 @@ class wo extends GA {
|
|
|
4487
4487
|
outlineSelected: E = !1,
|
|
4488
4488
|
...i
|
|
4489
4489
|
}) {
|
|
4490
|
-
super(i), this.setState("initialized"), this.source_ = A, this.region_ = I, this.colorMap_ = new
|
|
4490
|
+
super(i), this.setState("initialized"), this.source_ = A, this.region_ = I, this.colorMap_ = new Pg(B), this.onPickValue_ = Q, this.lod_ = C, this.outlineSelected_ = E;
|
|
4491
4491
|
}
|
|
4492
4492
|
update() {
|
|
4493
4493
|
switch (this.state) {
|
|
@@ -4507,13 +4507,13 @@ class wo extends GA {
|
|
|
4507
4507
|
return this.colorMap_;
|
|
4508
4508
|
}
|
|
4509
4509
|
setColorMap(A) {
|
|
4510
|
-
this.colorMap_ = new
|
|
4510
|
+
this.colorMap_ = new Pg(A), this.image_ && this.image_.setColorMap(this.colorMap_);
|
|
4511
4511
|
}
|
|
4512
4512
|
setSelectedValue(A) {
|
|
4513
4513
|
this.selectedValue_ = A, this.image_ && this.image_.setSelectedValue(this.selectedValue_);
|
|
4514
4514
|
}
|
|
4515
4515
|
onEvent(A) {
|
|
4516
|
-
this.pointerDownPos_ =
|
|
4516
|
+
this.pointerDownPos_ = hg(
|
|
4517
4517
|
A,
|
|
4518
4518
|
this.pointerDownPos_,
|
|
4519
4519
|
(I) => this.getValueAtWorld(I),
|
|
@@ -4531,7 +4531,7 @@ class wo extends GA {
|
|
|
4531
4531
|
}
|
|
4532
4532
|
createImage(A) {
|
|
4533
4533
|
this.imageChunk_ = A;
|
|
4534
|
-
const I = new
|
|
4534
|
+
const I = new UC({
|
|
4535
4535
|
width: A.shape.x,
|
|
4536
4536
|
height: A.shape.y,
|
|
4537
4537
|
imageData: OA.createWithChunk(A),
|
|
@@ -4560,7 +4560,7 @@ class MI extends Error {
|
|
|
4560
4560
|
super(A), this.name = "AbortError", Object.setPrototypeOf(this, MI.prototype);
|
|
4561
4561
|
}
|
|
4562
4562
|
}
|
|
4563
|
-
class
|
|
4563
|
+
class kC {
|
|
4564
4564
|
maxConcurrent_;
|
|
4565
4565
|
pending_ = [];
|
|
4566
4566
|
abortController_ = new AbortController();
|
|
@@ -4604,12 +4604,12 @@ class UC {
|
|
|
4604
4604
|
return this.pending_.length;
|
|
4605
4605
|
}
|
|
4606
4606
|
}
|
|
4607
|
-
class
|
|
4607
|
+
class LC {
|
|
4608
4608
|
source_;
|
|
4609
4609
|
region_;
|
|
4610
4610
|
seriesDimensionName_;
|
|
4611
4611
|
seriesIndex_;
|
|
4612
|
-
scheduler_ = new
|
|
4612
|
+
scheduler_ = new kC(16);
|
|
4613
4613
|
lod_;
|
|
4614
4614
|
loader_ = null;
|
|
4615
4615
|
seriesAttributes_;
|
|
@@ -4722,7 +4722,7 @@ class kC {
|
|
|
4722
4722
|
return this.loader_ ??= await this.source_.open(), this.loader_;
|
|
4723
4723
|
}
|
|
4724
4724
|
}
|
|
4725
|
-
class
|
|
4725
|
+
class no extends GA {
|
|
4726
4726
|
type = "ImageSeriesLayer";
|
|
4727
4727
|
seriesLoader_;
|
|
4728
4728
|
initialChannelProps_;
|
|
@@ -4739,7 +4739,7 @@ class Fo extends GA {
|
|
|
4739
4739
|
lod: C,
|
|
4740
4740
|
...E
|
|
4741
4741
|
}) {
|
|
4742
|
-
super(E), this.setState("initialized"), this.channelProps_ = Q, this.initialChannelProps_ = Q, this.seriesLoader_ = new
|
|
4742
|
+
super(E), this.setState("initialized"), this.channelProps_ = Q, this.initialChannelProps_ = Q, this.seriesLoader_ = new LC({
|
|
4743
4743
|
source: A,
|
|
4744
4744
|
region: I,
|
|
4745
4745
|
seriesDimensionName: B,
|
|
@@ -4796,7 +4796,7 @@ class Fo extends GA {
|
|
|
4796
4796
|
}) : A.data && this.texture_.updateWithChunk(A);
|
|
4797
4797
|
}
|
|
4798
4798
|
createImage(A, I, B) {
|
|
4799
|
-
const Q = new
|
|
4799
|
+
const Q = new sg(
|
|
4800
4800
|
A.shape.x,
|
|
4801
4801
|
A.shape.y,
|
|
4802
4802
|
I,
|
|
@@ -4810,19 +4810,19 @@ class iI extends Error {
|
|
|
4810
4810
|
super(`Node not found: ${A}`, I), this.name = "NodeNotFoundError";
|
|
4811
4811
|
}
|
|
4812
4812
|
}
|
|
4813
|
-
class
|
|
4813
|
+
class tg extends Error {
|
|
4814
4814
|
constructor(A) {
|
|
4815
4815
|
super(`Missing key: ${A}`), this.name = "KeyError";
|
|
4816
4816
|
}
|
|
4817
4817
|
}
|
|
4818
|
-
class
|
|
4818
|
+
class Gg {
|
|
4819
4819
|
kind = "array_to_array";
|
|
4820
4820
|
constructor(A, I) {
|
|
4821
4821
|
if (A.keepbits < 0)
|
|
4822
4822
|
throw new Error("keepbits must be zero or positive");
|
|
4823
4823
|
}
|
|
4824
4824
|
static fromConfig(A, I) {
|
|
4825
|
-
return new
|
|
4825
|
+
return new Gg(A, I);
|
|
4826
4826
|
}
|
|
4827
4827
|
/**
|
|
4828
4828
|
* Encode a chunk of data with bit-rounding.
|
|
@@ -4840,7 +4840,7 @@ class tg {
|
|
|
4840
4840
|
return A;
|
|
4841
4841
|
}
|
|
4842
4842
|
}
|
|
4843
|
-
class
|
|
4843
|
+
class NB {
|
|
4844
4844
|
#A;
|
|
4845
4845
|
constructor(A, I, B) {
|
|
4846
4846
|
typeof A == "number" ? this.#A = new Uint8Array(A) : A instanceof ArrayBuffer ? this.#A = new Uint8Array(A, I, B) : this.#A = new Uint8Array(Array.from(A, (Q) => Q ? 1 : 0));
|
|
@@ -4875,7 +4875,7 @@ class RB {
|
|
|
4875
4875
|
yield this.get(A);
|
|
4876
4876
|
}
|
|
4877
4877
|
}
|
|
4878
|
-
class
|
|
4878
|
+
class wg {
|
|
4879
4879
|
_data;
|
|
4880
4880
|
chars;
|
|
4881
4881
|
#A;
|
|
@@ -4983,14 +4983,14 @@ function aI(g) {
|
|
|
4983
4983
|
const A = new TextDecoder().decode(g);
|
|
4984
4984
|
return JSON.parse(A);
|
|
4985
4985
|
}
|
|
4986
|
-
function
|
|
4986
|
+
function Og(g, A) {
|
|
4987
4987
|
const I = A / 2, B = A - 1;
|
|
4988
4988
|
let Q = 0;
|
|
4989
4989
|
for (let C = 0; C < g.length; C += A)
|
|
4990
4990
|
for (let E = 0; E < I; E += 1)
|
|
4991
4991
|
Q = g[C + E], g[C + E] = g[C + B - E], g[C + B - E] = Q;
|
|
4992
4992
|
}
|
|
4993
|
-
const
|
|
4993
|
+
const JC = {
|
|
4994
4994
|
int8: Int8Array,
|
|
4995
4995
|
int16: Int16Array,
|
|
4996
4996
|
int32: Int32Array,
|
|
@@ -5001,37 +5001,37 @@ const LC = {
|
|
|
5001
5001
|
uint64: globalThis.BigUint64Array,
|
|
5002
5002
|
float32: Float32Array,
|
|
5003
5003
|
float64: Float64Array,
|
|
5004
|
-
bool:
|
|
5005
|
-
},
|
|
5006
|
-
function
|
|
5004
|
+
bool: NB
|
|
5005
|
+
}, YC = /v2:([US])(\d+)/;
|
|
5006
|
+
function cB(g) {
|
|
5007
5007
|
if (g === "v2:object")
|
|
5008
5008
|
return globalThis.Array;
|
|
5009
|
-
let A = g.match(
|
|
5009
|
+
let A = g.match(YC);
|
|
5010
5010
|
if (A) {
|
|
5011
5011
|
let [, B, Q] = A;
|
|
5012
|
-
return (B === "U" ? oI :
|
|
5012
|
+
return (B === "U" ? oI : wg).bind(null, Number(Q));
|
|
5013
5013
|
}
|
|
5014
|
-
let I =
|
|
5014
|
+
let I = JC[g];
|
|
5015
5015
|
if (!I)
|
|
5016
5016
|
throw new Error(`Unknown or unsupported data_type: ${g}`);
|
|
5017
5017
|
return I;
|
|
5018
5018
|
}
|
|
5019
5019
|
function RA(g, A) {
|
|
5020
|
-
return (A === "C" ?
|
|
5020
|
+
return (A === "C" ? MC : KC)(g);
|
|
5021
5021
|
}
|
|
5022
|
-
function
|
|
5022
|
+
function MC(g) {
|
|
5023
5023
|
const A = g.length, I = globalThis.Array(A);
|
|
5024
5024
|
for (let B = A - 1, Q = 1; B >= 0; B--)
|
|
5025
5025
|
I[B] = Q, Q *= g[B];
|
|
5026
5026
|
return I;
|
|
5027
5027
|
}
|
|
5028
|
-
function
|
|
5028
|
+
function KC(g) {
|
|
5029
5029
|
const A = g.length, I = globalThis.Array(A);
|
|
5030
5030
|
for (let B = 0, Q = 1; B < A; B++)
|
|
5031
5031
|
I[B] = Q, Q *= g[B];
|
|
5032
5032
|
return I;
|
|
5033
5033
|
}
|
|
5034
|
-
function
|
|
5034
|
+
function dC({ name: g, configuration: A }) {
|
|
5035
5035
|
if (g === "default") {
|
|
5036
5036
|
const I = A?.separator ?? "/";
|
|
5037
5037
|
return (B) => ["c", ...B].join(I);
|
|
@@ -5045,11 +5045,11 @@ function KC({ name: g, configuration: A }) {
|
|
|
5045
5045
|
function _I(g) {
|
|
5046
5046
|
return g.find((I) => I.name === "transpose")?.configuration?.order === "F" ? "F" : "C";
|
|
5047
5047
|
}
|
|
5048
|
-
const
|
|
5049
|
-
function
|
|
5048
|
+
const HC = /^([<|>])(.*)$/;
|
|
5049
|
+
function qC(g) {
|
|
5050
5050
|
if (g === "|O")
|
|
5051
5051
|
return { data_type: "v2:object" };
|
|
5052
|
-
let A = g.match(
|
|
5052
|
+
let A = g.match(HC);
|
|
5053
5053
|
if (!A)
|
|
5054
5054
|
throw new Error(`Invalid dtype: ${g}`);
|
|
5055
5055
|
let [, I, B] = A, Q = {
|
|
@@ -5069,8 +5069,8 @@ function HC(g) {
|
|
|
5069
5069
|
throw new Error(`Unsupported or unknown dtype: ${g}`);
|
|
5070
5070
|
return I === "|" ? { data_type: Q } : { data_type: Q, endian: I === "<" ? "little" : "big" };
|
|
5071
5071
|
}
|
|
5072
|
-
function
|
|
5073
|
-
let I = [], B =
|
|
5072
|
+
function lC(g, A = {}) {
|
|
5073
|
+
let I = [], B = qC(g.dtype);
|
|
5074
5074
|
g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } }), "endian" in B && B.endian === "big" && I.push({ name: "bytes", configuration: { endian: "big" } });
|
|
5075
5075
|
for (let { id: Q, ...C } of g.filters ?? [])
|
|
5076
5076
|
I.push({ name: Q, configuration: C });
|
|
@@ -5100,14 +5100,14 @@ function qC(g, A = {}) {
|
|
|
5100
5100
|
attributes: A
|
|
5101
5101
|
};
|
|
5102
5102
|
}
|
|
5103
|
-
function
|
|
5103
|
+
function fC(g, A = {}) {
|
|
5104
5104
|
return {
|
|
5105
5105
|
zarr_format: 3,
|
|
5106
5106
|
node_type: "group",
|
|
5107
5107
|
attributes: A
|
|
5108
5108
|
};
|
|
5109
5109
|
}
|
|
5110
|
-
function
|
|
5110
|
+
function pC(g, A) {
|
|
5111
5111
|
if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
|
|
5112
5112
|
return g === A;
|
|
5113
5113
|
let I = g === "bool";
|
|
@@ -5122,18 +5122,18 @@ function fC(g, A) {
|
|
|
5122
5122
|
let C = g === "v2:object";
|
|
5123
5123
|
return A === "object" ? C : !B && !Q && !I && !C;
|
|
5124
5124
|
}
|
|
5125
|
-
function
|
|
5125
|
+
function mC(g) {
|
|
5126
5126
|
return g?.name === "sharding_indexed";
|
|
5127
5127
|
}
|
|
5128
|
-
function
|
|
5128
|
+
function UB(g) {
|
|
5129
5129
|
return (g.data_type === "uint64" || g.data_type === "int64") && g.fill_value != null ? BigInt(g.fill_value) : g.fill_value;
|
|
5130
5130
|
}
|
|
5131
|
-
const
|
|
5132
|
-
function
|
|
5131
|
+
const Vg = uC();
|
|
5132
|
+
function uC() {
|
|
5133
5133
|
const g = new Uint32Array([305419896]);
|
|
5134
5134
|
return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
|
|
5135
5135
|
}
|
|
5136
|
-
function
|
|
5136
|
+
function vg(g) {
|
|
5137
5137
|
return "BYTES_PER_ELEMENT" in g ? g.BYTES_PER_ELEMENT : 4;
|
|
5138
5138
|
}
|
|
5139
5139
|
class KI {
|
|
@@ -5144,7 +5144,7 @@ class KI {
|
|
|
5144
5144
|
#Q;
|
|
5145
5145
|
#B;
|
|
5146
5146
|
constructor(A, I) {
|
|
5147
|
-
this.#B = A?.endian, this.#I =
|
|
5147
|
+
this.#B = A?.endian, this.#I = cB(I.data_type), this.#Q = I.shape, this.#A = RA(I.shape, _I(I.codecs));
|
|
5148
5148
|
const B = new this.#I(0);
|
|
5149
5149
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5150
5150
|
}
|
|
@@ -5153,20 +5153,20 @@ class KI {
|
|
|
5153
5153
|
}
|
|
5154
5154
|
encode(A) {
|
|
5155
5155
|
let I = new Uint8Array(A.data.buffer);
|
|
5156
|
-
return
|
|
5156
|
+
return Vg && this.#B === "big" && Og(I, vg(this.#I)), I;
|
|
5157
5157
|
}
|
|
5158
5158
|
decode(A) {
|
|
5159
|
-
return
|
|
5159
|
+
return Vg && this.#B === "big" && Og(A, vg(this.#I)), {
|
|
5160
5160
|
data: new this.#I(A.buffer, A.byteOffset, A.byteLength / this.#g),
|
|
5161
5161
|
shape: this.#Q,
|
|
5162
5162
|
stride: this.#A
|
|
5163
5163
|
};
|
|
5164
5164
|
}
|
|
5165
5165
|
}
|
|
5166
|
-
class
|
|
5166
|
+
class Fg {
|
|
5167
5167
|
kind = "bytes_to_bytes";
|
|
5168
5168
|
static fromConfig() {
|
|
5169
|
-
return new
|
|
5169
|
+
return new Fg();
|
|
5170
5170
|
}
|
|
5171
5171
|
encode(A) {
|
|
5172
5172
|
throw new Error("Not implemented");
|
|
@@ -5175,7 +5175,7 @@ class wg {
|
|
|
5175
5175
|
return new Uint8Array(A.buffer, A.byteOffset, A.byteLength - 4);
|
|
5176
5176
|
}
|
|
5177
5177
|
}
|
|
5178
|
-
function
|
|
5178
|
+
function TC(g, A) {
|
|
5179
5179
|
if (Number.isNaN(A))
|
|
5180
5180
|
throw new Error("JsonCodec allow_nan is false but NaN was encountered during encoding.");
|
|
5181
5181
|
if (A === Number.POSITIVE_INFINITY)
|
|
@@ -5184,10 +5184,10 @@ function uC(g, A) {
|
|
|
5184
5184
|
throw new Error("JsonCodec allow_nan is false but -Infinity was encountered during encoding.");
|
|
5185
5185
|
return A;
|
|
5186
5186
|
}
|
|
5187
|
-
function
|
|
5187
|
+
function WC(g, A) {
|
|
5188
5188
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
|
|
5189
5189
|
}
|
|
5190
|
-
class
|
|
5190
|
+
class ng {
|
|
5191
5191
|
configuration;
|
|
5192
5192
|
kind = "array_to_bytes";
|
|
5193
5193
|
#A;
|
|
@@ -5208,7 +5208,7 @@ class Fg {
|
|
|
5208
5208
|
}, this.#I = { strict: a };
|
|
5209
5209
|
}
|
|
5210
5210
|
static fromConfig(A) {
|
|
5211
|
-
return new
|
|
5211
|
+
return new ng(A);
|
|
5212
5212
|
}
|
|
5213
5213
|
encode(A) {
|
|
5214
5214
|
const { indent: I, encoding: B, ensure_ascii: Q, check_circular: C, allow_nan: E, sort_keys: i } = this.#A;
|
|
@@ -5217,7 +5217,7 @@ class Fg {
|
|
|
5217
5217
|
const o = [];
|
|
5218
5218
|
if (!C)
|
|
5219
5219
|
throw new Error("JsonCodec does not yet support skipping the check for circular references during encoding.");
|
|
5220
|
-
E || o.push(
|
|
5220
|
+
E || o.push(TC), i && o.push(WC);
|
|
5221
5221
|
const a = Array.from(A.data);
|
|
5222
5222
|
a.push("|O"), a.push(A.shape);
|
|
5223
5223
|
let D;
|
|
@@ -5244,8 +5244,8 @@ class Fg {
|
|
|
5244
5244
|
return { data: B, shape: Q, stride: C };
|
|
5245
5245
|
}
|
|
5246
5246
|
}
|
|
5247
|
-
function
|
|
5248
|
-
return g instanceof
|
|
5247
|
+
function Xg(g) {
|
|
5248
|
+
return g instanceof NB || g instanceof wg || g instanceof oI ? new Proxy(g, {
|
|
5249
5249
|
get(I, B) {
|
|
5250
5250
|
return I.get(Number(B));
|
|
5251
5251
|
},
|
|
@@ -5254,9 +5254,9 @@ function vg(g) {
|
|
|
5254
5254
|
}
|
|
5255
5255
|
}) : g;
|
|
5256
5256
|
}
|
|
5257
|
-
function
|
|
5257
|
+
function xC(g, A) {
|
|
5258
5258
|
let I;
|
|
5259
|
-
return g.data instanceof
|
|
5259
|
+
return g.data instanceof wg || g.data instanceof oI ? I = new g.constructor(
|
|
5260
5260
|
// @ts-expect-error
|
|
5261
5261
|
g.data.length,
|
|
5262
5262
|
g.data.chars
|
|
@@ -5266,8 +5266,8 @@ function WC(g, A) {
|
|
|
5266
5266
|
stride: RA(g.shape, A)
|
|
5267
5267
|
};
|
|
5268
5268
|
}
|
|
5269
|
-
function
|
|
5270
|
-
let I =
|
|
5269
|
+
function bC(g, A) {
|
|
5270
|
+
let I = xC(g, A), B = g.shape.length, Q = g.data.length, C = Array(B).fill(0), E = Xg(g.data), i = Xg(I.data);
|
|
5271
5271
|
for (let o = 0; o < Q; o++) {
|
|
5272
5272
|
let a = 0;
|
|
5273
5273
|
for (let D = 0; D < B; D++)
|
|
@@ -5282,29 +5282,29 @@ function xC(g, A) {
|
|
|
5282
5282
|
}
|
|
5283
5283
|
return I;
|
|
5284
5284
|
}
|
|
5285
|
-
function
|
|
5285
|
+
function ZC(g) {
|
|
5286
5286
|
if (!g.stride)
|
|
5287
5287
|
return "C";
|
|
5288
5288
|
let A = RA(g.shape, "C");
|
|
5289
5289
|
return g.stride.every((I, B) => I === A[B]) ? "C" : "F";
|
|
5290
5290
|
}
|
|
5291
|
-
class
|
|
5291
|
+
class eg {
|
|
5292
5292
|
configuration;
|
|
5293
5293
|
kind = "array_to_array";
|
|
5294
5294
|
constructor(A) {
|
|
5295
5295
|
this.configuration = A;
|
|
5296
5296
|
}
|
|
5297
5297
|
static fromConfig(A) {
|
|
5298
|
-
return new
|
|
5298
|
+
return new eg(A);
|
|
5299
5299
|
}
|
|
5300
5300
|
encode(A) {
|
|
5301
|
-
return
|
|
5301
|
+
return ZC(A) === this.configuration?.order ? A : bC(A, this.configuration?.order ?? "C");
|
|
5302
5302
|
}
|
|
5303
5303
|
decode(A) {
|
|
5304
5304
|
return A;
|
|
5305
5305
|
}
|
|
5306
5306
|
}
|
|
5307
|
-
class
|
|
5307
|
+
class rg {
|
|
5308
5308
|
kind = "array_to_bytes";
|
|
5309
5309
|
#A;
|
|
5310
5310
|
#I;
|
|
@@ -5312,7 +5312,7 @@ class eg {
|
|
|
5312
5312
|
this.#A = A, this.#I = RA(A, "C");
|
|
5313
5313
|
}
|
|
5314
5314
|
static fromConfig(A, I) {
|
|
5315
|
-
return new
|
|
5315
|
+
return new rg(I.shape);
|
|
5316
5316
|
}
|
|
5317
5317
|
encode(A) {
|
|
5318
5318
|
throw new Error("Method not implemented.");
|
|
@@ -5326,15 +5326,15 @@ class eg {
|
|
|
5326
5326
|
return { data: Q, shape: this.#A, stride: this.#I };
|
|
5327
5327
|
}
|
|
5328
5328
|
}
|
|
5329
|
-
function
|
|
5330
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("gzip", () => import("./gzip-DchmmbTG.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zlib", () => import("./zlib-Din1wO0I.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("transpose", () =>
|
|
5329
|
+
function PC() {
|
|
5330
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("gzip", () => import("./gzip-DchmmbTG.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zlib", () => import("./zlib-Din1wO0I.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("transpose", () => eg).set("bytes", () => KI).set("crc32c", () => Fg).set("vlen-utf8", () => rg).set("json2", () => ng).set("bitround", () => Gg);
|
|
5331
5331
|
}
|
|
5332
|
-
const
|
|
5332
|
+
const OC = PC();
|
|
5333
5333
|
function $I(g) {
|
|
5334
5334
|
let A;
|
|
5335
5335
|
return {
|
|
5336
5336
|
async encode(I) {
|
|
5337
|
-
A || (A = await
|
|
5337
|
+
A || (A = await jg(g));
|
|
5338
5338
|
for (const Q of A.array_to_array)
|
|
5339
5339
|
I = await Q.encode(I);
|
|
5340
5340
|
let B = await A.array_to_bytes.encode(I);
|
|
@@ -5343,7 +5343,7 @@ function $I(g) {
|
|
|
5343
5343
|
return B;
|
|
5344
5344
|
},
|
|
5345
5345
|
async decode(I) {
|
|
5346
|
-
A || (A = await
|
|
5346
|
+
A || (A = await jg(g));
|
|
5347
5347
|
for (let Q = A.bytes_to_bytes.length - 1; Q >= 0; Q--)
|
|
5348
5348
|
I = await A.bytes_to_bytes[Q].decode(I);
|
|
5349
5349
|
let B = await A.array_to_bytes.decode(I);
|
|
@@ -5353,9 +5353,9 @@ function $I(g) {
|
|
|
5353
5353
|
}
|
|
5354
5354
|
};
|
|
5355
5355
|
}
|
|
5356
|
-
async function
|
|
5356
|
+
async function jg(g) {
|
|
5357
5357
|
let A = g.codecs.map(async (C) => {
|
|
5358
|
-
let E = await
|
|
5358
|
+
let E = await OC.get(C.name)?.();
|
|
5359
5359
|
if (!E)
|
|
5360
5360
|
throw new Error(`Unknown codec: ${C.name}`);
|
|
5361
5361
|
return { Codec: E, meta: C };
|
|
@@ -5374,17 +5374,17 @@ async function Xg(g) {
|
|
|
5374
5374
|
}
|
|
5375
5375
|
}
|
|
5376
5376
|
if (!B) {
|
|
5377
|
-
if (!
|
|
5377
|
+
if (!VC(g))
|
|
5378
5378
|
throw new Error(`Cannot encode ${g.data_type} to bytes without a codec`);
|
|
5379
5379
|
B = KI.fromConfig({ endian: "little" }, g);
|
|
5380
5380
|
}
|
|
5381
5381
|
return { array_to_array: I, array_to_bytes: B, bytes_to_bytes: Q };
|
|
5382
5382
|
}
|
|
5383
|
-
function
|
|
5383
|
+
function VC(g) {
|
|
5384
5384
|
return g.data_type !== "v2:object";
|
|
5385
5385
|
}
|
|
5386
|
-
const
|
|
5387
|
-
function
|
|
5386
|
+
const zg = 18446744073709551615n;
|
|
5387
|
+
function vC(g, A, I, B) {
|
|
5388
5388
|
if (g.store.getRange === void 0)
|
|
5389
5389
|
throw new Error("Store does not support range requests");
|
|
5390
5390
|
let Q = g.store.getRange.bind(g.store), C = A.map((o, a) => o / B.chunk_shape[a]), E = $I({
|
|
@@ -5405,7 +5405,7 @@ function VC(g, A, I, B) {
|
|
|
5405
5405
|
if (h === null)
|
|
5406
5406
|
return;
|
|
5407
5407
|
let { data: y, shape: t, stride: e } = h, r = o.map((k, N) => k % t[N]).reduce((k, N, K) => k + N * e[K], 0), R = y[r], F = y[r + 1];
|
|
5408
|
-
if (!(R ===
|
|
5408
|
+
if (!(R === zg && F === zg))
|
|
5409
5409
|
return Q(D, {
|
|
5410
5410
|
offset: Number(R),
|
|
5411
5411
|
length: Number(F)
|
|
@@ -5423,7 +5423,7 @@ class _ {
|
|
|
5423
5423
|
return new _(this.store, new URL(A, I).pathname);
|
|
5424
5424
|
}
|
|
5425
5425
|
}
|
|
5426
|
-
class
|
|
5426
|
+
class Sg extends _ {
|
|
5427
5427
|
kind = "group";
|
|
5428
5428
|
#A;
|
|
5429
5429
|
constructor(A, I, B) {
|
|
@@ -5434,13 +5434,13 @@ class rg extends _ {
|
|
|
5434
5434
|
}
|
|
5435
5435
|
}
|
|
5436
5436
|
const uA = Symbol("zarrita.context");
|
|
5437
|
-
function
|
|
5437
|
+
function XC(g) {
|
|
5438
5438
|
return g[uA];
|
|
5439
5439
|
}
|
|
5440
|
-
function
|
|
5441
|
-
let { configuration: I } = A.codecs.find(
|
|
5442
|
-
encode_chunk_key:
|
|
5443
|
-
TypedArray:
|
|
5440
|
+
function jC(g, A) {
|
|
5441
|
+
let { configuration: I } = A.codecs.find(mC) ?? {}, B = {
|
|
5442
|
+
encode_chunk_key: dC(A.chunk_key_encoding),
|
|
5443
|
+
TypedArray: cB(A.data_type),
|
|
5444
5444
|
fill_value: A.fill_value
|
|
5445
5445
|
};
|
|
5446
5446
|
if (I) {
|
|
@@ -5457,7 +5457,7 @@ function XC(g, A) {
|
|
|
5457
5457
|
get_strides(E, i) {
|
|
5458
5458
|
return RA(E, i ?? C);
|
|
5459
5459
|
},
|
|
5460
|
-
get_chunk_bytes:
|
|
5460
|
+
get_chunk_bytes: vC(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
|
|
5461
5461
|
};
|
|
5462
5462
|
}
|
|
5463
5463
|
let Q = _I(A.codecs);
|
|
@@ -5486,8 +5486,8 @@ let eI = class extends _ {
|
|
|
5486
5486
|
constructor(A, I, B) {
|
|
5487
5487
|
super(A, I), this.#A = {
|
|
5488
5488
|
...B,
|
|
5489
|
-
fill_value:
|
|
5490
|
-
}, this[uA] =
|
|
5489
|
+
fill_value: UB(B)
|
|
5490
|
+
}, this[uA] = jC(this, B);
|
|
5491
5491
|
}
|
|
5492
5492
|
get attrs() {
|
|
5493
5493
|
return this.#A.attributes;
|
|
@@ -5531,10 +5531,10 @@ let eI = class extends _ {
|
|
|
5531
5531
|
* ```
|
|
5532
5532
|
*/
|
|
5533
5533
|
is(A) {
|
|
5534
|
-
return
|
|
5534
|
+
return pC(this.dtype, A);
|
|
5535
5535
|
}
|
|
5536
|
-
}, dI =
|
|
5537
|
-
function
|
|
5536
|
+
}, dI = zC();
|
|
5537
|
+
function zC() {
|
|
5538
5538
|
let g = /* @__PURE__ */ new WeakMap();
|
|
5539
5539
|
function A(I) {
|
|
5540
5540
|
let B = g.get(I) ?? { v2: 0, v3: 0 };
|
|
@@ -5550,46 +5550,46 @@ function jC() {
|
|
|
5550
5550
|
}
|
|
5551
5551
|
};
|
|
5552
5552
|
}
|
|
5553
|
-
async function
|
|
5553
|
+
async function _C(g) {
|
|
5554
5554
|
let A = await g.store.get(g.resolve(".zattrs").path);
|
|
5555
5555
|
return A ? aI(A) : {};
|
|
5556
5556
|
}
|
|
5557
|
-
async function
|
|
5557
|
+
async function $C(g, A = {}) {
|
|
5558
5558
|
let I = "store" in g ? g : new _(g), B = {};
|
|
5559
|
-
return (A.attrs ?? !0) && (B = await
|
|
5559
|
+
return (A.attrs ?? !0) && (B = await _C(I)), A.kind === "array" ? _g(I, B) : A.kind === "group" ? $g(I, B) : _g(I, B).catch((Q) => {
|
|
5560
5560
|
if (Q instanceof iI)
|
|
5561
|
-
return
|
|
5561
|
+
return $g(I, B);
|
|
5562
5562
|
throw Q;
|
|
5563
5563
|
});
|
|
5564
5564
|
}
|
|
5565
|
-
async function
|
|
5565
|
+
async function _g(g, A) {
|
|
5566
5566
|
let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
|
|
5567
5567
|
if (!B)
|
|
5568
5568
|
throw new iI("v2 array", {
|
|
5569
|
-
cause: new
|
|
5569
|
+
cause: new tg(I)
|
|
5570
5570
|
});
|
|
5571
|
-
return dI.increment(g.store, "v2"), new eI(g.store, g.path,
|
|
5571
|
+
return dI.increment(g.store, "v2"), new eI(g.store, g.path, lC(aI(B), A));
|
|
5572
5572
|
}
|
|
5573
|
-
async function
|
|
5573
|
+
async function $g(g, A) {
|
|
5574
5574
|
let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
|
|
5575
5575
|
if (!B)
|
|
5576
5576
|
throw new iI("v2 group", {
|
|
5577
|
-
cause: new
|
|
5577
|
+
cause: new tg(I)
|
|
5578
5578
|
});
|
|
5579
|
-
return dI.increment(g.store, "v2"), new
|
|
5579
|
+
return dI.increment(g.store, "v2"), new Sg(g.store, g.path, fC(aI(B), A));
|
|
5580
5580
|
}
|
|
5581
|
-
async function
|
|
5581
|
+
async function AE(g) {
|
|
5582
5582
|
let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
|
|
5583
5583
|
if (!B)
|
|
5584
5584
|
throw new iI("v3 array or group", {
|
|
5585
|
-
cause: new
|
|
5585
|
+
cause: new tg(I)
|
|
5586
5586
|
});
|
|
5587
5587
|
let Q = aI(B);
|
|
5588
|
-
return Q.node_type === "array" && (Q.fill_value =
|
|
5588
|
+
return Q.node_type === "array" && (Q.fill_value = UB(Q)), Q.node_type === "array" ? new eI(A, g.path, Q) : new Sg(A, g.path, Q);
|
|
5589
5589
|
}
|
|
5590
|
-
async function
|
|
5591
|
-
let I = "store" in g ? g : new _(g), B = await
|
|
5592
|
-
if (dI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof eI || A.kind === "group" && B instanceof
|
|
5590
|
+
async function IE(g, A = {}) {
|
|
5591
|
+
let I = "store" in g ? g : new _(g), B = await AE(I);
|
|
5592
|
+
if (dI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof eI || A.kind === "group" && B instanceof Sg)
|
|
5593
5593
|
return B;
|
|
5594
5594
|
let Q = B instanceof eI ? "array" : "group";
|
|
5595
5595
|
throw new Error(`Expected node of kind ${A.kind}, found ${Q}.`);
|
|
@@ -5602,9 +5602,9 @@ async function z(g, A = {}) {
|
|
|
5602
5602
|
throw E;
|
|
5603
5603
|
});
|
|
5604
5604
|
}
|
|
5605
|
-
z.v2 =
|
|
5606
|
-
z.v3 =
|
|
5607
|
-
function
|
|
5605
|
+
z.v2 = $C;
|
|
5606
|
+
z.v3 = IE;
|
|
5607
|
+
function kB(g, A, I, B = {}) {
|
|
5608
5608
|
return A !== void 0 && I !== void 0 && (B = {
|
|
5609
5609
|
...B,
|
|
5610
5610
|
headers: {
|
|
@@ -5613,7 +5613,7 @@ function UB(g, A, I, B = {}) {
|
|
|
5613
5613
|
}
|
|
5614
5614
|
}), fetch(g, B);
|
|
5615
5615
|
}
|
|
5616
|
-
function
|
|
5616
|
+
function gE(g, A) {
|
|
5617
5617
|
return {
|
|
5618
5618
|
...g,
|
|
5619
5619
|
...A,
|
|
@@ -5623,20 +5623,20 @@ function IE(g, A) {
|
|
|
5623
5623
|
}
|
|
5624
5624
|
};
|
|
5625
5625
|
}
|
|
5626
|
-
function
|
|
5626
|
+
function AB(g, A) {
|
|
5627
5627
|
const I = typeof g == "string" ? new URL(g) : g;
|
|
5628
5628
|
I.pathname.endsWith("/") || (I.pathname += "/");
|
|
5629
5629
|
const B = new URL(A.slice(1), I);
|
|
5630
5630
|
return B.search = I.search, B;
|
|
5631
5631
|
}
|
|
5632
|
-
async function
|
|
5632
|
+
async function IB(g) {
|
|
5633
5633
|
if (g.status !== 404) {
|
|
5634
5634
|
if (g.status === 200 || g.status === 206)
|
|
5635
5635
|
return new Uint8Array(await g.arrayBuffer());
|
|
5636
5636
|
throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
|
|
5637
5637
|
}
|
|
5638
5638
|
}
|
|
5639
|
-
async function
|
|
5639
|
+
async function BE(g, A, I, B) {
|
|
5640
5640
|
if (B)
|
|
5641
5641
|
return fetch(g, {
|
|
5642
5642
|
...I,
|
|
@@ -5646,7 +5646,7 @@ async function gE(g, A, I, B) {
|
|
|
5646
5646
|
if (!Q.ok)
|
|
5647
5647
|
return Q;
|
|
5648
5648
|
let C = Q.headers.get("Content-Length"), E = Number(C);
|
|
5649
|
-
return
|
|
5649
|
+
return kB(g, E - A, E, I);
|
|
5650
5650
|
}
|
|
5651
5651
|
class DI {
|
|
5652
5652
|
url;
|
|
@@ -5656,23 +5656,23 @@ class DI {
|
|
|
5656
5656
|
this.url = A, this.#A = I.overrides ?? {}, this.#I = I.useSuffixRequest ?? !1;
|
|
5657
5657
|
}
|
|
5658
5658
|
#g(A) {
|
|
5659
|
-
return
|
|
5659
|
+
return gE(this.#A, A);
|
|
5660
5660
|
}
|
|
5661
5661
|
async get(A, I = {}) {
|
|
5662
|
-
let B =
|
|
5663
|
-
return
|
|
5662
|
+
let B = AB(this.url, A).href, Q = await fetch(B, this.#g(I));
|
|
5663
|
+
return IB(Q);
|
|
5664
5664
|
}
|
|
5665
5665
|
async getRange(A, I, B = {}) {
|
|
5666
|
-
let Q =
|
|
5667
|
-
return "suffixLength" in I ? E = await
|
|
5666
|
+
let Q = AB(this.url, A), C = this.#g(B), E;
|
|
5667
|
+
return "suffixLength" in I ? E = await BE(Q, I.suffixLength, C, this.#I) : E = await kB(Q, I.offset, I.length, C), IB(E);
|
|
5668
5668
|
}
|
|
5669
5669
|
}
|
|
5670
|
-
function*
|
|
5670
|
+
function* QE(g, A, I = 1) {
|
|
5671
5671
|
A === void 0 && (A = g, g = 0);
|
|
5672
5672
|
for (let B = g; B < A; B += I)
|
|
5673
5673
|
yield B;
|
|
5674
5674
|
}
|
|
5675
|
-
function*
|
|
5675
|
+
function* CE(...g) {
|
|
5676
5676
|
if (g.length === 0)
|
|
5677
5677
|
return;
|
|
5678
5678
|
const A = g.map((B) => B[Symbol.iterator]()), I = A.map((B) => B.next());
|
|
@@ -5687,7 +5687,7 @@ function* QE(...g) {
|
|
|
5687
5687
|
I[B] = A[B].next();
|
|
5688
5688
|
}
|
|
5689
5689
|
}
|
|
5690
|
-
function
|
|
5690
|
+
function EE({ start: g, stop: A, step: I }, B) {
|
|
5691
5691
|
if (I === 0)
|
|
5692
5692
|
throw new Error("slice step cannot be zero");
|
|
5693
5693
|
I = I ?? 1;
|
|
@@ -5701,47 +5701,47 @@ function rI(g, A, I = null) {
|
|
|
5701
5701
|
step: I
|
|
5702
5702
|
};
|
|
5703
5703
|
}
|
|
5704
|
-
function
|
|
5704
|
+
function iE() {
|
|
5705
5705
|
const g = [];
|
|
5706
5706
|
return {
|
|
5707
5707
|
add: (A) => g.push(A()),
|
|
5708
5708
|
onIdle: () => Promise.all(g)
|
|
5709
5709
|
};
|
|
5710
5710
|
}
|
|
5711
|
-
class
|
|
5711
|
+
class Rg extends Error {
|
|
5712
5712
|
constructor(A) {
|
|
5713
5713
|
super(A), this.name = "IndexError";
|
|
5714
5714
|
}
|
|
5715
5715
|
}
|
|
5716
|
-
function
|
|
5717
|
-
throw new
|
|
5718
|
-
}
|
|
5719
|
-
function oE(g) {
|
|
5720
|
-
throw new Sg(`index out of bounds for dimension with length ${g}`);
|
|
5716
|
+
function oE(g, A) {
|
|
5717
|
+
throw new Rg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
|
|
5721
5718
|
}
|
|
5722
|
-
function aE() {
|
|
5723
|
-
throw new
|
|
5719
|
+
function aE(g) {
|
|
5720
|
+
throw new Rg(`index out of bounds for dimension with length ${g}`);
|
|
5724
5721
|
}
|
|
5725
|
-
function DE(
|
|
5726
|
-
|
|
5722
|
+
function DE() {
|
|
5723
|
+
throw new Rg("only slices with step >= 1 are supported");
|
|
5727
5724
|
}
|
|
5728
5725
|
function sE(g, A) {
|
|
5729
|
-
|
|
5726
|
+
g.length > A.length && oE(g, A);
|
|
5730
5727
|
}
|
|
5731
|
-
|
|
5728
|
+
function hE(g, A) {
|
|
5729
|
+
return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && aE(A), g;
|
|
5730
|
+
}
|
|
5731
|
+
class yE {
|
|
5732
5732
|
dim_sel;
|
|
5733
5733
|
dim_len;
|
|
5734
5734
|
dim_chunk_len;
|
|
5735
5735
|
nitems;
|
|
5736
5736
|
constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
|
|
5737
|
-
A =
|
|
5737
|
+
A = hE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
|
|
5738
5738
|
}
|
|
5739
5739
|
*[Symbol.iterator]() {
|
|
5740
5740
|
const A = Math.floor(this.dim_sel / this.dim_chunk_len), I = A * this.dim_chunk_len, B = this.dim_sel - I;
|
|
5741
5741
|
yield { dim_chunk_ix: A, dim_chunk_sel: B };
|
|
5742
5742
|
}
|
|
5743
5743
|
}
|
|
5744
|
-
class
|
|
5744
|
+
class gB {
|
|
5745
5745
|
start;
|
|
5746
5746
|
stop;
|
|
5747
5747
|
step;
|
|
@@ -5750,12 +5750,12 @@ class IB {
|
|
|
5750
5750
|
nitems;
|
|
5751
5751
|
nchunks;
|
|
5752
5752
|
constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
|
|
5753
|
-
const [Q, C, E] =
|
|
5754
|
-
this.start = Q, this.stop = C, this.step = E, this.step < 1 &&
|
|
5753
|
+
const [Q, C, E] = EE(A, I);
|
|
5754
|
+
this.start = Q, this.stop = C, this.step = E, this.step < 1 && DE(), this.dim_len = I, this.dim_chunk_len = B, this.nitems = Math.max(0, Math.ceil((this.stop - this.start) / this.step)), this.nchunks = Math.ceil(this.dim_len / this.dim_chunk_len);
|
|
5755
5755
|
}
|
|
5756
5756
|
*[Symbol.iterator]() {
|
|
5757
5757
|
const A = Math.floor(this.start / this.dim_chunk_len), I = Math.ceil(this.stop / this.dim_chunk_len);
|
|
5758
|
-
for (const B of
|
|
5758
|
+
for (const B of QE(A, I)) {
|
|
5759
5759
|
const Q = B * this.dim_chunk_len, C = Math.min(this.dim_len, (B + 1) * this.dim_chunk_len), E = C - Q;
|
|
5760
5760
|
let i = 0, o = 0;
|
|
5761
5761
|
if (this.start < Q) {
|
|
@@ -5776,50 +5776,50 @@ class IB {
|
|
|
5776
5776
|
}
|
|
5777
5777
|
}
|
|
5778
5778
|
}
|
|
5779
|
-
function
|
|
5779
|
+
function tE(g, A) {
|
|
5780
5780
|
let I = [];
|
|
5781
|
-
return g === null ? I = A.map((B) => rI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? rI(null))),
|
|
5781
|
+
return g === null ? I = A.map((B) => rI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? rI(null))), sE(I, A), I;
|
|
5782
5782
|
}
|
|
5783
|
-
class
|
|
5783
|
+
class GE {
|
|
5784
5784
|
dim_indexers;
|
|
5785
5785
|
shape;
|
|
5786
5786
|
constructor({ selection: A, shape: I, chunk_shape: B }) {
|
|
5787
|
-
this.dim_indexers =
|
|
5787
|
+
this.dim_indexers = tE(A, I).map((Q, C) => new (typeof Q == "number" ? yE : gB)({
|
|
5788
5788
|
// @ts-expect-error ts inference not strong enough to know correct chunk
|
|
5789
5789
|
dim_sel: Q,
|
|
5790
5790
|
dim_len: I[C],
|
|
5791
5791
|
dim_chunk_len: B[C]
|
|
5792
|
-
})), this.shape = this.dim_indexers.filter((Q) => Q instanceof
|
|
5792
|
+
})), this.shape = this.dim_indexers.filter((Q) => Q instanceof gB).map((Q) => Q.nitems);
|
|
5793
5793
|
}
|
|
5794
5794
|
*[Symbol.iterator]() {
|
|
5795
|
-
for (const A of
|
|
5795
|
+
for (const A of CE(...this.dim_indexers)) {
|
|
5796
5796
|
const I = A.map((Q) => Q.dim_chunk_ix), B = A.map((Q) => "dim_out_sel" in Q ? { from: Q.dim_chunk_sel, to: Q.dim_out_sel } : { from: Q.dim_chunk_sel, to: null });
|
|
5797
5797
|
yield { chunk_coords: I, mapping: B };
|
|
5798
5798
|
}
|
|
5799
5799
|
}
|
|
5800
5800
|
}
|
|
5801
|
-
function
|
|
5801
|
+
function wE(g, A) {
|
|
5802
5802
|
return "get" in g ? g.get(A) : g[A];
|
|
5803
5803
|
}
|
|
5804
|
-
async function
|
|
5805
|
-
let Q =
|
|
5804
|
+
async function FE(g, A, I, B) {
|
|
5805
|
+
let Q = XC(g), C = new GE({
|
|
5806
5806
|
selection: A,
|
|
5807
5807
|
shape: g.shape,
|
|
5808
5808
|
chunk_shape: g.chunks
|
|
5809
|
-
}), E = B.prepare(new Q.TypedArray(C.shape.reduce((o, a) => o * a, 1)), C.shape, Q.get_strides(C.shape, I.order)), i = I.create_queue?.() ??
|
|
5809
|
+
}), E = B.prepare(new Q.TypedArray(C.shape.reduce((o, a) => o * a, 1)), C.shape, Q.get_strides(C.shape, I.order)), i = I.create_queue?.() ?? iE();
|
|
5810
5810
|
for (const { chunk_coords: o, mapping: a } of C)
|
|
5811
5811
|
i.add(async () => {
|
|
5812
5812
|
let { data: D, shape: h, stride: y } = await g.getChunk(o, I.opts), t = B.prepare(D, h, y);
|
|
5813
5813
|
B.set_from_chunk(E, t, a);
|
|
5814
5814
|
});
|
|
5815
|
-
return await i.onIdle(), C.shape.length === 0 ?
|
|
5815
|
+
return await i.onIdle(), C.shape.length === 0 ? wE(E.data, 0) : E;
|
|
5816
5816
|
}
|
|
5817
|
-
function
|
|
5817
|
+
function Ng(g, A = 0, I) {
|
|
5818
5818
|
let B = I ?? g.length - A;
|
|
5819
5819
|
return {
|
|
5820
5820
|
length: B,
|
|
5821
5821
|
subarray(Q, C = B) {
|
|
5822
|
-
return
|
|
5822
|
+
return Ng(g, A + Q, C - Q);
|
|
5823
5823
|
},
|
|
5824
5824
|
set(Q, C = 0) {
|
|
5825
5825
|
for (let E = 0; E < Q.length; E++)
|
|
@@ -5833,7 +5833,7 @@ function Rg(g, A = 0, I) {
|
|
|
5833
5833
|
function ZI(g) {
|
|
5834
5834
|
return globalThis.Array.isArray(g.data) ? {
|
|
5835
5835
|
// @ts-expect-error
|
|
5836
|
-
data:
|
|
5836
|
+
data: Ng(g.data),
|
|
5837
5837
|
stride: g.stride,
|
|
5838
5838
|
bytes_per_element: 1
|
|
5839
5839
|
} : {
|
|
@@ -5842,32 +5842,32 @@ function ZI(g) {
|
|
|
5842
5842
|
bytes_per_element: g.data.BYTES_PER_ELEMENT
|
|
5843
5843
|
};
|
|
5844
5844
|
}
|
|
5845
|
-
function
|
|
5845
|
+
function nE(g) {
|
|
5846
5846
|
return "chars" in g ? g.constructor.bind(null, g.chars) : g.constructor;
|
|
5847
5847
|
}
|
|
5848
|
-
function
|
|
5848
|
+
function eE(g, A) {
|
|
5849
5849
|
if (globalThis.Array.isArray(g.data))
|
|
5850
|
-
return
|
|
5851
|
-
let I =
|
|
5850
|
+
return Ng([A]);
|
|
5851
|
+
let I = nE(g.data), B = new I([A]);
|
|
5852
5852
|
return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
|
|
5853
5853
|
}
|
|
5854
|
-
const
|
|
5854
|
+
const rE = {
|
|
5855
5855
|
prepare(g, A, I) {
|
|
5856
5856
|
return { data: g, shape: A, stride: I };
|
|
5857
5857
|
},
|
|
5858
5858
|
set_scalar(g, A, I) {
|
|
5859
5859
|
let B = ZI(g);
|
|
5860
|
-
Ag(B, A,
|
|
5860
|
+
Ag(B, A, eE(g, I), B.bytes_per_element);
|
|
5861
5861
|
},
|
|
5862
5862
|
set_from_chunk(g, A, I) {
|
|
5863
5863
|
let B = ZI(g);
|
|
5864
5864
|
tI(B, ZI(A), B.bytes_per_element, I);
|
|
5865
5865
|
}
|
|
5866
5866
|
};
|
|
5867
|
-
async function
|
|
5868
|
-
return
|
|
5867
|
+
async function SE(g, A = null, I = {}) {
|
|
5868
|
+
return FE(g, A, I, rE);
|
|
5869
5869
|
}
|
|
5870
|
-
function
|
|
5870
|
+
function LB(g, A, I) {
|
|
5871
5871
|
return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
|
|
5872
5872
|
}
|
|
5873
5873
|
function Ag(g, A, I, B) {
|
|
@@ -5881,7 +5881,7 @@ function Ag(g, A, I, B) {
|
|
|
5881
5881
|
Ag({ data: y, stride: i }, C, I, B);
|
|
5882
5882
|
return;
|
|
5883
5883
|
}
|
|
5884
|
-
const [o, a, D] = Q, h =
|
|
5884
|
+
const [o, a, D] = Q, h = LB(o, a, D);
|
|
5885
5885
|
if (C.length === 0) {
|
|
5886
5886
|
for (let y = 0; y < h; y++)
|
|
5887
5887
|
g.data.set(I, E * (o + D * y) * B);
|
|
@@ -5917,7 +5917,7 @@ function tI(g, A, I, B) {
|
|
|
5917
5917
|
}, I, C);
|
|
5918
5918
|
return;
|
|
5919
5919
|
}
|
|
5920
|
-
const [D, h, y] = Q.to, [t, e, r] = Q.from, R =
|
|
5920
|
+
const [D, h, y] = Q.to, [t, e, r] = Q.from, R = LB(D, h, y);
|
|
5921
5921
|
if (C.length === 0) {
|
|
5922
5922
|
if (y === 1 && r === 1 && E === 1 && o === 1) {
|
|
5923
5923
|
let F = t * I, k = R * I;
|
|
@@ -5939,7 +5939,7 @@ function tI(g, A, I, B) {
|
|
|
5939
5939
|
stride: a
|
|
5940
5940
|
}, I, C);
|
|
5941
5941
|
}
|
|
5942
|
-
async function
|
|
5942
|
+
async function RE(g, A) {
|
|
5943
5943
|
const I = A.split("/"), B = I.pop();
|
|
5944
5944
|
if (!B)
|
|
5945
5945
|
throw new Error("Invalid path");
|
|
@@ -5947,7 +5947,7 @@ async function SE(g, A) {
|
|
|
5947
5947
|
g = await g.getDirectoryHandle(Q);
|
|
5948
5948
|
return g.getFileHandle(B);
|
|
5949
5949
|
}
|
|
5950
|
-
class
|
|
5950
|
+
class cg {
|
|
5951
5951
|
#A;
|
|
5952
5952
|
constructor(A) {
|
|
5953
5953
|
this.#A = A;
|
|
@@ -5956,7 +5956,7 @@ class Ng {
|
|
|
5956
5956
|
return this.#A;
|
|
5957
5957
|
}
|
|
5958
5958
|
async get(A) {
|
|
5959
|
-
const I = await
|
|
5959
|
+
const I = await RE(this.#A, A.slice(1)).catch(
|
|
5960
5960
|
() => {
|
|
5961
5961
|
}
|
|
5962
5962
|
);
|
|
@@ -5985,7 +5985,7 @@ async function sI(g, A) {
|
|
|
5985
5985
|
throw new Error(`Failed to open Zarr group at ${g}`);
|
|
5986
5986
|
}
|
|
5987
5987
|
}
|
|
5988
|
-
async function
|
|
5988
|
+
async function NE(g, A) {
|
|
5989
5989
|
if (A === "v2")
|
|
5990
5990
|
try {
|
|
5991
5991
|
return z.v2(g, { kind: "array", attrs: !1 });
|
|
@@ -6004,7 +6004,7 @@ async function RE(g, A) {
|
|
|
6004
6004
|
throw new Error(`Failed to open Zarr array at ${g}`);
|
|
6005
6005
|
}
|
|
6006
6006
|
}
|
|
6007
|
-
async function
|
|
6007
|
+
async function cE(g) {
|
|
6008
6008
|
let A;
|
|
6009
6009
|
switch (g.type) {
|
|
6010
6010
|
case "fetch": {
|
|
@@ -6015,7 +6015,7 @@ async function NE(g) {
|
|
|
6015
6015
|
}
|
|
6016
6016
|
case "filesystem": {
|
|
6017
6017
|
A = new _(
|
|
6018
|
-
new
|
|
6018
|
+
new cg(g.directoryHandle),
|
|
6019
6019
|
g.path
|
|
6020
6020
|
);
|
|
6021
6021
|
break;
|
|
@@ -6026,9 +6026,9 @@ async function NE(g) {
|
|
|
6026
6026
|
}
|
|
6027
6027
|
}
|
|
6028
6028
|
const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
|
|
6029
|
-
return
|
|
6029
|
+
return NE(I, g.zarrVersion);
|
|
6030
6030
|
}
|
|
6031
|
-
function
|
|
6031
|
+
function UE(g, A, I) {
|
|
6032
6032
|
if (g.store instanceof DI)
|
|
6033
6033
|
return {
|
|
6034
6034
|
type: "fetch",
|
|
@@ -6036,7 +6036,7 @@ function cE(g, A, I) {
|
|
|
6036
6036
|
zarrVersion: I,
|
|
6037
6037
|
url: g.store.url.toString()
|
|
6038
6038
|
};
|
|
6039
|
-
if (g.store instanceof
|
|
6039
|
+
if (g.store instanceof cg)
|
|
6040
6040
|
return {
|
|
6041
6041
|
type: "filesystem",
|
|
6042
6042
|
arrayPath: A,
|
|
@@ -6048,7 +6048,7 @@ function cE(g, A, I) {
|
|
|
6048
6048
|
`Unsupported store type: ${g.store.constructor.name}`
|
|
6049
6049
|
);
|
|
6050
6050
|
}
|
|
6051
|
-
const
|
|
6051
|
+
const JB = `class HI extends Error {
|
|
6052
6052
|
constructor(A, I = {}) {
|
|
6053
6053
|
super(\`Node not found: \${A}\`, I), this.name = "NodeNotFoundError";
|
|
6054
6054
|
}
|
|
@@ -9592,11 +9592,11 @@ return ret;
|
|
|
9592
9592
|
default: JQ
|
|
9593
9593
|
});
|
|
9594
9594
|
//# sourceMappingURL=worker_kernel-BYKAkuPZ.js.map
|
|
9595
|
-
`,
|
|
9596
|
-
function
|
|
9595
|
+
`, BB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", JB], { type: "text/javascript;charset=utf-8" });
|
|
9596
|
+
function kE(g) {
|
|
9597
9597
|
let A;
|
|
9598
9598
|
try {
|
|
9599
|
-
if (A =
|
|
9599
|
+
if (A = BB && (self.URL || self.webkitURL).createObjectURL(BB), !A) throw "";
|
|
9600
9600
|
const I = new Worker(A, {
|
|
9601
9601
|
type: "module",
|
|
9602
9602
|
name: g?.name
|
|
@@ -9606,7 +9606,7 @@ function UE(g) {
|
|
|
9606
9606
|
}), I;
|
|
9607
9607
|
} catch {
|
|
9608
9608
|
return new Worker(
|
|
9609
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
9609
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(JB),
|
|
9610
9610
|
{
|
|
9611
9611
|
type: "module",
|
|
9612
9612
|
name: g?.name
|
|
@@ -9614,17 +9614,17 @@ function UE(g) {
|
|
|
9614
9614
|
);
|
|
9615
9615
|
}
|
|
9616
9616
|
}
|
|
9617
|
-
const
|
|
9618
|
-
let gA = [],
|
|
9617
|
+
const LE = Math.min(navigator.hardwareConcurrency, 8);
|
|
9618
|
+
let gA = [], JE = 0, YB = 0;
|
|
9619
9619
|
const NA = /* @__PURE__ */ new Map(), SI = /* @__PURE__ */ new Set();
|
|
9620
|
-
function
|
|
9620
|
+
function MB(g) {
|
|
9621
9621
|
const A = gA.find((I) => I.worker === g);
|
|
9622
9622
|
return A || c.error(
|
|
9623
9623
|
"ZarrWorker",
|
|
9624
9624
|
"Worker not found in pool - this should not happen"
|
|
9625
9625
|
), A;
|
|
9626
9626
|
}
|
|
9627
|
-
function
|
|
9627
|
+
function YE(g, A) {
|
|
9628
9628
|
const { id: I, success: B } = g.data, Q = NA.get(I);
|
|
9629
9629
|
if (!Q) {
|
|
9630
9630
|
SI.has(I) ? SI.delete(I) : c.warn(
|
|
@@ -9635,13 +9635,13 @@ function JE(g, A) {
|
|
|
9635
9635
|
return;
|
|
9636
9636
|
}
|
|
9637
9637
|
NA.delete(I), Q.abortListener && Q.abortSignal && Q.abortSignal.removeEventListener("abort", Q.abortListener);
|
|
9638
|
-
const C =
|
|
9638
|
+
const C = MB(A);
|
|
9639
9639
|
C && C.pendingCount > 0 ? C.pendingCount-- : C && c.error(
|
|
9640
9640
|
"ZarrWorker",
|
|
9641
9641
|
"Received message but no pending tasks - this should not happen"
|
|
9642
9642
|
), B && g.data.type === "getChunk" ? Q.resolve(g.data.chunk) : B || Q.reject(new Error(g.data.error || "Unknown worker error"));
|
|
9643
9643
|
}
|
|
9644
|
-
function
|
|
9644
|
+
function QB(g, A) {
|
|
9645
9645
|
if (g instanceof MessageEvent) {
|
|
9646
9646
|
c.error(
|
|
9647
9647
|
"ZarrWorker",
|
|
@@ -9654,7 +9654,7 @@ function BB(g, A) {
|
|
|
9654
9654
|
"Worker failed - replacing worker and canceling its in-flight messages",
|
|
9655
9655
|
g.message
|
|
9656
9656
|
);
|
|
9657
|
-
const I =
|
|
9657
|
+
const I = MB(A);
|
|
9658
9658
|
if (I) {
|
|
9659
9659
|
const Q = gA.indexOf(I);
|
|
9660
9660
|
gA.splice(Q, 1);
|
|
@@ -9664,31 +9664,31 @@ function BB(g, A) {
|
|
|
9664
9664
|
for (const [Q, C] of NA.entries())
|
|
9665
9665
|
C.workerId === B && (C.reject(new Error(`Worker error: ${g.message}`)), NA.delete(Q));
|
|
9666
9666
|
try {
|
|
9667
|
-
const Q =
|
|
9667
|
+
const Q = KB();
|
|
9668
9668
|
gA.push({
|
|
9669
9669
|
worker: Q,
|
|
9670
9670
|
pendingCount: 0,
|
|
9671
|
-
workerId:
|
|
9671
|
+
workerId: YB++
|
|
9672
9672
|
}), c.debug("ZarrWorker", "Replacement worker created successfully");
|
|
9673
9673
|
} catch (Q) {
|
|
9674
9674
|
c.error("ZarrWorker", "Failed to create replacement worker", Q);
|
|
9675
9675
|
}
|
|
9676
9676
|
}
|
|
9677
|
-
function
|
|
9678
|
-
const g = new
|
|
9679
|
-
return g.addEventListener("message", (A) =>
|
|
9677
|
+
function KB() {
|
|
9678
|
+
const g = new kE();
|
|
9679
|
+
return g.addEventListener("message", (A) => YE(A, g)), g.addEventListener("error", (A) => QB(A, g)), g.addEventListener(
|
|
9680
9680
|
"messageerror",
|
|
9681
|
-
(A) =>
|
|
9681
|
+
(A) => QB(A, g)
|
|
9682
9682
|
), g;
|
|
9683
9683
|
}
|
|
9684
|
-
function
|
|
9684
|
+
function ME() {
|
|
9685
9685
|
if (gA.length === 0)
|
|
9686
9686
|
throw new Error("Worker pool is not initialized");
|
|
9687
9687
|
return gA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
|
|
9688
9688
|
}
|
|
9689
|
-
async function
|
|
9689
|
+
async function KE(g, A, I) {
|
|
9690
9690
|
return new Promise((B, Q) => {
|
|
9691
|
-
const C =
|
|
9691
|
+
const C = ME(), E = JE++, i = {
|
|
9692
9692
|
resolve: B,
|
|
9693
9693
|
reject: Q,
|
|
9694
9694
|
workerId: C.workerId
|
|
@@ -9714,15 +9714,15 @@ async function ME(g, A, I) {
|
|
|
9714
9714
|
});
|
|
9715
9715
|
});
|
|
9716
9716
|
}
|
|
9717
|
-
function
|
|
9717
|
+
function dE() {
|
|
9718
9718
|
if (!(gA.length > 0))
|
|
9719
9719
|
try {
|
|
9720
|
-
for (let g = 0; g <
|
|
9721
|
-
const A =
|
|
9720
|
+
for (let g = 0; g < LE; g++) {
|
|
9721
|
+
const A = KB();
|
|
9722
9722
|
gA.push({
|
|
9723
9723
|
worker: A,
|
|
9724
9724
|
pendingCount: 0,
|
|
9725
|
-
workerId:
|
|
9725
|
+
workerId: YB++
|
|
9726
9726
|
});
|
|
9727
9727
|
}
|
|
9728
9728
|
c.debug(
|
|
@@ -9730,26 +9730,26 @@ function KE() {
|
|
|
9730
9730
|
`Initialized worker pool with ${gA.length} workers`
|
|
9731
9731
|
);
|
|
9732
9732
|
} catch {
|
|
9733
|
-
c.warn("ZarrWorker", "Failed to create workers - clearing pool"),
|
|
9733
|
+
c.warn("ZarrWorker", "Failed to create workers - clearing pool"), qE();
|
|
9734
9734
|
return;
|
|
9735
9735
|
}
|
|
9736
9736
|
}
|
|
9737
|
-
async function
|
|
9738
|
-
|
|
9737
|
+
async function HE(g, A, I, B) {
|
|
9738
|
+
dE();
|
|
9739
9739
|
try {
|
|
9740
|
-
return await
|
|
9740
|
+
return await KE(A, I, B);
|
|
9741
9741
|
} catch (Q) {
|
|
9742
9742
|
if (Q instanceof DOMException && Q.name === "AbortError")
|
|
9743
9743
|
throw Q;
|
|
9744
9744
|
return c.warn("ZarrWorker", "Falling back to main thread", Q), await g.getChunk(I, B);
|
|
9745
9745
|
}
|
|
9746
9746
|
}
|
|
9747
|
-
function
|
|
9747
|
+
function qE() {
|
|
9748
9748
|
for (const g of gA)
|
|
9749
9749
|
g.worker.terminate();
|
|
9750
9750
|
gA = [], NA.clear();
|
|
9751
9751
|
}
|
|
9752
|
-
class
|
|
9752
|
+
class lE {
|
|
9753
9753
|
promises_ = [];
|
|
9754
9754
|
scheduler_;
|
|
9755
9755
|
constructor(A) {
|
|
@@ -9762,13 +9762,13 @@ class qE {
|
|
|
9762
9762
|
return Promise.all(this.promises_.map((A) => this.scheduler_.submit(A)));
|
|
9763
9763
|
}
|
|
9764
9764
|
}
|
|
9765
|
-
class
|
|
9765
|
+
class fE {
|
|
9766
9766
|
metadata_;
|
|
9767
9767
|
arrays_;
|
|
9768
9768
|
arrayParams_;
|
|
9769
9769
|
dimensions_;
|
|
9770
9770
|
constructor(A) {
|
|
9771
|
-
this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ =
|
|
9771
|
+
this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = pE(this.metadata_, this.arrays_);
|
|
9772
9772
|
}
|
|
9773
9773
|
getSourceDimensionMap() {
|
|
9774
9774
|
return this.dimensions_;
|
|
@@ -9776,14 +9776,14 @@ class lE {
|
|
|
9776
9776
|
async loadChunkData(A, I) {
|
|
9777
9777
|
const B = [];
|
|
9778
9778
|
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);
|
|
9779
|
-
const Q = this.arrays_[A.lod], C = this.arrayParams_[A.lod], E = await
|
|
9779
|
+
const Q = this.arrays_[A.lod], C = this.arrayParams_[A.lod], E = await HE(Q, C, B, {
|
|
9780
9780
|
signal: I
|
|
9781
9781
|
});
|
|
9782
|
-
if (!
|
|
9782
|
+
if (!pg(E.data))
|
|
9783
9783
|
throw new Error(
|
|
9784
9784
|
`Received chunk has an unsupported data type, data=${E.data.constructor.name}`
|
|
9785
9785
|
);
|
|
9786
|
-
|
|
9786
|
+
EB(E);
|
|
9787
9787
|
const i = {
|
|
9788
9788
|
x: E.shape[this.dimensions_.x.index],
|
|
9789
9789
|
y: E.shape[this.dimensions_.y.index],
|
|
@@ -9799,7 +9799,7 @@ class lE {
|
|
|
9799
9799
|
E.stride
|
|
9800
9800
|
) : A.data = E.data;
|
|
9801
9801
|
const D = A.data.BYTES_PER_ELEMENT;
|
|
9802
|
-
if (!
|
|
9802
|
+
if (!Wg(D))
|
|
9803
9803
|
throw new Error(
|
|
9804
9804
|
"Invalid row alignment value. Possible values are 1, 2, 4, or 8"
|
|
9805
9805
|
);
|
|
@@ -9826,20 +9826,20 @@ class lE {
|
|
|
9826
9826
|
const Q = this.regionToIndices(A, I), C = this.arrays_[I];
|
|
9827
9827
|
let E = {};
|
|
9828
9828
|
B !== void 0 && (E = {
|
|
9829
|
-
create_queue: () => new
|
|
9829
|
+
create_queue: () => new lE(B),
|
|
9830
9830
|
opts: { signal: B.abortSignal }
|
|
9831
9831
|
});
|
|
9832
|
-
const i = await
|
|
9833
|
-
if (!
|
|
9832
|
+
const i = await SE(C, Q, E);
|
|
9833
|
+
if (!pg(i.data))
|
|
9834
9834
|
throw new Error(
|
|
9835
9835
|
`Subarray has an unsupported data type, data=${i.data.constructor.name}`
|
|
9836
9836
|
);
|
|
9837
|
-
if (
|
|
9837
|
+
if (EB(i), i.shape.length !== 2 && i.shape.length !== 3)
|
|
9838
9838
|
throw new Error(
|
|
9839
9839
|
`Expected to receive a 2D or 3D subarray. Instead chunk has shape ${i.shape}`
|
|
9840
9840
|
);
|
|
9841
9841
|
const o = i.data.BYTES_PER_ELEMENT;
|
|
9842
|
-
if (!
|
|
9842
|
+
if (!Wg(o))
|
|
9843
9843
|
throw new Error(
|
|
9844
9844
|
"Invalid row alignment value. Possible values are 1, 2, 4, or 8"
|
|
9845
9845
|
);
|
|
@@ -9877,7 +9877,7 @@ class lE {
|
|
|
9877
9877
|
this.dimensions_.t
|
|
9878
9878
|
].filter((C) => C !== void 0).sort((C, E) => C.index - E.index), Q = [];
|
|
9879
9879
|
for (const C of B) {
|
|
9880
|
-
const E = A.find((D) =>
|
|
9880
|
+
const E = A.find((D) => dB(D.dimension, C.name));
|
|
9881
9881
|
if (!E)
|
|
9882
9882
|
throw new Error(`Region does not contain a slice for ${C.name}`);
|
|
9883
9883
|
const i = C.lods[I];
|
|
@@ -9891,8 +9891,8 @@ class lE {
|
|
|
9891
9891
|
return Q;
|
|
9892
9892
|
}
|
|
9893
9893
|
}
|
|
9894
|
-
function
|
|
9895
|
-
const I = g.axes.map((h) => h.name), B = g.axes.length, Q =
|
|
9894
|
+
function pE(g, A) {
|
|
9895
|
+
const I = g.axes.map((h) => h.name), B = g.axes.length, Q = CB(I, "x"), C = CB(I, "y"), E = (h, y) => {
|
|
9896
9896
|
const t = [];
|
|
9897
9897
|
for (let e = 0; e < g.datasets.length; e++) {
|
|
9898
9898
|
const r = g.datasets[e], R = A[e], F = r.coordinateTransformations[0].scale, k = r.coordinateTransformations.length === 2 ? r.coordinateTransformations[1].translation : new Array(B).fill(0);
|
|
@@ -9920,10 +9920,10 @@ function fE(g, A) {
|
|
|
9920
9920
|
const D = GI(I, "t");
|
|
9921
9921
|
return D !== -1 && (i.t = E(I[D], D)), i;
|
|
9922
9922
|
}
|
|
9923
|
-
function
|
|
9923
|
+
function dB(g, A) {
|
|
9924
9924
|
return g.toLowerCase() === A.toLowerCase();
|
|
9925
9925
|
}
|
|
9926
|
-
function
|
|
9926
|
+
function CB(g, A) {
|
|
9927
9927
|
const I = GI(g, A);
|
|
9928
9928
|
if (I === -1)
|
|
9929
9929
|
throw new Error(
|
|
@@ -9932,9 +9932,9 @@ function QB(g, A) {
|
|
|
9932
9932
|
return I;
|
|
9933
9933
|
}
|
|
9934
9934
|
function GI(g, A) {
|
|
9935
|
-
return g.findIndex((I) =>
|
|
9935
|
+
return g.findIndex((I) => dB(I, A));
|
|
9936
9936
|
}
|
|
9937
|
-
function
|
|
9937
|
+
function EB(g) {
|
|
9938
9938
|
let A = 1;
|
|
9939
9939
|
for (let I = g.shape.length - 1; I >= 0; I--) {
|
|
9940
9940
|
if (g.stride[I] !== A)
|
|
@@ -10047,7 +10047,7 @@ const n = H.arrayToEnum([
|
|
|
10047
10047
|
"invalid_intersection_types",
|
|
10048
10048
|
"not_multiple_of",
|
|
10049
10049
|
"not_finite"
|
|
10050
|
-
]),
|
|
10050
|
+
]), mE = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
10051
10051
|
class v extends Error {
|
|
10052
10052
|
get errors() {
|
|
10053
10053
|
return this.issues;
|
|
@@ -10164,12 +10164,12 @@ const HA = (g, A) => {
|
|
|
10164
10164
|
}
|
|
10165
10165
|
return { message: I };
|
|
10166
10166
|
};
|
|
10167
|
-
let
|
|
10168
|
-
function
|
|
10169
|
-
|
|
10167
|
+
let HB = HA;
|
|
10168
|
+
function uE(g) {
|
|
10169
|
+
HB = g;
|
|
10170
10170
|
}
|
|
10171
10171
|
function RI() {
|
|
10172
|
-
return
|
|
10172
|
+
return HB;
|
|
10173
10173
|
}
|
|
10174
10174
|
const NI = (g) => {
|
|
10175
10175
|
const { data: A, path: I, errorMaps: B, issueData: Q } = g, C = [...I, ...Q.path || []], E = {
|
|
@@ -10191,7 +10191,7 @@ const NI = (g) => {
|
|
|
10191
10191
|
path: C,
|
|
10192
10192
|
message: i
|
|
10193
10193
|
};
|
|
10194
|
-
},
|
|
10194
|
+
}, TE = [];
|
|
10195
10195
|
function w(g, A) {
|
|
10196
10196
|
const I = RI(), B = NI({
|
|
10197
10197
|
issueData: A,
|
|
@@ -10258,7 +10258,7 @@ function cI(g, A, I, B) {
|
|
|
10258
10258
|
if (typeof A == "function" ? g !== A || !0 : !A.has(g)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10259
10259
|
return A.get(g);
|
|
10260
10260
|
}
|
|
10261
|
-
function
|
|
10261
|
+
function qB(g, A, I, B, Q) {
|
|
10262
10262
|
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");
|
|
10263
10263
|
return A.set(g, I), I;
|
|
10264
10264
|
}
|
|
@@ -10275,7 +10275,7 @@ class EA {
|
|
|
10275
10275
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
10276
10276
|
}
|
|
10277
10277
|
}
|
|
10278
|
-
const
|
|
10278
|
+
const iB = (g, A) => {
|
|
10279
10279
|
if (cA(A))
|
|
10280
10280
|
return { success: !0, data: A.value };
|
|
10281
10281
|
if (!g.common.issues.length)
|
|
@@ -10362,7 +10362,7 @@ class d {
|
|
|
10362
10362
|
data: A,
|
|
10363
10363
|
parsedType: aA(A)
|
|
10364
10364
|
}, C = this._parseSync({ data: A, path: Q.path, parent: Q });
|
|
10365
|
-
return
|
|
10365
|
+
return iB(Q, C);
|
|
10366
10366
|
}
|
|
10367
10367
|
"~validate"(A) {
|
|
10368
10368
|
var I, B;
|
|
@@ -10416,7 +10416,7 @@ class d {
|
|
|
10416
10416
|
data: A,
|
|
10417
10417
|
parsedType: aA(A)
|
|
10418
10418
|
}, Q = this._parse({ data: A, path: B.path, parent: B }), C = await (VA(Q) ? Q : Promise.resolve(Q));
|
|
10419
|
-
return
|
|
10419
|
+
return iB(B, C);
|
|
10420
10420
|
}
|
|
10421
10421
|
refine(A, I) {
|
|
10422
10422
|
const B = (Q) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(Q) : I;
|
|
@@ -10487,7 +10487,7 @@ class d {
|
|
|
10487
10487
|
});
|
|
10488
10488
|
}
|
|
10489
10489
|
brand() {
|
|
10490
|
-
return new
|
|
10490
|
+
return new Ug({
|
|
10491
10491
|
typeName: U.ZodBranded,
|
|
10492
10492
|
type: this,
|
|
10493
10493
|
...M(this._def)
|
|
@@ -10522,26 +10522,26 @@ class d {
|
|
|
10522
10522
|
return this.safeParse(null).success;
|
|
10523
10523
|
}
|
|
10524
10524
|
}
|
|
10525
|
-
const
|
|
10525
|
+
const WE = /^c[^\s-]{8,}$/i, xE = /^[0-9a-z]+$/, bE = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ZE = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, PE = /^[a-z0-9_-]{21}$/i, OE = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, VE = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, vE = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, XE = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
10526
10526
|
let PI;
|
|
10527
|
-
const
|
|
10528
|
-
function
|
|
10527
|
+
const jE = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zE = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, _E = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, $E = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ai = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ii = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, lB = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", gi = new RegExp(`^${lB}$`);
|
|
10528
|
+
function fB(g) {
|
|
10529
10529
|
let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
10530
10530
|
return g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`), A;
|
|
10531
10531
|
}
|
|
10532
|
-
function
|
|
10533
|
-
return new RegExp(`^${
|
|
10532
|
+
function Bi(g) {
|
|
10533
|
+
return new RegExp(`^${fB(g)}$`);
|
|
10534
10534
|
}
|
|
10535
|
-
function
|
|
10536
|
-
let A = `${
|
|
10535
|
+
function pB(g) {
|
|
10536
|
+
let A = `${lB}T${fB(g)}`;
|
|
10537
10537
|
const I = [];
|
|
10538
10538
|
return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
|
|
10539
10539
|
}
|
|
10540
|
-
function Bi(g, A) {
|
|
10541
|
-
return !!((A === "v4" || !A) && XE.test(g) || (A === "v6" || !A) && zE.test(g));
|
|
10542
|
-
}
|
|
10543
10540
|
function Qi(g, A) {
|
|
10544
|
-
|
|
10541
|
+
return !!((A === "v4" || !A) && jE.test(g) || (A === "v6" || !A) && _E.test(g));
|
|
10542
|
+
}
|
|
10543
|
+
function Ci(g, A) {
|
|
10544
|
+
if (!OE.test(g))
|
|
10545
10545
|
return !1;
|
|
10546
10546
|
try {
|
|
10547
10547
|
const [I] = g.split("."), B = I.replace(/-/g, "+").replace(/_/g, "/").padEnd(I.length + (4 - I.length % 4) % 4, "="), Q = JSON.parse(atob(B));
|
|
@@ -10550,8 +10550,8 @@ function Qi(g, A) {
|
|
|
10550
10550
|
return !1;
|
|
10551
10551
|
}
|
|
10552
10552
|
}
|
|
10553
|
-
function
|
|
10554
|
-
return !!((A === "v4" || !A) &&
|
|
10553
|
+
function Ei(g, A) {
|
|
10554
|
+
return !!((A === "v4" || !A) && zE.test(g) || (A === "v6" || !A) && $E.test(g));
|
|
10555
10555
|
}
|
|
10556
10556
|
class $ extends d {
|
|
10557
10557
|
_parse(A) {
|
|
@@ -10602,43 +10602,43 @@ class $ extends d {
|
|
|
10602
10602
|
message: C.message
|
|
10603
10603
|
}), B.dirty());
|
|
10604
10604
|
} else if (C.kind === "email")
|
|
10605
|
-
|
|
10605
|
+
vE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10606
10606
|
validation: "email",
|
|
10607
10607
|
code: G.invalid_string,
|
|
10608
10608
|
message: C.message
|
|
10609
10609
|
}), B.dirty());
|
|
10610
10610
|
else if (C.kind === "emoji")
|
|
10611
|
-
PI || (PI = new RegExp(
|
|
10611
|
+
PI || (PI = new RegExp(XE, "u")), PI.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10612
10612
|
validation: "emoji",
|
|
10613
10613
|
code: G.invalid_string,
|
|
10614
10614
|
message: C.message
|
|
10615
10615
|
}), B.dirty());
|
|
10616
10616
|
else if (C.kind === "uuid")
|
|
10617
|
-
|
|
10617
|
+
ZE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10618
10618
|
validation: "uuid",
|
|
10619
10619
|
code: G.invalid_string,
|
|
10620
10620
|
message: C.message
|
|
10621
10621
|
}), B.dirty());
|
|
10622
10622
|
else if (C.kind === "nanoid")
|
|
10623
|
-
|
|
10623
|
+
PE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10624
10624
|
validation: "nanoid",
|
|
10625
10625
|
code: G.invalid_string,
|
|
10626
10626
|
message: C.message
|
|
10627
10627
|
}), B.dirty());
|
|
10628
10628
|
else if (C.kind === "cuid")
|
|
10629
|
-
|
|
10629
|
+
WE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10630
10630
|
validation: "cuid",
|
|
10631
10631
|
code: G.invalid_string,
|
|
10632
10632
|
message: C.message
|
|
10633
10633
|
}), B.dirty());
|
|
10634
10634
|
else if (C.kind === "cuid2")
|
|
10635
|
-
|
|
10635
|
+
xE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10636
10636
|
validation: "cuid2",
|
|
10637
10637
|
code: G.invalid_string,
|
|
10638
10638
|
message: C.message
|
|
10639
10639
|
}), B.dirty());
|
|
10640
10640
|
else if (C.kind === "ulid")
|
|
10641
|
-
|
|
10641
|
+
bE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10642
10642
|
validation: "ulid",
|
|
10643
10643
|
code: G.invalid_string,
|
|
10644
10644
|
message: C.message
|
|
@@ -10669,39 +10669,39 @@ class $ extends d {
|
|
|
10669
10669
|
code: G.invalid_string,
|
|
10670
10670
|
validation: { endsWith: C.value },
|
|
10671
10671
|
message: C.message
|
|
10672
|
-
}), B.dirty()) : C.kind === "datetime" ?
|
|
10672
|
+
}), B.dirty()) : C.kind === "datetime" ? pB(C).test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10673
10673
|
code: G.invalid_string,
|
|
10674
10674
|
validation: "datetime",
|
|
10675
10675
|
message: C.message
|
|
10676
|
-
}), B.dirty()) : C.kind === "date" ?
|
|
10676
|
+
}), B.dirty()) : C.kind === "date" ? gi.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10677
10677
|
code: G.invalid_string,
|
|
10678
10678
|
validation: "date",
|
|
10679
10679
|
message: C.message
|
|
10680
|
-
}), B.dirty()) : C.kind === "time" ?
|
|
10680
|
+
}), B.dirty()) : C.kind === "time" ? Bi(C).test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10681
10681
|
code: G.invalid_string,
|
|
10682
10682
|
validation: "time",
|
|
10683
10683
|
message: C.message
|
|
10684
|
-
}), B.dirty()) : C.kind === "duration" ?
|
|
10684
|
+
}), B.dirty()) : C.kind === "duration" ? VE.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10685
10685
|
validation: "duration",
|
|
10686
10686
|
code: G.invalid_string,
|
|
10687
10687
|
message: C.message
|
|
10688
|
-
}), B.dirty()) : C.kind === "ip" ?
|
|
10688
|
+
}), B.dirty()) : C.kind === "ip" ? Qi(A.data, C.version) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10689
10689
|
validation: "ip",
|
|
10690
10690
|
code: G.invalid_string,
|
|
10691
10691
|
message: C.message
|
|
10692
|
-
}), B.dirty()) : C.kind === "jwt" ?
|
|
10692
|
+
}), B.dirty()) : C.kind === "jwt" ? Ci(A.data, C.alg) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10693
10693
|
validation: "jwt",
|
|
10694
10694
|
code: G.invalid_string,
|
|
10695
10695
|
message: C.message
|
|
10696
|
-
}), B.dirty()) : C.kind === "cidr" ?
|
|
10696
|
+
}), B.dirty()) : C.kind === "cidr" ? Ei(A.data, C.version) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10697
10697
|
validation: "cidr",
|
|
10698
10698
|
code: G.invalid_string,
|
|
10699
10699
|
message: C.message
|
|
10700
|
-
}), B.dirty()) : C.kind === "base64" ?
|
|
10700
|
+
}), B.dirty()) : C.kind === "base64" ? Ai.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10701
10701
|
validation: "base64",
|
|
10702
10702
|
code: G.invalid_string,
|
|
10703
10703
|
message: C.message
|
|
10704
|
-
}), B.dirty()) : C.kind === "base64url" ?
|
|
10704
|
+
}), B.dirty()) : C.kind === "base64url" ? Ii.test(A.data) || (Q = this._getOrReturnCtx(A, Q), w(Q, {
|
|
10705
10705
|
validation: "base64url",
|
|
10706
10706
|
code: G.invalid_string,
|
|
10707
10707
|
message: C.message
|
|
@@ -10940,7 +10940,7 @@ $.create = (g) => {
|
|
|
10940
10940
|
...M(g)
|
|
10941
10941
|
});
|
|
10942
10942
|
};
|
|
10943
|
-
function
|
|
10943
|
+
function ii(g, A) {
|
|
10944
10944
|
const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, Q = I > B ? I : B, C = parseInt(g.toFixed(Q).replace(".", "")), E = parseInt(A.toFixed(Q).replace(".", ""));
|
|
10945
10945
|
return C % E / Math.pow(10, Q);
|
|
10946
10946
|
}
|
|
@@ -10979,7 +10979,7 @@ class sA extends d {
|
|
|
10979
10979
|
inclusive: C.inclusive,
|
|
10980
10980
|
exact: !1,
|
|
10981
10981
|
message: C.message
|
|
10982
|
-
}), Q.dirty()) : C.kind === "multipleOf" ?
|
|
10982
|
+
}), Q.dirty()) : C.kind === "multipleOf" ? ii(A.data, C.value) !== 0 && (B = this._getOrReturnCtx(A, B), w(B, {
|
|
10983
10983
|
code: G.not_multiple_of,
|
|
10984
10984
|
multipleOf: C.value,
|
|
10985
10985
|
message: C.message
|
|
@@ -11806,7 +11806,7 @@ class f extends d {
|
|
|
11806
11806
|
});
|
|
11807
11807
|
}
|
|
11808
11808
|
keyof() {
|
|
11809
|
-
return
|
|
11809
|
+
return mB(H.objectKeys(this.shape));
|
|
11810
11810
|
}
|
|
11811
11811
|
}
|
|
11812
11812
|
f.create = (g, A) => new f({
|
|
@@ -11903,7 +11903,7 @@ zA.create = (g, A) => new zA({
|
|
|
11903
11903
|
typeName: U.ZodUnion,
|
|
11904
11904
|
...M(A)
|
|
11905
11905
|
});
|
|
11906
|
-
const oA = (g) => g instanceof AI ? oA(g.schema) : g instanceof QA ? oA(g.innerType()) : g instanceof II ? [g.value] : g instanceof yA ? g.options : g instanceof gI ? H.objectValues(g.enum) : g instanceof BI ? oA(g._def.innerType) : g instanceof XA ? [void 0] : g instanceof jA ? [null] : g instanceof CA ? [void 0, ...oA(g.unwrap())] : g instanceof tA ? [null, ...oA(g.unwrap())] : g instanceof
|
|
11906
|
+
const oA = (g) => g instanceof AI ? oA(g.schema) : g instanceof QA ? oA(g.innerType()) : g instanceof II ? [g.value] : g instanceof yA ? g.options : g instanceof gI ? H.objectValues(g.enum) : g instanceof BI ? oA(g._def.innerType) : g instanceof XA ? [void 0] : g instanceof jA ? [null] : g instanceof CA ? [void 0, ...oA(g.unwrap())] : g instanceof tA ? [null, ...oA(g.unwrap())] : g instanceof Ug || g instanceof CI ? oA(g.unwrap()) : g instanceof QI ? oA(g._def.innerType) : [];
|
|
11907
11907
|
class HI extends d {
|
|
11908
11908
|
_parse(A) {
|
|
11909
11909
|
const { ctx: I } = this._processInputParams(A);
|
|
@@ -12369,7 +12369,7 @@ II.create = (g, A) => new II({
|
|
|
12369
12369
|
typeName: U.ZodLiteral,
|
|
12370
12370
|
...M(A)
|
|
12371
12371
|
});
|
|
12372
|
-
function
|
|
12372
|
+
function mB(g, A) {
|
|
12373
12373
|
return new yA({
|
|
12374
12374
|
values: g,
|
|
12375
12375
|
typeName: U.ZodEnum,
|
|
@@ -12389,7 +12389,7 @@ class yA extends d {
|
|
|
12389
12389
|
code: G.invalid_type
|
|
12390
12390
|
}), L;
|
|
12391
12391
|
}
|
|
12392
|
-
if (cI(this, TA) ||
|
|
12392
|
+
if (cI(this, TA) || qB(this, TA, new Set(this._def.values)), !cI(this, TA).has(A.data)) {
|
|
12393
12393
|
const I = this._getOrReturnCtx(A), B = this._def.values;
|
|
12394
12394
|
return w(I, {
|
|
12395
12395
|
received: I.data,
|
|
@@ -12434,7 +12434,7 @@ class yA extends d {
|
|
|
12434
12434
|
}
|
|
12435
12435
|
}
|
|
12436
12436
|
TA = /* @__PURE__ */ new WeakMap();
|
|
12437
|
-
yA.create =
|
|
12437
|
+
yA.create = mB;
|
|
12438
12438
|
class gI extends d {
|
|
12439
12439
|
constructor() {
|
|
12440
12440
|
super(...arguments), WA.set(this, void 0);
|
|
@@ -12449,7 +12449,7 @@ class gI extends d {
|
|
|
12449
12449
|
code: G.invalid_type
|
|
12450
12450
|
}), L;
|
|
12451
12451
|
}
|
|
12452
|
-
if (cI(this, WA) ||
|
|
12452
|
+
if (cI(this, WA) || qB(this, WA, new Set(H.getValidEnumValues(this._def.values))), !cI(this, WA).has(A.data)) {
|
|
12453
12453
|
const Q = H.objectValues(I);
|
|
12454
12454
|
return w(B, {
|
|
12455
12455
|
received: B.data,
|
|
@@ -12688,8 +12688,8 @@ JI.create = (g) => new JI({
|
|
|
12688
12688
|
typeName: U.ZodNaN,
|
|
12689
12689
|
...M(g)
|
|
12690
12690
|
});
|
|
12691
|
-
const
|
|
12692
|
-
class
|
|
12691
|
+
const oi = Symbol("zod_brand");
|
|
12692
|
+
class Ug extends d {
|
|
12693
12693
|
_parse(A) {
|
|
12694
12694
|
const { ctx: I } = this._processInputParams(A), B = I.data;
|
|
12695
12695
|
return this._def.type._parse({
|
|
@@ -12756,11 +12756,11 @@ CI.create = (g, A) => new CI({
|
|
|
12756
12756
|
typeName: U.ZodReadonly,
|
|
12757
12757
|
...M(A)
|
|
12758
12758
|
});
|
|
12759
|
-
function
|
|
12759
|
+
function oB(g, A) {
|
|
12760
12760
|
const I = typeof g == "function" ? g(A) : typeof g == "string" ? { message: g } : g;
|
|
12761
12761
|
return typeof I == "string" ? { message: I } : I;
|
|
12762
12762
|
}
|
|
12763
|
-
function
|
|
12763
|
+
function uB(g, A = {}, I) {
|
|
12764
12764
|
return g ? qA.create().superRefine((B, Q) => {
|
|
12765
12765
|
var C, E;
|
|
12766
12766
|
const i = g(B);
|
|
@@ -12768,26 +12768,26 @@ function mB(g, A = {}, I) {
|
|
|
12768
12768
|
return i.then((o) => {
|
|
12769
12769
|
var a, D;
|
|
12770
12770
|
if (!o) {
|
|
12771
|
-
const h =
|
|
12771
|
+
const h = oB(A, B), y = (D = (a = h.fatal) !== null && a !== void 0 ? a : I) !== null && D !== void 0 ? D : !0;
|
|
12772
12772
|
Q.addIssue({ code: "custom", ...h, fatal: y });
|
|
12773
12773
|
}
|
|
12774
12774
|
});
|
|
12775
12775
|
if (!i) {
|
|
12776
|
-
const o =
|
|
12776
|
+
const o = oB(A, B), a = (E = (C = o.fatal) !== null && C !== void 0 ? C : I) !== null && E !== void 0 ? E : !0;
|
|
12777
12777
|
Q.addIssue({ code: "custom", ...o, fatal: a });
|
|
12778
12778
|
}
|
|
12779
12779
|
}) : qA.create();
|
|
12780
12780
|
}
|
|
12781
|
-
const
|
|
12781
|
+
const ai = {
|
|
12782
12782
|
object: f.lazycreate
|
|
12783
12783
|
};
|
|
12784
12784
|
var U;
|
|
12785
12785
|
(function(g) {
|
|
12786
12786
|
g.ZodString = "ZodString", g.ZodNumber = "ZodNumber", g.ZodNaN = "ZodNaN", g.ZodBigInt = "ZodBigInt", g.ZodBoolean = "ZodBoolean", g.ZodDate = "ZodDate", g.ZodSymbol = "ZodSymbol", g.ZodUndefined = "ZodUndefined", g.ZodNull = "ZodNull", g.ZodAny = "ZodAny", g.ZodUnknown = "ZodUnknown", g.ZodNever = "ZodNever", g.ZodVoid = "ZodVoid", g.ZodArray = "ZodArray", g.ZodObject = "ZodObject", g.ZodUnion = "ZodUnion", g.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", g.ZodIntersection = "ZodIntersection", g.ZodTuple = "ZodTuple", g.ZodRecord = "ZodRecord", g.ZodMap = "ZodMap", g.ZodSet = "ZodSet", g.ZodFunction = "ZodFunction", g.ZodLazy = "ZodLazy", g.ZodLiteral = "ZodLiteral", g.ZodEnum = "ZodEnum", g.ZodEffects = "ZodEffects", g.ZodNativeEnum = "ZodNativeEnum", g.ZodOptional = "ZodOptional", g.ZodNullable = "ZodNullable", g.ZodDefault = "ZodDefault", g.ZodCatch = "ZodCatch", g.ZodPromise = "ZodPromise", g.ZodBranded = "ZodBranded", g.ZodPipeline = "ZodPipeline", g.ZodReadonly = "ZodReadonly";
|
|
12787
12787
|
})(U || (U = {}));
|
|
12788
|
-
const
|
|
12788
|
+
const Di = (g, A = {
|
|
12789
12789
|
message: `Input not instance of ${g.name}`
|
|
12790
|
-
}) =>
|
|
12790
|
+
}) => uB((I) => I instanceof g, A), TB = $.create, WB = sA.create, si = JI.create, hi = hA.create, xB = vA.create, yi = UA.create, ti = UI.create, Gi = XA.create, wi = jA.create, Fi = qA.create, ni = SA.create, ei = DA.create, ri = kI.create, Si = BA.create, Ri = f.create, Ni = f.strictCreate, ci = zA.create, Ui = HI.create, ki = _A.create, Li = iA.create, Ji = $A.create, Yi = LI.create, Mi = kA.create, Ki = KA.create, di = AI.create, Hi = II.create, qi = yA.create, li = gI.create, fi = lA.create, aB = QA.create, pi = CA.create, mi = tA.create, ui = QA.createWithPreprocess, Ti = hI.create, Wi = () => TB().optional(), xi = () => WB().optional(), bi = () => xB().optional(), Zi = {
|
|
12791
12791
|
string: (g) => $.create({ ...g, coerce: !0 }),
|
|
12792
12792
|
number: (g) => sA.create({ ...g, coerce: !0 }),
|
|
12793
12793
|
boolean: (g) => vA.create({
|
|
@@ -12796,14 +12796,14 @@ const ai = (g, A = {
|
|
|
12796
12796
|
}),
|
|
12797
12797
|
bigint: (g) => hA.create({ ...g, coerce: !0 }),
|
|
12798
12798
|
date: (g) => UA.create({ ...g, coerce: !0 })
|
|
12799
|
-
},
|
|
12799
|
+
}, Pi = L;
|
|
12800
12800
|
var s = /* @__PURE__ */ Object.freeze({
|
|
12801
12801
|
__proto__: null,
|
|
12802
12802
|
defaultErrorMap: HA,
|
|
12803
|
-
setErrorMap:
|
|
12803
|
+
setErrorMap: uE,
|
|
12804
12804
|
getErrorMap: RI,
|
|
12805
12805
|
makeIssue: NI,
|
|
12806
|
-
EMPTY_PATH:
|
|
12806
|
+
EMPTY_PATH: TE,
|
|
12807
12807
|
addIssueToContext: w,
|
|
12808
12808
|
ParseStatus: x,
|
|
12809
12809
|
INVALID: L,
|
|
@@ -12822,7 +12822,7 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12822
12822
|
ZodParsedType: n,
|
|
12823
12823
|
getParsedType: aA,
|
|
12824
12824
|
ZodType: d,
|
|
12825
|
-
datetimeRegex:
|
|
12825
|
+
datetimeRegex: pB,
|
|
12826
12826
|
ZodString: $,
|
|
12827
12827
|
ZodNumber: sA,
|
|
12828
12828
|
ZodBigInt: hA,
|
|
@@ -12857,63 +12857,63 @@ var s = /* @__PURE__ */ Object.freeze({
|
|
|
12857
12857
|
ZodDefault: BI,
|
|
12858
12858
|
ZodCatch: QI,
|
|
12859
12859
|
ZodNaN: JI,
|
|
12860
|
-
BRAND:
|
|
12861
|
-
ZodBranded:
|
|
12860
|
+
BRAND: oi,
|
|
12861
|
+
ZodBranded: Ug,
|
|
12862
12862
|
ZodPipeline: hI,
|
|
12863
12863
|
ZodReadonly: CI,
|
|
12864
|
-
custom:
|
|
12864
|
+
custom: uB,
|
|
12865
12865
|
Schema: d,
|
|
12866
12866
|
ZodSchema: d,
|
|
12867
|
-
late:
|
|
12867
|
+
late: ai,
|
|
12868
12868
|
get ZodFirstPartyTypeKind() {
|
|
12869
12869
|
return U;
|
|
12870
12870
|
},
|
|
12871
|
-
coerce:
|
|
12872
|
-
any:
|
|
12873
|
-
array:
|
|
12874
|
-
bigint:
|
|
12875
|
-
boolean:
|
|
12876
|
-
date:
|
|
12877
|
-
discriminatedUnion:
|
|
12878
|
-
effect:
|
|
12879
|
-
enum:
|
|
12880
|
-
function:
|
|
12881
|
-
instanceof:
|
|
12882
|
-
intersection:
|
|
12883
|
-
lazy:
|
|
12884
|
-
literal:
|
|
12885
|
-
map:
|
|
12886
|
-
nan:
|
|
12887
|
-
nativeEnum:
|
|
12888
|
-
never:
|
|
12889
|
-
null:
|
|
12890
|
-
nullable:
|
|
12891
|
-
number:
|
|
12892
|
-
object:
|
|
12893
|
-
oboolean:
|
|
12894
|
-
onumber:
|
|
12895
|
-
optional:
|
|
12896
|
-
ostring:
|
|
12897
|
-
pipeline:
|
|
12898
|
-
preprocess:
|
|
12899
|
-
promise:
|
|
12900
|
-
record:
|
|
12901
|
-
set:
|
|
12902
|
-
strictObject:
|
|
12903
|
-
string:
|
|
12904
|
-
symbol:
|
|
12905
|
-
transformer:
|
|
12906
|
-
tuple:
|
|
12907
|
-
undefined:
|
|
12908
|
-
union:
|
|
12909
|
-
unknown:
|
|
12910
|
-
void:
|
|
12911
|
-
NEVER:
|
|
12871
|
+
coerce: Zi,
|
|
12872
|
+
any: Fi,
|
|
12873
|
+
array: Si,
|
|
12874
|
+
bigint: hi,
|
|
12875
|
+
boolean: xB,
|
|
12876
|
+
date: yi,
|
|
12877
|
+
discriminatedUnion: Ui,
|
|
12878
|
+
effect: aB,
|
|
12879
|
+
enum: qi,
|
|
12880
|
+
function: Ki,
|
|
12881
|
+
instanceof: Di,
|
|
12882
|
+
intersection: ki,
|
|
12883
|
+
lazy: di,
|
|
12884
|
+
literal: Hi,
|
|
12885
|
+
map: Yi,
|
|
12886
|
+
nan: si,
|
|
12887
|
+
nativeEnum: li,
|
|
12888
|
+
never: ei,
|
|
12889
|
+
null: wi,
|
|
12890
|
+
nullable: mi,
|
|
12891
|
+
number: WB,
|
|
12892
|
+
object: Ri,
|
|
12893
|
+
oboolean: bi,
|
|
12894
|
+
onumber: xi,
|
|
12895
|
+
optional: pi,
|
|
12896
|
+
ostring: Wi,
|
|
12897
|
+
pipeline: Ti,
|
|
12898
|
+
preprocess: ui,
|
|
12899
|
+
promise: fi,
|
|
12900
|
+
record: Ji,
|
|
12901
|
+
set: Mi,
|
|
12902
|
+
strictObject: Ni,
|
|
12903
|
+
string: TB,
|
|
12904
|
+
symbol: ti,
|
|
12905
|
+
transformer: aB,
|
|
12906
|
+
tuple: Li,
|
|
12907
|
+
undefined: Gi,
|
|
12908
|
+
union: ci,
|
|
12909
|
+
unknown: ni,
|
|
12910
|
+
void: ri,
|
|
12911
|
+
NEVER: Pi,
|
|
12912
12912
|
ZodIssueCode: G,
|
|
12913
|
-
quotelessJson:
|
|
12913
|
+
quotelessJson: mE,
|
|
12914
12914
|
ZodError: v
|
|
12915
12915
|
});
|
|
12916
|
-
const
|
|
12916
|
+
const Oi = s.object({
|
|
12917
12917
|
/**The multiscale datasets for this image*/
|
|
12918
12918
|
multiscales: s.array(
|
|
12919
12919
|
s.object({
|
|
@@ -13041,7 +13041,7 @@ const Pi = s.object({
|
|
|
13041
13041
|
projection: s.string().optional()
|
|
13042
13042
|
}).optional()
|
|
13043
13043
|
}).optional()
|
|
13044
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13044
|
+
}).describe("JSON from OME-NGFF .zattrs"), Vi = s.object({
|
|
13045
13045
|
plate: s.object({
|
|
13046
13046
|
/**The acquisitions for this plate*/
|
|
13047
13047
|
acquisitions: s.array(
|
|
@@ -13100,7 +13100,7 @@ const Pi = s.object({
|
|
|
13100
13100
|
})
|
|
13101
13101
|
).min(1).describe("The wells of the plate")
|
|
13102
13102
|
}).optional()
|
|
13103
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13103
|
+
}).describe("JSON from OME-NGFF .zattrs"), vi = s.object({
|
|
13104
13104
|
well: s.object({
|
|
13105
13105
|
/**The fields of view for this well*/
|
|
13106
13106
|
images: s.array(
|
|
@@ -13114,7 +13114,7 @@ const Pi = s.object({
|
|
|
13114
13114
|
/**The version of the specification*/
|
|
13115
13115
|
version: s.literal("0.4").describe("The version of the specification").optional()
|
|
13116
13116
|
}).optional()
|
|
13117
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13117
|
+
}).describe("JSON from OME-NGFF .zattrs"), Xi = s.object({
|
|
13118
13118
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13119
13119
|
ome: s.object({
|
|
13120
13120
|
/**The multiscale datasets for this image*/
|
|
@@ -13244,7 +13244,7 @@ const Pi = s.object({
|
|
|
13244
13244
|
/**The version of the OME-Zarr Metadata*/
|
|
13245
13245
|
version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13246
13246
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13247
|
-
}).describe("The zarr.json attributes key"),
|
|
13247
|
+
}).describe("The zarr.json attributes key"), ji = s.object({
|
|
13248
13248
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13249
13249
|
ome: s.object({
|
|
13250
13250
|
plate: s.object({
|
|
@@ -13306,7 +13306,7 @@ const Pi = s.object({
|
|
|
13306
13306
|
/**The version of the OME-Zarr Metadata*/
|
|
13307
13307
|
version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13308
13308
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13309
|
-
}).describe("The zarr.json attributes key"),
|
|
13309
|
+
}).describe("The zarr.json attributes key"), zi = s.object({
|
|
13310
13310
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13311
13311
|
ome: s.object({
|
|
13312
13312
|
well: s.object({
|
|
@@ -13325,15 +13325,15 @@ const Pi = s.object({
|
|
|
13325
13325
|
/**The version of the OME-Zarr Metadata*/
|
|
13326
13326
|
version: s.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13327
13327
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13328
|
-
}).describe("JSON from OME-Zarr zarr.json"),
|
|
13329
|
-
function
|
|
13328
|
+
}).describe("JSON from OME-Zarr zarr.json"), _i = ["0.4", "0.5"], $i = new Set(_i);
|
|
13329
|
+
function Ao(g) {
|
|
13330
13330
|
if (!("ome" in g) || !(g.ome instanceof Object)) return;
|
|
13331
13331
|
const A = g.ome;
|
|
13332
|
-
if ("version" in A && typeof A.version == "string" &&
|
|
13332
|
+
if ("version" in A && typeof A.version == "string" && $i.has(A.version))
|
|
13333
13333
|
return A.version;
|
|
13334
13334
|
}
|
|
13335
|
-
function
|
|
13336
|
-
const A =
|
|
13335
|
+
function kg(g) {
|
|
13336
|
+
const A = Ao(g);
|
|
13337
13337
|
return A === void 0 ? "0.4" : A;
|
|
13338
13338
|
}
|
|
13339
13339
|
function fA(g) {
|
|
@@ -13345,14 +13345,14 @@ function fA(g) {
|
|
|
13345
13345
|
return "v3";
|
|
13346
13346
|
}
|
|
13347
13347
|
}
|
|
13348
|
-
function
|
|
13348
|
+
function bB(g, A) {
|
|
13349
13349
|
const I = { ...g };
|
|
13350
13350
|
return delete I[A], I;
|
|
13351
13351
|
}
|
|
13352
|
-
async function
|
|
13352
|
+
async function ro(g, A) {
|
|
13353
13353
|
const I = new _(new DI(g)), B = fA(A), Q = await sI(I, B);
|
|
13354
13354
|
try {
|
|
13355
|
-
return
|
|
13355
|
+
return Io(Q.attrs);
|
|
13356
13356
|
} catch {
|
|
13357
13357
|
throw Error(
|
|
13358
13358
|
`Failed to parse OME-Zarr plate:
|
|
@@ -13360,58 +13360,58 @@ ${JSON.stringify(Q.attrs)}`
|
|
|
13360
13360
|
);
|
|
13361
13361
|
}
|
|
13362
13362
|
}
|
|
13363
|
-
function
|
|
13364
|
-
switch (
|
|
13363
|
+
function Io(g) {
|
|
13364
|
+
switch (kg(g)) {
|
|
13365
13365
|
case "0.5":
|
|
13366
13366
|
return {
|
|
13367
|
-
...
|
|
13367
|
+
...ji.parse(g).ome,
|
|
13368
13368
|
originalVersion: "0.5"
|
|
13369
13369
|
};
|
|
13370
13370
|
case "0.4":
|
|
13371
13371
|
return {
|
|
13372
|
-
...
|
|
13372
|
+
...go(Vi.parse(g)).ome,
|
|
13373
13373
|
originalVersion: "0.4"
|
|
13374
13374
|
};
|
|
13375
13375
|
}
|
|
13376
13376
|
}
|
|
13377
|
-
function
|
|
13377
|
+
function go(g) {
|
|
13378
13378
|
if (g.plate === void 0)
|
|
13379
13379
|
throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
|
|
13380
13380
|
return {
|
|
13381
13381
|
ome: {
|
|
13382
|
-
plate:
|
|
13382
|
+
plate: bB(g.plate, "version"),
|
|
13383
13383
|
version: "0.5"
|
|
13384
13384
|
}
|
|
13385
13385
|
};
|
|
13386
13386
|
}
|
|
13387
|
-
function
|
|
13387
|
+
function Bo(g) {
|
|
13388
13388
|
if (g.well === void 0)
|
|
13389
13389
|
throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
|
|
13390
13390
|
return {
|
|
13391
13391
|
ome: {
|
|
13392
|
-
well:
|
|
13392
|
+
well: bB(g.well, "version"),
|
|
13393
13393
|
version: "0.5"
|
|
13394
13394
|
}
|
|
13395
13395
|
};
|
|
13396
13396
|
}
|
|
13397
|
-
function
|
|
13398
|
-
switch (
|
|
13397
|
+
function Qo(g) {
|
|
13398
|
+
switch (kg(g)) {
|
|
13399
13399
|
case "0.5":
|
|
13400
13400
|
return {
|
|
13401
|
-
...
|
|
13401
|
+
...zi.parse(g).ome,
|
|
13402
13402
|
originalVersion: "0.5"
|
|
13403
13403
|
};
|
|
13404
13404
|
case "0.4":
|
|
13405
13405
|
return {
|
|
13406
|
-
...
|
|
13406
|
+
...Bo(vi.parse(g)).ome,
|
|
13407
13407
|
originalVersion: "0.4"
|
|
13408
13408
|
};
|
|
13409
13409
|
}
|
|
13410
13410
|
}
|
|
13411
|
-
async function
|
|
13411
|
+
async function So(g, A, I) {
|
|
13412
13412
|
const B = new _(new DI(g + "/" + A)), Q = fA(I), C = await sI(B, Q);
|
|
13413
13413
|
try {
|
|
13414
|
-
return
|
|
13414
|
+
return Qo(C.attrs);
|
|
13415
13415
|
} catch {
|
|
13416
13416
|
throw Error(
|
|
13417
13417
|
`Failed to parse OME-Zarr well:
|
|
@@ -13419,15 +13419,15 @@ ${JSON.stringify(C.attrs)}`
|
|
|
13419
13419
|
);
|
|
13420
13420
|
}
|
|
13421
13421
|
}
|
|
13422
|
-
async function
|
|
13422
|
+
async function Ro(g) {
|
|
13423
13423
|
const A = fA(g.version), I = await sI(g.location, A);
|
|
13424
|
-
return
|
|
13424
|
+
return Lg(I.attrs).omero?.channels ?? [];
|
|
13425
13425
|
}
|
|
13426
|
-
async function
|
|
13426
|
+
async function No(g) {
|
|
13427
13427
|
const A = fA(g.version), I = await sI(g.location, A);
|
|
13428
|
-
return
|
|
13428
|
+
return Lg(I.attrs).omero?.rdefs;
|
|
13429
13429
|
}
|
|
13430
|
-
function
|
|
13430
|
+
function Co(g) {
|
|
13431
13431
|
return {
|
|
13432
13432
|
ome: {
|
|
13433
13433
|
multiscales: g.multiscales,
|
|
@@ -13436,37 +13436,37 @@ function Qo(g) {
|
|
|
13436
13436
|
}
|
|
13437
13437
|
};
|
|
13438
13438
|
}
|
|
13439
|
-
function
|
|
13440
|
-
switch (
|
|
13439
|
+
function Eo(g) {
|
|
13440
|
+
switch (kg(g)) {
|
|
13441
13441
|
case "0.5":
|
|
13442
13442
|
return {
|
|
13443
|
-
...
|
|
13443
|
+
...Xi.parse(g).ome,
|
|
13444
13444
|
originalVersion: "0.5"
|
|
13445
13445
|
};
|
|
13446
13446
|
case "0.4":
|
|
13447
13447
|
return {
|
|
13448
|
-
...
|
|
13448
|
+
...Co(Oi.parse(g)).ome,
|
|
13449
13449
|
originalVersion: "0.4"
|
|
13450
13450
|
};
|
|
13451
13451
|
}
|
|
13452
13452
|
}
|
|
13453
|
-
function
|
|
13453
|
+
function Lg(g) {
|
|
13454
13454
|
try {
|
|
13455
|
-
return
|
|
13455
|
+
return Eo(g);
|
|
13456
13456
|
} catch {
|
|
13457
13457
|
throw Error(`Failed to parse OME-Zarr image:
|
|
13458
13458
|
${JSON.stringify(g)}`);
|
|
13459
13459
|
}
|
|
13460
13460
|
}
|
|
13461
|
-
class
|
|
13461
|
+
class Cg {
|
|
13462
13462
|
location;
|
|
13463
13463
|
version;
|
|
13464
|
-
constructor(A
|
|
13465
|
-
this.location =
|
|
13464
|
+
constructor(A) {
|
|
13465
|
+
this.location = A.location, this.version = A.version;
|
|
13466
13466
|
}
|
|
13467
13467
|
async open() {
|
|
13468
13468
|
let A = fA(this.version);
|
|
13469
|
-
const I = await sI(this.location, A), B =
|
|
13469
|
+
const I = await sI(this.location, A), B = Lg(I.attrs), Q = B.multiscales;
|
|
13470
13470
|
if (Q.length !== 1)
|
|
13471
13471
|
throw new Error(
|
|
13472
13472
|
`Exactly one multiscale image is supported. Found ${Q.length} images.`
|
|
@@ -13476,37 +13476,66 @@ class No {
|
|
|
13476
13476
|
throw new Error("No datasets found in the multiscale image.");
|
|
13477
13477
|
A || (A = fA(B.originalVersion));
|
|
13478
13478
|
const E = C.datasets.map(
|
|
13479
|
-
(D) =>
|
|
13479
|
+
(D) => UE(this.location, D.path, A)
|
|
13480
13480
|
), i = await Promise.all(
|
|
13481
|
-
E.map((D) =>
|
|
13481
|
+
E.map((D) => cE(D))
|
|
13482
13482
|
), o = i[0].shape, a = C.axes;
|
|
13483
13483
|
if (a.length !== o.length)
|
|
13484
13484
|
throw new Error(
|
|
13485
13485
|
`Mismatch between number of axes (${a.length}) and array shape (${o.length})`
|
|
13486
13486
|
);
|
|
13487
|
-
return new
|
|
13487
|
+
return new fE({
|
|
13488
13488
|
metadata: C,
|
|
13489
13489
|
arrays: i,
|
|
13490
13490
|
arrayParams: E
|
|
13491
13491
|
});
|
|
13492
13492
|
}
|
|
13493
|
+
/**
|
|
13494
|
+
* Creates an OmeZarrImageSource from an HTTP(S) URL.
|
|
13495
|
+
*
|
|
13496
|
+
* @param url URL of Zarr root
|
|
13497
|
+
* @param version OME-Zarr version
|
|
13498
|
+
*/
|
|
13499
|
+
static fromHttp(A) {
|
|
13500
|
+
const I = new DI(A.url);
|
|
13501
|
+
return new Cg({
|
|
13502
|
+
location: new _(I),
|
|
13503
|
+
version: A.version
|
|
13504
|
+
});
|
|
13505
|
+
}
|
|
13506
|
+
/**
|
|
13507
|
+
* Creates an OmeZarrImageSource from a local filesystem directory.
|
|
13508
|
+
*
|
|
13509
|
+
* @param directory return value of `window.showDirectoryPicker()` which gives the browser
|
|
13510
|
+
* permission to access a directory (only works in Chrome/Edge)
|
|
13511
|
+
* @param version OME-Zarr version
|
|
13512
|
+
* @param path path to image, beginning with "/". This argument allows the application to only
|
|
13513
|
+
* ask the user once for permission to the root directory
|
|
13514
|
+
*/
|
|
13515
|
+
static fromFileSystem(A) {
|
|
13516
|
+
const I = new cg(A.directory);
|
|
13517
|
+
return new Cg({
|
|
13518
|
+
location: new _(I, A.path),
|
|
13519
|
+
version: A.version
|
|
13520
|
+
});
|
|
13521
|
+
}
|
|
13493
13522
|
}
|
|
13494
|
-
const
|
|
13523
|
+
const ZB = [
|
|
13495
13524
|
"fallbackVisible",
|
|
13496
13525
|
"prefetchTime",
|
|
13497
13526
|
"visibleCurrent",
|
|
13498
13527
|
"fallbackBackground",
|
|
13499
13528
|
"prefetchSpace"
|
|
13500
13529
|
];
|
|
13501
|
-
function
|
|
13502
|
-
|
|
13530
|
+
function Jg(g) {
|
|
13531
|
+
io(g);
|
|
13503
13532
|
const A = {
|
|
13504
13533
|
x: g.prefetch.x,
|
|
13505
13534
|
y: g.prefetch.y,
|
|
13506
13535
|
z: g.prefetch.z ?? 0,
|
|
13507
13536
|
t: g.prefetch.t ?? 0
|
|
13508
13537
|
}, I = Object.freeze(
|
|
13509
|
-
|
|
13538
|
+
ZB.reduce(
|
|
13510
13539
|
(C, E) => {
|
|
13511
13540
|
const i = g.priorityOrder.indexOf(E);
|
|
13512
13541
|
return C[E] = i, C;
|
|
@@ -13527,7 +13556,7 @@ function Lg(g) {
|
|
|
13527
13556
|
return Object.freeze(Q);
|
|
13528
13557
|
}
|
|
13529
13558
|
function co(g = {}) {
|
|
13530
|
-
return
|
|
13559
|
+
return Jg(Yg({
|
|
13531
13560
|
profile: "exploration",
|
|
13532
13561
|
prefetch: { x: 1, y: 1, z: 1, t: 0 },
|
|
13533
13562
|
priorityOrder: [
|
|
@@ -13540,7 +13569,7 @@ function co(g = {}) {
|
|
|
13540
13569
|
}, g));
|
|
13541
13570
|
}
|
|
13542
13571
|
function Uo(g = {}) {
|
|
13543
|
-
return
|
|
13572
|
+
return Jg(Yg({
|
|
13544
13573
|
profile: "playback",
|
|
13545
13574
|
prefetch: { x: 0, y: 0, z: 0, t: 20 },
|
|
13546
13575
|
priorityOrder: [
|
|
@@ -13553,7 +13582,7 @@ function Uo(g = {}) {
|
|
|
13553
13582
|
}, g));
|
|
13554
13583
|
}
|
|
13555
13584
|
function ko(g = {}) {
|
|
13556
|
-
return
|
|
13585
|
+
return Jg(Yg({
|
|
13557
13586
|
profile: "no-prefetch",
|
|
13558
13587
|
prefetch: { x: 0, y: 0, z: 0, t: 0 },
|
|
13559
13588
|
priorityOrder: [
|
|
@@ -13565,7 +13594,7 @@ function ko(g = {}) {
|
|
|
13565
13594
|
]
|
|
13566
13595
|
}, g));
|
|
13567
13596
|
}
|
|
13568
|
-
function
|
|
13597
|
+
function io(g) {
|
|
13569
13598
|
for (const [B, Q] of Object.entries(g.prefetch))
|
|
13570
13599
|
if (Q !== void 0 && Q < 0)
|
|
13571
13600
|
throw new Error(`prefetch.${B} must be a non-negative number`);
|
|
@@ -13573,10 +13602,10 @@ function Eo(g) {
|
|
|
13573
13602
|
if (A?.min !== void 0 && A?.max !== void 0 && A.min > A.max)
|
|
13574
13603
|
throw new Error("lod.min must be <= lod.max");
|
|
13575
13604
|
const I = g.priorityOrder;
|
|
13576
|
-
if (I.length !==
|
|
13605
|
+
if (I.length !== ZB.length || new Set(I).size !== I.length)
|
|
13577
13606
|
throw new Error("priorityOrder must include all categories exactly once");
|
|
13578
13607
|
}
|
|
13579
|
-
function
|
|
13608
|
+
function Yg(g, A = {}) {
|
|
13580
13609
|
return {
|
|
13581
13610
|
profile: A.profile ?? g.profile,
|
|
13582
13611
|
prefetch: { ...g.prefetch, ...A.prefetch ?? {} },
|
|
@@ -13644,40 +13673,40 @@ class Jo extends mA {
|
|
|
13644
13673
|
}
|
|
13645
13674
|
}
|
|
13646
13675
|
export {
|
|
13647
|
-
|
|
13676
|
+
ho as AxesLayer,
|
|
13648
13677
|
j as Box2,
|
|
13649
13678
|
eA as Box3,
|
|
13650
|
-
|
|
13679
|
+
RB as ChunkedImageLayer,
|
|
13651
13680
|
l as Color,
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13681
|
+
QC as Frustum,
|
|
13682
|
+
oo as Idetik,
|
|
13683
|
+
wo as ImageLayer,
|
|
13684
|
+
no as ImageSeriesLayer,
|
|
13685
|
+
Fo as LabelImageLayer,
|
|
13657
13686
|
GA as Layer,
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13687
|
+
VQ as LayerManager,
|
|
13688
|
+
Cg as OmeZarrImageSource,
|
|
13689
|
+
ao as OrthographicCamera,
|
|
13690
|
+
so as PanZoomControls,
|
|
13691
|
+
Do as PerspectiveCamera,
|
|
13663
13692
|
JA as Plane,
|
|
13664
13693
|
Jo as Points,
|
|
13665
|
-
|
|
13694
|
+
yo as ProjectedLineLayer,
|
|
13666
13695
|
Lo as Spherical,
|
|
13667
13696
|
EI as Texture2DArray,
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13697
|
+
yg as Texture3D,
|
|
13698
|
+
to as TracksLayer,
|
|
13699
|
+
zQ as Viewport,
|
|
13700
|
+
Go as VolumeLayer,
|
|
13701
|
+
mQ as WebGLRenderer,
|
|
13673
13702
|
co as createExplorationPolicy,
|
|
13674
|
-
|
|
13703
|
+
Jg as createImageSourcePolicy,
|
|
13675
13704
|
ko as createNoPrefetchPolicy,
|
|
13676
13705
|
Uo as createPlaybackPolicy,
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13706
|
+
ro as loadOmeZarrPlate,
|
|
13707
|
+
So as loadOmeZarrWell,
|
|
13708
|
+
Ro as loadOmeroChannels,
|
|
13709
|
+
No as loadOmeroDefaults,
|
|
13710
|
+
$Q as parseViewportConfigs
|
|
13682
13711
|
};
|
|
13683
13712
|
//# sourceMappingURL=index.js.map
|